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
43 \options fleqn,liststotoc,bibtotoc,idxtotoc,BCOR7.5mm,titlepage,tablecaptionabove
44 \use_default_options false
48 \maintain_unincluded_children false
51 InsetLayout CharStyle:MenuItem
60 \newcommand*{\menuitem}[1]{{\sffamily #1}}
69 \font_typewriter default
70 \font_default_family default
78 \default_output_format default
80 \bibtex_command default
81 \index_command default
85 \pdf_title "LyX Configuration Manual"
86 \pdf_author "LyX Team"
87 \pdf_subject "LyX-documentation Customization"
88 \pdf_keywords "LyX, documentation, customization"
90 \pdf_bookmarksnumbered true
91 \pdf_bookmarksopen true
92 \pdf_bookmarksopenlevel 1
97 \pdf_pdfusetitle false
98 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true,pdfstartview=XYZ, plainpages=false, pdfpagelabels"
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 Quotes erd
5474 to get a list of available packages.
5475 To install one, right click on it or use the toolbar button to install
5480 \begin_layout Standard
5481 If your LaTeX distribution doesn't provide such a `package manager', or
5482 if the file is not available from your distribution, then you can follow
5483 these steps to install it manually.
5486 \begin_layout Enumerate
5487 Get the package from
5488 \begin_inset CommandInset href
5491 target "http://www.ctan.org/"
5498 \begin_layout Enumerate
5499 You can install the package in several different places.
5500 If you want it to be available for all users on your system, then you should
5501 install it in your `local' TeX tree; if you want (or need) it to be available
5502 just for you, then you can install it in your own `user' TeX tree.
5503 Where these trees should be created, if they do not already exist, depends
5504 upon the details of your system.
5505 To find out where they are, look in the file
5506 \begin_inset Flex CharStyle:Code
5509 \begin_layout Plain Layout
5519 \begin_layout Plain Layout
5520 This usually lives in the directory
5521 \begin_inset Flex CharStyle:Code
5524 \begin_layout Plain Layout
5530 , though you can run
5531 \begin_inset Flex CharStyle:Code
5534 \begin_layout Plain Layout
5545 The location of the `local' TeX tree is defined by the
5546 \begin_inset Flex CharStyle:Code
5549 \begin_layout Plain Layout
5555 variable; this is usually somewhere like
5556 \begin_inset Flex URL
5559 \begin_layout Plain Layout
5561 /usr/local/share/texmf/
5567 The location of the `user' TeX tree is defined by
5568 \begin_inset Flex CharStyle:Code
5571 \begin_layout Plain Layout
5578 \begin_inset Flex CharStyle:Code
5581 \begin_layout Plain Layout
5588 (If these variables are not predefined, you can define them.) You'll probably
5589 need root permissions to create or modify the `local' tree, but your `user'
5590 tree shouldn't have such limitations.
5593 \begin_layout Enumerate
5595 \begin_inset Flex CharStyle:Code
5598 \begin_layout Plain Layout
5605 \begin_inset Flex CharStyle:Code
5608 \begin_layout Plain Layout
5615 \begin_inset Flex CharStyle:Code
5618 \begin_layout Plain Layout
5625 \begin_inset space \thinspace{}
5629 \begin_inset Newline newline
5633 \begin_inset Flex CharStyle:Code
5636 \begin_layout Plain Layout
5637 TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
5643 \begin_inset Newline newline
5649 \begin_layout Enumerate
5650 Your local and user trees
5654 have the same sort of directory structure as your main existing
5655 \begin_inset Flex CharStyle:Code
5658 \begin_layout Plain Layout
5664 directory, which will be found at
5665 \begin_inset Flex CharStyle:Code
5668 \begin_layout Plain Layout
5675 \begin_inset Flex CharStyle:Code
5678 \begin_layout Plain Layout
5684 .) For example, latex packages should go under
5685 \begin_inset Flex CharStyle:Code
5688 \begin_layout Plain Layout
5689 $TEXMFLOCAL/tex/latex/
5695 \begin_inset Flex CharStyle:Code
5698 \begin_layout Plain Layout
5699 $TEXMFHOME/tex/latex/
5705 If you do not put them here, they probably will not work.
5708 \begin_layout Enumerate
5709 Once your tree is properly set up, you can install the package into an appropria
5711 If you are lucky, your package will have been provided as a so-called `TDS'
5712 (TeX Directory Structure) zip file.
5713 To install it, you want to unzip it from the top of your tree.
5714 So, for example, you can copy the file
5715 \begin_inset Flex CharStyle:Code
5718 \begin_layout Plain Layout
5725 \begin_inset Flex CharStyle:Code
5728 \begin_layout Plain Layout
5729 /home/yourname/texmf/
5734 and then, from inside that directory, just run:
5735 \begin_inset Flex CharStyle:Code
5738 \begin_layout Plain Layout
5745 This will extract the needed files and copy them where they need to be.
5746 \begin_inset Newline newline
5749 If you do not have a TDS file, then you have to do this manually.
5750 For example, you might install the FoilTeX files into
5751 \begin_inset Flex URL
5754 \begin_layout Plain Layout
5756 $TEXMFLOCAL/tex/latex/contrib/foiltex
5762 Why there? The CTAN download directories are themselves organized much
5763 like a TeX tree, and it isn't a bad idea to follow its structure when you
5764 install your own files.
5765 FoilTeX, as it happens, is found at
5766 \begin_inset Flex URL
5769 \begin_layout Plain Layout
5771 http://ctan.org/texarchive/macros/latex/contrib/foiltex/
5780 \begin_layout Enumerate
5781 Finally, you must update the database TeX uses to find files.
5782 On MiKTeX, this is done by pressing the button
5785 \begin_inset space ~
5790 that you find in MiKTeX's
5791 \begin_inset Quotes eld
5795 \begin_inset Quotes erd
5800 \begin_inset Flex CharStyle:Code
5803 \begin_layout Plain Layout
5804 $TEXMFLOCAL/tex/latex/
5810 Under TeXLive and the like, you should run
5811 \begin_inset Flex CharStyle:Code
5814 \begin_layout Plain Layout
5820 from a terminal, with root permissions if necessary.
5824 \begin_layout Standard
5825 Your package is now installed and available to LaTeX.
5826 You can verify this from a terminal by typing `
5827 \begin_inset Flex CharStyle:Code
5830 \begin_layout Plain Layout
5831 kpsewhich yourfile.ext
5837 To make LyX aware of it, however, you will need to reconfigure (
5838 \begin_inset Flex CharStyle:MenuItem
5841 \begin_layout Plain Layout
5842 Tools\SpecialChar \menuseparator
5848 ) and then restart LyX.
5849 If the new package was a document class, such as FoilTeX again, you will
5850 now see it available under
5851 \begin_inset Flex CharStyle:MenuItem
5854 \begin_layout Plain Layout
5855 Document\SpecialChar \menuseparator
5856 Settings\SpecialChar \menuseparator
5863 \begin_inset Flex CharStyle:MenuItem
5866 \begin_layout Plain Layout
5875 \begin_layout Standard
5876 What if there isn't a layout file is available for your new document class?
5877 Then, unfortunately, LyX will know nothing about it until you create a
5878 layout file yourself (or get someone else to do it).
5879 That is the topic of the next section.
5882 \begin_layout Section
5883 Types of layout files
5886 \begin_layout Standard
5887 This section describes the various sorts of LyX files that contain layout
5889 These files describe various paragraph and character styles, determining
5890 how LyX should display them and how they should be translated into LaTeX,
5891 DocBook, XHTML, or whatever output format is being used.
5895 \begin_layout Standard
5896 We shall try to provide a thorough description of the process of writing
5898 However, there are so many different types of documents supported even
5899 by just LaTeX that we can't hope to cover every different possibility or
5900 problem you might encounter.
5901 The LyX users' list is frequented by people with lots of experience with
5902 layout design who are willing to share what they've learned, so please
5903 feel free to ask questions there.
5906 \begin_layout Standard
5907 As you prepare to write a new layout, it is extremely helpful to look at
5908 the layouts distributed with LyX.
5909 If you write a LyX layout for a LaTeX document class that might also be
5910 used by others, or write a module that might be useful to others, then
5911 you should consider posting your layout to the
5912 \begin_inset CommandInset href
5914 name "layout section on the LyX wiki"
5915 target "http://wiki.lyx.org/Layouts/Layouts"
5919 or even to the LyX developers' list, so that it might be included in LyX
5924 \begin_layout Plain Layout
5925 Note that LyX is licensed under the General Public License, so any material
5926 that is contribued to LyX must be similarly licensed.
5934 \begin_layout Subsection
5936 \begin_inset CommandInset label
5938 name "sub:Layout-modules"
5945 \begin_layout Standard
5946 We have spoken to this point about `layout files'.
5947 But there are different sorts of files that contain layout information.
5948 Layout files, strictly so called, have the
5949 \begin_inset Flex CharStyle:Code
5952 \begin_layout Plain Layout
5958 extension and provide LyX with information about document classes.
5959 As of LyX 1.6, however, layout information can also be contained in layout
5965 \begin_inset Flex CharStyle:Code
5968 \begin_layout Plain Layout
5975 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
5976 some modules—such as the
5977 \begin_inset Flex CharStyle:Code
5980 \begin_layout Plain Layout
5986 module—specifcally provide support for one package.
5987 In a sense, layout modules are similar to included
5991 \begin_layout Plain Layout
5992 These can have any extension, but by convention have the
5993 \begin_inset Flex CharStyle:Code
5996 \begin_layout Plain Layout
6008 \begin_inset Flex CharStyle:Code
6011 \begin_layout Plain Layout
6017 —in that modules are not specific to a given document class but may be used
6018 with many different classes.
6019 The difference is that using an included file with
6020 \begin_inset Flex CharStyle:Code
6023 \begin_layout Plain Layout
6029 requires editing that file.
6030 Modules, by contrast, are selected in the
6031 \begin_inset Flex CharStyle:MenuItem
6034 \begin_layout Plain Layout
6035 Document\SpecialChar \menuseparator
6044 \begin_layout Standard
6045 Building modules is the easiest way to get started with layout editing,
6046 since it can be as simple as adding a single new paragraph style or flex
6048 But modules may, in principle, contain anything a layout file can contain.
6051 \begin_layout Standard
6052 After creating a new module and copying it to the
6053 \begin_inset Flex CharStyle:Code
6056 \begin_layout Plain Layout
6062 folder, you will need to reconfigure and then restart LyX for the module
6063 to appear in the menu.
6064 However, changes you make to the module will be seen immediately, if you
6066 \begin_inset Flex CharStyle:MenuItem
6069 \begin_layout Plain Layout
6070 Document\SpecialChar \menuseparator
6076 , highlight something, and then hit
6077 \begin_inset Quotes eld
6081 \begin_inset Quotes erd
6087 It is strongly recommended that you save your work before doing this
6092 it is strongly recommended that you not attempt to edit modules while simultaneo
6093 usly working on actual documents
6096 Though of course the developers strive to keep LyX stable in such situations,
6097 syntax errors and the like in your module file could cause strange behavior.
6100 \begin_layout Subsection
6102 \begin_inset Flex CharStyle:MenuItem
6105 \begin_layout Plain Layout
6114 \begin_layout Standard
6115 There are two situations you are likely to encounter when wanting to support
6116 a new LaTeX document class, involving LaTeX2e class (
6117 \begin_inset Flex CharStyle:Code
6120 \begin_layout Plain Layout
6127 \begin_inset Flex CharStyle:Code
6130 \begin_layout Plain Layout
6137 Supporting a style file is usually fairly easy.
6138 Supporting a new class file is a bit harder.
6139 We'll discuss the former in this section and the latter in the next.
6140 Similar remarks apply, of course, if you want to support a new DocBook
6144 \begin_layout Standard
6145 The easier case is the one in which your new document class is provided
6146 as a style file that is to be used in conjunction with an already supported
6148 For the sake of the example, we'll assume that the style file is called
6150 \begin_inset Flex CharStyle:MenuItem
6153 \begin_layout Plain Layout
6159 and that it is meant to be used with
6160 \begin_inset Flex CharStyle:MenuItem
6163 \begin_layout Plain Layout
6169 , which is a standard class.
6173 \begin_layout Standard
6174 Start by copying the existing class's layout file into your local directory:
6178 \begin_layout Plain Layout
6179 Of course, which directory is your local directory will vary by platform,
6180 and LyX allows you to specify your local directory on startup, too, using
6182 \begin_inset Flex CharStyle:Code
6185 \begin_layout Plain Layout
6199 \begin_layout LyX-Code
6200 cp report.layout ~/.lyx/layouts/myclass.layout
6203 \begin_layout Standard
6205 \begin_inset Flex CharStyle:Code
6208 \begin_layout Plain Layout
6214 and change the line:
6217 \begin_layout LyX-Code
6220 DeclareLaTeXClass{report}
6223 \begin_layout Standard
6227 \begin_layout LyX-Code
6230 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6233 \begin_layout Standard
6237 \begin_layout LyX-Code
6239 \begin_inset Newline newline
6245 \begin_inset Newline newline
6251 \begin_layout Standard
6252 near the top of the file.
6255 \begin_layout Standard
6256 Start LyX and select
6257 \begin_inset Flex CharStyle:MenuItem
6260 \begin_layout Plain Layout
6261 Tools\SpecialChar \menuseparator
6268 Then restart LyX and try creating a new document.
6270 \begin_inset Flex CharStyle:MenuItem
6273 \begin_layout Plain Layout
6279 " as a document class option in the
6280 \begin_inset Flex CharStyle:MenuItem
6283 \begin_layout Plain Layout
6284 Document\SpecialChar \menuseparator
6291 It is likely that some of the sectioning commands and such in your new
6292 class will work differently from how they worked in the base class—
6293 \begin_inset Flex CharStyle:Code
6296 \begin_layout Plain Layout
6302 in this example—so you can fiddle around with the settings for the different
6303 sections if you wish.
6304 The layout information for sections is contained in
6305 \begin_inset Flex CharStyle:Code
6308 \begin_layout Plain Layout
6314 , but you do not need to copy and change this file.
6315 Instead, you can simply add your changes to your layout file, after the
6317 \begin_inset Flex CharStyle:Code
6320 \begin_layout Plain Layout
6326 , which itself includes
6327 \begin_inset Flex CharStyle:Code
6330 \begin_layout Plain Layout
6337 For example, you might add these lines:
6340 \begin_layout LyX-Code
6344 \begin_layout LyX-Code
6348 \begin_layout LyX-Code
6352 \begin_layout LyX-Code
6356 \begin_layout LyX-Code
6360 \begin_layout Standard
6361 to change the font for chapter headings to sans-serif.
6362 This will override (or, in this case, add to) the existing declaration
6363 for the Chapter style.
6367 \begin_layout Standard
6368 Your new package may also provide commands or environments not present in
6370 In this case, you will want to add these to the layout file.
6372 \begin_inset CommandInset ref
6374 reference "sec:TextClass"
6378 for information on how to do so.
6381 \begin_layout Standard
6383 \begin_inset Flex CharStyle:MenuItem
6386 \begin_layout Plain Layout
6392 can be used with several different document classes, and even if it cannot,
6393 you might find it easiest just to write a module that you can load with
6395 The simplest possible such module would be:
6398 \begin_layout LyX-Code
6401 DeclareLyXModule{My Package}
6404 \begin_layout LyX-Code
6408 \begin_layout LyX-Code
6409 #Support for mypkg.sty.
6412 \begin_layout LyX-Code
6414 \begin_inset Newline newline
6420 \begin_layout LyX-Code
6422 \begin_inset Newline newline
6428 \begin_layout LyX-Code
6430 \begin_inset Newline newline
6436 \begin_inset Newline newline
6442 \begin_layout Standard
6443 A more complex module might modify the behavior of some existing constructs
6444 or define some new ones.
6446 \begin_inset CommandInset ref
6448 reference "sec:TextClass"
6455 \begin_layout Subsection
6457 \begin_inset Flex CharStyle:MenuItem
6460 \begin_layout Plain Layout
6469 \begin_layout Standard
6470 There are two possibilities here.
6471 One is that the class file is itself based upon an existing document class.
6472 For example, many thesis classes are based upon
6473 \begin_inset Flex CharStyle:MenuItem
6476 \begin_layout Plain Layout
6483 To see whether yours is, look for a line like
6486 \begin_layout LyX-Code
6492 \begin_layout Standard
6494 If so, then you may proceed largely as in the previous section, though
6496 \begin_inset Flex CharStyle:Code
6499 \begin_layout Plain Layout
6505 line will be different.
6506 If your new class is
6507 \begin_inset Flex CharStyle:Code
6510 \begin_layout Plain Layout
6516 and it is based upon
6517 \begin_inset Flex CharStyle:Code
6520 \begin_layout Plain Layout
6526 , then the line should read:
6530 \begin_layout Plain Layout
6531 And it will be easiest if you save the file to
6532 \begin_inset Flex CharStyle:Code
6535 \begin_layout Plain Layout
6541 : LyX assumes that the document class has the same name as the layout file.
6550 \begin_layout LyX-Code
6553 DeclareLaTeXClass[thesis,book]{thesis}
6556 \begin_layout Standard
6557 If, on the other hand, the new class is not based upon an existing class,
6558 you will probably have to
6559 \begin_inset Quotes eld
6563 \begin_inset Quotes erd
6567 We strongly suggest copying an existing layout file which uses a similar
6568 LaTeX class and then modifying it, if you can do so.
6569 At least use an existing file as a starting point so you can find out what
6570 items you need to worry about.
6571 Again, the specifics are covered below.
6574 \begin_layout Subsection
6576 \begin_inset CommandInset label
6578 name "sub:Creating-Templates"
6585 \begin_layout Standard
6586 Once you have written a layout file for a new document class, you might
6587 want to consider writing a
6592 A template acts as a kind of tutorial for your layout, showing how it might
6593 be used, though containing dummy content.
6594 You can of course look at the various templates included with LyX for ideas.
6597 \begin_layout Standard
6598 Templates are created just like usual documents: using LyX.
6599 The only difference is that usual documents contain all possible settings,
6600 including the font scheme and the paper size.
6601 Usually a user doesn't want a template to overwrite his preferred settings
6602 for such parameters.
6603 For that reason, the designer of a template should remove the corresponding
6605 \begin_inset Flex CharStyle:Code
6608 \begin_layout Plain Layout
6617 \begin_inset Flex CharStyle:Code
6620 \begin_layout Plain Layout
6628 from the template LyX file.
6629 This can be done with any simple text-editor, for example
6630 \begin_inset Flex CharStyle:Code
6633 \begin_layout Plain Layout
6640 \begin_inset Flex CharStyle:Code
6643 \begin_layout Plain Layout
6653 \begin_layout Standard
6654 Put the edited template files you create in
6655 \begin_inset Flex CharStyle:Code
6658 \begin_layout Plain Layout
6664 , copy the ones you use from the global template directory in
6665 \begin_inset Flex CharStyle:Code
6668 \begin_layout Plain Layout
6674 to the same place, and redefine the template path in the
6675 \begin_inset Flex CharStyle:MenuItem
6678 \begin_layout Plain Layout
6679 Tools\SpecialChar \menuseparator
6680 Preferences\SpecialChar \menuseparator
6689 \begin_layout Standard
6690 Note, by the way, that there is a template which has a particular meaning:
6692 \begin_inset Flex CharStyle:Code
6695 \begin_layout Plain Layout
6702 This template is loaded every time you create a new document with
6703 \begin_inset Flex CharStyle:MenuItem
6706 \begin_layout Plain Layout
6707 File\SpecialChar \menuseparator
6713 in order to provide useful defaults.
6714 To create this template from inside LyX, all you have to do is to open
6715 a document with the correct settings, and use the
6716 \begin_inset Flex CharStyle:MenuItem
6719 \begin_layout Plain Layout
6720 Save as Document Defaults
6728 \begin_layout Subsection
6729 Upgrading old layout files
6732 \begin_layout Standard
6733 The format of layout files changes with each LyX release, so old layout
6734 files need to be converted to the new format.
6735 This process has been automated since LyX 1.4: If LyX reads a layout file
6736 in an older format, it automatically calls the script
6737 \begin_inset Flex CharStyle:Code
6740 \begin_layout Plain Layout
6746 to convert it to a temporary file in current format.
6747 The original file is left untouched.
6748 If you use the layout file often, then, you may want to convert it permanently,
6749 so that LyX does not have to do so itself every time.
6750 To do this, you can call the converter manually:
6753 \begin_layout LyX-Code
6754 mv myclass.layout myclass.old
6757 \begin_layout LyX-Code
6758 python LyXDir/scripts/layout2layout.py myclass.old myclass.layout
6761 \begin_layout Standard
6763 \begin_inset Flex CharStyle:Code
6766 \begin_layout Plain Layout
6772 with the name of your LyX system directory, of course.
6775 \begin_layout Standard
6776 Note that manual conversion does not affect included files, so these will
6777 have to be converted separately.
6780 \begin_layout Section
6781 \begin_inset CommandInset label
6783 name "sec:TextClass"
6787 The layout file format
6790 \begin_layout Standard
6791 When it's finally time to get your hands dirty and create or edit your own
6792 layout file, the following sections describe what you're up against.
6793 Our advice is to go slowly, save and test often, listen to soothing music,
6794 and enjoy one or two of your favorite adult beverages; more if you are
6795 getting particularly stuck.
6796 It's really not that hard, except that the multitude of options can become
6797 overwhelming if you try to do too much in one sitting.
6798 Go have another adult beverage, just for good measure.
6801 \begin_layout Standard
6802 Note that all the tags used in layout files are case-insensitive.
6804 \begin_inset Flex CharStyle:Code
6807 \begin_layout Plain Layout
6814 \begin_inset Flex CharStyle:Code
6817 \begin_layout Plain Layout
6824 \begin_inset Flex CharStyle:Code
6827 \begin_layout Plain Layout
6833 are really the same tag.
6834 The possible values are printed in brackets after the feature's name.
6835 The default value if a feature isn't specified inside a text class-description
6837 \begin_inset Flex CharStyle:Code
6840 \begin_layout Plain Layout
6849 If the argument has a data type like
6850 \begin_inset Quotes eld
6854 \begin_inset Quotes erd
6858 \begin_inset Quotes eld
6862 \begin_inset Quotes erd
6865 , the default is shown like this:
6866 \begin_inset Flex CharStyle:Code
6869 \begin_layout Plain Layout
6880 \begin_layout Subsection
6881 The document class declaration
6884 \begin_layout Standard
6885 Lines in a layout file which begin with
6886 \begin_inset Flex CharStyle:Code
6889 \begin_layout Plain Layout
6896 There is one exception to this rule.
6898 \begin_inset Flex CharStyle:Code
6901 \begin_layout Plain Layout
6907 files should begin with a line like:
6910 \begin_layout LyX-Code
6913 #% Do not delete the line below; configure depends on this
6916 \begin_layout LyX-Code
6921 DeclareLaTeXClass{article}
6924 \begin_layout Standard
6925 The second line is used when you (re)configure LyX.
6926 The layout file is read by the LaTeX script
6927 \begin_inset Flex CharStyle:Code
6930 \begin_layout Plain Layout
6936 , in a special mode where
6937 \begin_inset Flex CharStyle:Code
6940 \begin_layout Plain Layout
6947 The first line is just a LaTeX comment, and the second one contains the
6948 declaration of the text class.
6949 If these lines appear in a file named
6950 \begin_inset Flex CharStyle:Code
6953 \begin_layout Plain Layout
6959 , then they define a text class of name
6960 \begin_inset Flex CharStyle:Code
6963 \begin_layout Plain Layout
6969 (the name of the layout file) which uses the LaTeX document class
6970 \begin_inset Flex CharStyle:Code
6973 \begin_layout Plain Layout
6979 (the default is to use the same name as the layout).
6981 \begin_inset Quotes eld
6985 \begin_inset Quotes erd
6988 that appears above is used as a description of the text class in the
6989 \begin_inset Flex CharStyle:MenuItem
6992 \begin_layout Plain Layout
6993 Document\SpecialChar \menuseparator
7002 \begin_layout Standard
7003 Let's assume that you wrote your own text class that uses the
7004 \begin_inset Flex CharStyle:Code
7007 \begin_layout Plain Layout
7013 document class, but where you changed the appearance of the section headings.
7014 If you put it in a file
7015 \begin_inset Flex CharStyle:Code
7018 \begin_layout Plain Layout
7024 , the header of this file should be:
7027 \begin_layout LyX-Code
7030 #% Do not delete the line below; configure depends on this
7033 \begin_layout LyX-Code
7038 DeclareLaTeXClass[article]{article (with my own headings)}
7041 \begin_layout Standard
7042 This declares a text class
7043 \begin_inset Flex CharStyle:Code
7046 \begin_layout Plain Layout
7052 , associated with the LaTeX document class
7053 \begin_inset Flex CharStyle:Code
7056 \begin_layout Plain Layout
7063 \begin_inset Quotes eld
7066 article (with my own headings)
7067 \begin_inset Quotes erd
7071 If your text class depends on several packages, you can declare it as:
7074 \begin_layout LyX-Code
7077 #% Do not delete the line below; configure depends on this
7080 \begin_layout LyX-Code
7085 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
7088 \begin_layout Standard
7089 This indicates that your text class uses the
7090 \begin_inset Flex CharStyle:Code
7093 \begin_layout Plain Layout
7100 Finally, it is also possible to declare classes for DocBook code.
7101 Typical declarations will look like:
7104 \begin_layout LyX-Code
7107 #% Do not delete the line below; configure depends on this
7110 \begin_layout LyX-Code
7115 DeclareDocBookClass[article]{SGML (DocBook article)}
7118 \begin_layout Standard
7119 Note that these declarations can also be given an optional parameter declaring
7120 the name of the document class (but not a list).
7123 \begin_layout Standard
7124 So, to be as explicit as possible, the form of the layout declaration is:
7127 \begin_layout LyX-Code
7132 DeclareLaTeXClass[class,package.sty]{layout description}
7135 \begin_layout Standard
7136 The class need only be specified if the name of the LaTeX class file and
7137 the name of the layout file are different or if there are packages to load.
7138 If the name of the class file is not specified, then LyX will simply assume
7139 that it is the same as the name of the layout file.
7142 \begin_layout Standard
7143 When the text class has been modified to your taste, all you have to do
7144 is to copy it either to
7145 \begin_inset Flex CharStyle:Code
7148 \begin_layout Plain Layout
7155 \begin_inset Flex CharStyle:Code
7158 \begin_layout Plain Layout
7165 \begin_inset Flex CharStyle:MenuItem
7168 \begin_layout Plain Layout
7169 Tools\SpecialChar \menuseparator
7175 , exit LyX and restart.
7176 Then your new text class should be available along with the others.
7179 \begin_layout Standard
7180 Once the layout file is installed, you can edit it and see your changes
7181 without having to reconfigure or to restart LyX.
7186 \begin_layout Plain Layout
7187 In versions of LyX prior to 1.6, this was not true.
7188 As a result, editing layout files was very time consuming, since you had
7189 constantly to restart LyX to see changes.
7194 You can force a reload of the current layout by using the LyX function
7196 \begin_inset Flex CharStyle:MenuItem
7199 \begin_layout Plain Layout
7206 There is no default binding for this function—though, of course, you can
7207 bind it to a key yourself.
7208 But you will normally use this function simply by entering it in the mini-buffe
7213 \begin_layout Standard
7219 \begin_inset Flex CharStyle:MenuItem
7222 \begin_layout Plain Layout
7228 is very much an `advanced feature'.
7233 recommended that you save your work before using this function.
7238 recommended that you not attempt to edit layout information while simultaneousl
7239 y working on a document that you care about.
7240 Use a test document.
7241 Syntax errors and the like in your layout file could cause peculiar behavior.
7242 In particular, such errors could cause LyX to regard the current layout
7243 as invalid and to attempt to switch to some other layout.
7247 \begin_layout Plain Layout
7248 Really bad syntax errors may even caused LyX to exit.
7249 This is because certain sorts of errors may make LyX unable to read
7259 The LyX team strives to keep LyX stable in such situations, but safe is
7264 \begin_layout Plain Layout
7265 While we're giving advice: make regular backups.
7266 And be nice to your mother.
7274 \begin_layout Subsection
7275 The Module declaration
7278 \begin_layout Standard
7279 A module must begin with a line like the following:
7282 \begin_layout LyX-Code
7285 DeclareLyXModule[endnotes.sty]{Endnotes}
7288 \begin_layout Standard
7289 The mandatory argument, in curly brackets, is the name of the module, as
7291 \begin_inset Flex CharStyle:MenuItem
7294 \begin_layout Plain Layout
7295 Document\SpecialChar \menuseparator
7302 The argument in square brackets is optional: It declares any LaTeX packages
7303 on which the module depends.
7304 Please note that only packages about which LyX knows should be listed in
7305 the square brackets.
7309 \begin_layout Plain Layout
7310 The list of such packages is documented only in the source code.
7315 LyX will not check for arbitrary packages.
7316 It is also possible to use the form
7317 \begin_inset Flex CharStyle:MenuItem
7320 \begin_layout Plain Layout
7326 as an optional argument, which declares that the module can only be used
7327 when there exists a conversion chain between the formats `
7328 \begin_inset Flex CharStyle:Code
7331 \begin_layout Plain Layout
7338 \begin_inset Flex CharStyle:Code
7341 \begin_layout Plain Layout
7350 \begin_layout Standard
7351 The module declaration should then be followed by lines like the following:
7354 \begin_layout LyX-Code
7358 \begin_layout LyX-Code
7359 #Adds an endnote command, in addition to footnotes.
7363 \begin_layout LyX-Code
7364 #You will need to add
7366 theendnotes in TeX code where you
7369 \begin_layout LyX-Code
7370 #want the endnotes to appear.
7374 \begin_layout LyX-Code
7378 \begin_layout LyX-Code
7379 #Requires: somemodule | othermodule
7382 \begin_layout LyX-Code
7383 #Excludes: badmodule
7386 \begin_layout Standard
7387 The description is used in
7388 \begin_inset Flex CharStyle:MenuItem
7391 \begin_layout Plain Layout
7392 Document\SpecialChar \menuseparator
7398 to provide the user with information about what the module does.
7400 \begin_inset Flex CharStyle:Code
7403 \begin_layout Plain Layout
7409 line is used to identify other modules with which this one must be used;
7411 \begin_inset Flex CharStyle:Code
7414 \begin_layout Plain Layout
7420 line is used to identify modules with which this one may not be used.
7421 Both are optional, and, as shown, multiple modules should be separated
7422 with the pipe symbol: |.
7423 Note that the required modules are treated disjunctively:
7427 of the required modules must be used.
7432 excluded module may be used.
7433 Note that modules are identified here by their
7438 \begin_inset Flex CharStyle:Code
7441 \begin_layout Plain Layout
7449 \begin_inset Flex CharStyle:Code
7452 \begin_layout Plain Layout
7459 \begin_inset Flex CharStyle:Code
7462 \begin_layout Plain Layout
7471 \begin_layout Subsection
7475 \begin_layout Standard
7476 The first non-comment line of any layout file, included file, or module
7481 contain the file format number:
7484 \begin_layout Description
7485 \begin_inset Flex CharStyle:Code
7488 \begin_layout Plain Layout
7495 \begin_inset Flex CharStyle:Code
7498 \begin_layout Plain Layout
7504 ] The format of the layout file.
7507 \begin_layout Standard
7508 This tag was introduced with LyX 1.4.0.
7509 Layout files from LyX 1.3.x and earlier don't have an explicit file format
7510 and are considered to be of format 1.
7511 The format for the present version of LyX is format 21.
7512 But each version of LyX is capable of reading earlier versions' layout
7513 files, just as they are capable of reading files produced by earlier versions
7515 There is, however, no provision for converting to earlier formats.
7516 So LyX 1.6.x will not read layout files in format 21 but only files in format
7520 \begin_layout Subsection
7521 \begin_inset CommandInset label
7523 name "sub:General-text-class"
7527 General text class parameters
7530 \begin_layout Standard
7531 These are general parameters that govern the behavior of an entire document
7537 mean that they must appear in
7538 \begin_inset Flex CharStyle:Code
7541 \begin_layout Plain Layout
7547 files rather than in modules.
7548 A module can contain any layout tag.)
7551 \begin_layout Description
7552 \begin_inset Flex CharStyle:Code
7555 \begin_layout Plain Layout
7561 Adds information that will be output in the
7562 \begin_inset Flex CharStyle:Code
7565 \begin_layout Plain Layout
7571 block when this document class is output to XHTML.
7572 Typically, this would be used to output CSS style information, but it can
7573 be used for anything that can appear in
7574 \begin_inset Flex CharStyle:Code
7577 \begin_layout Plain Layout
7585 \begin_inset Quotes eld
7589 \begin_inset Flex CharStyle:Code
7592 \begin_layout Plain Layout
7599 \begin_inset Quotes erd
7605 \begin_layout Description
7606 \begin_inset Flex CharStyle:Code
7609 \begin_layout Plain Layout
7615 Adds information to the document preamble.
7617 \begin_inset Quotes eld
7621 \begin_inset Flex CharStyle:Code
7624 \begin_layout Plain Layout
7631 \begin_inset Quotes erd
7637 \begin_layout Description
7638 \begin_inset Flex CharStyle:Code
7641 \begin_layout Plain Layout
7647 Defines formats for use in the display of bibliographic information.
7649 \begin_inset CommandInset ref
7651 reference "sub:Citation-format-description"
7657 \begin_inset Quotes eld
7661 \begin_inset Flex CharStyle:Code
7664 \begin_layout Plain Layout
7671 \begin_inset Quotes erd
7677 \begin_layout Description
7678 \begin_inset Flex CharStyle:Code
7681 \begin_layout Plain Layout
7687 Describes various global options supported by the document class.
7689 \begin_inset space ~
7693 \begin_inset CommandInset ref
7695 reference "sub:ClassOptions"
7701 \begin_inset Quotes eld
7705 \begin_inset Flex CharStyle:Code
7708 \begin_layout Plain Layout
7715 \begin_inset Quotes erd
7721 \begin_layout Description
7722 \begin_inset Flex CharStyle:Code
7725 \begin_layout Plain Layout
7732 \begin_inset Flex CharStyle:Code
7735 \begin_layout Plain Layout
7744 \begin_inset Flex CharStyle:Code
7747 \begin_layout Plain Layout
7753 ] Whether the class should
7757 to having one or two columns.
7758 Can be changed in the
7759 \begin_inset Flex CharStyle:MenuItem
7762 \begin_layout Plain Layout
7763 Document\SpecialChar \menuseparator
7772 \begin_layout Description
7773 \begin_inset Flex CharStyle:Code
7776 \begin_layout Plain Layout
7783 \begin_inset Flex CharStyle:Code
7786 \begin_layout Plain Layout
7792 ] This sequence defines the properties for a counter.
7793 If the counter does not yet exist, it is created; if it does exist, it
7796 \begin_inset Quotes eld
7800 \begin_inset Flex CharStyle:Code
7803 \begin_layout Plain Layout
7810 \begin_inset Quotes erd
7814 \begin_inset Newline newline
7818 \begin_inset space ~
7822 \begin_inset CommandInset ref
7824 reference "sub:Counters"
7828 for details on counters.
7831 \begin_layout Description
7832 \begin_inset Flex CharStyle:Code
7835 \begin_layout Plain Layout
7841 Sets the default font used to display the document.
7843 \begin_inset space ~
7847 \begin_inset CommandInset ref
7849 reference "sub:Font-description"
7853 for how to declare fonts.
7855 \begin_inset Quotes eld
7859 \begin_inset Flex CharStyle:Code
7862 \begin_layout Plain Layout
7869 \begin_inset Quotes erd
7875 \begin_layout Description
7876 \begin_inset Flex CharStyle:Code
7879 \begin_layout Plain Layout
7886 \begin_inset Flex CharStyle:Code
7889 \begin_layout Plain Layout
7895 Specifies a module to be included by default with this document class.
7896 The module should be specified by filename without the
7897 \begin_inset Flex CharStyle:Code
7900 \begin_layout Plain Layout
7907 The user can still remove the module, but it will be active at the outset.
7908 (This applies only when new files are created, or when this class is chosen
7909 for an existing document.)
7912 \begin_layout Description
7913 \begin_inset Flex CharStyle:Code
7916 \begin_layout Plain Layout
7923 \begin_inset Flex CharStyle:Code
7926 \begin_layout Plain Layout
7932 ] This is the style that will be assigned to new paragraphs, usually
7933 \begin_inset Flex CharStyle:MenuItem
7936 \begin_layout Plain Layout
7943 This will default to the first defined style if not given, but you are
7944 encouraged to use this directive.
7947 \begin_layout Description
7948 \begin_inset Flex CharStyle:Code
7951 \begin_layout Plain Layout
7958 \begin_inset Flex CharStyle:Code
7961 \begin_layout Plain Layout
7967 ] This tag indicates that the module in question—which should be specified
7968 by filename without the
7969 \begin_inset Flex CharStyle:Code
7972 \begin_layout Plain Layout
7978 extension—cannot be used with this document class.
7979 This might be used in a journal-specific layout file to prevent, say, the
7981 \begin_inset Flex CharStyle:Code
7984 \begin_layout Plain Layout
7990 module that numbers theorems by section.
7995 be used in a module.
7996 Modules have their own way of excluding other modules (see
7997 \begin_inset CommandInset ref
7999 reference "sub:Layout-modules"
8006 \begin_layout Description
8007 \begin_inset Flex CharStyle:Code
8010 \begin_layout Plain Layout
8016 Defines a new float.
8018 \begin_inset space ~
8022 \begin_inset CommandInset ref
8024 reference "sub:Floats"
8030 \begin_inset Quotes eld
8034 \begin_inset Flex CharStyle:Code
8037 \begin_layout Plain Layout
8044 \begin_inset Quotes erd
8050 \begin_layout Description
8051 \begin_inset Flex CharStyle:Code
8054 \begin_layout Plain Layout
8060 Sets the information that will be output in the
8061 \begin_inset Flex CharStyle:Code
8064 \begin_layout Plain Layout
8070 block when this document class is output to XHTML.
8071 Note that this will completely override any prior
8072 \begin_inset Flex CharStyle:Code
8075 \begin_layout Plain Layout
8082 \begin_inset Flex CharStyle:Code
8085 \begin_layout Plain Layout
8093 \begin_inset Flex CharStyle:Code
8096 \begin_layout Plain Layout
8102 if you just want to add material to the preamble.) Must end with
8103 \begin_inset Quotes eld
8107 \begin_inset Flex CharStyle:Code
8110 \begin_layout Plain Layout
8117 \begin_inset Quotes erd
8123 \begin_layout Description
8124 \begin_inset Flex CharStyle:Code
8127 \begin_layout Plain Layout
8134 \begin_inset Flex CharStyle:Code
8137 \begin_layout Plain Layout
8143 ] The layout to use for the table of contents, bibliography, and so forth,
8144 when the document is output to HTML.
8145 For articles, this should normally be Section; for books, Chapter.
8146 If it is not given, then LyX will attempt to figure out which layout to
8150 \begin_layout Description
8151 \begin_inset Flex CharStyle:Code
8154 \begin_layout Plain Layout
8161 \begin_inset Flex CharStyle:Code
8164 \begin_layout Plain Layout
8170 ] Modifies the properties of the given counter.
8171 If the counter does not exist, the section is ignored.
8173 \begin_inset Quotes eld
8177 \begin_inset Flex CharStyle:Code
8180 \begin_layout Plain Layout
8187 \begin_inset Quotes erd
8191 \begin_inset Newline newline
8195 \begin_inset space ~
8199 \begin_inset CommandInset ref
8201 reference "sub:Counters"
8205 for details on counters.
8208 \begin_layout Description
8209 \begin_inset Flex CharStyle:Code
8212 \begin_layout Plain Layout
8219 \begin_inset Flex CharStyle:Code
8222 \begin_layout Plain Layout
8228 ] Modifies the properties of the given paragraph style.
8229 If the style does not exist, the section is ignored.
8231 \begin_inset Quotes eld
8235 \begin_inset Flex CharStyle:Code
8238 \begin_layout Plain Layout
8245 \begin_inset Quotes erd
8251 \begin_layout Description
8252 \begin_inset Flex CharStyle:Code
8255 \begin_layout Plain Layout
8261 As its name implies, this command allows you to include another layout
8262 definition file within yours to avoid duplicating commands.
8263 Common examples are the standard layout files, for example,
8264 \begin_inset Flex CharStyle:Code
8267 \begin_layout Plain Layout
8273 , which contains most of the basic layouts.
8276 \begin_layout Description
8277 \begin_inset Flex CharStyle:Code
8280 \begin_layout Plain Layout
8286 This section (re-)defines the layout of an inset.
8287 It can be applied to an existing inset or to a new, user-defined inset,
8288 e.g., a new character style.
8290 \begin_inset Quotes eld
8294 \begin_inset Flex CharStyle:Code
8297 \begin_layout Plain Layout
8304 \begin_inset Quotes erd
8308 \begin_inset Newline newline
8312 \begin_inset space ~
8316 \begin_inset CommandInset ref
8318 reference "sub:Flex-insets-and"
8322 for more information.
8326 \begin_layout Description
8327 \begin_inset Flex CharStyle:Code
8330 \begin_layout Plain Layout
8337 \begin_inset Flex CharStyle:Code
8340 \begin_layout Plain Layout
8346 ] A string that indicates the width of the left margin on the screen, for
8348 \begin_inset Quotes eld
8352 \begin_inset Quotes erd
8356 (Note that this is not a `length', like
8357 \begin_inset Quotes eld
8361 \begin_inset Quotes erd
8367 \begin_layout Description
8368 \begin_inset Flex CharStyle:Code
8371 \begin_layout Plain Layout
8377 This command deletes an existing float.
8378 This is particularly useful when you want to suppress a float that has
8379 been defined in an input file.
8382 \begin_layout Description
8383 \begin_inset Flex CharStyle:Code
8386 \begin_layout Plain Layout
8392 This command deletes an existing style.
8393 This is particularly useful when you want to suppress a style that has
8394 be defined in an input file.
8397 \begin_layout Description
8398 \begin_inset Flex CharStyle:Code
8401 \begin_layout Plain Layout
8407 A string indicating the file format (as defined in the Preferences dialog)
8408 produced by this class.
8409 It is mainly useful when
8410 \begin_inset Flex CharStyle:Code
8413 \begin_layout Plain Layout
8419 is `literate' and one wants to define a new type of literate document.
8420 This string is reset to `docbook', `latex', or `literate' when the correspondin
8422 \begin_inset Flex CharStyle:Code
8425 \begin_layout Plain Layout
8431 parameter is encountered.
8434 \begin_layout Description
8435 \begin_inset Flex CharStyle:Code
8438 \begin_layout Plain Layout
8444 A string indicating what sort of output documents using this class will
8446 At present, the options are: `docbook', `latex', and `literate'.
8449 \begin_layout Description
8450 \begin_inset Flex CharStyle:Code
8453 \begin_layout Plain Layout
8460 \begin_inset Flex CharStyle:Code
8463 \begin_layout Plain Layout
8472 \begin_inset Flex CharStyle:Code
8475 \begin_layout Plain Layout
8482 \begin_inset Flex CharStyle:Code
8485 \begin_layout Plain Layout
8491 ] The default pagestyle.
8492 Can be changed in the
8493 \begin_inset Flex CharStyle:MenuItem
8496 \begin_layout Plain Layout
8497 Document\SpecialChar \menuseparator
8506 \begin_layout Description
8507 \begin_inset Flex CharStyle:Code
8510 \begin_layout Plain Layout
8516 Sets the preamble for the LaTeX document.
8517 Note that this will completely override any prior
8518 \begin_inset Flex CharStyle:Code
8521 \begin_layout Plain Layout
8528 \begin_inset Flex CharStyle:Code
8531 \begin_layout Plain Layout
8539 \begin_inset Flex CharStyle:Code
8542 \begin_layout Plain Layout
8548 if you just want to add material to the preamble.) Must end with
8549 \begin_inset Quotes eld
8553 \begin_inset Flex CharStyle:Code
8556 \begin_layout Plain Layout
8563 \begin_inset Quotes erd
8569 \begin_layout Description
8570 \begin_inset Flex CharStyle:Code
8573 \begin_layout Plain Layout
8580 \begin_inset Flex CharStyle:Code
8583 \begin_layout Plain Layout
8590 \begin_inset Flex CharStyle:Code
8593 \begin_layout Plain Layout
8602 \begin_inset Flex CharStyle:Code
8605 \begin_layout Plain Layout
8611 ] Whether the class already provides the feature
8612 \begin_inset Flex CharStyle:Code
8615 \begin_layout Plain Layout
8622 A feature is in general the name of a package (
8623 \begin_inset Flex CharStyle:Code
8626 \begin_layout Plain Layout
8633 \begin_inset Flex CharStyle:Code
8636 \begin_layout Plain Layout
8642 , \SpecialChar \ldots{}
8644 \begin_inset Flex CharStyle:Code
8647 \begin_layout Plain Layout
8654 \begin_inset Flex CharStyle:Code
8657 \begin_layout Plain Layout
8663 ,\SpecialChar \ldots{}
8664 ); the complete list of supported features is unfortunately not documented
8665 outside the LyX source code—but see
8666 \begin_inset Flex CharStyle:Code
8669 \begin_layout Plain Layout
8675 if you're interested.
8677 \begin_inset Flex CharStyle:MenuItem
8680 \begin_layout Plain Layout
8681 Help\SpecialChar \menuseparator
8687 also gives an overview of the supported packages.
8690 \begin_layout Description
8691 \begin_inset Flex CharStyle:Code
8694 \begin_layout Plain Layout
8701 \begin_inset Flex CharStyle:Code
8704 \begin_layout Plain Layout
8710 ] Indicates that this layout provides the functionality of the module mentioned,
8711 which should be specified by the filename without the
8712 \begin_inset Flex CharStyle:Code
8715 \begin_layout Plain Layout
8722 This will typically be used if the layout includes the module directly,
8723 rather than using the
8724 \begin_inset Flex CharStyle:Code
8727 \begin_layout Plain Layout
8733 tag to indicate that it ought to be used.
8734 It could also be used in a module that provided an alternate implementation
8735 of the same functionality.
8738 \begin_layout Description
8739 \begin_inset Flex CharStyle:Code
8742 \begin_layout Plain Layout
8749 \begin_inset Flex CharStyle:Code
8752 \begin_layout Plain Layout
8758 ] Whether the class requires the feature
8759 \begin_inset Flex CharStyle:Code
8762 \begin_layout Plain Layout
8769 Multiple features must be separated by commas.
8770 Note that you can only request supported features.
8772 \begin_inset Flex CharStyle:Code
8775 \begin_layout Plain Layout
8781 for a list of these.)
8784 \begin_layout Description
8785 \begin_inset Flex CharStyle:Code
8788 \begin_layout Plain Layout
8794 A string that indicates the width of the right margin on the screen, for
8796 \begin_inset Quotes eld
8800 \begin_inset Quotes erd
8806 \begin_layout Description
8807 \begin_inset Flex CharStyle:Code
8810 \begin_layout Plain Layout
8816 Sets which divisions get numbered.
8818 \begin_inset Flex CharStyle:Code
8821 \begin_layout Plain Layout
8830 \begin_layout Description
8831 \begin_inset Flex CharStyle:Code
8834 \begin_layout Plain Layout
8841 \begin_inset Flex CharStyle:Code
8844 \begin_layout Plain Layout
8853 \begin_inset Flex CharStyle:Code
8856 \begin_layout Plain Layout
8862 ] Whether the class-default should be printing on one or both sides of the
8864 Can be changed in the
8865 \begin_inset Flex CharStyle:MenuItem
8868 \begin_layout Plain Layout
8869 Document\SpecialChar \menuseparator
8878 \begin_layout Description
8879 \begin_inset Flex CharStyle:Code
8882 \begin_layout Plain Layout
8888 This sequence defines a paragraph style.
8889 If the style does not yet exist, it is created; if it does exist, its parameter
8892 \begin_inset Quotes eld
8896 \begin_inset Flex CharStyle:Code
8899 \begin_layout Plain Layout
8906 \begin_inset Quotes erd
8910 \begin_inset Newline newline
8914 \begin_inset space ~
8918 \begin_inset CommandInset ref
8920 reference "sub:Paragraph-Styles"
8924 for details on paragraph styles.
8927 \begin_layout Description
8928 \begin_inset Flex CharStyle:Code
8931 \begin_layout Plain Layout
8938 \begin_inset Flex CharStyle:Code
8941 \begin_layout Plain Layout
8947 ] The name of the command or environment to be used with
8948 \begin_inset Flex CharStyle:Code
8951 \begin_layout Plain Layout
8960 \begin_layout Description
8961 \begin_inset Flex CharStyle:Code
8964 \begin_layout Plain Layout
8971 \begin_inset Flex CharStyle:Code
8974 \begin_layout Plain Layout
8983 \begin_inset Flex CharStyle:Code
8986 \begin_layout Plain Layout
8992 ] Indicates what kind of markup is used to define the title of a document.
8994 \begin_inset Flex CharStyle:Code
8997 \begin_layout Plain Layout
9003 means that the macro with name
9004 \begin_inset Flex CharStyle:Code
9007 \begin_layout Plain Layout
9013 will be inserted after the last layout which has
9014 \begin_inset Quotes eld
9018 \begin_inset Flex CharStyle:Code
9021 \begin_layout Plain Layout
9028 \begin_inset Quotes erd
9033 \begin_inset Flex CharStyle:Code
9036 \begin_layout Plain Layout
9042 corresponds to the case where the block of paragraphs which have
9043 \begin_inset Quotes eld
9047 \begin_inset Flex CharStyle:Code
9050 \begin_layout Plain Layout
9057 \begin_inset Quotes erd
9060 should be enclosed into the
9061 \begin_inset Flex CharStyle:Code
9064 \begin_layout Plain Layout
9073 \begin_layout Description
9074 \begin_inset Flex CharStyle:Code
9077 \begin_layout Plain Layout
9083 Sets which divisions are included in the table of contents.
9085 \begin_inset Flex CharStyle:Code
9088 \begin_layout Plain Layout
9097 \begin_layout Subsection
9098 \begin_inset Flex CharStyle:Code
9101 \begin_layout Plain Layout
9108 \begin_inset CommandInset label
9110 name "sub:ClassOptions"
9117 \begin_layout Standard
9119 \begin_inset Flex CharStyle:Code
9122 \begin_layout Plain Layout
9128 section can contain the following entries:
9131 \begin_layout Description
9132 \begin_inset Flex CharStyle:Code
9135 \begin_layout Plain Layout
9142 \begin_inset Flex CharStyle:Code
9145 \begin_layout Plain Layout
9151 ] The list of available font sizes for the document's main font, separated
9153 \begin_inset Quotes eld
9157 \begin_inset Flex CharStyle:Code
9160 \begin_layout Plain Layout
9167 \begin_inset Quotes erd
9173 \begin_layout Description
9174 \begin_inset Flex CharStyle:Code
9177 \begin_layout Plain Layout
9183 Used to set the DTD line with XML-based output classes.
9185 \begin_inset space \thinspace{}
9189 \begin_inset Quotes eld
9192 -//OASIS//DTD DocBook V4.2//EN
9193 \begin_inset Quotes erd
9199 \begin_layout Description
9200 \begin_inset Flex CharStyle:Code
9203 \begin_layout Plain Layout
9210 \begin_inset Flex CharStyle:Code
9213 \begin_layout Plain Layout
9214 string="empty|plain|headings|fancy"
9219 ] The list of available page styles, separated by
9220 \begin_inset Quotes eld
9224 \begin_inset Flex CharStyle:Code
9227 \begin_layout Plain Layout
9234 \begin_inset Quotes erd
9240 \begin_layout Description
9241 \begin_inset Flex CharStyle:Code
9244 \begin_layout Plain Layout
9251 \begin_inset Flex CharStyle:Code
9254 \begin_layout Plain Layout
9260 ] Some document class options, separated by a comma, that will be added
9261 to the optional part of the
9262 \begin_inset Flex CharStyle:Code
9265 \begin_layout Plain Layout
9276 \begin_layout Standard
9278 \begin_inset Flex CharStyle:Code
9281 \begin_layout Plain Layout
9287 section must end with
9288 \begin_inset Quotes eld
9292 \begin_inset Flex CharStyle:Code
9295 \begin_layout Plain Layout
9302 \begin_inset Quotes erd
9308 \begin_layout Subsection
9310 \begin_inset CommandInset label
9312 name "sub:Paragraph-Styles"
9319 \begin_layout Standard
9320 A paragraph style description looks like this:
9324 \begin_layout Plain Layout
9325 Note that this will either define a new layout or modify an existing one.
9333 \begin_layout LyX-Code
9340 \begin_layout LyX-Code
9344 \begin_layout LyX-Code
9348 \begin_layout Standard
9349 where the following commands are allowed:
9352 \begin_layout Description
9353 \begin_inset Flex CharStyle:Code
9356 \begin_layout Plain Layout
9363 \begin_inset Flex CharStyle:Code
9366 \begin_layout Plain Layout
9371 , left, right, center
9376 ] Paragraph alignment.
9379 \begin_layout Description
9380 \begin_inset Flex CharStyle:Code
9383 \begin_layout Plain Layout
9390 \begin_inset Flex CharStyle:Code
9393 \begin_layout Plain Layout
9398 , left, right, center
9403 ] A comma separated list of permitted alignments.
9404 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
9406 For example a right-aligned or centered enumeration isn't possible.)
9409 \begin_layout Description
9410 \begin_inset Flex CharStyle:Code
9413 \begin_layout Plain Layout
9419 Note that this will completely override any prior
9420 \begin_inset Flex CharStyle:Code
9423 \begin_layout Plain Layout
9429 declaration for this style.
9431 \begin_inset Quotes eld
9435 \begin_inset Flex CharStyle:Code
9438 \begin_layout Plain Layout
9445 \begin_inset Quotes erd
9450 \begin_inset CommandInset ref
9452 reference "sub:I18n"
9456 for details on its use.
9459 \begin_layout Description
9460 \begin_inset Flex CharStyle:Code
9463 \begin_layout Plain Layout
9470 \begin_inset Flex CharStyle:Code
9473 \begin_layout Plain Layout
9483 \begin_layout Plain Layout
9484 Note that a `float' here is a real number, such as: 1.5.
9489 The vertical space with which the last of a chain of paragraphs with this
9490 layout is separated from the following paragraph.
9491 If the next paragraph has another layout, the separations are not simply
9492 added, but the maximum is taken.
9495 \begin_layout Description
9496 \begin_inset Flex CharStyle:Code
9499 \begin_layout Plain Layout
9506 \begin_inset Flex CharStyle:Code
9509 \begin_layout Plain Layout
9515 The category for this style.
9516 This is used to group related styles in the Layout combobox on the toolbar.
9517 Any string can be used, but you may want to use existing categories with
9522 \begin_layout Description
9523 \begin_inset Flex CharStyle:Code
9526 \begin_layout Plain Layout
9532 Depth of XML command.
9533 Used only with XML-type formats.
9536 \begin_layout Description
9537 \begin_inset Flex CharStyle:Code
9540 \begin_layout Plain Layout
9547 \begin_inset CommandInset label
9549 name "des:CopyStyle"
9554 \begin_inset Flex CharStyle:Code
9557 \begin_layout Plain Layout
9563 Copies all the features of an existing style into the current one.
9567 \begin_layout Description
9568 \begin_inset Flex CharStyle:Code
9571 \begin_layout Plain Layout
9577 The name of a style whose preamble should be output
9582 This allows to ensure some ordering of the preamble snippets when macros
9583 definitions depend on one another.
9587 \begin_layout Plain Layout
9588 Note that, besides that functionality, there is no way to ensure any ordering
9590 The ordering that you see in a given version of LyX may change without
9591 warning in later versions.
9599 \begin_layout Description
9600 \begin_inset Flex CharStyle:Code
9603 \begin_layout Plain Layout
9610 \begin_inset Flex CharStyle:Code
9613 \begin_layout Plain Layout
9618 , Box, Filled_Box, Static
9623 ] The type of label that stands at the end of the paragraph (or sequence
9625 \begin_inset Flex CharStyle:Code
9628 \begin_layout Plain Layout
9635 \begin_inset Flex CharStyle:Code
9638 \begin_layout Plain Layout
9645 \begin_inset Flex CharStyle:Code
9648 \begin_layout Plain Layout
9655 \begin_inset Flex CharStyle:Code
9658 \begin_layout Plain Layout
9666 \begin_inset Flex CharStyle:Code
9669 \begin_layout Plain Layout
9676 \begin_inset Quotes eld
9680 \begin_inset Quotes erd
9684 \begin_inset Flex CharStyle:Code
9687 \begin_layout Plain Layout
9694 \begin_inset Flex CharStyle:Code
9697 \begin_layout Plain Layout
9698 \begin_inset space ~
9707 \begin_inset space ~
9710 black) square suitable for end of proof markers,
9711 \begin_inset Flex CharStyle:Code
9714 \begin_layout Plain Layout
9720 is an explicit text string.
9723 \begin_layout Description
9724 \begin_inset Flex CharStyle:Code
9727 \begin_layout Plain Layout
9734 \begin_inset Flex CharStyle:Code
9737 \begin_layout Plain Layout
9743 ] The string used for a label with a
9744 \begin_inset Flex CharStyle:Code
9747 \begin_layout Plain Layout
9754 \begin_inset Flex CharStyle:Code
9757 \begin_layout Plain Layout
9767 \begin_layout Description
9768 \begin_inset Flex CharStyle:Code
9771 \begin_layout Plain Layout
9778 \begin_inset Flex CharStyle:Code
9781 \begin_layout Plain Layout
9792 \begin_inset Flex CharStyle:Code
9795 \begin_layout Plain Layout
9804 \begin_layout Description
9805 \begin_inset Flex CharStyle:Code
9808 \begin_layout Plain Layout
9815 \begin_inset Flex CharStyle:Code
9818 \begin_layout Plain Layout
9828 ] With this parameter the
9829 \begin_inset Flex CharStyle:MenuItem
9832 \begin_layout Plain Layout
9839 \begin_inset Quotes eld
9842 Vertical space above
9843 \begin_inset Quotes erd
9847 \begin_inset Flex CharStyle:MenuItem
9850 \begin_layout Plain Layout
9851 Edit\SpecialChar \menuseparator
9853 \begin_inset space ~
9861 dialog can be set when initializing a paragraph with this style.
9865 \begin_layout Plain Layout
9868 Note from Jean-Marc:
9870 I'm not sure that this setting has much use, and it should probably be
9871 removed in later versions.
9879 \begin_layout Description
9880 \begin_inset Flex CharStyle:Code
9883 \begin_layout Plain Layout
9889 The font used for both the text body
9895 \begin_inset space ~
9899 \begin_inset CommandInset ref
9901 reference "sub:Font-description"
9906 Note that defining this font automatically defines the
9907 \begin_inset Flex CharStyle:Code
9910 \begin_layout Plain Layout
9917 So you should define this one first if you also want to define
9918 \begin_inset Flex CharStyle:Code
9921 \begin_layout Plain Layout
9930 \begin_layout Description
9931 \begin_inset Flex CharStyle:Code
9934 \begin_layout Plain Layout
9941 \begin_inset CommandInset label
9943 name "des:FreeSpacing"
9948 \begin_inset Flex CharStyle:Code
9951 \begin_layout Plain Layout
9960 \begin_inset Flex CharStyle:Code
9963 \begin_layout Plain Layout
9969 ] Usually LyX doesn't allow you to insert more than one space between words,
9970 since a space is considered as the separation between two words, not a
9971 character or symbol of its own.
9972 This is a very fine thing but sometimes annoying, for example, when typing
9973 program code or plain LaTeX code.
9975 \begin_inset Flex CharStyle:Code
9978 \begin_layout Plain Layout
9985 Note that LyX will create protected blanks for the additional blanks when
9986 in another mode than LaTeX-mode.
9989 \begin_layout Description
9990 \begin_inset Flex CharStyle:Code
9993 \begin_layout Plain Layout
9999 These tags are used with XHTML output.
10001 \begin_inset CommandInset ref
10003 reference "sub:Paragraph-Style-XHTML"
10010 \begin_layout Description
10011 \begin_inset Flex CharStyle:Code
10014 \begin_layout Plain Layout
10020 [[FIXME]] (Used only with XML-type formats.)
10023 \begin_layout Description
10024 \begin_inset Flex CharStyle:Code
10027 \begin_layout Plain Layout
10034 \begin_inset Flex CharStyle:Code
10037 \begin_layout Plain Layout
10043 If 1, marks the layout as to be included in the document preamble rather
10044 than in the document body.
10045 This is useful for document classes that want such information as the title
10046 and author to appear in the preamble.
10047 Note that this works only for layouts for which the
10048 \begin_inset Flex CharStyle:Code
10051 \begin_layout Plain Layout
10058 \begin_inset Flex CharStyle:Code
10061 \begin_layout Plain Layout
10070 \begin_layout Description
10071 \begin_inset Flex CharStyle:Code
10074 \begin_layout Plain Layout
10081 \begin_inset Flex CharStyle:Code
10084 \begin_layout Plain Layout
10090 If 1, marks the layout as being part of a title block (see also the
10091 \begin_inset Flex CharStyle:Code
10094 \begin_layout Plain Layout
10101 \begin_inset Flex CharStyle:Code
10104 \begin_layout Plain Layout
10113 \begin_layout Description
10114 \begin_inset Flex CharStyle:Code
10117 \begin_layout Plain Layout
10124 \begin_inset Flex CharStyle:Code
10127 \begin_layout Plain Layout
10133 ] This provides extra space between paragraphs that have the same layout.
10134 If you put other layouts into an environment, each is separated with the
10136 \begin_inset Flex CharStyle:Code
10139 \begin_layout Plain Layout
10146 But the whole items of the environment are additionally separated with
10148 \begin_inset Flex CharStyle:Code
10151 \begin_layout Plain Layout
10158 Note that this is a
10163 \begin_layout Description
10164 \begin_inset Flex CharStyle:Code
10167 \begin_layout Plain Layout
10173 [[FIXME]] (Used only with XML-type formats.)
10176 \begin_layout Description
10177 \begin_inset Flex CharStyle:Code
10180 \begin_layout Plain Layout
10187 \begin_inset CommandInset label
10189 name "des:KeepEmpty"
10194 \begin_inset Flex CharStyle:Code
10197 \begin_layout Plain Layout
10206 \begin_inset Flex CharStyle:Code
10209 \begin_layout Plain Layout
10215 ] Usually LyX does not allow you to leave a paragraph empty, since it would
10216 lead to empty LaTeX output.
10217 There are some cases where this could be desirable however: in a letter
10218 template, the required fields can be provided as empty fields, so that
10219 people do not forget them; in some special classes, a layout can be used
10220 as some kind of break, which does not contain actual text.
10223 \begin_layout Description
10224 \begin_inset Flex CharStyle:Code
10227 \begin_layout Plain Layout
10233 [float=0] The vertical space between the label and the text body.
10234 Only used for labels that are above the text body (
10235 \begin_inset Flex CharStyle:Code
10238 \begin_layout Plain Layout
10245 \begin_inset Flex CharStyle:Code
10248 \begin_layout Plain Layout
10249 Centered_Top_Environment
10257 \begin_layout Description
10258 \begin_inset Flex CharStyle:Code
10261 \begin_layout Plain Layout
10268 \begin_inset Flex CharStyle:Code
10271 \begin_layout Plain Layout
10278 \begin_inset Newline newline
10281 The name of the counter for automatic numbering.
10283 \begin_inset Newline newline
10291 \begin_inset Flex CharStyle:Code
10294 \begin_layout Plain Layout
10301 \begin_inset Flex CharStyle:Code
10304 \begin_layout Plain Layout
10311 In that case, the counter will be stepped each time the layout appears.
10313 \begin_inset Newline newline
10321 \begin_inset Flex CharStyle:Code
10324 \begin_layout Plain Layout
10331 \begin_inset Flex CharStyle:Code
10334 \begin_layout Plain Layout
10340 , though this case is a bit complicated.
10341 Suppose you declare
10342 \begin_inset Quotes eld
10346 \begin_inset Flex CharStyle:Code
10349 \begin_layout Plain Layout
10350 LabelCounter myenum
10356 \begin_inset Quotes erd
10360 Then the actual counters used are
10361 \begin_inset Flex CharStyle:Code
10364 \begin_layout Plain Layout
10371 \begin_inset Flex CharStyle:Code
10374 \begin_layout Plain Layout
10381 \begin_inset Flex CharStyle:Code
10384 \begin_layout Plain Layout
10391 \begin_inset Flex CharStyle:Code
10394 \begin_layout Plain Layout
10400 , much as in LaTeX.
10401 These counters must all be declared separately.
10402 \begin_inset Newline newline
10406 \begin_inset CommandInset ref
10408 reference "sub:Counters"
10412 for details on counters.
10415 \begin_layout Description
10416 \begin_inset Flex CharStyle:Code
10419 \begin_layout Plain Layout
10425 The font used for the label.
10427 \begin_inset space ~
10431 \begin_inset CommandInset ref
10433 reference "sub:Font-description"
10440 \begin_layout Description
10441 \begin_inset Flex CharStyle:Code
10444 \begin_layout Plain Layout
10450 Text that indicates how far a label should be indented.
10453 \begin_layout Description
10454 \begin_inset Flex CharStyle:Code
10457 \begin_layout Plain Layout
10464 \begin_inset Flex CharStyle:Code
10467 \begin_layout Plain Layout
10473 ] The horizontal space between the label and the text body.
10474 Only used for labels that are not above the text body.
10477 \begin_layout Description
10478 \begin_inset Flex CharStyle:Code
10481 \begin_layout Plain Layout
10488 \begin_inset Flex CharStyle:Code
10491 \begin_layout Plain Layout
10497 ] The string used for a label with a
10498 \begin_inset Flex CharStyle:Code
10501 \begin_layout Plain Layout
10509 \begin_inset Flex CharStyle:Code
10512 \begin_layout Plain Layout
10518 is set, this string can be contain the special formatting commands described
10520 \begin_inset CommandInset ref
10522 reference "sub:Counters"
10530 \begin_layout Plain Layout
10531 For the sake of backwards compatibility, the string
10532 \begin_inset Flex CharStyle:Code
10535 \begin_layout Plain Layout
10545 will be replaced by the expanded
10546 \begin_inset Flex CharStyle:Code
10549 \begin_layout Plain Layout
10556 \begin_inset Flex CharStyle:Code
10559 \begin_layout Plain Layout
10568 This feature is now obsolete and should be replaced by the mechanisms of
10570 \begin_inset CommandInset ref
10572 reference "sub:Counters"
10584 \begin_layout Description
10585 \begin_inset Flex CharStyle:Code
10588 \begin_layout Plain Layout
10589 LabelStringAppendix
10595 \begin_inset Flex CharStyle:Code
10598 \begin_layout Plain Layout
10604 ] This is used inside the appendix instead of
10605 \begin_inset Flex CharStyle:Code
10608 \begin_layout Plain Layout
10616 \begin_inset Flex CharStyle:Code
10619 \begin_layout Plain Layout
10626 \begin_inset Flex CharStyle:Code
10629 \begin_layout Plain Layout
10630 LabelStringAppendix
10638 \begin_layout Description
10639 \begin_inset Flex CharStyle:Code
10642 \begin_layout Plain Layout
10648 [FIXME] (Used only with XML-type formats.)
10651 \begin_layout Description
10652 \begin_inset Flex CharStyle:Code
10655 \begin_layout Plain Layout
10662 \begin_inset Flex CharStyle:Code
10665 \begin_layout Plain Layout
10670 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
10671 Enumerate, Itemize, Bibliography
10680 \begin_layout Itemize
10681 \begin_inset Flex CharStyle:Code
10684 \begin_layout Plain Layout
10690 means the label is the very first word (up to the first real blank).
10691 Use protected spaces (like
10692 \begin_inset space ~
10695 that one) if you want more than one word as the label.
10699 \begin_layout Itemize
10700 \begin_inset Flex CharStyle:Code
10703 \begin_layout Plain Layout
10709 means the label is simply whatever
10710 \begin_inset Flex CharStyle:Code
10713 \begin_layout Plain Layout
10720 Note that this really is `static'.
10723 \begin_layout Itemize
10724 \begin_inset Flex CharStyle:Code
10727 \begin_layout Plain Layout
10734 \begin_inset Flex CharStyle:Code
10737 \begin_layout Plain Layout
10738 Centered_Top_Environment
10743 are special cases of
10744 \begin_inset Flex CharStyle:Code
10747 \begin_layout Plain Layout
10754 The label will be printed above the paragraph, but only at the top of an
10755 environment or the top of a chain of paragraphs with this layout.
10756 This might be used with the
10757 \begin_inset Flex CharStyle:MenuItem
10760 \begin_layout Plain Layout
10766 layout, for example.
10769 \begin_layout Itemize
10770 \begin_inset Flex CharStyle:Code
10773 \begin_layout Plain Layout
10779 is a special case for the caption-labels
10780 \begin_inset Quotes eld
10784 \begin_inset Quotes erd
10788 \begin_inset Quotes eld
10792 \begin_inset Quotes erd
10797 \begin_inset Flex CharStyle:Code
10800 \begin_layout Plain Layout
10806 means the (hardcoded) label string depends on the kind of float: It is
10807 hardcoded to be `FloatType N', where N is the value of the counter associated
10811 \begin_layout Itemize
10813 \begin_inset Flex CharStyle:Code
10816 \begin_layout Plain Layout
10822 label type defines automatically numbered labels.
10824 \begin_inset Flex CharStyle:Code
10827 \begin_layout Plain Layout
10833 will be expanded to resolve any counter references it contains: For example,
10835 \begin_inset Quotes eld
10839 \begin_inset Flex CharStyle:Code
10842 \begin_layout Plain Layout
10853 \begin_inset Quotes erd
10858 \begin_inset CommandInset ref
10860 reference "sub:Counters"
10864 for more information on counters.
10867 \begin_layout Itemize
10868 \begin_inset Flex CharStyle:Code
10871 \begin_layout Plain Layout
10877 produces the usual sort of enumeration labels.
10878 At present, it is hardcoded to use Arabic numerals, lowercase letters,
10879 small Roman numerals, and uppercase letters for the four possible depths.
10882 \begin_layout Itemize
10883 \begin_inset Flex CharStyle:Code
10886 \begin_layout Plain Layout
10892 produces various bullets at the different levels.
10893 It is also hardcoded.
10896 \begin_layout Itemize
10897 \begin_inset Flex CharStyle:Code
10900 \begin_layout Plain Layout
10906 is used internally by LyX and should be used only with
10907 \begin_inset Flex CharStyle:Code
10910 \begin_layout Plain Layout
10911 LatexType BibEnvironment
10920 \begin_layout Description
10921 \begin_inset Flex CharStyle:Code
10924 \begin_layout Plain Layout
10930 Note that this will completely override any prior
10931 \begin_inset Flex CharStyle:Code
10934 \begin_layout Plain Layout
10940 declaration for this style.
10942 \begin_inset Quotes eld
10946 \begin_inset Flex CharStyle:Code
10949 \begin_layout Plain Layout
10956 \begin_inset Quotes erd
10961 \begin_inset CommandInset ref
10963 reference "sub:I18n"
10967 for details on its use.
10970 \begin_layout Description
10971 \begin_inset Flex CharStyle:Code
10974 \begin_layout Plain Layout
10980 The name of the corresponding LaTeX stuff.
10981 Either the environment or command name.
10984 \begin_layout Description
10985 \begin_inset Flex CharStyle:Code
10988 \begin_layout Plain Layout
10994 An optional parameter for the corresponding
10995 \begin_inset Flex CharStyle:Code
10998 \begin_layout Plain Layout
11005 This parameter cannot be changed from within LyX.
11008 \begin_layout Description
11009 \begin_inset Flex CharStyle:Code
11012 \begin_layout Plain Layout
11019 \begin_inset CommandInset label
11021 name "des:LatexType"
11026 \begin_inset Flex CharStyle:Code
11029 \begin_layout Plain Layout
11034 , Command, Environment, Item_Environment,
11040 \begin_inset Flex CharStyle:Code
11043 \begin_layout Plain Layout
11044 List_Environment, Bib_Environment
11049 ] How the layout should be translated into LaTeX.
11053 \begin_layout Plain Layout
11054 \begin_inset Flex CharStyle:Code
11057 \begin_layout Plain Layout
11063 is perhaps a bit misleading, since these rules apply to SGML classes, too.
11064 Visit the SGML class files for specific examples.
11073 \begin_layout Itemize
11074 \begin_inset Flex CharStyle:Code
11077 \begin_layout Plain Layout
11083 means nothing special.
11087 \begin_layout Itemize
11088 \begin_inset Flex CharStyle:Code
11091 \begin_layout Plain Layout
11098 \begin_inset Flex CharStyle:Code
11101 \begin_layout Plain Layout
11108 {\SpecialChar \ldots{}
11117 \begin_layout Itemize
11118 \begin_inset Flex CharStyle:Code
11121 \begin_layout Plain Layout
11128 \begin_inset Flex CharStyle:Code
11131 \begin_layout Plain Layout
11138 }\SpecialChar \ldots{}
11154 \begin_layout Itemize
11155 \begin_inset Flex CharStyle:Code
11158 \begin_layout Plain Layout
11165 \begin_inset Flex CharStyle:Code
11168 \begin_layout Plain Layout
11175 \begin_inset Flex CharStyle:Code
11178 \begin_layout Plain Layout
11186 is generated for each paragraph of this environment.
11190 \begin_layout Itemize
11191 \begin_inset Flex CharStyle:Code
11194 \begin_layout Plain Layout
11201 \begin_inset Flex CharStyle:Code
11204 \begin_layout Plain Layout
11211 \begin_inset Flex CharStyle:Code
11214 \begin_layout Plain Layout
11220 is passed as an argument to the environment.
11222 \begin_inset Flex CharStyle:Code
11225 \begin_layout Plain Layout
11231 can be defined in the
11232 \begin_inset Flex CharStyle:MenuItem
11235 \begin_layout Plain Layout
11240 ayout\SpecialChar \menuseparator
11254 \begin_layout Standard
11255 Putting the last few things together, the LaTeX output will be either:
11258 \begin_layout LyX-Code
11261 latexname[latexparam]{\SpecialChar \ldots{}
11265 \begin_layout Standard
11269 \begin_layout LyX-Code
11272 begin{latexname}[latexparam] \SpecialChar \ldots{}
11278 \begin_layout Standard
11279 depending upon the LaTeX type.
11283 \begin_layout Description
11284 \begin_inset Flex CharStyle:Code
11287 \begin_layout Plain Layout
11294 \begin_inset Flex CharStyle:Code
11297 \begin_layout Plain Layout
11303 ] If you put layouts into environments, the leftmargins are not simply added,
11304 but added with a factor
11305 \begin_inset Formula $\frac{4}{depth+4}$
11309 Note that this parameter is also used when the margin is defined as
11310 \begin_inset Flex CharStyle:Code
11313 \begin_layout Plain Layout
11320 \begin_inset Flex CharStyle:Code
11323 \begin_layout Plain Layout
11330 Then it is added to the manual or dynamic margin.
11332 \begin_inset Newline newline
11335 The argument is passed as a string.
11337 \begin_inset Quotes eld
11341 \begin_inset Flex CharStyle:Code
11344 \begin_layout Plain Layout
11351 \begin_inset Quotes erd
11354 means that the paragraph is indented with the width of
11355 \begin_inset Quotes eld
11359 \begin_inset Flex CharStyle:Code
11362 \begin_layout Plain Layout
11369 \begin_inset Quotes erd
11372 in the normal font.
11373 You can get a negative width by prefixing the string with
11374 \begin_inset Quotes eld
11378 \begin_inset Flex CharStyle:Code
11381 \begin_layout Plain Layout
11388 \begin_inset Quotes erd
11392 This way was chosen so that the look is the same with each used screen
11397 \begin_layout Description
11398 \begin_inset Flex CharStyle:Code
11401 \begin_layout Plain Layout
11408 \begin_inset Flex CharStyle:Code
11411 \begin_layout Plain Layout
11416 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11422 \begin_inset Newline newline
11425 The kind of margin that the layout has on the left side.
11427 \begin_inset Flex CharStyle:Code
11430 \begin_layout Plain Layout
11436 just means a fixed margin.
11438 \begin_inset Flex CharStyle:Code
11441 \begin_layout Plain Layout
11447 means that the left margin depends on the string entered in the
11448 \begin_inset Flex CharStyle:MenuItem
11451 \begin_layout Plain Layout
11452 Edit\SpecialChar \menuseparator
11454 \begin_inset space ~
11463 This is used to typeset nice lists without tabulators.
11465 \begin_inset Flex CharStyle:Code
11468 \begin_layout Plain Layout
11474 means that the margin depends on the size of the label.
11475 This is used for automatic enumerated headlines.
11476 It is obvious that the headline
11477 \begin_inset Quotes eld
11480 5.4.3.2.1 Very long headline
11481 \begin_inset Quotes erd
11484 must have a wider left margin (as wide as
11485 \begin_inset Quotes eld
11489 \begin_inset Quotes erd
11492 plus the space) than
11493 \begin_inset Quotes eld
11496 3.2 Very long headline
11497 \begin_inset Quotes erd
11501 \begin_inset Quotes eld
11505 \begin_inset Quotes erd
11508 are not able to do this.
11510 \begin_inset Flex CharStyle:Code
11513 \begin_layout Plain Layout
11519 is similar, but only the very first row of the paragraph is dynamic, while
11520 the others are static; this is used, for example, for descriptions.
11522 \begin_inset Flex CharStyle:Code
11525 \begin_layout Plain Layout
11531 means the margin is chosen in a way that the longest row of this paragraph
11532 fits to the right margin.
11533 This is used to typeset an address on the right edge of the page.
11536 \begin_layout Description
11537 \begin_inset Flex CharStyle:Code
11540 \begin_layout Plain Layout
11547 \begin_inset Flex CharStyle:Code
11550 \begin_layout Plain Layout
11559 \begin_inset Flex CharStyle:Code
11562 \begin_layout Plain Layout
11568 ] Whether fragile commands in this layout should be
11569 \begin_inset Flex CharStyle:Code
11572 \begin_layout Plain Layout
11585 whether this command should itself be protected.)
11588 \begin_layout Description
11589 \begin_inset Flex CharStyle:Code
11592 \begin_layout Plain Layout
11599 \begin_inset Flex CharStyle:Code
11602 \begin_layout Plain Layout
11609 \begin_inset Flex CharStyle:Code
11612 \begin_layout Plain Layout
11620 ] Whether newlines are translated into LaTeX newlines (
11621 \begin_inset Flex CharStyle:Code
11624 \begin_layout Plain Layout
11635 The translation can be switched off to allow more comfortable LaTeX editing
11639 \begin_layout Description
11640 \begin_inset Flex CharStyle:Code
11643 \begin_layout Plain Layout
11650 \begin_inset Flex CharStyle:Code
11653 \begin_layout Plain Layout
11660 \begin_inset Flex CharStyle:Code
11663 \begin_layout Plain Layout
11671 ] Whether the following Paragraph is allowed to indent its very first row.
11673 \begin_inset Flex CharStyle:Code
11676 \begin_layout Plain Layout
11682 means that it is not allowed to do so;
11683 \begin_inset Flex CharStyle:Code
11686 \begin_layout Plain Layout
11692 means it could do so if it wants to.
11695 \begin_layout Description
11696 \begin_inset Flex CharStyle:Code
11699 \begin_layout Plain Layout
11705 Name of a layout that has replaced this layout.
11706 This is used to rename a layout, while keeping backward compatibility.
11709 \begin_layout Description
11710 \begin_inset Flex CharStyle:Code
11713 \begin_layout Plain Layout
11720 \begin_inset Flex CharStyle:Code
11723 \begin_layout Plain Layout
11729 ] The number of optional arguments that can be used with this layout.
11730 This is useful for things like section headings, and only makes sense with
11732 Note that, on output, the optional arguments will all precede any required
11733 arguments (see below).
11734 So one can have constructs like:
11738 \begin_layout LyX-Code
11741 mycmd[opt1]{req1}{contents of paragraph}
11744 \begin_layout Standard
11745 but one cannot have things like:
11748 \begin_layout LyX-Code
11751 mycmd[opt1]{req1}[opt2]{contents of paragraph}
11754 \begin_layout Standard
11755 at least, not without ERT (with which you can have anything).
11760 \begin_layout Description
11761 \begin_inset Flex CharStyle:Code
11764 \begin_layout Plain Layout
11771 \begin_inset CommandInset label
11773 name "des:ParbreakIsNewline"
11778 \begin_inset Flex CharStyle:Code
11781 \begin_layout Plain Layout
11790 \begin_inset Flex CharStyle:Code
11793 \begin_layout Plain Layout
11799 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
11800 output, but only by a line break; together with
11801 \begin_inset Flex CharStyle:Code
11804 \begin_layout Plain Layout
11810 , this allows to emulate a plain text editor (like the ERT inset).
11813 \begin_layout Description
11814 \begin_inset Flex CharStyle:Code
11817 \begin_layout Plain Layout
11824 \begin_inset Flex CharStyle:Code
11827 \begin_layout Plain Layout
11833 ] The indent of the very first line of a paragraph.
11835 \begin_inset Flex CharStyle:Code
11838 \begin_layout Plain Layout
11844 will be fixed for a certain layout.
11845 The exception is Standard layout, since the indentation of a Standard layout
11846 paragraph can be prohibited with
11847 \begin_inset Flex CharStyle:Code
11850 \begin_layout Plain Layout
11857 Also, Standard layout paragraphs inside environments use the
11858 \begin_inset Flex CharStyle:Code
11861 \begin_layout Plain Layout
11867 of the environment, not their native one.
11868 For example, Standard paragraphs inside an enumeration are not indented.
11871 \begin_layout Description
11872 \begin_inset Flex CharStyle:Code
11875 \begin_layout Plain Layout
11882 \begin_inset Flex CharStyle:Code
11885 \begin_layout Plain Layout
11891 ] The vertical space between two paragraphs of this layout.
11894 \begin_layout Description
11895 \begin_inset Flex CharStyle:Code
11898 \begin_layout Plain Layout
11905 \begin_inset Flex CharStyle:Code
11908 \begin_layout Plain Layout
11914 ] LyX allows the user to choose either
11915 \begin_inset Quotes eld
11919 \begin_inset Quotes erd
11923 \begin_inset Quotes eld
11927 \begin_inset Quotes erd
11930 to typeset a document.
11932 \begin_inset Quotes eld
11936 \begin_inset Quotes erd
11939 is chosen, this value is completely ignored.
11941 \begin_inset Quotes eld
11945 \begin_inset Quotes erd
11948 is chosen, the parindent of a LaTeXtype
11949 \begin_inset Quotes eld
11953 \begin_inset Quotes erd
11956 layout is ignored and all paragraphs are separated by this parskip argument.
11957 The vertical space is calculated with
11958 \begin_inset Flex CharStyle:Code
11961 \begin_layout Plain Layout
11963 \begin_inset space ~
11972 \begin_inset Flex CharStyle:Code
11975 \begin_layout Plain Layout
11981 is the height of a row with the normal font.
11982 This way, the look stays the same with different screen fonts.
11985 \begin_layout Description
11986 \begin_inset Flex CharStyle:Code
11989 \begin_layout Plain Layout
11996 \begin_inset CommandInset label
11998 name "des:PassThru"
12003 \begin_inset Flex CharStyle:Code
12006 \begin_layout Plain Layout
12015 \begin_inset Flex CharStyle:Code
12018 \begin_layout Plain Layout
12024 ] Whether the contents of this paragraph should be output in raw form, meaning
12025 without special translations that LaTeX would require.
12028 \begin_layout Description
12029 \begin_inset Flex CharStyle:Code
12032 \begin_layout Plain Layout
12039 \begin_inset CommandInset label
12041 name "des:Preamble"
12045 Information to be included in the LaTeX preamble when this style is used.
12046 Used to define macros, load packages, etc., required by this particular
12049 \begin_inset Quotes eld
12053 \begin_inset Flex CharStyle:Code
12056 \begin_layout Plain Layout
12063 \begin_inset Quotes erd
12069 \begin_layout Description
12070 \begin_inset Flex CharStyle:Code
12073 \begin_layout Plain Layout
12080 \begin_inset Flex CharStyle:Code
12083 \begin_layout Plain Layout
12089 ] The prefix to use when creating labels referring to paragraphs of this
12091 This allows the use of formatted references.
12094 \begin_layout Description
12095 \begin_inset Flex CharStyle:Code
12098 \begin_layout Plain Layout
12105 \begin_inset Flex CharStyle:Code
12108 \begin_layout Plain Layout
12114 ] The number of required arguments that the LaTeX command or environment
12115 corresponding to this layout expects.
12116 In the case of a command, these are required arguments
12120 that associated with the content of the paragraph itself.
12121 These do not actually have to be provided: LyX will output empty arguments
12123 Note that optional arguments will be output before required arguments.
12124 See the discussion of the
12125 \begin_inset Flex CharStyle:Code
12128 \begin_layout Plain Layout
12134 tag above for more information.
12137 \begin_layout Description
12138 \begin_inset Flex CharStyle:Code
12141 \begin_layout Plain Layout
12148 \begin_inset Flex CharStyle:Code
12151 \begin_layout Plain Layout
12158 \begin_inset CommandInset label
12160 name "des:Requires"
12164 Whether the layout requires the feature
12165 \begin_inset Flex CharStyle:Code
12168 \begin_layout Plain Layout
12175 See the description of
12176 \begin_inset Flex CharStyle:Code
12179 \begin_layout Plain Layout
12186 \begin_inset CommandInset ref
12187 LatexCommand pageref
12188 reference "des:FreeSpacing"
12192 ) for information on `features'.
12196 \begin_layout Description
12197 \begin_inset Flex CharStyle:Code
12200 \begin_layout Plain Layout
12207 \begin_inset Flex CharStyle:Code
12210 \begin_layout Plain Layout
12217 \begin_inset Flex CharStyle:Code
12220 \begin_layout Plain Layout
12229 \begin_layout Description
12230 \begin_inset Flex CharStyle:Code
12233 \begin_layout Plain Layout
12240 \begin_inset Flex CharStyle:Code
12243 \begin_layout Plain Layout
12248 , onehalf, double, other
12257 ] This defines what the default spacing should be in the layout.
12259 \begin_inset Flex CharStyle:Code
12262 \begin_layout Plain Layout
12269 \begin_inset Flex CharStyle:Code
12272 \begin_layout Plain Layout
12279 \begin_inset Flex CharStyle:Code
12282 \begin_layout Plain Layout
12288 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
12289 If you specify the argument
12290 \begin_inset Flex CharStyle:Code
12293 \begin_layout Plain Layout
12299 , then you should also provide a numerical argument which will be the actual
12301 Note that, contrary to other parameters,
12302 \begin_inset Flex CharStyle:Code
12305 \begin_layout Plain Layout
12311 implies the generation of specific LaTeX code, using the package
12314 \begin_inset Flex CharStyle:Code
12317 \begin_layout Plain Layout
12326 \begin_layout Description
12327 \begin_inset Flex CharStyle:Code
12330 \begin_layout Plain Layout
12337 \begin_inset Flex CharStyle:Code
12340 \begin_layout Plain Layout
12347 \begin_inset Flex CharStyle:Code
12350 \begin_layout Plain Layout
12358 ] Spellcheck paragraphs of this style.
12362 \begin_layout Description
12363 \begin_inset Flex CharStyle:Code
12366 \begin_layout Plain Layout
12372 The font used for the text body .
12374 \begin_inset CommandInset ref
12376 reference "sub:Font-description"
12383 \begin_layout Description
12384 \begin_inset Flex CharStyle:Code
12387 \begin_layout Plain Layout
12396 \begin_inset Flex CharStyle:Code
12399 \begin_layout Plain Layout
12409 The level of the style in the table of contents.
12410 This is used for automatic numbering of section headings.
12413 \begin_layout Description
12414 \begin_inset Flex CharStyle:Code
12417 \begin_layout Plain Layout
12424 \begin_inset Flex CharStyle:Code
12427 \begin_layout Plain Layout
12433 ] The vertical space with which the very first of a chain of paragraphs
12434 with this layout is separated from the previous paragraph.
12435 If the previous paragraph has another layout, the separations are not simply
12436 added, but the maximum is taken.
12439 \begin_layout Subsection
12440 \begin_inset CommandInset label
12446 Internationalization of Paragraph Styles
12449 \begin_layout Standard
12450 LyX has long supported internationalization of layout information, but,
12451 until version 2.0, this applied only to the user interface and not to, say,
12453 Thus, French authors were forced to resort to ugly hacks if they wanted
12458 1' instead of `Theorem 1'.
12459 Thanks to Georg Baum, that is no longer the case.
12462 \begin_layout Standard
12464 \begin_inset Flex CharStyle:Code
12467 \begin_layout Plain Layout
12473 defines text that is to appear in the typeset document, it may use
12474 \begin_inset Flex CharStyle:Code
12477 \begin_layout Plain Layout
12484 \begin_inset Flex CharStyle:Code
12487 \begin_layout Plain Layout
12493 to support non-English and even multi-language documents correctly.
12494 The following excerpt (from the
12495 \begin_inset Flex CharStyle:Code
12498 \begin_layout Plain Layout
12504 file) shows how this works:
12507 \begin_layout LyX-Code
12512 \begin_layout LyX-Code
12515 theoremstyle{remark}
12518 \begin_layout LyX-Code
12521 newtheorem{claim}[thm]{
12528 \begin_layout LyX-Code
12532 \begin_layout LyX-Code
12536 \begin_layout LyX-Code
12541 claimname}{_(Claim)}
12544 \begin_layout LyX-Code
12548 \begin_layout LyX-Code
12552 \begin_layout LyX-Code
12561 claimname}{_(Claim)}}
12564 \begin_layout LyX-Code
12569 \begin_layout Standard
12570 In principle, any legal LaTeX may appear in the
12571 \begin_inset Flex CharStyle:Code
12574 \begin_layout Plain Layout
12581 \begin_inset Flex CharStyle:Code
12584 \begin_layout Plain Layout
12590 tags, but in practice they will typically look as they do here.
12591 The key to correct translation of the typeset text is the definition of
12593 \begin_inset Flex CharStyle:Code
12596 \begin_layout Plain Layout
12605 \begin_inset Flex CharStyle:Code
12608 \begin_layout Plain Layout
12620 \begin_layout Standard
12622 \begin_inset Flex CharStyle:Code
12625 \begin_layout Plain Layout
12631 tag provides for internationalization based upon the overall language of
12633 The contents of the tag will be included in the preamble, just as with
12635 \begin_inset Flex CharStyle:Code
12638 \begin_layout Plain Layout
12645 What makes it special is the use of the
12646 \begin_inset Quotes eld
12650 \begin_inset Quotes erd
12654 \begin_inset Flex CharStyle:Code
12657 \begin_layout Plain Layout
12663 , which will be replaced, when LyX produces LaTeX output, with the translation
12664 of its argument into the document language.
12667 \begin_layout Standard
12669 \begin_inset Flex CharStyle:Code
12672 \begin_layout Plain Layout
12678 tag is more complex, since it is meant to provide support for multi-language
12679 documents and so offers an interface to the
12680 \begin_inset Flex CharStyle:Code
12683 \begin_layout Plain Layout
12690 Its contents will be added to the preamble once for each language that
12691 appears in the document.
12692 In this case, the argument to
12693 \begin_inset Flex CharStyle:Code
12696 \begin_layout Plain Layout
12702 will be replaced with its translation into the language in question; the
12704 \begin_inset Flex CharStyle:Code
12707 \begin_layout Plain Layout
12713 is replaced by the language name (as used by the babel package).
12716 \begin_layout Standard
12717 A German document that also included a French section would thus have the
12718 following in the preamble:
12721 \begin_layout LyX-Code
12730 claimname}{Affirmation}}
12738 claimname}{Behauptung}}
12742 claimname}{Behauptung}
12745 \begin_layout Standard
12747 \begin_inset Flex CharStyle:Code
12750 \begin_layout Plain Layout
12756 will then conspire to produce the correct text in the output.
12759 \begin_layout Standard
12760 One important point to note here is that the translations are provided by
12761 LyX itself, through the same mechanism it uses for internationalization
12762 of the user interface.
12763 This means, in effect, that
12764 \begin_inset Flex CharStyle:Code
12767 \begin_layout Plain Layout
12774 \begin_inset Flex CharStyle:Code
12777 \begin_layout Plain Layout
12783 are really only of use in layout files that are provided with LyX, since
12784 text entered in user-created layout files will not be seen by LyX's internation
12785 alization routines.
12786 That said, however, any layout created with the intention that it will
12787 be included with LyX should use these tags where appropriate.
12790 \begin_layout Subsection
12792 \begin_inset CommandInset label
12801 \begin_layout Standard
12802 Since version 1.3.0 of LyX, it is has been both possible and necessary to
12803 define the floats (
12804 \begin_inset Flex CharStyle:MenuItem
12807 \begin_layout Plain Layout
12814 \begin_inset Flex CharStyle:MenuItem
12817 \begin_layout Plain Layout
12823 , \SpecialChar \ldots{}
12824 ) in the text class itself.
12825 Standard floats are included in the file
12826 \begin_inset Flex CharStyle:Code
12829 \begin_layout Plain Layout
12835 , so you may have to do no more than add
12838 \begin_layout LyX-Code
12839 Input stdfloats.inc
12842 \begin_layout Standard
12843 to your layout file.
12844 If you want to implement a text class that proposes some other float types
12845 (like the AGU class bundled with LyX), the information below will hopefully
12849 \begin_layout Description
12850 \begin_inset Flex CharStyle:Code
12853 \begin_layout Plain Layout
12860 \begin_inset Flex CharStyle:Code
12863 \begin_layout Plain Layout
12870 \begin_inset Quotes erd
12874 \begin_inset Quotes erd
12877 ] The file name extension of an auxiliary file for the list of figures (or
12879 LaTeX writes the captions to this file.
12882 \begin_layout Description
12883 \begin_inset Flex CharStyle:Code
12886 \begin_layout Plain Layout
12893 \begin_inset Flex CharStyle:Code
12896 \begin_layout Plain Layout
12903 \begin_inset Quotes erd
12907 \begin_inset Quotes erd
12910 ] The string that will be used in the menus and also for the caption.
12911 This is translated to the current language if babel is used.
12914 \begin_layout Description
12915 \begin_inset Flex CharStyle:Code
12918 \begin_layout Plain Layout
12924 These are used for XHTML output.
12926 \begin_inset CommandInset ref
12928 reference "sec:Tags-for-XHTML"
12935 \begin_layout Description
12936 \begin_inset Flex CharStyle:Code
12939 \begin_layout Plain Layout
12946 \begin_inset Flex CharStyle:Code
12949 \begin_layout Plain Layout
12956 \begin_inset Quotes erd
12960 \begin_inset Quotes erd
12963 ] The command used to generate a list of floats of this type; the leading
12966 ' should be omitted.
12972 \begin_inset Flex CharStyle:Code
12975 \begin_layout Plain Layout
12981 is false, since there is no standard way to generate this command.
12983 \begin_inset Flex CharStyle:Code
12986 \begin_layout Plain Layout
12992 is true, since in that case there is a standard way.
12995 \begin_layout Description
12996 \begin_inset Flex CharStyle:Code
12999 \begin_layout Plain Layout
13006 \begin_inset Flex CharStyle:Code
13009 \begin_layout Plain Layout
13016 \begin_inset Quotes erd
13020 \begin_inset Quotes erd
13023 ] A title for a list of floats of this kind (list of figures, tables, or
13025 It is used for the screen label within LyX; it is passed to LaTeX for use
13026 as the title there; and it is used as the title in XHTML output.
13027 It will be translated to the document language.
13030 \begin_layout Description
13031 \begin_inset Flex CharStyle:Code
13034 \begin_layout Plain Layout
13041 \begin_inset Flex CharStyle:Code
13044 \begin_layout Plain Layout
13051 \begin_inset Flex CharStyle:Code
13054 \begin_layout Plain Layout
13062 ] Indicates whether the float is already defined in the document class or
13063 if we instead need to load
13064 \begin_inset Flex CharStyle:Code
13067 \begin_layout Plain Layout
13073 and use what it provides.
13075 \begin_inset Flex CharStyle:Code
13078 \begin_layout Plain Layout
13085 \begin_inset Flex CharStyle:Code
13088 \begin_layout Plain Layout
13095 It should be set to
13096 \begin_inset Flex CharStyle:Code
13099 \begin_layout Plain Layout
13105 if the float is already defined by the LaTeX document class.
13108 \begin_layout Description
13109 \begin_inset Flex CharStyle:Code
13112 \begin_layout Plain Layout
13119 \begin_inset Flex CharStyle:Code
13122 \begin_layout Plain Layout
13129 \begin_inset Quotes erd
13133 \begin_inset Quotes erd
13136 ] This (optional) argument determines whether floats of this class will
13137 be numbered within some sectional unit of the document.
13138 For example, if within is equal to
13139 \begin_inset Flex CharStyle:Code
13142 \begin_layout Plain Layout
13148 , the floats will be numbered within chapters.
13152 \begin_layout Description
13153 \begin_inset Flex CharStyle:Code
13156 \begin_layout Plain Layout
13163 \begin_inset Flex CharStyle:Code
13166 \begin_layout Plain Layout
13173 \begin_inset Quotes erd
13177 \begin_inset Quotes erd
13180 ] The default placement for the given class of floats.
13181 The string should be as in standard LaTeX:
13182 \begin_inset Flex CharStyle:Code
13185 \begin_layout Plain Layout
13192 \begin_inset Flex CharStyle:Code
13195 \begin_layout Plain Layout
13202 \begin_inset Flex CharStyle:Code
13205 \begin_layout Plain Layout
13212 \begin_inset Flex CharStyle:Code
13215 \begin_layout Plain Layout
13221 for top, bottom, page, and here, respectively.
13225 \begin_layout Plain Layout
13226 Note that the order of these letters in the string is irrelevant, like in
13232 On top of that there is a new type,
13233 \begin_inset Flex CharStyle:Code
13236 \begin_layout Plain Layout
13242 , which does not really correspond to a float, since it means: put it
13243 \begin_inset Quotes eld
13247 \begin_inset Quotes erd
13251 Note however that the
13252 \begin_inset Flex CharStyle:Code
13255 \begin_layout Plain Layout
13261 specifier is special and, because of implementation details, cannot be
13262 used in non-built in float types.
13263 If you do not understand what this means, just use
13264 \begin_inset Quotes eld
13268 \begin_inset Flex CharStyle:Code
13271 \begin_layout Plain Layout
13278 \begin_inset Quotes erd
13284 \begin_layout Description
13285 \begin_inset Flex CharStyle:Code
13288 \begin_layout Plain Layout
13295 \begin_inset Flex CharStyle:Code
13298 \begin_layout Plain Layout
13304 ] The prefix to use when creating labels referring to floats of this type.
13305 This allows the use of formatted references.
13306 Note that you can remove any
13307 \begin_inset Flex CharStyle:Code
13310 \begin_layout Plain Layout
13316 set by a copied style by using the special value
13317 \begin_inset Quotes eld
13321 \begin_inset Quotes erd
13324 , which must be all caps.
13327 \begin_layout Description
13328 \begin_inset Flex CharStyle:Code
13331 \begin_layout Plain Layout
13338 \begin_inset Flex CharStyle:Code
13341 \begin_layout Plain Layout
13348 \begin_inset Quotes erd
13352 \begin_inset Quotes erd
13355 ] The style used when defining the float using
13356 \begin_inset Flex CharStyle:Code
13359 \begin_layout Plain Layout
13370 \begin_layout Description
13371 \begin_inset Flex CharStyle:Code
13374 \begin_layout Plain Layout
13381 \begin_inset Flex CharStyle:Code
13384 \begin_layout Plain Layout
13391 \begin_inset Quotes erd
13395 \begin_inset Quotes erd
13399 \begin_inset Quotes eld
13403 \begin_inset Quotes erd
13406 of the new class of floats, like program or algorithm.
13407 After the appropriate
13408 \begin_inset Flex CharStyle:Code
13411 \begin_layout Plain Layout
13420 \begin_inset Flex CharStyle:Code
13423 \begin_layout Plain Layout
13432 \begin_inset Flex CharStyle:Code
13435 \begin_layout Plain Layout
13446 \begin_layout Standard
13447 Note that defining a float with type
13448 \begin_inset Flex CharStyle:Code
13451 \begin_layout Plain Layout
13459 automatically defines the corresponding counter with name
13460 \begin_inset Flex CharStyle:Code
13463 \begin_layout Plain Layout
13474 \begin_layout Subsection
13475 Flex insets and InsetLayout
13476 \begin_inset CommandInset label
13478 name "sub:Flex-insets-and"
13485 \begin_layout Standard
13486 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
13487 these are called Flex insets.
13491 \begin_layout Standard
13492 Flex insets come in three different kinds:
13495 \begin_layout Itemize
13497 \begin_inset Flex CharStyle:Code
13500 \begin_layout Plain Layout
13506 ): These define semantic markup corresponding to such LaTeX commands as
13508 \begin_inset Flex CharStyle:Code
13511 \begin_layout Plain Layout
13520 \begin_inset Flex CharStyle:Code
13523 \begin_layout Plain Layout
13534 \begin_layout Itemize
13536 \begin_inset Flex CharStyle:Code
13539 \begin_layout Plain Layout
13545 ): These can be used to define custom collapsible insets, similar to TeX
13546 code, footnote, and the like.
13547 An obvious example is an endnote inset, which is defined in the
13548 \begin_inset Flex CharStyle:Code
13551 \begin_layout Plain Layout
13560 \begin_layout Itemize
13562 \begin_inset Flex CharStyle:Code
13565 \begin_layout Plain Layout
13571 ): For use with DocBook classes.
13574 \begin_layout Standard
13575 Flex insets are defined using the
13576 \begin_inset Flex CharStyle:Code
13579 \begin_layout Plain Layout
13585 tag, which shall be explained in a moment.
13588 \begin_layout Standard
13590 \begin_inset Flex CharStyle:Code
13593 \begin_layout Plain Layout
13599 tag also serves another function: It can be used to customize the general
13600 layout of many different types of insets.
13602 \begin_inset Flex CharStyle:Code
13605 \begin_layout Plain Layout
13611 can be used to customize the layout parameters for footnotes, marginal
13612 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
13613 boxes, tables, algorithms, URLs, and optional arguments, as well as to
13614 define Flex insets.
13617 \begin_layout Standard
13619 \begin_inset Flex CharStyle:Code
13622 \begin_layout Plain Layout
13628 definition must begin with a line of the form:
13631 \begin_layout LyX-Code
13635 \begin_layout Standard
13637 \begin_inset Flex CharStyle:Code
13640 \begin_layout Plain Layout
13646 indicates the inset whose layout is being defined, and here there are two
13650 \begin_layout Enumerate
13651 The layout for a pre-existing inset is being modified.
13652 In this case, can be
13653 \begin_inset Flex CharStyle:Code
13656 \begin_layout Plain Layout
13662 any one of the following:
13663 \begin_inset Flex CharStyle:Code
13666 \begin_layout Plain Layout
13673 \begin_inset Flex CharStyle:Code
13676 \begin_layout Plain Layout
13683 \begin_inset Flex CharStyle:Code
13686 \begin_layout Plain Layout
13693 \begin_inset Flex CharStyle:Code
13696 \begin_layout Plain Layout
13703 \begin_inset Flex CharStyle:Code
13706 \begin_layout Plain Layout
13713 \begin_inset Flex CharStyle:Code
13716 \begin_layout Plain Layout
13723 \begin_inset Flex CharStyle:Code
13726 \begin_layout Plain Layout
13733 \begin_inset Flex CharStyle:Code
13736 \begin_layout Plain Layout
13743 \begin_inset Flex CharStyle:Code
13746 \begin_layout Plain Layout
13753 \begin_inset Flex CharStyle:Code
13756 \begin_layout Plain Layout
13763 \begin_inset Flex CharStyle:Code
13766 \begin_layout Plain Layout
13773 \begin_inset Flex CharStyle:Code
13776 \begin_layout Plain Layout
13783 \begin_inset Flex CharStyle:Code
13786 \begin_layout Plain Layout
13793 \begin_inset Flex CharStyle:Code
13796 \begin_layout Plain Layout
13803 \begin_inset Flex CharStyle:Code
13806 \begin_layout Plain Layout
13813 \begin_inset Flex CharStyle:Code
13816 \begin_layout Plain Layout
13823 \begin_inset Flex CharStyle:Code
13826 \begin_layout Plain Layout
13833 \begin_inset Flex CharStyle:Code
13836 \begin_layout Plain Layout
13843 \begin_inset Flex CharStyle:Code
13846 \begin_layout Plain Layout
13853 \begin_inset Flex CharStyle:Code
13856 \begin_layout Plain Layout
13865 \begin_layout Enumerate
13866 The layout for a Flex inset is being defined.
13868 \begin_inset Flex CharStyle:Code
13871 \begin_layout Plain Layout
13877 can be any valid identifier not used by a pre-existing inset.
13878 Note that the definition of a flex inset
13883 \begin_inset Flex CharStyle:Code
13886 \begin_layout Plain Layout
13892 entry, declaring which type of inset this is.
13895 \begin_layout Standard
13897 \begin_inset Flex CharStyle:Code
13900 \begin_layout Plain Layout
13906 definition can contain the following entries:
13909 \begin_layout Description
13910 \begin_inset Flex CharStyle:Code
13913 \begin_layout Plain Layout
13919 The color for the inset's background.
13920 The valid colors are defined in
13921 \begin_inset Flex CharStyle:Code
13924 \begin_layout Plain Layout
13933 \begin_layout Description
13934 \begin_inset Flex CharStyle:Code
13937 \begin_layout Plain Layout
13944 \begin_inset Flex CharStyle:Code
13947 \begin_layout Plain Layout
13956 \begin_inset Flex CharStyle:Code
13959 \begin_layout Plain Layout
13965 ] Whether to use the content of the inset as the label, when the inset is
13970 \begin_layout Description
13971 \begin_inset Flex CharStyle:Code
13974 \begin_layout Plain Layout
13980 As with paragraph styles (see page
13981 \begin_inset CommandInset ref
13983 reference "des:CopyStyle"
13990 \begin_layout Description
13991 \begin_inset Flex CharStyle:Code
13994 \begin_layout Plain Layout
14001 \begin_inset Flex CharStyle:Code
14004 \begin_layout Plain Layout
14013 \begin_inset Flex CharStyle:Code
14016 \begin_layout Plain Layout
14022 ] Indicates whether the user may employ the Paragraph Settings dialog to
14023 customize the paragraph.
14026 \begin_layout Description
14027 \begin_inset Flex CharStyle:Code
14030 \begin_layout Plain Layout
14037 \begin_inset Flex CharStyle:Code
14040 \begin_layout Plain Layout
14047 \begin_inset Flex CharStyle:Code
14050 \begin_layout Plain Layout
14057 \begin_inset Flex CharStyle:Code
14060 \begin_layout Plain Layout
14066 , describing the rendering style used for the inset's frame and buttons.
14067 Footnotes generally use
14068 \begin_inset Flex CharStyle:Code
14071 \begin_layout Plain Layout
14077 , ERT insets generally
14078 \begin_inset Flex CharStyle:Code
14081 \begin_layout Plain Layout
14087 , and character styles
14088 \begin_inset Flex CharStyle:Code
14091 \begin_layout Plain Layout
14100 \begin_layout Description
14101 \begin_inset Flex CharStyle:Code
14104 \begin_layout Plain Layout
14110 Required at the end of the InsetLayout declarations.
14113 \begin_layout Description
14114 \begin_inset Flex CharStyle:Code
14117 \begin_layout Plain Layout
14123 The font used for both the text body
14129 \begin_inset space ~
14133 \begin_inset CommandInset ref
14135 reference "sub:Font-description"
14140 Note that defining this font automatically defines the
14141 \begin_inset Flex CharStyle:Code
14144 \begin_layout Plain Layout
14150 to the same value, so define this first and define
14151 \begin_inset Flex CharStyle:Code
14154 \begin_layout Plain Layout
14160 later if you want them to be different.
14163 \begin_layout Description
14164 \begin_inset Flex CharStyle:Code
14167 \begin_layout Plain Layout
14174 \begin_inset Quotes eld
14178 \begin_inset Quotes erd
14181 language, leading to Left-to-Right (latin) output, e.
14182 \begin_inset space \thinspace{}
14186 \begin_inset space \space{}
14189 in TeX code or URL.
14193 \begin_layout Description
14194 \begin_inset Flex CharStyle:Code
14197 \begin_layout Plain Layout
14204 \begin_inset Flex CharStyle:Code
14207 \begin_layout Plain Layout
14216 \begin_inset Flex CharStyle:Code
14219 \begin_layout Plain Layout
14225 ] Indicates whether the PlainLayout should be used or, instead, the user
14226 can change the paragraph style used in the inset.
14230 \begin_layout Description
14231 \begin_inset Flex CharStyle:Code
14234 \begin_layout Plain Layout
14240 As with paragraph styles (see page
14241 \begin_inset CommandInset ref
14242 LatexCommand pageref
14243 reference "des:FreeSpacing"
14251 \begin_layout Description
14252 \begin_inset Flex CharStyle:Code
14255 \begin_layout Plain Layout
14261 These tags control XHTML output.
14265 \begin_layout Description
14266 \begin_inset Flex CharStyle:Code
14269 \begin_layout Plain Layout
14276 \begin_inset Flex CharStyle:Code
14279 \begin_layout Plain Layout
14288 \begin_inset Flex CharStyle:Code
14291 \begin_layout Plain Layout
14297 ] Whether to include the contents of this inset in the strings generated
14298 for the `Outline' pane.
14299 One would not, for example, want the content of a footnote in a section
14300 header to be included in the TOC displayed in the outline, but one would
14301 normally want the content of a character style displayed.
14302 Default is false: not to include.
14305 \begin_layout Description
14306 \begin_inset Flex CharStyle:Code
14309 \begin_layout Plain Layout
14315 As with paragraph styles (see page
14316 \begin_inset CommandInset ref
14317 LatexCommand pageref
14318 reference "des:KeepEmpty"
14326 \begin_layout Description
14327 \begin_inset Flex CharStyle:Code
14330 \begin_layout Plain Layout
14336 The font used for the label.
14338 \begin_inset space ~
14342 \begin_inset CommandInset ref
14344 reference "sub:Font-description"
14349 Note that this definition can never appear before
14350 \begin_inset Flex CharStyle:Code
14353 \begin_layout Plain Layout
14359 , lest it be ineffective.
14362 \begin_layout Description
14363 \begin_inset Flex CharStyle:Code
14366 \begin_layout Plain Layout
14372 What will be displayed on the button or elsewhere as the inset label.
14373 Some inset types (TeX code and Branch) modify this label on the fly.
14376 \begin_layout Description
14377 \begin_inset Flex CharStyle:Code
14380 \begin_layout Plain Layout
14386 The name of the corresponding LaTeX stuff.
14387 Either the environment or command name.
14390 \begin_layout Description
14391 \begin_inset Flex CharStyle:Code
14394 \begin_layout Plain Layout
14400 The optional parameter for the corresponding
14401 \begin_inset Flex CharStyle:Code
14404 \begin_layout Plain Layout
14410 stuff, including possible bracket pairs like
14411 \begin_inset Flex CharStyle:Code
14414 \begin_layout Plain Layout
14421 This parameter cannot be changed from within LyX.
14424 \begin_layout Description
14425 \begin_inset Flex CharStyle:Code
14428 \begin_layout Plain Layout
14434 As with paragraph styles (see page
14435 \begin_inset CommandInset ref
14436 LatexCommand pageref
14437 reference "des:LatexType"
14444 \begin_layout Description
14445 \begin_inset Flex CharStyle:Code
14448 \begin_layout Plain Layout
14455 \begin_inset Flex CharStyle:Code
14458 \begin_layout Plain Layout
14465 \begin_inset Flex CharStyle:Code
14468 \begin_layout Plain Layout
14475 \begin_inset Flex CharStyle:Code
14478 \begin_layout Plain Layout
14485 \begin_inset Flex CharStyle:Code
14488 \begin_layout Plain Layout
14494 (indicating a dummy definition ending definitions of charstyles, etc).
14495 This entry is required in and is only meaningful for Flex insets.
14496 Among other things, it determines on which menu this inset will appear.
14498 \begin_inset Flex CharStyle:Code
14501 \begin_layout Plain Layout
14508 \begin_inset Flex CharStyle:Code
14511 \begin_layout Plain Layout
14518 \begin_inset Flex CharStyle:Code
14521 \begin_layout Plain Layout
14529 \begin_inset Flex CharStyle:Code
14532 \begin_layout Plain Layout
14538 can be set to true for charstyle insets, if you wish, by setting it
14543 \begin_inset Flex CharStyle:Code
14546 \begin_layout Plain Layout
14555 \begin_layout Description
14556 \begin_inset Flex CharStyle:Code
14559 \begin_layout Plain Layout
14566 \begin_inset Flex CharStyle:Code
14569 \begin_layout Plain Layout
14578 \begin_inset Flex CharStyle:Code
14581 \begin_layout Plain Layout
14587 ] Whether multiple paragraphs are permitted in this inset.
14589 \begin_inset Flex CharStyle:Code
14592 \begin_layout Plain Layout
14598 to the same value and
14599 \begin_inset Flex CharStyle:Code
14602 \begin_layout Plain Layout
14608 to the opposite value.
14609 These can be reset to other values, if they are used
14614 \begin_inset Flex CharStyle:Code
14617 \begin_layout Plain Layout
14627 \begin_layout Description
14628 \begin_inset Flex CharStyle:Code
14631 \begin_layout Plain Layout
14638 \begin_inset Flex CharStyle:Code
14641 \begin_layout Plain Layout
14650 \begin_inset Flex CharStyle:Code
14653 \begin_layout Plain Layout
14659 ] Whether fragile commands in this layout should be
14660 \begin_inset Flex CharStyle:Code
14663 \begin_layout Plain Layout
14676 whether the command should itself be protected.) Default is false.
14679 \begin_layout Description
14680 \begin_inset Flex CharStyle:Code
14683 \begin_layout Plain Layout
14690 \begin_inset Flex CharStyle:Code
14693 \begin_layout Plain Layout
14702 \begin_inset Flex CharStyle:Code
14705 \begin_layout Plain Layout
14711 ] As with paragraph styles (see page
14712 \begin_inset CommandInset ref
14713 LatexCommand pageref
14714 reference "des:ParbreakIsNewline"
14722 \begin_layout Description
14723 \begin_inset Flex CharStyle:Code
14726 \begin_layout Plain Layout
14733 \begin_inset Flex CharStyle:Code
14736 \begin_layout Plain Layout
14745 \begin_inset Flex CharStyle:Code
14748 \begin_layout Plain Layout
14754 ] As with paragraph styles (see page
14755 \begin_inset CommandInset ref
14756 LatexCommand pageref
14757 reference "des:PassThru"
14765 \begin_layout Description
14766 \begin_inset Flex CharStyle:Code
14769 \begin_layout Plain Layout
14775 As with paragraph styles (see page
14776 \begin_inset CommandInset ref
14777 LatexCommand pageref
14778 reference "des:Preamble"
14785 \begin_layout Description
14786 \begin_inset Flex CharStyle:Code
14789 \begin_layout Plain Layout
14796 \begin_inset Flex CharStyle:Code
14799 \begin_layout Plain Layout
14805 ] The prefix to use when creating labels referring to insets of this type.
14806 This allows the use of formatted references.
14809 \begin_layout Description
14810 \begin_inset Flex CharStyle:Code
14813 \begin_layout Plain Layout
14820 \begin_inset Flex CharStyle:Code
14823 \begin_layout Plain Layout
14829 ] As with paragraph styles (see page
14830 \begin_inset CommandInset ref
14831 LatexCommand pageref
14832 reference "des:Requires"
14839 \begin_layout Description
14840 \begin_inset Flex CharStyle:Code
14843 \begin_layout Plain Layout
14850 \begin_inset Flex CharStyle:Code
14853 \begin_layout Plain Layout
14860 \begin_inset Flex CharStyle:Code
14863 \begin_layout Plain Layout
14871 ] Spellcheck the contents of this inset.
14875 \begin_layout Subsection
14877 \begin_inset CommandInset label
14879 name "sub:Counters"
14886 \begin_layout Standard
14887 Since version 1.3.0 of LyX, it is both possible and necessary to define the
14889 \begin_inset Flex CharStyle:MenuItem
14892 \begin_layout Plain Layout
14899 \begin_inset Flex CharStyle:MenuItem
14902 \begin_layout Plain Layout
14908 , \SpecialChar \ldots{}
14909 ) in the text class itself.
14910 The standard counters are defined in the file
14911 \begin_inset Flex CharStyle:Code
14914 \begin_layout Plain Layout
14920 , so you may have to do no more than add
14923 \begin_layout LyX-Code
14924 Input stdcounters.inc
14927 \begin_layout Standard
14928 to your layout file to get them to work.
14929 But if you want to define custom counters, then you can do so.
14930 The counter declaration must begin with:
14933 \begin_layout LyX-Code
14934 Counter CounterName
14937 \begin_layout Standard
14939 \begin_inset Flex CharStyle:Code
14942 \begin_layout Plain Layout
14948 ' is replaced by the name of the counter.
14949 And it must end with
14950 \begin_inset Quotes eld
14954 \begin_inset Flex CharStyle:Code
14957 \begin_layout Plain Layout
14964 \begin_inset Quotes erd
14968 The following parameters can also be used:
14971 \begin_layout Description
14972 \begin_inset Flex CharStyle:Code
14975 \begin_layout Plain Layout
14982 \begin_inset Flex CharStyle:Code
14985 \begin_layout Plain Layout
14992 \begin_inset Quotes erd
14996 \begin_inset Quotes erd
14999 ] When defined, this string defines how the counter is displayed.
15000 Setting this value sets
15001 \begin_inset Flex CharStyle:Code
15004 \begin_layout Plain Layout
15005 LabelStringAppendix
15011 The following special constructs can be used in the string:
15015 \begin_layout Itemize
15016 \begin_inset Flex CharStyle:Code
15019 \begin_layout Plain Layout
15027 will be replaced by the expansion of the
15028 \begin_inset Flex CharStyle:Code
15031 \begin_layout Plain Layout
15038 \begin_inset Flex CharStyle:Code
15041 \begin_layout Plain Layout
15042 LabelStringAppendix
15048 \begin_inset Flex CharStyle:Code
15051 \begin_layout Plain Layout
15061 \begin_layout Itemize
15062 counter values can be expressed using LaTeX-like macros
15063 \begin_inset Flex CharStyle:Code
15066 \begin_layout Plain Layout
15083 \begin_inset Flex CharStyle:Code
15086 \begin_layout Plain Layout
15098 \begin_layout Plain Layout
15108 Actually, the situation is a bit more complicated: any
15127 other than those described below will produce arabic numerals.
15128 It would not be surprising to see this change in the future.
15134 \begin_inset Flex CharStyle:Code
15137 \begin_layout Plain Layout
15143 : 1, 2, 3,\SpecialChar \ldots{}
15145 \begin_inset Flex CharStyle:Code
15148 \begin_layout Plain Layout
15154 for lower-case letters: a, b, c, \SpecialChar \ldots{}
15156 \begin_inset Flex CharStyle:Code
15159 \begin_layout Plain Layout
15165 for upper-case letters: A, B, C, \SpecialChar \ldots{}
15167 \begin_inset Flex CharStyle:Code
15170 \begin_layout Plain Layout
15176 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
15178 \begin_inset Flex CharStyle:Code
15181 \begin_layout Plain Layout
15187 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
15189 \begin_inset Flex CharStyle:Code
15192 \begin_layout Plain Layout
15198 for hebrew numerals.
15202 \begin_layout Standard
15203 If LabelString is not defined, a default value is constructed as follows:
15204 if the counter has a master counter
15205 \begin_inset Flex CharStyle:Code
15208 \begin_layout Plain Layout
15215 \begin_inset Flex CharStyle:Code
15218 \begin_layout Plain Layout
15225 \begin_inset Flex CharStyle:Code
15228 \begin_layout Plain Layout
15238 is used; otherwise the string
15239 \begin_inset Flex CharStyle:Code
15242 \begin_layout Plain Layout
15253 \begin_layout Description
15254 \begin_inset Flex CharStyle:Code
15257 \begin_layout Plain Layout
15258 LabelStringAppendix
15264 \begin_inset Flex CharStyle:Code
15267 \begin_layout Plain Layout
15274 \begin_inset Quotes erd
15278 \begin_inset Quotes erd
15282 \begin_inset Flex CharStyle:Code
15285 \begin_layout Plain Layout
15291 , but for use in the Appendix.
15294 \begin_layout Description
15295 \begin_inset Flex CharStyle:Code
15298 \begin_layout Plain Layout
15305 \begin_inset Flex CharStyle:Code
15308 \begin_layout Plain Layout
15315 \begin_inset Quotes erd
15319 \begin_inset Quotes erd
15322 ] A format for use with formatted references to this counter.
15323 For example, one might want to have references to section numbers appear
15325 \begin_inset Quotes eld
15329 \begin_inset Quotes erd
15333 The string should contain
15334 \begin_inset Quotes eld
15338 \begin_inset Quotes erd
15342 This will be replaced by the counter number itself.
15343 So, for sections, it would be: Section ##.
15346 \begin_layout Description
15347 \begin_inset Flex CharStyle:Code
15350 \begin_layout Plain Layout
15357 \begin_inset Flex CharStyle:Code
15360 \begin_layout Plain Layout
15367 \begin_inset Quotes erd
15371 \begin_inset Quotes erd
15374 ] If this is set to the name of another counter, the present counter will
15375 be reset every time the other one is increased.
15377 \begin_inset Flex CharStyle:Code
15380 \begin_layout Plain Layout
15387 \begin_inset Flex CharStyle:Code
15390 \begin_layout Plain Layout
15399 \begin_layout Subsection
15401 \begin_inset CommandInset label
15403 name "sub:Font-description"
15410 \begin_layout Standard
15411 A font description looks like this:
15414 \begin_layout LyX-Code
15424 \begin_layout LyX-Code
15428 \begin_layout LyX-Code
15432 \begin_layout Standard
15433 The following commands are available:
15436 \begin_layout Description
15437 \begin_inset Flex CharStyle:Code
15440 \begin_layout Plain Layout
15447 \begin_inset Flex CharStyle:Code
15450 \begin_layout Plain Layout
15459 \begin_inset Flex CharStyle:Code
15462 \begin_layout Plain Layout
15469 \begin_inset Flex CharStyle:Code
15472 \begin_layout Plain Layout
15479 \begin_inset Flex CharStyle:Code
15482 \begin_layout Plain Layout
15489 \begin_inset Flex CharStyle:Code
15492 \begin_layout Plain Layout
15499 \begin_inset Flex CharStyle:Code
15502 \begin_layout Plain Layout
15509 \begin_inset Flex CharStyle:Code
15512 \begin_layout Plain Layout
15519 \begin_inset Flex CharStyle:Code
15522 \begin_layout Plain Layout
15529 \begin_inset Flex CharStyle:Code
15532 \begin_layout Plain Layout
15541 \begin_layout Description
15542 \begin_inset Flex CharStyle:Code
15545 \begin_layout Plain Layout
15552 \begin_inset Flex CharStyle:Code
15555 \begin_layout Plain Layout
15564 \begin_inset Flex CharStyle:Code
15567 \begin_layout Plain Layout
15574 \begin_inset Flex CharStyle:Code
15577 \begin_layout Plain Layout
15586 \begin_layout Description
15587 \begin_inset Flex CharStyle:Code
15590 \begin_layout Plain Layout
15597 \begin_inset Flex CharStyle:Code
15600 \begin_layout Plain Layout
15606 ] Valid arguments are:
15607 \begin_inset Flex CharStyle:Code
15610 \begin_layout Plain Layout
15617 \begin_inset Flex CharStyle:Code
15620 \begin_layout Plain Layout
15627 \begin_inset Flex CharStyle:Code
15630 \begin_layout Plain Layout
15637 \begin_inset Flex CharStyle:Code
15640 \begin_layout Plain Layout
15647 \begin_inset Flex CharStyle:Code
15650 \begin_layout Plain Layout
15657 \begin_inset Flex CharStyle:Code
15660 \begin_layout Plain Layout
15667 Each of these turns on or off the corresponding attribute.
15669 \begin_inset Flex CharStyle:Code
15672 \begin_layout Plain Layout
15678 turns on emphasis, and
15679 \begin_inset Flex CharStyle:Code
15682 \begin_layout Plain Layout
15690 \begin_inset Newline newline
15693 If the latter seems puzzling, remember that the font settings for the present
15694 context are generally inherited from the surrounding context.
15696 \begin_inset Flex CharStyle:Code
15699 \begin_layout Plain Layout
15705 would turn off the emphasis that was anyway in effect, say, in a theorem
15709 \begin_layout Description
15710 \begin_inset Flex CharStyle:Code
15713 \begin_layout Plain Layout
15720 \begin_inset Flex CharStyle:Code
15723 \begin_layout Plain Layout
15732 \begin_inset Flex CharStyle:Code
15735 \begin_layout Plain Layout
15744 \begin_layout Description
15745 \begin_inset Flex CharStyle:Code
15748 \begin_layout Plain Layout
15755 \begin_inset Flex CharStyle:Code
15758 \begin_layout Plain Layout
15767 \begin_inset Flex CharStyle:Code
15770 \begin_layout Plain Layout
15777 \begin_inset Flex CharStyle:Code
15780 \begin_layout Plain Layout
15787 \begin_inset Flex CharStyle:Code
15790 \begin_layout Plain Layout
15799 \begin_layout Description
15800 \begin_inset Flex CharStyle:Code
15803 \begin_layout Plain Layout
15810 \begin_inset Flex CharStyle:Code
15813 \begin_layout Plain Layout
15820 \begin_inset Flex CharStyle:Code
15823 \begin_layout Plain Layout
15830 \begin_inset Flex CharStyle:Code
15833 \begin_layout Plain Layout
15842 \begin_inset Flex CharStyle:Code
15845 \begin_layout Plain Layout
15852 \begin_inset Flex CharStyle:Code
15855 \begin_layout Plain Layout
15862 \begin_inset Flex CharStyle:Code
15865 \begin_layout Plain Layout
15872 \begin_inset Flex CharStyle:Code
15875 \begin_layout Plain Layout
15882 \begin_inset Flex CharStyle:Code
15885 \begin_layout Plain Layout
15894 \begin_layout Subsection
15895 \begin_inset CommandInset label
15897 name "sub:Citation-format-description"
15901 Citation format description
15904 \begin_layout Standard
15906 \begin_inset Flex CharStyle:Code
15909 \begin_layout Plain Layout
15915 blocks are used to describe how bibliographic information should be displayed,
15916 both within LyX itself (in the citation dialog and in tooltips, for example)
15917 and in XHTML output.
15918 Such a block might look like this:
15921 \begin_layout LyX-Code
15925 \begin_layout LyX-Code
15929 \begin_layout LyX-Code
15933 \begin_layout LyX-Code
15937 \begin_layout Standard
15938 The individual lines define how the bibliographic information associated
15939 with an article or book, respectively, is to be displayed, and such a definitio
15940 n can be given for any `entry type' that might be present in a BibTeX file.
15941 LyX defines a default format in the source code that will be used if no
15942 specific definition has been given.
15943 LyX predefines several formats in the file
15944 \begin_inset Flex CharStyle:Code
15947 \begin_layout Plain Layout
15953 , which is included in most of LyX's document classes.
15956 \begin_layout Standard
15957 The definitions use a simple language that allows BibTeX keys to be replaced
15959 Keys should be enclosed in
15960 \begin_inset Flex CharStyle:Code
15963 \begin_layout Plain Layout
15970 \begin_inset Flex CharStyle:Code
15973 \begin_layout Plain Layout
15980 So a simple definition might look like this:
15983 \begin_layout LyX-Code
15985 \begin_inset Quotes eld
15989 \begin_inset Quotes erd
15995 \begin_layout Standard
15996 This would print the author, followed by a comma, followed by the title,
15997 in quotes, followed by a period.
16000 \begin_layout Standard
16001 Of course, sometimes you may want to print a key only if it exists.
16002 This can be done by using a conditional construction, such as:
16003 \begin_inset Flex CharStyle:Code
16006 \begin_layout Plain Layout
16008 \begin_inset space ~
16018 \begin_inset Flex CharStyle:Code
16021 \begin_layout Plain Layout
16027 key exists, then print
16028 \begin_inset Quotes eld
16032 \begin_inset space ~
16036 \begin_inset Quotes erd
16039 followed by the volume key.
16040 It is also possible to have an else clause in the conditional, such as:
16042 \begin_inset Flex CharStyle:Code
16045 \begin_layout Plain Layout
16046 {%author%[[%author%]][[%editor%, ed.]]}
16053 \begin_inset Flex CharStyle:Code
16056 \begin_layout Plain Layout
16062 key is printed if it exists; otherwise, the editor key is printed, followed
16064 \begin_inset Quotes eld
16068 \begin_inset space ~
16072 \begin_inset Quotes erd
16075 Note that the key is again enclosed in
16076 \begin_inset Flex CharStyle:Code
16079 \begin_layout Plain Layout
16085 signs; the entire conditional is enclosed in braces; and the if and else
16086 clauses are enclosed in double brackets,
16087 \begin_inset Quotes eld
16091 \begin_inset Flex CharStyle:Code
16094 \begin_layout Plain Layout
16101 \begin_inset Quotes eld
16105 \begin_inset Quotes eld
16109 \begin_inset Flex CharStyle:Code
16112 \begin_layout Plain Layout
16119 \begin_inset Quotes erd
16123 There must be no space between any of these.
16126 \begin_layout Standard
16127 There is one other piece of syntax available in definitions, which looks
16129 \begin_inset Flex CharStyle:Code
16132 \begin_layout Plain Layout
16139 This defines a piece of formatting information that is to be used when
16141 \begin_inset Quotes eld
16145 \begin_inset Quotes erd
16149 Obviously, we do not want to output HTML tags when writing plain text,
16150 so they should be wrapped in
16151 \begin_inset Quotes eld
16155 \begin_inset Quotes erd
16159 \begin_inset Quotes eld
16163 \begin_inset Quotes erd
16169 \begin_layout Standard
16170 Two special sorts of definitions are also possible in a
16171 \begin_inset Flex CharStyle:Code
16174 \begin_layout Plain Layout
16181 An example of the first would be:
16184 \begin_layout LyX-Code
16186 \begin_inset Quotes eld
16190 \begin_inset Quotes erd
16196 \begin_layout Standard
16197 This is an abbreviation, or macro, and it can be used by treating it as
16199 \begin_inset Flex CharStyle:Code
16202 \begin_layout Plain Layout
16210 \begin_inset Flex CharStyle:Code
16213 \begin_layout Plain Layout
16219 exactly as it would treat its definition.
16220 So, let us issue the obvious
16228 \begin_layout LyX-Code
16232 \begin_layout Standard
16233 or anything like it.
16234 LyX shouldn't go into an infinite loop, but it may go into a long one before
16238 \begin_layout Standard
16239 The second sort of special definition might look like this:
16242 \begin_layout LyX-Code
16246 \begin_layout Standard
16247 This defines a translatable piece of text, which allows relevant parts of
16248 the bibliography to be translated.
16249 It can be included in a definition by treating it as a key:
16250 \begin_inset Flex CharStyle:Code
16253 \begin_layout Plain Layout
16260 Several of these are predefined in
16261 \begin_inset Flex CharStyle:Code
16264 \begin_layout Plain Layout
16271 Note that these are not macros, in the sense just defined.
16272 They will not be expanded.
16275 \begin_layout Standard
16276 So here then is an example that use all these features:
16279 \begin_layout LyX-Code
16280 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
16283 \begin_layout Standard
16284 The defines a macro that prints the author, followed by a comma, if the
16286 \begin_inset Flex CharStyle:Code
16289 \begin_layout Plain Layout
16295 key is defined, or else prints the name of the editor, followed by the
16297 \begin_inset Flex CharStyle:Code
16300 \begin_layout Plain Layout
16306 or its translation (it is by default
16307 \begin_inset Quotes eld
16311 \begin_inset Quotes erd
16315 \begin_inset Flex CharStyle:Code
16318 \begin_layout Plain Layout
16325 Note that this is in fact defined in
16326 \begin_inset Flex CharStyle:Code
16329 \begin_layout Plain Layout
16335 , so you can use it in your own definitions, or re-definitions, if you load
16339 \begin_layout Section
16340 \begin_inset CommandInset label
16342 name "sec:Tags-for-XHTML"
16346 Tags for XHTML output
16349 \begin_layout Standard
16350 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
16351 by layout information.
16352 In general, LyX provides sensible defaults and, as mentioned earlier, it
16353 will even construct default CSS style rules from the other layout tags.
16354 For example, LyX will attempt to use the information provided in the
16355 \begin_inset Flex CharStyle:Code
16358 \begin_layout Plain Layout
16364 declaration for the Chapter style to write CSS that will appropriately
16365 format chapter headings.
16368 \begin_layout Standard
16369 In many cases, then, you may not have to do anything at all to get acceptable
16370 XHTML output for your own environments, custom insets, and so forth.
16371 But in some cases you will, and so LyX provides a number of layout tags
16372 that can be used to customize the XHTML and CSS that are generated.
16375 \begin_layout Standard
16376 Note that there are two tags,
16377 \begin_inset Flex CharStyle:Code
16380 \begin_layout Plain Layout
16387 \begin_inset Flex CharStyle:Code
16390 \begin_layout Plain Layout
16396 that may appear outside style and inset declarations.
16398 \begin_inset CommandInset ref
16400 reference "sub:General-text-class"
16404 for details on these.
16407 \begin_layout Subsection
16408 \begin_inset CommandInset label
16410 name "sub:Paragraph-Style-XHTML"
16417 \begin_layout Standard
16418 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
16419 dealing with a normal paragraph, a command, or an environment, where this
16420 is itself determined by the contents of the corresponding
16421 \begin_inset Flex CharStyle:Code
16424 \begin_layout Plain Layout
16434 \begin_layout Standard
16435 For a command or normal paragraph, the output XHTML has the following form:
16438 \begin_layout LyX-Code
16440 \begin_inset Quotes erd
16444 \begin_inset Quotes erd
16450 \begin_layout LyX-Code
16452 \begin_inset Quotes erd
16456 \begin_inset Quotes erd
16462 \begin_layout LyX-Code
16463 Contents of the paragraph.
16466 \begin_layout LyX-Code
16470 \begin_layout Standard
16471 The label tags are of course omitted if the paragraph does not have a label.
16474 \begin_layout Standard
16475 For an environment that is not some sort of list, the XHTML takes this form:
16478 \begin_layout LyX-Code
16480 \begin_inset Quotes erd
16484 \begin_inset Quotes erd
16490 \begin_layout LyX-Code
16492 \begin_inset Quotes erd
16496 \begin_inset Quotes erd
16500 \begin_inset Quotes erd
16504 \begin_inset Quotes erd
16507 >Environment Label</labeltag>First paragraph.</itemtag>
16510 \begin_layout LyX-Code
16511 <itemtag>Second paragraph.</itemtag>
16514 \begin_layout LyX-Code
16518 \begin_layout Standard
16519 Note that the label is output only for the first paragraph, as it should
16520 be for a theorem, for example.
16524 \begin_layout Standard
16525 For a list, we have one of these forms:
16528 \begin_layout LyX-Code
16530 \begin_inset Quotes erd
16534 \begin_inset Quotes erd
16540 \begin_layout LyX-Code
16542 \begin_inset Quotes erd
16546 \begin_inset Quotes erd
16550 \begin_inset Quotes erd
16554 \begin_inset Quotes erd
16557 >List Label</labeltag>First item.</itemtag>
16560 \begin_layout LyX-Code
16562 \begin_inset Quotes erd
16566 \begin_inset Quotes erd
16570 \begin_inset Quotes erd
16574 \begin_inset Quotes erd
16577 >List Label</labeltag>Second item.</itemtag>
16580 \begin_layout LyX-Code
16584 \begin_layout LyX-Code
16588 \begin_layout LyX-Code
16590 \begin_inset Quotes erd
16594 \begin_inset Quotes erd
16600 \begin_layout LyX-Code
16602 \begin_inset Quotes erd
16606 \begin_inset Quotes erd
16609 >List Label</labeltag><itemtag attr=
16610 \begin_inset Quotes erd
16614 \begin_inset Quotes erd
16617 >First item.</itemtag>
16620 \begin_layout LyX-Code
16622 \begin_inset Quotes erd
16626 \begin_inset Quotes erd
16629 >List Label</labeltag><itemtag attr=
16630 \begin_inset Quotes erd
16634 \begin_inset Quotes erd
16637 >Second item.</itemtag>
16640 \begin_layout LyX-Code
16644 \begin_layout Standard
16645 Note the different orders of
16646 \begin_inset Flex CharStyle:Code
16649 \begin_layout Plain Layout
16656 \begin_inset Flex CharStyle:Code
16659 \begin_layout Plain Layout
16666 Which order we get depends upon the setting of
16667 \begin_inset Flex CharStyle:Code
16670 \begin_layout Plain Layout
16677 \begin_inset Flex CharStyle:Code
16680 \begin_layout Plain Layout
16686 is false (the default), you get the first of these, with the label within
16687 the item; if true, you get the second, with the label outside the item.
16690 \begin_layout Standard
16691 The specific tags and attributes output for each paragraph type can be controlle
16692 d by means of the layout tags we are about to describe.
16693 As mentioned earlier, however, LyX uses sensible defaults for many of these,
16694 so you often may not need to do very much to get good XHTML output.
16695 Think of the available tags as there so you can tweak things to your liking.
16698 \begin_layout Description
16699 \begin_inset Flex CharStyle:Code
16702 \begin_layout Plain Layout
16709 \begin_inset Flex CharStyle:Code
16712 \begin_layout Plain Layout
16718 ] Specifies attribute information to be output with the main tag.
16720 \begin_inset Quotes eld
16724 \begin_inset Flex CharStyle:Code
16727 \begin_layout Plain Layout
16734 \begin_inset Quotes erd
16738 By default, LyX will output
16739 \begin_inset Quotes eld
16743 \begin_inset Flex CharStyle:Code
16746 \begin_layout Plain Layout
16753 \begin_inset Quotes erd
16757 \begin_inset Flex CharStyle:Code
16760 \begin_layout Plain Layout
16766 is the LyX name of the layout, made lowercase, for example: chapter.
16769 \begin_layout Description
16770 \begin_inset Flex CharStyle:Code
16773 \begin_layout Plain Layout
16780 \begin_inset Flex CharStyle:Code
16783 \begin_layout Plain Layout
16793 ] Whether to output the default CSS information LyX generates for this layout,
16794 even if additional information is explicitly provided via
16795 \begin_inset Flex CharStyle:Code
16798 \begin_layout Plain Layout
16806 \begin_inset Flex CharStyle:Code
16809 \begin_layout Plain Layout
16815 allows you to alter or augment the generated CSS, rather than to override
16818 \begin_inset Flex CharStyle:Code
16821 \begin_layout Plain Layout
16830 \begin_layout Description
16831 \begin_inset Flex CharStyle:Code
16834 \begin_layout Plain Layout
16841 \begin_inset Flex CharStyle:Code
16844 \begin_layout Plain Layout
16850 ] The tag to be used for individual paragraphs of environments, replacing
16852 \begin_inset Flex CharStyle:Code
16855 \begin_layout Plain Layout
16861 in the examples above.
16863 \begin_inset Flex CharStyle:Code
16866 \begin_layout Plain Layout
16875 \begin_layout Description
16876 \begin_inset Flex CharStyle:Code
16879 \begin_layout Plain Layout
16886 \begin_inset Flex CharStyle:Code
16889 \begin_layout Plain Layout
16895 ] Attributes for the item tag.
16897 \begin_inset Quotes eld
16901 \begin_inset Flex CharStyle:Code
16904 \begin_layout Plain Layout
16905 class=`layoutname_item'
16911 \begin_inset Quotes erd
16917 \begin_layout Description
16918 \begin_inset Flex CharStyle:Code
16921 \begin_layout Plain Layout
16928 \begin_inset Flex CharStyle:Code
16931 \begin_layout Plain Layout
16937 ] The tag to be used for paragraph and item labels, replacing
16938 \begin_inset Flex CharStyle:Code
16941 \begin_layout Plain Layout
16947 in the examples above.
16949 \begin_inset Flex CharStyle:Code
16952 \begin_layout Plain Layout
16961 \begin_layout Description
16962 \begin_inset Flex CharStyle:Code
16965 \begin_layout Plain Layout
16972 \begin_inset Flex CharStyle:Code
16975 \begin_layout Plain Layout
16981 ] Attributes for the label tag.
16983 \begin_inset Quotes eld
16987 \begin_inset Flex CharStyle:Code
16990 \begin_layout Plain Layout
16991 class=`layoutname_label'
16997 \begin_inset Quotes erd
17003 \begin_layout Description
17004 \begin_inset Flex CharStyle:Code
17007 \begin_layout Plain Layout
17014 \begin_inset Flex CharStyle:Code
17017 \begin_layout Plain Layout
17027 ] Meaningful only for list-like environments, this tag controls whether
17028 the label tag is output before or inside the item tag.
17029 This is used, for example, in the description environment, where we want
17031 \begin_inset Flex CharStyle:Code
17034 \begin_layout Plain Layout
17035 <dt>\SpecialChar \ldots{}
17036 </dt><dd>\SpecialChar \ldots{}
17044 \begin_inset Flex CharStyle:Code
17047 \begin_layout Plain Layout
17053 : The label tag is output inside the item tag.
17056 \begin_layout Description
17057 \begin_inset Flex CharStyle:Code
17060 \begin_layout Plain Layout
17066 Information to be output in the
17067 \begin_inset Flex CharStyle:Code
17070 \begin_layout Plain Layout
17076 section when this style is used.
17077 This might, for example, be used to include a
17078 \begin_inset Flex CharStyle:Code
17081 \begin_layout Plain Layout
17088 \begin_inset Flex CharStyle:Code
17091 \begin_layout Plain Layout
17100 \begin_layout Description
17101 \begin_inset Flex CharStyle:Code
17104 \begin_layout Plain Layout
17110 CSS style information to be included when this style is used.
17111 Note that this will automatically be wrapped in a layout-generated
17112 \begin_inset Flex CharStyle:Code
17115 \begin_layout Plain Layout
17121 block, so only the CSS itself need be included.
17124 \begin_layout Description
17125 \begin_inset Flex CharStyle:Code
17128 \begin_layout Plain Layout
17135 \begin_inset Flex CharStyle:Code
17138 \begin_layout Plain Layout
17144 ] The tag to be used for the main label, replacing
17145 \begin_inset Flex CharStyle:Code
17148 \begin_layout Plain Layout
17154 in the examples above.
17156 \begin_inset Flex CharStyle:Code
17159 \begin_layout Plain Layout
17168 \begin_layout Description
17169 \begin_inset Flex CharStyle:Code
17172 \begin_layout Plain Layout
17179 \begin_inset Flex CharStyle:Code
17182 \begin_layout Plain Layout
17192 ] Marks this style as the one to be used to generate the
17193 \begin_inset Flex CharStyle:Code
17196 \begin_layout Plain Layout
17202 tag for the XHTML file.
17203 By default, it is false.
17205 \begin_inset Flex CharStyle:Code
17208 \begin_layout Plain Layout
17214 file sets it to true for the
17215 \begin_inset Flex CharStyle:Code
17218 \begin_layout Plain Layout
17228 \begin_layout Subsection
17232 \begin_layout Standard
17233 The XHTML output of insets can also be controlled by information in layout
17238 \begin_layout Plain Layout
17239 At present, this is true only for
17240 \begin_inset Quotes eld
17244 \begin_inset Quotes erd
17247 insets (insets you can type into) and is not true for
17248 \begin_inset Quotes eld
17252 \begin_inset Quotes erd
17255 insets (insets that are associated with dialog boxes).
17260 Here, too, LyX tries to provide sensible defaults, and it constructs default
17262 But everything can be customized.
17265 \begin_layout Standard
17266 The XHTML LyX outputs for an inset has the following form:
17269 \begin_layout LyX-Code
17271 \begin_inset Quotes erd
17275 \begin_inset Quotes erd
17281 \begin_layout LyX-Code
17282 <labeltag>Label</labeltag>
17285 \begin_layout LyX-Code
17287 \begin_inset Quotes erd
17291 \begin_inset Quotes erd
17294 >Contents of the inset.</innertag>
17297 \begin_layout LyX-Code
17301 \begin_layout Standard
17302 If the inset permits multiple paragraphs---that is, if
17303 \begin_inset Flex CharStyle:Code
17306 \begin_layout Plain Layout
17312 is true---then the contents of the inset will itself be output as paragraphs
17313 formatted according to the styles used for those paragraphs (standard,
17314 quote, and the like).
17315 The label tag is of course omitted if the paragraph does not have a label
17316 and, at present, is always
17317 \begin_inset Flex CharStyle:Code
17320 \begin_layout Plain Layout
17327 The inner tag is optional and, by default, does not appear.
17330 \begin_layout Standard
17331 The specific tags and attributes output for each inset can be controlled
17332 by means of the following layout tags.
17335 \begin_layout Description
17336 \begin_inset Flex CharStyle:Code
17339 \begin_layout Plain Layout
17346 \begin_inset Flex CharStyle:Code
17349 \begin_layout Plain Layout
17355 ] Specifies attribute information to be output with the main tag.
17357 \begin_inset Quotes eld
17361 \begin_inset Flex CharStyle:Code
17364 \begin_layout Plain Layout
17365 class=`myinset' onclick=`\SpecialChar \ldots{}
17372 \begin_inset Quotes erd
17376 By default, LyX will output
17377 \begin_inset Quotes eld
17381 \begin_inset Flex CharStyle:Code
17384 \begin_layout Plain Layout
17391 \begin_inset Quotes erd
17395 \begin_inset Flex CharStyle:Code
17398 \begin_layout Plain Layout
17404 is the LyX name of the inset, made lowercase and with non-alphanumeric
17405 characters converted to underscores, for example: footnote.
17408 \begin_layout Description
17409 \begin_inset Flex CharStyle:Code
17412 \begin_layout Plain Layout
17419 \begin_inset Flex CharStyle:Code
17422 \begin_layout Plain Layout
17432 ] Whether to output the default CSS information LyX generates for this layout,
17433 even if additional information is explicitly provided via
17434 \begin_inset Flex CharStyle:Code
17437 \begin_layout Plain Layout
17445 \begin_inset Flex CharStyle:Code
17448 \begin_layout Plain Layout
17454 allows you to alter or augment the generated CSS, rather than to override
17459 \begin_layout Description
17460 \begin_inset Flex CharStyle:Code
17463 \begin_layout Plain Layout
17470 \begin_inset Flex CharStyle:Code
17473 \begin_layout Plain Layout
17479 ] Attributes for the inner tag.
17481 \begin_inset Quotes eld
17485 \begin_inset Flex CharStyle:Code
17488 \begin_layout Plain Layout
17489 class=`insetname_inner'
17495 \begin_inset Quotes erd
17501 \begin_layout Description
17502 \begin_inset Flex CharStyle:Code
17505 \begin_layout Plain Layout
17512 \begin_inset Flex CharStyle:Code
17515 \begin_layout Plain Layout
17521 ] The inner tag, replacing
17522 \begin_inset Flex CharStyle:Code
17525 \begin_layout Plain Layout
17531 in the examples above.
17532 By default, there is none.
17535 \begin_layout Description
17536 \begin_inset Flex CharStyle:Code
17539 \begin_layout Plain Layout
17546 \begin_inset Flex CharStyle:Code
17549 \begin_layout Plain Layout
17557 ] Whether this inset represents a standalone block of text (such as a footnote)
17558 or instead represents material that is included in the surrounding text
17559 (such as a branch).
17563 \begin_layout Description
17564 \begin_inset Flex CharStyle:Code
17567 \begin_layout Plain Layout
17574 \begin_inset Flex CharStyle:Code
17577 \begin_layout Plain Layout
17583 ] A label for this inset, possibly including a reference to a counter.
17584 For example, for footnote, it might be:
17585 \begin_inset Flex CharStyle:Code
17588 \begin_layout Plain Layout
17597 This is optional, and there is no default.
17600 \begin_layout Description
17601 \begin_inset Flex CharStyle:Code
17604 \begin_layout Plain Layout
17610 Information to be output in the
17611 \begin_inset Flex CharStyle:Code
17614 \begin_layout Plain Layout
17620 section when this style is used.
17621 This might, for example, be used to include a
17622 \begin_inset Flex CharStyle:Code
17625 \begin_layout Plain Layout
17632 \begin_inset Flex CharStyle:Code
17635 \begin_layout Plain Layout
17644 \begin_layout Description
17645 \begin_inset Flex CharStyle:Code
17648 \begin_layout Plain Layout
17654 CSS style information to be included when this style is used.
17655 Note that this will automatically be wrapped in a layout-generated
17656 \begin_inset Flex CharStyle:Code
17659 \begin_layout Plain Layout
17665 block, so only the CSS itself need be included.
17668 \begin_layout Description
17669 \begin_inset Flex CharStyle:Code
17672 \begin_layout Plain Layout
17679 \begin_inset Flex CharStyle:Code
17682 \begin_layout Plain Layout
17688 ] The tag to be used for the main label, replacing
17689 \begin_inset Flex CharStyle:Code
17692 \begin_layout Plain Layout
17698 in the examples above.
17699 The default depends upon the setting of
17700 \begin_inset Flex CharStyle:Code
17703 \begin_layout Plain Layout
17710 \begin_inset Flex CharStyle:Code
17713 \begin_layout Plain Layout
17719 is true, the default is
17720 \begin_inset Flex CharStyle:Code
17723 \begin_layout Plain Layout
17729 ; if it is false, the default is
17730 \begin_inset Flex CharStyle:Code
17733 \begin_layout Plain Layout
17742 \begin_layout Subsection
17746 \begin_layout Standard
17747 The XHTML output for floats too can be controlled by layout information.
17748 The output has the following form:
17751 \begin_layout LyX-Code
17753 \begin_inset Quotes erd
17757 \begin_inset Quotes erd
17763 \begin_layout LyX-Code
17764 Contents of the float.
17767 \begin_layout LyX-Code
17771 \begin_layout Standard
17772 The caption, if there is one, is a separate inset and will be output as
17774 Its appearance can be controlled via the InsetLayout for caption insets.
17778 \begin_layout Description
17779 \begin_inset Flex CharStyle:Code
17782 \begin_layout Plain Layout
17789 \begin_inset Flex CharStyle:Code
17792 \begin_layout Plain Layout
17798 ] Specifies attribute information to be output with the main tag.
17800 \begin_inset Quotes eld
17804 \begin_inset Flex CharStyle:Code
17807 \begin_layout Plain Layout
17808 class=`myfloat' onclick=`\SpecialChar \ldots{}
17815 \begin_inset Quotes erd
17819 By default, LyX will output
17820 \begin_inset Quotes eld
17824 \begin_inset Flex CharStyle:Code
17827 \begin_layout Plain Layout
17828 class=`float float-floattype'
17834 \begin_inset Quotes erd
17838 \begin_inset Flex CharStyle:Code
17841 \begin_layout Plain Layout
17847 is LyX's name for this type of float, as determined by the float delcaration
17849 \begin_inset CommandInset ref
17851 reference "sub:Floats"
17855 ), though made lowercase and with non-alphanumeric characters converted
17856 to underscores, for example: float-table.
17859 \begin_layout Description
17860 \begin_inset Flex CharStyle:Code
17863 \begin_layout Plain Layout
17869 CSS style information to be included when this float is used.
17870 Note that this will automatically be wrapped in a layout-generated
17871 \begin_inset Flex CharStyle:Code
17874 \begin_layout Plain Layout
17880 block, so only the CSS itself need be included.
17883 \begin_layout Description
17884 \begin_inset Flex CharStyle:Code
17887 \begin_layout Plain Layout
17894 \begin_inset Flex CharStyle:Code
17897 \begin_layout Plain Layout
17903 ] The tag to be used for this float, replacing
17904 \begin_inset Quotes eld
17908 \begin_inset Flex CharStyle:Code
17911 \begin_layout Plain Layout
17918 \begin_inset Quotes erd
17921 in the example above.
17923 \begin_inset Flex CharStyle:Code
17926 \begin_layout Plain Layout
17932 and will rarely need changing.
17935 \begin_layout Subsection
17936 Bibliography formatting
17939 \begin_layout Standard
17940 The bibliography can be formatted using
17941 \begin_inset Flex CharStyle:Code
17944 \begin_layout Plain Layout
17952 \begin_inset CommandInset ref
17954 reference "sub:Citation-format-description"
17961 \begin_layout Subsection
17965 \begin_layout Standard
17966 We have several times mentioned that LyX will generate default CSS style
17967 rules for both insets and paragraph styles, based upon the other layout
17968 information that is provided.
17969 In this section, we shall say a word about which layout information LyX
17973 \begin_layout Standard
17974 At present, LyX auto-generates CSS only for font information, making use
17976 \begin_inset Flex CharStyle:Code
17979 \begin_layout Plain Layout
17986 \begin_inset Flex CharStyle:Code
17989 \begin_layout Plain Layout
17996 \begin_inset Flex CharStyle:Code
17999 \begin_layout Plain Layout
18006 \begin_inset Flex CharStyle:Code
18009 \begin_layout Plain Layout
18016 \begin_inset Flex CharStyle:Code
18019 \begin_layout Plain Layout
18027 \begin_inset CommandInset ref
18029 reference "sub:Font-description"
18033 .) The translation is mostly straightforward and obvious.
18035 \begin_inset Quotes eld
18039 \begin_inset Flex CharStyle:Code
18042 \begin_layout Plain Layout
18049 \begin_inset Quotes erd
18053 \begin_inset Quotes eld
18057 \begin_inset Flex CharStyle:Code
18060 \begin_layout Plain Layout
18061 font-family: sans-serif;
18067 \begin_inset Quotes erd
18071 The correspondence of LyX sizes and CSS sizes is a little less obvious
18072 but nonetheless intuitive.
18074 \begin_inset Flex CharStyle:Code
18077 \begin_layout Plain Layout
18084 \begin_inset Flex URL
18087 \begin_layout Plain Layout
18098 \begin_layout Chapter
18099 Including External Material
18102 \begin_layout Standard
18103 \begin_inset Box Shadowbox
18113 height_special "totalheight"
18116 \begin_layout Plain Layout
18117 WARNING: This portion of the documentation has not been updated for some
18119 We certainly hope that it is still accurate, but there are no guarantees.
18127 \begin_layout Standard
18128 The use of material from sources external to LyX is covered in detail in
18134 This part of the manual covers what needs to happen behind the scenes for
18135 new sorts of material to be included.
18138 \begin_layout Section
18142 \begin_layout Standard
18143 The external material feature is based on the concept of a
18148 A template is a specification of how LyX should interface with a certain
18150 As bundled, LyX comes with predefined templates for Xfig figures, various
18151 raster format images, chess diagrams, and LilyPond music notation.
18152 You can check the actual list by using the menu
18153 \begin_inset Flex CharStyle:MenuItem
18156 \begin_layout Plain Layout
18157 Insert\SpecialChar \menuseparator
18158 File\SpecialChar \menuseparator
18165 Furthermore, it is possible to roll your own template to support a specific
18167 Later we'll describe in more detail what is involved, and hopefully you
18168 will submit all the templates you create so we can include them in a later
18172 \begin_layout Standard
18173 Another basic idea of the external material feature is to distinguish between
18174 the original file that serves as a base for final material and the produced
18175 file that is included in your exported or printed document.
18176 For example, consider the case of a figure produced with
18177 \begin_inset Flex CharStyle:Code
18180 \begin_layout Plain Layout
18187 The Xfig application itself works on an original file with the
18188 \begin_inset Flex CharStyle:Code
18191 \begin_layout Plain Layout
18198 Within Xfig, you create and change your figure, and when you are done,
18200 \begin_inset Flex CharStyle:Code
18203 \begin_layout Plain Layout
18210 When you want to include the figure in your document, you invoke
18211 \begin_inset Flex CharStyle:Code
18214 \begin_layout Plain Layout
18220 in order to create a PostScript file that can readily be included in your
18223 \begin_inset Flex CharStyle:Code
18226 \begin_layout Plain Layout
18232 file is the original file, and the PostScript file is the produced file.
18235 \begin_layout Standard
18236 This distinction is important in order to allow updating of the material
18237 while you are in the process of writing the document.
18238 Furthermore, it provides us with the flexibility that is needed to support
18239 multiple export formats.
18240 For instance, in the case of a plain text file, it is not exactly an award-winn
18241 ing idea to include the figure as raw PostScript.
18242 Instead, you'd either prefer to just include a reference to the figure
18243 or try to invoke some graphics to ASCII converter to make the final result
18244 look similar to the real graphics.
18245 The external material management allows you to do this, because it is parametri
18246 zed on the different export formats that LyX supports.
18249 \begin_layout Standard
18250 Besides supporting the production of different products according to the
18251 exported format, it supports tight integration with editing and viewing
18253 In the case of an Xfig figure, you are able to invoke Xfig on the original
18254 file with a single click from within the external material dialog in LyX,
18255 and also preview the produced PostScript file with Ghostview with another
18257 No more fiddling around with the command line and/or file browsers to locate
18258 and manipulate the original or produced files.
18259 In this way, you are finally able to take full advantage of the many different
18260 applications that are relevant to use when you write your documents, and
18261 ultimately be more productive.
18264 \begin_layout Section
18265 The external template configuration file
18268 \begin_layout Standard
18269 It is relatively easy to add custom external template definitions to LyX.
18270 However, be aware that doing this in an careless manner most probably
18274 introduce an easily exploitable security hole.
18275 So before you do this, please read the discussion about security in section
18277 \begin_inset CommandInset ref
18279 reference "sec:Security-discussion"
18286 \begin_layout Standard
18287 Having said that, we encourage you to submit any interesting templates that
18292 \begin_layout Standard
18293 The external templates are defined in the
18294 \begin_inset Flex CharStyle:Code
18297 \begin_layout Plain Layout
18298 LyXDir/lib/external_templates
18304 You can place your own version in
18305 \begin_inset Flex CharStyle:Code
18308 \begin_layout Plain Layout
18309 UserDir/external_templates
18317 \begin_layout Standard
18318 A typical template looks like this:
18321 \begin_layout LyX-Code
18325 \begin_layout LyX-Code
18326 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
18329 \begin_layout LyX-Code
18333 \begin_layout LyX-Code
18337 \begin_layout LyX-Code
18341 \begin_layout LyX-Code
18345 \begin_layout LyX-Code
18349 \begin_layout LyX-Code
18350 AutomaticProduction true
18353 \begin_layout LyX-Code
18357 \begin_layout LyX-Code
18361 \begin_layout LyX-Code
18365 \begin_layout LyX-Code
18366 TransformCommand Rotate RotationLatexCommand
18369 \begin_layout LyX-Code
18370 TransformCommand Resize ResizeLatexCommand
18373 \begin_layout LyX-Code
18374 Product "$$RotateFront$$ResizeFront
18377 \begin_layout LyX-Code
18382 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
18385 \begin_layout LyX-Code
18386 $$ResizeBack$$RotateBack"
18389 \begin_layout LyX-Code
18393 \begin_layout LyX-Code
18394 UpdateResult "$$AbsPath$$Basename.pstex_t"
18397 \begin_layout LyX-Code
18398 Requirement "graphicx"
18401 \begin_layout LyX-Code
18402 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
18405 \begin_layout LyX-Code
18406 ReferencedFile latex "$$AbsPath$$Basename.eps"
18409 \begin_layout LyX-Code
18410 ReferencedFile dvi "$$AbsPath$$Basename.eps"
18413 \begin_layout LyX-Code
18417 \begin_layout LyX-Code
18421 \begin_layout LyX-Code
18422 TransformCommand Rotate RotationLatexCommand
18425 \begin_layout LyX-Code
18426 TransformCommand Resize ResizeLatexCommand
18429 \begin_layout LyX-Code
18430 Product "$$RotateFront$$ResizeFront
18433 \begin_layout LyX-Code
18438 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
18441 \begin_layout LyX-Code
18442 $$ResizeBack$$RotateBack"
18445 \begin_layout LyX-Code
18446 UpdateFormat pdftex
18449 \begin_layout LyX-Code
18450 UpdateResult "$$AbsPath$$Basename.pdftex_t"
18453 \begin_layout LyX-Code
18454 Requirement "graphicx"
18457 \begin_layout LyX-Code
18458 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
18461 \begin_layout LyX-Code
18462 ReferencedFile latex "$$AbsPath$$Basename.pdf"
18465 \begin_layout LyX-Code
18469 \begin_layout LyX-Code
18473 \begin_layout LyX-Code
18474 Product "$$Contents(
18476 "$$AbsPath$$Basename.asc
18481 \begin_layout LyX-Code
18482 UpdateFormat asciixfig
18485 \begin_layout LyX-Code
18486 UpdateResult "$$AbsPath$$Basename.asc"
18489 \begin_layout LyX-Code
18493 \begin_layout LyX-Code
18497 \begin_layout LyX-Code
18498 Product "<graphic fileref=
18500 "$$AbsOrRelPathMaster$$Basename.eps
18505 \begin_layout LyX-Code
18509 \begin_layout LyX-Code
18513 \begin_layout LyX-Code
18514 UpdateResult "$$AbsPath$$Basename.eps"
18517 \begin_layout LyX-Code
18518 ReferencedFile docbook "$$AbsPath$$Basename.eps"
18521 \begin_layout LyX-Code
18522 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
18525 \begin_layout LyX-Code
18529 \begin_layout LyX-Code
18530 Product "[XFig: $$FName]"
18533 \begin_layout LyX-Code
18537 \begin_layout LyX-Code
18541 \begin_layout Standard
18542 As you can see, the template is enclosed in
18543 \begin_inset Flex CharStyle:Code
18546 \begin_layout Plain Layout
18552 \SpecialChar \ldots{}
18554 \begin_inset Flex CharStyle:Code
18557 \begin_layout Plain Layout
18564 It contains a header specifying some general settings and, for each supported
18565 primary document file format, a section
18566 \begin_inset Flex CharStyle:Code
18569 \begin_layout Plain Layout
18575 \SpecialChar \ldots{}
18577 \begin_inset Flex CharStyle:Code
18580 \begin_layout Plain Layout
18589 \begin_layout Subsection
18590 The template header
18593 \begin_layout Description
18594 \begin_inset Flex CharStyle:Code
18597 \begin_layout Plain Layout
18598 AutomaticProduction
18599 \begin_inset space ~
18607 Whether the file represented by the template must be generated by LyX.
18608 This command must occur exactly once.
18611 \begin_layout Description
18612 \begin_inset Flex CharStyle:Code
18615 \begin_layout Plain Layout
18617 \begin_inset space ~
18625 A glob pattern that is used in the file dialog to filter out the desired
18627 If there is more than one possible file extension (e.
18628 \begin_inset space \thinspace{}
18632 \begin_inset space \space{}
18636 \begin_inset Flex CharStyle:Code
18639 \begin_layout Plain Layout
18646 \begin_inset Flex CharStyle:Code
18649 \begin_layout Plain Layout
18655 ), use something like
18656 \begin_inset Flex CharStyle:Code
18659 \begin_layout Plain Layout
18666 This command must occur exactly once.
18669 \begin_layout Description
18670 \begin_inset Flex CharStyle:Code
18673 \begin_layout Plain Layout
18675 \begin_inset space ~
18683 The text that is displayed on the button.
18684 This command must occur exactly once.
18687 \begin_layout Description
18688 \begin_inset Flex CharStyle:Code
18691 \begin_layout Plain Layout
18693 \begin_inset space ~
18697 \begin_inset space ~
18705 The help text that is used in the External dialog.
18706 Provide enough information to explain to the user just what the template
18707 can provide him with.
18708 This command must occur exactly once.
18711 \begin_layout Description
18712 \begin_inset Flex CharStyle:Code
18715 \begin_layout Plain Layout
18717 \begin_inset space ~
18725 The file format of the original file.
18726 This must be the name of a format that is known to LyX (see section
18727 \begin_inset CommandInset ref
18729 reference "sec:Formats"
18735 \begin_inset Quotes eld
18739 \begin_inset Flex CharStyle:Code
18742 \begin_layout Plain Layout
18749 \begin_inset Quotes erd
18752 if the template can handle original files of more than one format.
18753 LyX will attempt to interrogate the file itself in order to deduce its
18754 format in this case.
18755 This command must occur exactly once.
18758 \begin_layout Description
18759 \begin_inset Flex CharStyle:Code
18762 \begin_layout Plain Layout
18764 \begin_inset space ~
18772 A unique name for the template.
18773 It must not contain substitution macros (see below).
18776 \begin_layout Description
18777 \begin_inset Flex CharStyle:Code
18780 \begin_layout Plain Layout
18782 \begin_inset space ~
18785 Rotate|Resize|Clip|Extra
18790 This command specifies which transformations are supported by this template.
18791 It may occur zero or more times.
18792 This command enables the corresponding tabs in the external dialog.
18794 \begin_inset Flex CharStyle:Code
18797 \begin_layout Plain Layout
18803 command must have either a corresponding
18804 \begin_inset Flex CharStyle:Code
18807 \begin_layout Plain Layout
18814 \begin_inset Flex CharStyle:Code
18817 \begin_layout Plain Layout
18824 \begin_inset Flex CharStyle:Code
18827 \begin_layout Plain Layout
18834 Otherwise the transformation will not be supported by that format.
18837 \begin_layout Subsection
18841 \begin_layout Description
18842 \begin_inset Flex CharStyle:Code
18845 \begin_layout Plain Layout
18847 \begin_inset space ~
18850 LaTeX|PDFLaTeX|PlainText|DocBook
18855 The primary document file format that this format definition is for.
18856 Not every template has a sensible representation in all document file formats.
18857 Please define nevertheless a
18858 \begin_inset Flex CharStyle:Code
18861 \begin_layout Plain Layout
18867 section for all formats.
18868 Use a dummy text when no representation is available.
18869 Then you can at least see a reference to the external material in the exported
18873 \begin_layout Description
18874 \begin_inset Flex CharStyle:Code
18877 \begin_layout Plain Layout
18879 \begin_inset space ~
18883 \begin_inset space ~
18891 This command defines an additional macro
18892 \begin_inset Flex CharStyle:Code
18895 \begin_layout Plain Layout
18901 for substitution in
18902 \begin_inset Flex CharStyle:Code
18905 \begin_layout Plain Layout
18913 \begin_inset Flex CharStyle:Code
18916 \begin_layout Plain Layout
18922 itself may contain substitution macros.
18923 The advantage over using
18924 \begin_inset Flex CharStyle:Code
18927 \begin_layout Plain Layout
18934 \begin_inset Flex CharStyle:Code
18937 \begin_layout Plain Layout
18943 is that the substituted value of
18944 \begin_inset Flex CharStyle:Code
18947 \begin_layout Plain Layout
18953 is sanitized so that it is a valid optional argument in the document format.
18954 This command may occur zero or more times.
18957 \begin_layout Description
18958 \begin_inset Flex CharStyle:Code
18961 \begin_layout Plain Layout
18963 \begin_inset space ~
18971 The text that is inserted in the exported document.
18972 This is actually the most important command and can be quite complex.
18973 This command must occur exactly once.
18976 \begin_layout Description
18977 \begin_inset Flex CharStyle:Code
18980 \begin_layout Plain Layout
18982 \begin_inset space ~
18990 This command specifies a preamble snippet that will be included in the
18992 It has to be defined using
18993 \begin_inset Flex CharStyle:Code
18996 \begin_layout Plain Layout
19002 \SpecialChar \ldots{}
19004 \begin_inset Flex CharStyle:Code
19007 \begin_layout Plain Layout
19014 This command may occur zero or more times.
19017 \begin_layout Description
19018 \begin_inset Flex CharStyle:Code
19021 \begin_layout Plain Layout
19023 \begin_inset space ~
19027 \begin_inset space ~
19035 This command denotes files that are created by the conversion process and
19036 are needed for a particular export format.
19037 If the filename is relative, it is interpreted relative to the master document.
19038 This command may be given zero or more times.
19041 \begin_layout Description
19042 \begin_inset Flex CharStyle:Code
19045 \begin_layout Plain Layout
19047 \begin_inset space ~
19055 The name of a required LaTeX package.
19056 The package is included via
19057 \begin_inset Flex CharStyle:Code
19060 \begin_layout Plain Layout
19068 in the LaTeX preamble.
19069 This command may occur zero or more times.
19072 \begin_layout Description
19073 \begin_inset Flex CharStyle:Code
19076 \begin_layout Plain Layout
19078 \begin_inset space ~
19082 \begin_inset space ~
19085 RotationLatexCommand
19090 This command specifies that the built in LaTeX command should be used for
19092 This command may occur once or not at all.
19095 \begin_layout Description
19096 \begin_inset Flex CharStyle:Code
19099 \begin_layout Plain Layout
19101 \begin_inset space ~
19105 \begin_inset space ~
19113 This command specifies that the built in LaTeX command should be used for
19115 This command may occur once or not at all.
19118 \begin_layout Description
19119 \begin_inset Flex CharStyle:Code
19122 \begin_layout Plain Layout
19124 \begin_inset space ~
19128 \begin_inset space ~
19131 RotationLatexOption
19136 This command specifies that rotation is done via an optional argument.
19137 This command may occur once or not at all.
19140 \begin_layout Description
19141 \begin_inset Flex CharStyle:Code
19144 \begin_layout Plain Layout
19146 \begin_inset space ~
19150 \begin_inset space ~
19158 This command specifies that resizing is done via an optional argument.
19159 This command may occur once or not at all.
19162 \begin_layout Description
19163 \begin_inset Flex CharStyle:Code
19166 \begin_layout Plain Layout
19168 \begin_inset space ~
19172 \begin_inset space ~
19180 This command specifies that clipping is done via an optional argument.
19181 This command may occur once or not at all.
19184 \begin_layout Description
19185 \begin_inset Flex CharStyle:Code
19188 \begin_layout Plain Layout
19190 \begin_inset space ~
19194 \begin_inset space ~
19202 This command specifies that an extra optional argument is used.
19203 This command may occur once or not at all.
19206 \begin_layout Description
19207 \begin_inset Flex CharStyle:Code
19210 \begin_layout Plain Layout
19212 \begin_inset space ~
19220 The file format of the converted file.
19221 This must be the name of a format that is known to LyX (see the
19222 \begin_inset Flex CharStyle:MenuItem
19225 \begin_layout Plain Layout
19230 ools\SpecialChar \menuseparator
19235 references:Conversion
19241 This command must occur exactly once.
19244 \begin_layout Description
19245 \begin_inset Flex CharStyle:Code
19248 \begin_layout Plain Layout
19250 \begin_inset space ~
19258 The file name of the converted file.
19259 The file name must be absolute.
19260 This command must occur exactly once.
19263 \begin_layout Subsection
19264 Preamble definitions
19267 \begin_layout Standard
19268 The external template configuration file may contain additional preamble
19269 definitions enclosed by
19270 \begin_inset Flex CharStyle:Code
19273 \begin_layout Plain Layout
19279 \SpecialChar \ldots{}
19281 \begin_inset Flex CharStyle:Code
19284 \begin_layout Plain Layout
19291 They can be used by the templates in the
19292 \begin_inset Flex CharStyle:Code
19295 \begin_layout Plain Layout
19304 \begin_layout Section
19305 The substitution mechanism
19308 \begin_layout Standard
19309 When the external material facility invokes an external program, it is done
19310 on the basis of a command defined in the template configuration file.
19311 These commands can contain various macros that are expanded before execution.
19312 Execution always take place in the directory of the containing document.
19315 \begin_layout Standard
19316 Also, whenever external material is to be displayed, the name will be produced
19317 by the substitution mechanism, and most other commands in the template
19318 definition support substitution as well.
19321 \begin_layout Standard
19322 The available macros are the following:
19325 \begin_layout Description
19326 \begin_inset Flex CharStyle:Code
19329 \begin_layout Plain Layout
19330 $$AbsOrRelPathMaster
19335 The file path, absolute or relative to the master LyX document.
19338 \begin_layout Description
19339 \begin_inset Flex CharStyle:Code
19342 \begin_layout Plain Layout
19343 $$AbsOrRelPathParent
19348 The file path, absolute or relative to the LyX document.
19351 \begin_layout Description
19352 \begin_inset Flex CharStyle:Code
19355 \begin_layout Plain Layout
19361 The absolute file path.
19364 \begin_layout Description
19365 \begin_inset Flex CharStyle:Code
19368 \begin_layout Plain Layout
19374 The filename without path and without the extension.
19377 \begin_layout Description
19378 \begin_inset Flex CharStyle:Code
19381 \begin_layout Plain Layout
19383 \begin_inset Quotes eld
19387 \begin_inset Quotes erd
19395 This macro will expand to the contents of the file with the name
19396 \begin_inset Flex CharStyle:Code
19399 \begin_layout Plain Layout
19408 \begin_layout Description
19409 \begin_inset Flex CharStyle:Code
19412 \begin_layout Plain Layout
19418 The file extension (including the dot).
19421 \begin_layout Description
19422 \begin_inset Flex CharStyle:Code
19425 \begin_layout Plain Layout
19431 The filename of the file specified in the external material dialog.
19432 This is either an absolute name, or it is relative to the LyX document.
19435 \begin_layout Description
19436 \begin_inset Flex CharStyle:Code
19439 \begin_layout Plain Layout
19446 \begin_inset Flex CharStyle:Code
19449 \begin_layout Plain Layout
19455 (absolute name or relative to the LyX document).
19458 \begin_layout Description
19459 \begin_inset Flex CharStyle:Code
19462 \begin_layout Plain Layout
19468 The file path, relative to the master LyX document.
19471 \begin_layout Description
19472 \begin_inset Flex CharStyle:Code
19475 \begin_layout Plain Layout
19481 The file path, relative to the LyX document.
19484 \begin_layout Description
19485 \begin_inset Flex CharStyle:Code
19488 \begin_layout Plain Layout
19494 This macro will expand to the absolute path of the system directory.
19495 This is typically used to point to the various helper scripts that are
19499 \begin_layout Description
19500 \begin_inset Flex CharStyle:Code
19503 \begin_layout Plain Layout
19509 A name and full path to a temporary file which will be automatically deleted
19510 whenever the containing document is closed, or the external material insertion
19514 \begin_layout Standard
19515 All path macros contain a trailing directory separator, so you can construct
19517 \begin_inset space \thinspace{}
19521 \begin_inset space \space{}
19524 the absolute filename with
19525 \begin_inset Flex CharStyle:Code
19528 \begin_layout Plain Layout
19529 $$AbsPath$$Basename$$Extension
19537 \begin_layout Standard
19538 The macros above are substituted in all commands unless otherwise noted.
19540 \begin_inset Flex CharStyle:Code
19543 \begin_layout Plain Layout
19549 supports additionally the following substitutions if they are enabled by
19551 \begin_inset Flex CharStyle:Code
19554 \begin_layout Plain Layout
19561 \begin_inset Flex CharStyle:Code
19564 \begin_layout Plain Layout
19573 \begin_layout Description
19574 \begin_inset Flex CharStyle:Code
19577 \begin_layout Plain Layout
19583 The front part of the resize command.
19586 \begin_layout Description
19587 \begin_inset Flex CharStyle:Code
19590 \begin_layout Plain Layout
19596 The back part of the resize command.
19599 \begin_layout Description
19600 \begin_inset Flex CharStyle:Code
19603 \begin_layout Plain Layout
19609 The front part of the rotation command.
19612 \begin_layout Description
19613 \begin_inset Flex CharStyle:Code
19616 \begin_layout Plain Layout
19622 The back part of the rotation command.
19625 \begin_layout Standard
19626 The value string of the
19627 \begin_inset Flex CharStyle:Code
19630 \begin_layout Plain Layout
19636 command supports additionally the following substitutions if they are enabled
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
19673 \begin_layout Description
19674 \begin_inset Flex CharStyle:Code
19677 \begin_layout Plain Layout
19686 \begin_layout Description
19687 \begin_inset Flex CharStyle:Code
19690 \begin_layout Plain Layout
19699 \begin_layout Description
19700 \begin_inset Flex CharStyle:Code
19703 \begin_layout Plain Layout
19709 The rotation option.
19712 \begin_layout Standard
19713 You may ask why there are so many path macros.
19714 There are mainly two reasons:
19717 \begin_layout Enumerate
19718 Relative and absolute file names should remain relative or absolute, respectivel
19720 Users may have reasons to prefer either form.
19721 Relative names are useful for portable documents that should work on different
19722 machines, for example.
19723 Absolute names may be required by some programs.
19726 \begin_layout Enumerate
19727 LaTeX treats relative file names differently than LyX and other programs
19728 in nested included files.
19729 For LyX, a relative file name is always relative to the document that contains
19731 For LaTeX, it is always relative to the master document.
19732 These two definitions are identical if you have only one document, but
19733 differ if you have a master document that includes part documents.
19734 That means that relative filenames must be transformed when presented to
19736 Fortunately LyX does this automatically for you if you choose the right
19740 \begin_layout Standard
19741 So which path macro should be used in new template definitions? The rule
19745 \begin_layout Itemize
19747 \begin_inset Flex CharStyle:Code
19750 \begin_layout Plain Layout
19756 if an absolute path is required.
19759 \begin_layout Itemize
19761 \begin_inset Flex CharStyle:Code
19764 \begin_layout Plain Layout
19765 $$AbsOrRelPathMaster
19770 if the substituted string is some kind of LaTeX input.
19773 \begin_layout Itemize
19775 \begin_inset Flex CharStyle:Code
19778 \begin_layout Plain Layout
19779 $$AbsOrRelPathParent
19784 in order to preserve the user's choice.
19787 \begin_layout Standard
19788 There are special cases where this rule does not work and e.
19789 \begin_inset space \thinspace{}
19793 \begin_inset space \space{}
19796 relative names are needed, but normally it will work just fine.
19797 One example for such a case is the command
19798 \begin_inset Flex CharStyle:Code
19801 \begin_layout Plain Layout
19802 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
19807 in the XFig template above: We can't use the absolute name because the
19809 \begin_inset Flex CharStyle:Code
19812 \begin_layout Plain Layout
19818 files needs the relative name in order to rewrite the file content.
19821 \begin_layout Section
19822 Security discussion
19823 \begin_inset CommandInset label
19825 name "sec:Security-discussion"
19832 \begin_layout Standard
19833 The external material feature interfaces with a lot of external programs
19834 and does so automatically, so we have to consider the security implications
19836 In particular, since you have the option of including your own filenames
19837 and/or parameter strings and those are expanded into a command, it seems
19838 that it would be possible to create a malicious document which executes
19839 arbitrary commands when a user views or prints the document.
19840 This is something we definitely want to avoid.
19843 \begin_layout Standard
19844 However, since the external program commands are specified in the template
19845 configuration file only, there are no security issues if LyX is properly
19846 configured with safe templates only.
19847 This is so because the external programs are invoked with the
19848 \begin_inset Flex CharStyle:Code
19851 \begin_layout Plain Layout
19857 -system call rather than the
19858 \begin_inset Flex CharStyle:Code
19861 \begin_layout Plain Layout
19867 system-call, so it's not possible to execute arbitrary commands from the
19868 filename or parameter section via the shell.
19871 \begin_layout Standard
19872 This also implies that you are restricted in what command strings you can
19873 use in the external material templates.
19874 In particular, pipes and redirection are not readily available.
19875 This has to be so if LyX should remain safe.
19876 If you want to use some of the shell features, you should write a safe
19877 script to do this in a controlled manner, and then invoke the script from
19878 the command string.
19882 \begin_layout Standard
19883 It is possible to design a template that interacts directly with the shell,
19884 but since this would allow a malicious user to execute arbitrary commands
19885 by writing clever filenames and/or parameters, we generally recommend that
19886 you only use safe scripts that work with the
19887 \begin_inset Flex CharStyle:Code
19890 \begin_layout Plain Layout
19896 system call in a controlled manner.
19897 Of course, for use in a controlled environment, it can be tempting to just
19898 fall back to use ordinary shell scripts.
19899 If you do so, be aware that you
19903 provide an easily exploitable security hole in your system.
19904 Of course it stands to reason that such unsafe templates will never be
19905 included in the standard LyX distribution, although we do encourage people
19906 to submit new templates in the open source tradition.
19907 But LyX as shipped from the official distribution channels will never have
19911 \begin_layout Standard
19912 Including external material provides a lot of power, and you have to be
19913 careful not to introduce security hazards with this power.
19914 A subtle error in a single line in an innocent looking script can open
19915 the door to huge security problems.
19916 So if you do not fully understand the issues, we recommend that you consult
19917 a knowledgeable security professional or the LyX development team if you
19918 have any questions about whether a given template is safe or not.
19919 And do this before you use it in an uncontrolled environment.