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"
108 \paperorientation portrait
121 \paragraph_separation indent
122 \paragraph_indentation default
123 \quotes_language english
126 \paperpagestyle headings
127 \tracking_changes false
128 \output_changes false
136 Customizing LyX: Features for the Advanced User
144 \begin_layout Plain Layout
146 If you have comments or error corrections, please send them to the LyX Documenta
148 \begin_inset CommandInset href
150 target "lyx-docs@lists.lyx.org"
157 \begin_inset Quotes eld
161 \begin_inset Quotes erd
164 in the subject header, and please cc the current maintainer of this file,
165 Richard Heck <rgheck@comcast.net>.
171 \begin_inset Newline newline
175 \begin_inset Newline newline
181 \begin_layout Standard
182 \begin_inset CommandInset toc
183 LatexCommand tableofcontents
190 \begin_layout Standard
191 \begin_inset Note Note
194 \begin_layout Plain Layout
195 Please use change tracking when modifying this document.
196 This makes it easier for our translators to recognize things that have
197 been changed, and it helps the maintainer keep up-to-date with what's been
206 \begin_layout Chapter
210 \begin_layout Standard
211 This manual covers the customization features present in LyX.
212 In it, we discuss issues like keyboard shortcuts, screen previewing options,
213 printer options, sending commands to LyX via the LyX Server, internationalizati
214 on, installing new LaTeX classes and LyX layouts, etc.
215 We can't possibly hope to touch on everything you can change—our developers
216 add new features faster than we can document them—but we will explain the
217 most common customizations and hopefully point you in the right direction
218 for some of the more obscure ones.
221 \begin_layout Standard
222 \begin_inset Branch OutDated
225 \begin_layout Standard
226 Information from previous versions of this document that now seems to be
227 outdated is contained in the OutDated branch of this document.
228 By default, this information will not appear in the LaTeX output.
236 \begin_layout Chapter
237 LyX configuration files
240 \begin_layout Standard
241 This chapter aims to help you to find your way through the LyX configuration
243 Before continuing to read this chapter, you should find out where your
244 LyX library and user directories are by using
245 \begin_inset Flex CharStyle:MenuItem
248 \begin_layout Plain Layout
249 Help\SpecialChar \menuseparator
260 The library directory is the place where LyX places its system-wide configurati
261 on files; the user directory is where you can place your modified versions.
262 We will call the former
263 \begin_inset Flex CharStyle:Code
266 \begin_layout Plain Layout
273 \begin_inset Flex CharStyle:MenuItem
276 \begin_layout Plain Layout
282 in the remainder of this document.
286 \begin_layout Section
288 \begin_inset Flex CharStyle:Code
291 \begin_layout Plain Layout
300 \begin_layout Standard
301 \begin_inset Flex CharStyle:Code
304 \begin_layout Plain Layout
310 and its sub-directories contain a number of files and that can be used
311 to customize LyX's behavior.
312 You can change many of these files from within LyX itself through the
313 \begin_inset Flex CharStyle:MenuItem
316 \begin_layout Plain Layout
317 Tools\SpecialChar \menuseparator
324 Most customization that you will want to do in LyX is possible through
326 However, many other inner aspects of LyX can be customized by modifying
328 \begin_inset Flex CharStyle:Code
331 \begin_layout Plain Layout
338 These files fall in different categories, described in the following subsection
342 \begin_layout Subsection
343 Automatically generated files
346 \begin_layout Standard
347 The files, which are to be found in
348 \begin_inset Flex CharStyle:MenuItem
351 \begin_layout Plain Layout
357 , are generated when you configure LyX.
358 They contain various default values that are guessed by inspection.
359 In general, it is not a good idea to modify them, since they might be overwritt
363 \begin_layout Labeling
364 \labelwidthstring 00.00.0000
365 \begin_inset Flex CharStyle:Code
368 \begin_layout Plain Layout
374 contains defaults for various commands.
377 \begin_layout Labeling
378 \labelwidthstring 00.00.0000
379 \begin_inset Flex CharStyle:Code
382 \begin_layout Plain Layout
388 contains the list of packages that have been recognized by LyX.
389 It is currently unused by the LyX program itself, but the information extracted
390 , and more, is made available with
391 \begin_inset Flex CharStyle:MenuItem
394 \begin_layout Plain Layout
395 Help\SpecialChar \menuseparator
408 \begin_layout Labeling
409 \labelwidthstring 00.00.0000
410 \begin_inset Flex CharStyle:Code
413 \begin_layout Plain Layout
419 the list of text classes that have been found in your
420 \begin_inset Flex CharStyle:Code
423 \begin_layout Plain Layout
429 directories, along with the associated LaTeX document class and their descripti
433 \begin_layout Labeling
434 \labelwidthstring 00.00.0000
435 \begin_inset Flex CharStyle:Code
438 \begin_layout Plain Layout
444 the list of layout modules found in your
445 \begin_inset Flex CharStyle:Code
448 \begin_layout Plain Layout
457 \begin_layout Labeling
458 \labelwidthstring 00.00.0000
459 \begin_inset Flex CharStyle:Code
462 \begin_layout Plain Layout
468 lists of various sorts of LaTeX-related files found on your system
471 \begin_layout Labeling
472 \labelwidthstring 00.00.0000
473 \begin_inset Flex CharStyle:Code
476 \begin_layout Plain Layout
482 is automatically generated during configuration from the file
483 \begin_inset Flex CharStyle:Code
486 \begin_layout Plain Layout
493 It contains information on your LaTeX configuration.
496 \begin_layout Subsection
500 \begin_layout Standard
501 These directories are duplicated between
502 \begin_inset Flex CharStyle:Code
505 \begin_layout Plain Layout
512 \begin_inset Flex CharStyle:Code
515 \begin_layout Plain Layout
522 If a particular files exists in both places, the one in
523 \begin_inset Flex CharStyle:Code
526 \begin_layout Plain Layout
535 \begin_layout Labeling
536 \labelwidthstring 00.00.0000
537 \begin_inset Flex CharStyle:Code
540 \begin_layout Plain Layout
546 this directory contains files with the extension
547 \begin_inset Flex CharStyle:Code
550 \begin_layout Plain Layout
556 that define the keybindings used in LyX.
557 If there exists an internationalized version of the bind file named
558 \begin_inset Flex CharStyle:Code
561 \begin_layout Plain Layout
567 , that will be used first.
570 \begin_layout Labeling
571 \labelwidthstring 00.00.0000
572 \begin_inset Flex CharStyle:Code
575 \begin_layout Plain Layout
581 contains graphics files that can be included in documents.
585 \begin_layout Labeling
586 \labelwidthstring 00.00.0000
587 \begin_inset Flex CharStyle:Code
590 \begin_layout Plain Layout
596 contains LyX documentation files (including the one you are currently reading).
598 \begin_inset Flex CharStyle:Code
601 \begin_layout Plain Layout
607 deserves special attention, as noted above.
608 The internationalized help docs are in subdirectories
609 \begin_inset Flex CharStyle:Code
612 \begin_layout Plain Layout
619 \begin_inset Quotes eld
623 \begin_inset Quotes erd
626 is the ISO language code.
632 \begin_inset CommandInset ref
634 reference "cha:Internationalizing-LyX"
641 \begin_layout Labeling
642 \labelwidthstring 00.00.0000
643 \begin_inset Flex CharStyle:Code
646 \begin_layout Plain Layout
652 contains example files that explain how to use some features.
653 In the file browser, press the
654 \begin_inset Flex CharStyle:MenuItem
657 \begin_layout Plain Layout
666 \begin_layout Labeling
667 \labelwidthstring 00.00.0000
668 \begin_inset Flex CharStyle:Code
671 \begin_layout Plain Layout
677 contains image files that are used by the
678 \begin_inset Flex CharStyle:MenuItem
681 \begin_layout Plain Layout
688 In addition, it also contains the individual icons used in the toolbar
689 and the banners that can be shown when LyX is launched.
692 \begin_layout Labeling
693 \labelwidthstring 00.00.0000
694 \begin_inset Flex CharStyle:Code
697 \begin_layout Plain Layout
703 contains keyboard keymapping files.
709 \begin_inset CommandInset ref
711 reference "sec:International-Keymap-Stuff"
718 \begin_layout Labeling
719 \labelwidthstring 00.00.0000
720 \begin_inset Flex CharStyle:Code
723 \begin_layout Plain Layout
729 contains the text class and module files described in Chapter
734 \begin_inset CommandInset ref
736 reference "cha:Installing-New-Document"
743 \begin_layout Labeling
744 \labelwidthstring 00.00.0000
745 \begin_inset Flex CharStyle:Code
748 \begin_layout Plain Layout
755 \begin_inset Flex CharStyle:Code
758 \begin_layout Plain Layout
764 Python scripts used to convert between LyX versions.
765 These can be run from the command line if, say, you want to batch-convert
769 \begin_layout Labeling
770 \labelwidthstring 00.00.0000
771 \begin_inset Flex CharStyle:Code
774 \begin_layout Plain Layout
780 contains some files that demonstrate the capabilities of the
781 \begin_inset Flex CharStyle:MenuItem
784 \begin_layout Plain Layout
795 Also contains some scripts used by LyX itself.
798 \begin_layout Labeling
799 \labelwidthstring 00.00.0000
800 \begin_inset Flex CharStyle:Code
803 \begin_layout Plain Layout
809 contains the standard LyX template files described in Chapter
814 \begin_inset CommandInset ref
816 reference "sub:Creating-Templates"
823 \begin_layout Labeling
824 \labelwidthstring 00.00.0000
825 \begin_inset Flex CharStyle:Code
828 \begin_layout Plain Layout
834 contains files with the extension
835 \begin_inset Flex CharStyle:Code
838 \begin_layout Plain Layout
844 that define the user interface to LyX.
845 That is, the files define which items appear in which menus and the items
846 appearing on the toolbar.
849 \begin_layout Subsection
850 Files you don't want to modify
853 \begin_layout Standard
854 These files are used internally by LyX and you generally do not need to
855 modify them unless you are a developer.
858 \begin_layout Labeling
859 \labelwidthstring 00.00.0000
860 \begin_inset Flex CharStyle:Code
863 \begin_layout Plain Layout
869 this file contains the list of LyX developers.
870 The contents are displayed with the menu entry
871 \begin_inset Flex CharStyle:MenuItem
874 \begin_layout Plain Layout
875 Help\SpecialChar \menuseparator
888 \begin_layout Labeling
889 \labelwidthstring 00.00.0000
890 \begin_inset Flex CharStyle:Code
893 \begin_layout Plain Layout
899 this is a LaTeX script used during the configuration process.
903 \begin_layout Labeling
904 \labelwidthstring 00.00.0000
905 \begin_inset Flex CharStyle:Code
908 \begin_layout Plain Layout
914 this is the script that is used to re-configure LyX.
915 It creates configuration files in the directory it was run from.
918 \begin_layout Subsection
919 Other files needing a line or two...
922 \begin_layout Labeling
923 \labelwidthstring 00.00.0000
924 \begin_inset Flex CharStyle:Code
927 \begin_layout Plain Layout
933 this contains tables describing how different character encodings can be
937 \begin_layout Labeling
938 \labelwidthstring 00.00.0000
939 \begin_inset Flex CharStyle:Code
942 \begin_layout Plain Layout
948 this file contains the templates available to the new
949 \begin_inset Flex CharStyle:MenuItem
952 \begin_layout Plain Layout
965 \begin_layout Labeling
966 \labelwidthstring 00.00.0000
967 \begin_inset Flex CharStyle:Code
970 \begin_layout Plain Layout
976 this file contains a list of all the languages currently supported by LyX.
979 \begin_layout Section
980 Your local configuration directory
983 \begin_layout Standard
984 Even if you are using LyX as an unprivileged user, you might want to change
985 LyX configuration for your own use.
987 \begin_inset Flex CharStyle:Code
990 \begin_layout Plain Layout
996 directory contains all your personal configuration files.
997 This is the directory described as
998 \begin_inset Quotes eld
1002 \begin_inset Quotes erd
1006 \begin_inset Flex CharStyle:MenuItem
1009 \begin_layout Plain Layout
1010 Help\SpecialChar \menuseparator
1012 \begin_inset space ~
1021 This directory is used as a mirror of
1022 \begin_inset Flex CharStyle:Code
1025 \begin_layout Plain Layout
1031 , which means that every file in
1032 \begin_inset Flex CharStyle:Code
1035 \begin_layout Plain Layout
1041 is a replacement for the corresponding file in
1042 \begin_inset Flex CharStyle:Code
1045 \begin_layout Plain Layout
1052 Any configuration file described in the above sections can be placed either
1053 in the system-wide directory, in which case it will affect all users, or
1054 in your local directory for your own use.
1057 \begin_layout Standard
1058 To make things clearer, let's provide a few examples:
1061 \begin_layout Itemize
1062 The preferences set in the
1063 \begin_inset Flex CharStyle:MenuItem
1066 \begin_layout Plain Layout
1067 Tools\SpecialChar \menuseparator
1073 dialog are saved to a file
1074 \begin_inset Flex CharStyle:Code
1077 \begin_layout Plain Layout
1084 \begin_inset Flex CharStyle:Code
1087 \begin_layout Plain Layout
1096 \begin_layout Itemize
1097 When you reconfigure using
1098 \begin_inset Flex CharStyle:MenuItem
1101 \begin_layout Plain Layout
1102 Tools\SpecialChar \menuseparator
1109 \begin_inset Flex CharStyle:Code
1112 \begin_layout Plain Layout
1118 script, and the resulting files are written in your local configuration
1120 This means that any additional text class file that you might have added
1122 \begin_inset Flex CharStyle:Code
1125 \begin_layout Plain Layout
1131 will be added to the list of classes in the
1132 \begin_inset Flex CharStyle:MenuItem
1135 \begin_layout Plain Layout
1136 Document\SpecialChar \menuseparator
1145 \begin_layout Itemize
1146 If you get some updated documentation from LyX ftp site and cannot install
1147 it because you do not have sysadmin rights on your system, you can just
1149 \begin_inset Flex CharStyle:Code
1152 \begin_layout Plain Layout
1158 and the items in the
1159 \begin_inset Flex CharStyle:MenuItem
1162 \begin_layout Plain Layout
1168 menu will open them!
1171 \begin_layout Section
1172 Running LyX with multiple configurations
1175 \begin_layout Standard
1176 The configuration freedom of the local configuration directory may not suffice
1177 if you want to have more than one configuration at your disposal.
1178 For example, you may want to be use different key bindings or printer settings
1180 You can achieve this by having several such directories.
1181 You then specify which directory to use at run-time.
1184 \begin_layout Standard
1185 Invoking LyX with the command line switch
1186 \begin_inset Flex CharStyle:Code
1189 \begin_layout Plain Layout
1199 instructs the program to read the configuration from that directory, and
1200 not from the default directory.
1201 (You can determine the default directory by running LyX without the
1202 \begin_inset Flex CharStyle:Code
1205 \begin_layout Plain Layout
1211 switch.) If the specified directory does not exist, LyX offers to create
1212 it for you, just like it does for the default directory on the first time
1213 you run the program.
1214 You can modify the configuration options in this additional user directory
1215 exactly as you would for the default directory.
1216 These directories are completely independent (but read on).
1217 Note that setting the environment variable
1218 \begin_inset Flex CharStyle:Code
1221 \begin_layout Plain Layout
1227 to some value has exactly the same effect.
1230 \begin_layout Standard
1231 Having several configurations also requires more maintenance: if you want
1232 to add a new layout to
1233 \begin_inset Flex CharStyle:Code
1236 \begin_layout Plain Layout
1242 which you want available from all your configurations, you must add it
1243 to each directory separately.
1244 You can avoid this with the following trick: after LyX creates the additional
1245 directory, most of the subdirectories (see above) are empty.
1246 If you want the new configuration to mirror an existing one, replace the
1247 empty subdirectory with a symbolic link to the matching subdirectory in
1248 the existing configuration.
1250 \begin_inset Flex CharStyle:Code
1253 \begin_layout Plain Layout
1259 subdirectory, however, since it contains a file written by the configuration
1260 script (also accessible through
1261 \begin_inset Flex CharStyle:MenuItem
1264 \begin_layout Plain Layout
1265 Tools\SpecialChar \menuseparator
1271 ) which is configuration-specific.
1274 \begin_layout Chapter
1275 The Preferences dialog
1278 \begin_layout Standard
1279 All options of the preferences dialog are described in the Appendix
1281 The Preferences Dialog
1288 For some options you might find here more details.
1291 \begin_layout Section
1293 \begin_inset CommandInset label
1302 \begin_layout Standard
1303 The first step is to define your file formats if they are not already defined.
1305 \begin_inset Flex CharStyle:MenuItem
1308 \begin_layout Plain Layout
1309 Tools\SpecialChar \menuseparator
1317 \begin_inset Flex CharStyle:MenuItem
1320 \begin_layout Plain Layout
1321 File Handling\SpecialChar \menuseparator
1328 \begin_inset Flex CharStyle:MenuItem
1331 \begin_layout Plain Layout
1332 New\SpecialChar \ldots{}
1338 button to define your new format.
1340 \begin_inset Flex CharStyle:MenuItem
1343 \begin_layout Plain Layout
1349 field contains the name used to identify the format in the GUI.
1351 \begin_inset Flex CharStyle:MenuItem
1354 \begin_layout Plain Layout
1360 is used to identify the format internally.
1361 You will also need to enter a file extension.
1362 These are all required.
1364 \begin_inset Flex CharStyle:MenuItem
1367 \begin_layout Plain Layout
1373 field is used to provide a keyboard shortcut on the menus.
1374 (For example, pressing
1375 \begin_inset Flex CharStyle:MenuItem
1378 \begin_layout Plain Layout
1385 \begin_inset Flex CharStyle:MenuItem
1388 \begin_layout Plain Layout
1389 View\SpecialChar \menuseparator
1398 \begin_layout Standard
1400 \begin_inset Flex CharStyle:MenuItem
1403 \begin_layout Plain Layout
1410 \begin_inset Flex CharStyle:MenuItem
1413 \begin_layout Plain Layout
1420 For example, you might want to use
1421 \begin_inset Flex CharStyle:MenuItem
1424 \begin_layout Plain Layout
1430 to view PostScript files.
1431 You can enter the command needed to start the program in the corresponding
1433 In defining this command, you can use the four variables listed in the
1435 The viewer is launched when you view an image in LyX or use the
1436 \begin_inset Flex CharStyle:MenuItem
1439 \begin_layout Plain Layout
1446 The editor is for example launched when you right-click on an image and
1448 \begin_inset Flex CharStyle:MenuItem
1451 \begin_layout Plain Layout
1457 in the appearing context menu.
1460 \begin_layout Standard
1462 \begin_inset Flex CharStyle:MenuItem
1465 \begin_layout Plain Layout
1471 option tells LyX that a format is suitable for document export.
1472 If this is set and if a suitable conversion route exists (see sec.
1473 \begin_inset space \thinspace{}
1477 \begin_inset CommandInset ref
1479 reference "sec:Converters"
1483 ), the format will appear in the
1484 \begin_inset Flex CharStyle:MenuItem
1487 \begin_layout Plain Layout
1488 File\SpecialChar \menuseparator
1495 The format will also appear in the
1496 \begin_inset Flex CharStyle:MenuItem
1499 \begin_layout Plain Layout
1505 menu if a viewer is specified for the format.
1506 Pure image formats, such as
1507 \begin_inset Flex CharStyle:Code
1510 \begin_layout Plain Layout
1516 , should not use this option.
1517 Formats that can both represent vector graphics and documents like
1518 \begin_inset Flex CharStyle:Code
1521 \begin_layout Plain Layout
1530 \begin_layout Standard
1532 \begin_inset Flex CharStyle:MenuItem
1535 \begin_layout Plain Layout
1536 Vector graphics format
1541 tells LyX that a format can contain vector graphics.
1542 This information is used to determine the target format of included graphics
1544 \begin_inset Flex CharStyle:MenuItem
1547 \begin_layout Plain Layout
1554 Included graphics may need to be converted to either
1555 \begin_inset Flex CharStyle:MenuItem
1558 \begin_layout Plain Layout
1565 \begin_inset Flex CharStyle:MenuItem
1568 \begin_layout Plain Layout
1575 \begin_inset Flex CharStyle:MenuItem
1578 \begin_layout Plain Layout
1585 \begin_inset Flex CharStyle:MenuItem
1588 \begin_layout Plain Layout
1594 cannot handle other image formats.
1595 If an included graphic is not already in
1596 \begin_inset Flex CharStyle:MenuItem
1599 \begin_layout Plain Layout
1606 \begin_inset Flex CharStyle:MenuItem
1609 \begin_layout Plain Layout
1616 \begin_inset Flex CharStyle:MenuItem
1619 \begin_layout Plain Layout
1625 format, it is converted to
1626 \begin_inset Flex CharStyle:MenuItem
1629 \begin_layout Plain Layout
1635 if the vector format option is set, and otherwise to
1636 \begin_inset Flex CharStyle:MenuItem
1639 \begin_layout Plain Layout
1648 \begin_layout Section
1652 \begin_layout Standard
1653 Since all conversions from one format to another take place in LyX's temporary
1654 directory, it is sometimes necessary to modify a file before copying it
1655 to the temporary directory in order that the conversion may be performed.
1659 \begin_layout Plain Layout
1660 For example, the file may refer to other files—images, for example—using
1661 relative file names, and these may become invalid when the file is copied
1662 to the temporary directory.
1667 This is done by a Copier: It copies a file to (or from) the temporary directory
1668 and may modify it in the process.
1671 \begin_layout Standard
1672 The definitions of the copiers may use four variables:
1675 \begin_layout Labeling
1676 \labelwidthstring 00.00.0000
1677 \begin_inset Flex CharStyle:Code
1680 \begin_layout Plain Layout
1686 The LyX system directory (e.
1687 \begin_inset space \thinspace{}
1691 \begin_inset space \space{}
1695 \begin_inset Flex CharStyle:MenuItem
1698 \begin_layout Plain Layout
1707 \begin_layout Labeling
1708 \labelwidthstring 00.00.0000
1709 \begin_inset Flex CharStyle:Code
1712 \begin_layout Plain Layout
1721 \begin_layout Labeling
1722 \labelwidthstring 00.00.0000
1723 \begin_inset Flex CharStyle:Code
1726 \begin_layout Plain Layout
1735 \begin_layout Labeling
1736 \labelwidthstring 00.00.0000
1737 \begin_inset Flex CharStyle:Code
1740 \begin_layout Plain Layout
1749 \begin_layout Standard
1750 The latter should be the filename as it would be used in a LaTeX's
1757 It is relevant only when exporting files suitable for such inclusion.
1760 \begin_layout Standard
1761 Copiers can be used to do almost anything with output files.
1762 For example, suppose you want generated pdf files to be copied to a special
1764 \begin_inset Flex CharStyle:Code
1767 \begin_layout Plain Layout
1774 Then you could write a shell script such as this one:
1777 \begin_layout Standard
1778 \begin_inset listings
1782 \begin_layout Plain Layout
1787 \begin_layout Plain Layout
1792 \begin_layout Plain Layout
1794 TOFILE=`basename $2`
1797 \begin_layout Plain Layout
1799 cp $FROMFILE /home/you/pdf/$TOFILE
1804 Save it in your local LyX directory—say,
1805 \begin_inset Flex CharStyle:Code
1808 \begin_layout Plain Layout
1809 /home/you/.lyx/scripts/pdfcopier.sh
1814 —and make it executable, if you need to do so on your platform.
1816 \begin_inset Flex CharStyle:MenuItem
1819 \begin_layout Plain Layout
1820 Tools\SpecialChar \menuseparator
1826 dialog, select under
1827 \begin_inset Flex CharStyle:MenuItem
1830 \begin_layout Plain Layout
1831 File Handling\SpecialChar \menuseparator
1838 \begin_inset Flex CharStyle:MenuItem
1841 \begin_layout Plain Layout
1847 format—or one of the other pdf formats—and enter
1848 \begin_inset Flex CharStyle:Code
1851 \begin_layout Plain Layout
1852 pdfcopier.sh $$i $$o
1858 \begin_inset Flex CharStyle:MenuItem
1861 \begin_layout Plain Layout
1871 \begin_layout Standard
1872 Copiers are used by LyX in various of its own conversions.
1873 For example, if appropriate programs are found, LyX will automatically
1874 install copiers for the
1875 \begin_inset Flex CharStyle:MenuItem
1878 \begin_layout Plain Layout
1885 \begin_inset Flex CharStyle:MenuItem
1888 \begin_layout Plain Layout
1890 \begin_inset space ~
1899 When these formats are exported, the copier sees that not just the main
1900 HTML file but various associated files (style files, images, etc.) are also
1902 All these files are written to a subdirectory of the directory in which
1903 the original LyX file was found.
1907 \begin_layout Plain Layout
1908 This copier can be customized.
1910 \begin_inset Quotes eld
1914 \begin_inset Quotes erd
1917 argument takes a comma-separated list of extensions to be copied; if it
1918 is omitted, all files will be copied.
1920 \begin_inset Quotes eld
1924 \begin_inset Quotes erd
1927 argument determines the extension added to the generated directory.
1929 \begin_inset Quotes eld
1933 \begin_inset Flex CharStyle:MenuItem
1936 \begin_layout Plain Layout
1943 \begin_inset Quotes erd
1946 , so HTML generated from
1947 \begin_inset Flex CharStyle:MenuItem
1950 \begin_layout Plain Layout
1951 /path/to/filename.lyx
1957 \begin_inset Flex CharStyle:MenuItem
1960 \begin_layout Plain Layout
1961 /path/to/filename.html.LyXconv
1975 \begin_layout Section
1977 \begin_inset CommandInset label
1979 name "sec:Converters"
1986 \begin_layout Standard
1987 You can define your own Converters to convert files between different formats.
1989 \begin_inset Flex CharStyle:MenuItem
1992 \begin_layout Plain Layout
1993 Tools\SpecialChar \menuseparator
1994 Preferences\SpecialChar \menuseparator
1995 File Handling\SpecialChar \menuseparator
2004 \begin_layout Standard
2005 To define a new converter, select the
2006 \begin_inset Flex CharStyle:MenuItem
2009 \begin_layout Plain Layout
2011 \begin_inset space ~
2020 \begin_inset Flex CharStyle:MenuItem
2023 \begin_layout Plain Layout
2025 \begin_inset space ~
2033 from the drop-down lists, enter the command needed for the conversion,
2035 \begin_inset Flex CharStyle:MenuItem
2038 \begin_layout Plain Layout
2045 Several variables can be used in the definition of converters:
2048 \begin_layout Labeling
2049 \labelwidthstring 00.00.0000
2050 \begin_inset Flex CharStyle:Code
2053 \begin_layout Plain Layout
2059 The LyX system directory
2062 \begin_layout Labeling
2063 \labelwidthstring 00.00.0000
2064 \begin_inset Flex CharStyle:Code
2067 \begin_layout Plain Layout
2076 \begin_layout Labeling
2077 \labelwidthstring 00.00.0000
2078 \begin_inset Flex CharStyle:Code
2081 \begin_layout Plain Layout
2090 \begin_layout Labeling
2091 \labelwidthstring 00.00.0000
2092 \begin_inset Flex CharStyle:Code
2095 \begin_layout Plain Layout
2101 The base filename of the input file (i.
2102 \begin_inset space \thinspace{}
2105 g., without the extension)
2108 \begin_layout Labeling
2109 \labelwidthstring 00.00.0000
2110 \begin_inset Flex CharStyle:Code
2113 \begin_layout Plain Layout
2119 The path to the input file
2122 \begin_layout Labeling
2123 \labelwidthstring 00.00.0000
2124 \begin_inset Flex CharStyle:Code
2127 \begin_layout Plain Layout
2133 The path to the original input file (this is different from $$p when a
2134 chain of converters is called).
2137 \begin_layout Standard
2139 \begin_inset Flex CharStyle:MenuItem
2142 \begin_layout Plain Layout
2144 \begin_inset space ~
2152 field you can enter the following flags, separated by commas:
2155 \begin_layout Labeling
2156 \labelwidthstring 00.00.0000
2157 \begin_inset Flex CharStyle:Code
2160 \begin_layout Plain Layout
2166 This converter runs some form of LaTeX.
2167 This will make LyX's LaTeX error logs available.
2170 \begin_layout Labeling
2171 \labelwidthstring 00.00.0000
2172 \begin_inset Flex CharStyle:Code
2175 \begin_layout Plain Layout
2182 \begin_inset Flex CharStyle:MenuItem
2185 \begin_layout Plain Layout
2191 file for the conversion.
2194 \begin_layout Labeling
2195 \labelwidthstring 00.00.0000
2196 \begin_inset Flex CharStyle:Code
2199 \begin_layout Plain Layout
2208 \begin_layout Standard
2209 The following three flags are not really flags at all because they take
2211 \begin_inset Flex CharStyle:MenuItem
2214 \begin_layout Plain Layout
2216 \begin_inset space ~
2220 \begin_inset space ~
2231 \begin_layout Labeling
2232 \labelwidthstring 00.00.0000
2233 \begin_inset Flex CharStyle:Code
2236 \begin_layout Plain Layout
2242 If set, the converter's standard error will be redirected to a file
2243 \begin_inset Flex CharStyle:Code
2246 \begin_layout Plain Layout
2252 , and the script given as argument will be run as:
2253 \begin_inset Flex CharStyle:Code
2256 \begin_layout Plain Layout
2257 script < infile.out > infile.log
2263 The argument may contain
2264 \begin_inset Flex CharStyle:Code
2267 \begin_layout Plain Layout
2276 \begin_layout Labeling
2277 \labelwidthstring 00.00.0000
2278 \begin_inset Flex CharStyle:Code
2281 \begin_layout Plain Layout
2287 The name of the directory in which the converter will dump the generated
2289 LyX will not create this directory, and it does not copy anything into
2290 it, though it will copy this directory to the destination.
2291 The argument may contain
2292 \begin_inset Flex CharStyle:Code
2295 \begin_layout Plain Layout
2301 , which will be replaced by the base name of the input and output files,
2302 respectively, when the directory is copied.
2303 \begin_inset Newline newline
2306 Note that resultdir and usetempdir make no sense together.
2307 The latter will be ignored if the former is given.
2310 \begin_layout Labeling
2311 \labelwidthstring 00.00.0000
2312 \begin_inset Flex CharStyle:Code
2315 \begin_layout Plain Layout
2321 Determines the output file name and may, contain
2322 \begin_inset Flex CharStyle:Code
2325 \begin_layout Plain Layout
2332 Sensible only with resultdir and optional even then; if not given, it defaults
2336 \begin_layout Standard
2337 None of these last three are presently used in any of the converters that
2338 are installed with LyX.
2342 \begin_layout Standard
2343 You do not have to define converters for all formats between which you want
2345 For example, you will note that there is no `LyX to PostScript' converter,
2346 but LyX will export PostScript.
2347 It does so by first creating a LaTeX file (no converter needs to be defined
2348 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2349 and finally converting the resulting DVI file to PostScript.
2350 LyX finds such `chains' of converters automatically, and it will always
2351 choose the shortest possible chain.
2352 You can, though, still define multiple conversion methods between file
2354 For example, the standard LyX configuration provides three ways to convert
2355 LaTeX to PDF: Directly, using
2356 \begin_inset Flex CharStyle:MenuItem
2359 \begin_layout Plain Layout
2365 ; via (DVI and) PostScript, using
2366 \begin_inset Flex CharStyle:MenuItem
2369 \begin_layout Plain Layout
2376 \begin_inset Flex CharStyle:MenuItem
2379 \begin_layout Plain Layout
2386 To define such alternate chains, you must define multiple target `file
2387 formats', as described in section
2388 \begin_inset CommandInset ref
2390 reference "sec:Formats"
2395 For example, in the standard configuration, the formats named
2396 \begin_inset Flex CharStyle:MenuItem
2399 \begin_layout Plain Layout
2406 \begin_inset Flex CharStyle:MenuItem
2409 \begin_layout Plain Layout
2416 \begin_inset Flex CharStyle:MenuItem
2419 \begin_layout Plain Layout
2425 are defined, all of which share the extension
2426 \begin_inset Flex CharStyle:MenuItem
2429 \begin_layout Plain Layout
2435 , and which correspond to the conversion methods just mentioned.
2438 \begin_layout Chapter
2439 Internationalizing LyX
2440 \begin_inset CommandInset label
2442 name "cha:Internationalizing-LyX"
2449 \begin_layout Standard
2450 LyX supports using a translated interface.
2451 Last time we checked, LyX provided text in thirty languages.
2452 The language of choice is called your
2457 (For further reading on locale settings, see also the documentation for
2458 locale that comes with your operating system.
2459 For Linux, the manual page for
2460 \begin_inset Flex CharStyle:Code
2463 \begin_layout Plain Layout
2469 could be a good place to start).
2472 \begin_layout Standard
2473 Notice that these translations will work, but do contain a few flaws.
2474 In particular, all dialogs have been designed with the English text in
2475 mind, which means that some of the translated text will be too large to
2476 fit within the space allocated.
2477 This is only a display problem and will not cause any harm.
2478 Also, you will find that some of the translations do not define shortcut
2479 keys for everything.
2480 Sometimes, there are simply not enough free letters to do it.
2481 Other times, the translator just hasn't got around to doing it yet.
2482 Our localization team, which you may wish to join,
2486 \begin_layout Plain Layout
2487 If you are a fluent speaker of a language other than English, joining these
2488 teams is a great way to give back to the LyX community!
2493 will of course try to fix these shortcomings in future versions of LyX.
2496 \begin_layout Section
2500 \begin_layout Subsection
2501 Translating the graphical user interface (text messages).
2504 \begin_layout Standard
2506 \begin_inset Flex CharStyle:Code
2509 \begin_layout Plain Layout
2515 library to handle the internationalization of the interface.
2516 To have LyX speak your favorite language in all menus and dialogs, you
2518 \begin_inset Flex CharStyle:Code
2521 \begin_layout Plain Layout
2527 -file for that language.
2528 When this is available, you'll have to generate a
2529 \begin_inset Flex CharStyle:Code
2532 \begin_layout Plain Layout
2538 -file from it and install the
2539 \begin_inset Flex CharStyle:Code
2542 \begin_layout Plain Layout
2549 The process of doing all of this is explained in the documentation for
2551 \begin_inset Flex CharStyle:Code
2554 \begin_layout Plain Layout
2561 It is possible to do this just for yourself, but if you're going to do
2562 it, you might as well share the results of your labors with the rest of
2564 Send a message to the LyX developers' list for more information about how
2568 \begin_layout Standard
2569 In short, this is what you should do (xx denotes the language code):
2572 \begin_layout Itemize
2573 Check out the LyX source code.
2575 \begin_inset CommandInset href
2577 name "information on the web"
2578 target "http://www.lyx.org/devel/cvs.php"
2585 \begin_layout Itemize
2587 \begin_inset Flex CharStyle:Code
2590 \begin_layout Plain Layout
2596 to the folder of the
2597 \begin_inset Flex CharStyle:Code
2600 \begin_layout Plain Layout
2608 \begin_inset Flex CharStyle:Code
2611 \begin_layout Plain Layout
2619 \begin_inset Flex CharStyle:Code
2622 \begin_layout Plain Layout
2628 doesn't exist anywhere, it can be remade with the console command
2629 \begin_inset Flex CharStyle:Code
2632 \begin_layout Plain Layout
2638 in that directory, or you can use an existing po-file for some other language
2642 \begin_layout Itemize
2644 \begin_inset Flex CharStyle:Code
2647 \begin_layout Plain Layout
2657 \begin_layout Plain Layout
2658 This is just a text file, so it can be edited in any text editor.
2659 But there are also specialized programs that support such editing, such
2664 (for all platforms) or
2673 contains a `mode' for editing
2674 \begin_inset Flex CharStyle:Code
2677 \begin_layout Plain Layout
2688 For some menu- and widget-labels, there are also shortcut keys that should
2690 Those keys are marked after a `|', and should be translated according to
2691 the words and phrases of the language.
2692 You should also fill also out the information at the beginning of the new
2694 \begin_inset Flex CharStyle:Code
2697 \begin_layout Plain Layout
2703 -file with your email-address, etc., so people know where to reach you with
2704 suggestions and entertaining flames.
2707 \begin_layout Standard
2708 If you are just doing this on your own, then:
2711 \begin_layout Itemize
2713 \begin_inset Flex CharStyle:Code
2716 \begin_layout Plain Layout
2723 This can be done with
2724 \begin_inset Flex CharStyle:Code
2727 \begin_layout Plain Layout
2728 msgfmt -o xx.mo < xx.po
2736 \begin_layout Itemize
2738 \begin_inset Flex CharStyle:Code
2741 \begin_layout Plain Layout
2747 -file to your locale-tree, at the correct directory for application messages
2752 xx, and under the name
2753 \begin_inset Flex CharStyle:Code
2756 \begin_layout Plain Layout
2763 \begin_inset space \thinspace{}
2767 \begin_inset space \space{}
2771 \begin_inset Flex CharStyle:Code
2774 \begin_layout Plain Layout
2775 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2785 \begin_layout Standard
2786 As said, however, it would be best if the new
2787 \begin_inset Flex CharStyle:Code
2790 \begin_layout Plain Layout
2796 -file could be added to the LyX distribution, so others can use it.
2797 Adding it involves making additional changes to LyX.
2798 So send an email to the developers' mailing list if you're interested in
2802 \begin_layout Subsubsection
2806 \begin_layout Standard
2807 Sometimes it turns out that one English message needs to be translated into
2808 different messages in the target language.
2809 One example is the message
2810 \begin_inset Flex CharStyle:Code
2813 \begin_layout Plain Layout
2819 which has the German translation
2827 , depending upon exactly what the English
2828 \begin_inset Quotes eld
2832 \begin_inset Quotes erd
2837 \begin_inset Flex CharStyle:Code
2840 \begin_layout Plain Layout
2846 does not handle such ambiguous translations.
2847 Therefore you have to add some context information to the message: Instead
2849 \begin_inset Flex CharStyle:Code
2852 \begin_layout Plain Layout
2859 \begin_inset Flex CharStyle:Code
2862 \begin_layout Plain Layout
2863 To[[as in 'From format x to format y']]
2869 \begin_inset Flex CharStyle:Code
2872 \begin_layout Plain Layout
2873 To[[as in 'From page x to page y']].
2878 Now the two occurrences of
2879 \begin_inset Flex CharStyle:Code
2882 \begin_layout Plain Layout
2889 \begin_inset Flex CharStyle:Code
2892 \begin_layout Plain Layout
2898 and can be translated correctly to
2909 \begin_layout Standard
2910 Of course the context information needs to be stripped off the original
2911 message when no translation is used.
2912 Therefore you have to put it in double square brackets at the end of the
2913 message (see the example above).
2914 The translation mechanism of LyX ensures that everything in double square
2915 brackets at the end of messages is removed before displaying the message.
2918 \begin_layout Subsection
2919 Translating the documentation.
2922 \begin_layout Standard
2923 The online documentation (in the
2924 \begin_inset Flex CharStyle:MenuItem
2927 \begin_layout Plain Layout
2933 -menu) can (and should!) be translated.
2934 If there are translated versions of the documentation available
2938 \begin_layout Plain Layout
2939 As of March 2008, at least some of the documents have been translated into
2940 fourteen languages, with the Tutorial available in a few more.
2945 and the locale is set accordingly, these will be used automagically by
2947 LyX looks for translated versions as
2948 \begin_inset Flex CharStyle:Code
2951 \begin_layout Plain Layout
2952 LyXDir/doc/xx/DocName.lyx
2958 \begin_inset Flex CharStyle:Code
2961 \begin_layout Plain Layout
2967 is the code for the language currently in use.
2968 If there are no translated documents, the default English versions will
2970 Note that the translated versions must have the same filenames (
2971 \begin_inset Flex CharStyle:Code
2974 \begin_layout Plain Layout
2980 above) as the original.
2981 If you feel up to translating the documentation (an excellent way to proof-read
2982 the original documentation by the way!), there are a few things you should
2986 \begin_layout Itemize
2987 Check out the documentation translation web page at
2988 \begin_inset CommandInset href
2990 name "http://www.lyx.org/Translation"
2991 target "http://www.lyx.org/Translation"
2996 That way, you can find out which (if any) documents have already been translate
2997 d into your language.
2998 You can also find out who (if anyone) is organizing the effort to translate
2999 the documentation into your language.
3000 If no one is organizing the effort, please let us know that you're interested.
3003 \begin_layout Standard
3004 Once you get to actually translating, here's a few hints for you that may
3008 \begin_layout Itemize
3009 Join the documentation team! There is information on how to do that in
3010 \begin_inset Flex CharStyle:Code
3013 \begin_layout Plain Layout
3020 \begin_inset Flex CharStyle:MenuItem
3023 \begin_layout Plain Layout
3024 Help\SpecialChar \menuseparator
3030 ), which by the way is the first document you should translate.
3033 \begin_layout Itemize
3034 Learn the typographic conventions for the language you are translating to.
3035 Typography is an ancient art and over the centuries, a great variety of
3036 conventions have developed throughout different parts of the world.
3037 Also study the professional terminology amongst typographers in your country.
3038 Inventing your own terminology will only confuse the users.
3041 (Warning! Typography is addictive!)
3044 \begin_layout Itemize
3045 Make a copy of the document.
3046 This will be your working copy.
3047 You can use this as your personal translated help-file by placing it in
3049 \begin_inset Flex CharStyle:Code
3052 \begin_layout Plain Layout
3061 \begin_layout Itemize
3062 Sometimes the original document (from the LyX-team) will be updated.
3063 Use the source viewer at
3064 \begin_inset CommandInset href
3066 name "http://www.lyx.org/trac/timeline"
3067 target "http://www.lyx.org/trac/timeline"
3071 to see what has been changed.
3072 That way you can easily see which parts of the translated document need
3076 \begin_layout Standard
3077 If you ever find an error in the original document, fix it and notify the
3078 rest of the documentation team of the changes! (You didn't forget to join
3079 the documentation team, did you?)
3082 \begin_layout Standard
3083 \begin_inset Branch OutDated
3086 \begin_layout Section
3087 International Keyboard Support
3090 \begin_layout Standard
3093 [Editor's Note: The following section is by
3101 It needs to be fixed to conform to the new Documentation Style sheet and
3102 to make use of the new v1.0 features.
3103 The whole thing also needs to be merged with the section following it.-jw
3104 It may also be badly out of date.-rh (2008)]
3107 \begin_layout Subsection
3108 Defining Own Keymaps: Keymap File Format
3111 \begin_layout Standard
3112 Let's look at a keyboard definition file a little closer.
3113 It is a plain text file defining
3116 \begin_layout Itemize
3117 key-to-key or key-to-string translations
3120 \begin_layout Itemize
3124 \begin_layout Itemize
3125 dead keys exceptions
3128 \begin_layout Standard
3129 To define key-to-key or key-to-string translation, use this command:
3132 \begin_layout Quotation
3133 \begin_inset Flex CharStyle:Code
3136 \begin_layout Plain Layout
3145 \begin_inset Flex CharStyle:Code
3148 \begin_layout Plain Layout
3157 \begin_layout Standard
3159 \begin_inset Flex CharStyle:Code
3162 \begin_layout Plain Layout
3168 is the key to be translated and
3169 \begin_inset Flex CharStyle:Code
3172 \begin_layout Plain Layout
3178 is the string to be inserted into the document.
3179 To define dead keys, use:
3182 \begin_layout Quotation
3183 \begin_inset Flex CharStyle:Code
3186 \begin_layout Plain Layout
3195 \begin_inset Flex CharStyle:Code
3198 \begin_layout Plain Layout
3207 \begin_layout Standard
3209 \begin_inset Flex CharStyle:Code
3212 \begin_layout Plain Layout
3218 is a keyboard key and
3219 \begin_inset Flex CharStyle:Code
3222 \begin_layout Plain Layout
3229 The following dead keys are supported (shortcut name is in parentheses):
3232 \begin_layout Quotation
3236 \begin_inset space \hfill{}
3242 \begin_layout Quotation
3244 \begin_inset space \hfill{}
3250 \begin_layout Quotation
3252 \begin_inset space \hfill{}
3258 \begin_layout Quotation
3260 \begin_inset space \hfill{}
3266 \begin_layout Quotation
3268 \begin_inset space \hfill{}
3274 \begin_layout Quotation
3276 \begin_inset space \hfill{}
3283 \begin_layout Plain Layout
3295 \begin_layout Quotation
3297 \begin_inset space \hfill{}
3303 \begin_layout Quotation
3305 \begin_inset space \hfill{}
3312 \begin_layout Plain Layout
3324 \begin_layout Quotation
3326 \begin_inset space \hfill{}
3332 \begin_layout Quotation
3334 \begin_inset space \hfill{}
3340 \begin_layout Quotation
3342 \begin_inset space \hfill{}
3349 \begin_layout Plain Layout
3361 \begin_layout Quotation
3363 \begin_inset space \hfill{}
3370 \begin_layout Plain Layout
3382 \begin_layout Quotation
3384 \begin_inset space \hfill{}
3390 \begin_layout Quotation
3391 hungarian umlaut (hug)
3392 \begin_inset space \hfill{}
3398 \begin_layout Quotation
3400 \begin_inset space \hfill{}
3406 \begin_layout Quotation
3408 \begin_inset space \hfill{}
3415 \begin_layout Plain Layout
3427 \begin_layout Standard
3428 Since in many international keyboards there are exceptions to what some
3429 dead keys should do, you can define them using
3432 \begin_layout Quotation
3433 \begin_inset Flex CharStyle:Code
3436 \begin_layout Plain Layout
3444 deadkey key outstring
3447 \begin_layout Standard
3448 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3452 \begin_layout Quotation
3453 \begin_inset Flex CharStyle:Code
3456 \begin_layout Plain Layout
3469 \begin_layout Standard
3470 to make it work correctly.
3471 Also, you have to define as exceptions dead keys over i and j, to remove
3472 the dot from them before inserting an accent mark.
3473 I will change this when the time comes, but so far I haven't had time.
3476 \begin_layout Standard
3477 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3480 \begin_inset Flex CharStyle:Code
3483 \begin_layout Plain Layout
3489 have different meaning.
3491 \begin_inset Flex CharStyle:Code
3494 \begin_layout Plain Layout
3500 marks comments, quotes start and end LaTeX-style commands.
3501 To enter quote, you'll need to use
3502 \begin_inset Flex CharStyle:Code
3505 \begin_layout Plain Layout
3514 \begin_inset Flex CharStyle:Code
3517 \begin_layout Plain Layout
3524 \begin_inset Flex CharStyle:Code
3527 \begin_layout Plain Layout
3538 \begin_layout Standard
3539 If you make a keyboard description file that works for your language, please
3540 mail it to me, so I can include it in the next keymap distribution.
3543 \begin_layout Standard
3544 More keywords will be supported in keymap configuration file in future,
3548 \begin_layout Itemize
3549 \begin_inset Flex CharStyle:Code
3552 \begin_layout Plain Layout
3563 \begin_inset space \hfill{}
3567 \begin_inset Flex CharStyle:Code
3570 \begin_layout Plain Layout
3579 \begin_layout Itemize
3580 \begin_inset Flex CharStyle:Code
3583 \begin_layout Plain Layout
3594 \begin_inset space \hfill{}
3598 \begin_inset Flex CharStyle:Code
3601 \begin_layout Plain Layout
3607 an external keymap translation program
3610 \begin_layout Standard
3611 Also, it should look into
3612 \begin_inset Flex CharStyle:Code
3615 \begin_layout Plain Layout
3621 file for defaults, too (for example, a
3622 \begin_inset Flex CharStyle:Code
3625 \begin_layout Plain Layout
3633 option to include default keyboard).
3641 \begin_layout Section
3642 International Keymap Stuff
3643 \begin_inset CommandInset label
3645 name "sec:International-Keymap-Stuff"
3652 \begin_layout Standard
3653 \begin_inset Note Note
3656 \begin_layout Plain Layout
3657 In doing the revisions on this document in March 2008, I did not look over
3658 this stuff, as I do not understand it.
3659 It would be good if someone else could do so.
3668 \begin_layout Standard
3669 The next two sections describe the
3670 \begin_inset Flex CharStyle:Code
3673 \begin_layout Plain Layout
3682 \begin_inset Flex CharStyle:Code
3685 \begin_layout Plain Layout
3693 file syntax in detail.
3694 These sections should help you design your own key map if the ones provided
3695 do not meet your needs.
3698 \begin_layout Subsection
3702 \begin_layout Standard
3706 \begin_inset Flex CharStyle:Code
3709 \begin_layout Plain Layout
3715 file maps keystrokes to characters or strings.
3716 As the name suggests, it sets a keyboard mapping.
3718 \begin_inset Flex CharStyle:Code
3721 \begin_layout Plain Layout
3732 \begin_inset Flex CharStyle:Code
3735 \begin_layout Plain Layout
3750 \begin_inset Flex CharStyle:Code
3753 \begin_layout Plain Layout
3766 \begin_inset Flex CharStyle:Code
3769 \begin_layout Plain Layout
3778 \begin_inset Flex CharStyle:Code
3781 \begin_layout Plain Layout
3789 are described in this section.
3792 \begin_layout Labeling
3793 \labelwidthstring 00.00.0000
3794 \begin_inset Flex CharStyle:Code
3797 \begin_layout Plain Layout
3805 Map a character to a string
3808 \begin_layout LyX-Code
3823 \begin_layout Standard
3856 the double-quote (")
3873 must be escaped with a preceding backslash (
3884 \begin_layout Standard
3886 \begin_inset Flex CharStyle:MenuItem
3889 \begin_layout Plain Layout
3897 statement to cause the symbol
3898 \begin_inset Flex CharStyle:MenuItem
3901 \begin_layout Plain Layout
3909 to be output for the keystroke
3910 \begin_inset Flex CharStyle:MenuItem
3913 \begin_layout Plain Layout
3924 \begin_layout LyX-Code
3930 \begin_layout Labeling
3931 \labelwidthstring 00.00.0000
3932 \begin_inset Flex CharStyle:Code
3935 \begin_layout Plain Layout
3943 Specify an accent character
3946 \begin_layout LyX-Code
3955 \begin_layout Standard
3956 This will make the cha
3994 This is the dead key
3998 \begin_layout Plain Layout
4005 refers to a key that does not produce a character by itself, but when followed
4006 with another key, produces the desired accent character.
4007 For example, a German characte
4009 r with an umlaut like
4019 can be produced in this manner.
4028 \begin_layout Standard
4041 and then another key not in
4058 followed by the other, not allowed key, as output.
4062 \begin_inset Flex CharStyle:MenuItem
4065 \begin_layout Plain Layout
4073 cancels a dead key, so if
4084 \begin_inset Flex CharStyle:MenuItem
4087 \begin_layout Plain Layout
4096 , the cursor will not go one position backwards but will instead cancel
4112 might have had on the next keystroke.
4116 \begin_layout Standard
4117 The following example specifies that the character ' is to be an acute accent,
4118 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4121 \begin_layout LyX-Code
4124 kmod ' acute aeiouAEIOU
4127 \begin_layout Labeling
4128 \labelwidthstring 00.00.0000
4129 \begin_inset Flex CharStyle:Code
4132 \begin_layout Plain Layout
4138 Specify an exception to the accent character
4141 \begin_layout LyX-Code
4150 \begin_layout Standard
4151 This defines an exce
4192 have been assigned a keystroke with a previous
4195 \begin_inset Flex CharStyle:Code
4198 \begin_layout Plain Layout
4222 must not belong in the
4269 If such a declaration does not exist in
4277 \begin_inset Flex CharStyle:Code
4280 \begin_layout Plain Layout
4314 \begin_inset Flex CharStyle:Code
4317 \begin_layout Plain Layout
4331 \begin_layout Standard
4332 The following command produces causes äi to be produced when you enter acute-i
4336 \begin_layout LyX-Code
4350 \begin_layout Labeling
4351 \labelwidthstring 00.00.0000
4352 \begin_inset Flex CharStyle:Code
4355 \begin_layout Plain Layout
4361 Combine two accent characters
4364 \begin_layout LyX-Code
4370 accent1 accent2 allowed
4373 \begin_layout Standard
4374 This one is getting pretty esoteric.
4375 It allows you to combine the effect
4431 \begin_inset Flex CharStyle:Code
4434 \begin_layout Plain Layout
4462 \begin_layout Standard
4463 Consider this example from the
4464 \begin_inset Flex CharStyle:Code
4467 \begin_layout Plain Layout
4478 \begin_layout LyX-Code
4481 kmod ; acute aeioyvhAEIOYVH
4485 kcomb acute umlaut iyIY
4488 \begin_layout Standard
4489 This allows you to press
4490 \begin_inset Flex CharStyle:MenuItem
4493 \begin_layout Plain Layout
4501 and get the effect of
4502 \begin_inset Flex CharStyle:Code
4505 \begin_layout Plain Layout
4524 in this case cancels the last dead key, so if you press
4525 \begin_inset Flex CharStyle:MenuItem
4528 \begin_layout Plain Layout
4537 \begin_inset Flex CharStyle:Code
4540 \begin_layout Plain Layout
4553 \begin_layout Subsection
4557 \begin_layout Standard
4559 \begin_inset Flex CharStyle:Code
4562 \begin_layout Plain Layout
4570 mapping is performed, a
4571 \begin_inset Flex CharStyle:Code
4574 \begin_layout Plain Layout
4584 file maps the strings that the symbols generate to characters in the current
4586 The LyX distribution currently includes at least the
4587 \begin_inset Flex CharStyle:Code
4590 \begin_layout Plain Layout
4599 \begin_inset Flex CharStyle:Code
4602 \begin_layout Plain Layout
4613 \begin_layout Standard
4615 \begin_inset Flex CharStyle:Code
4618 \begin_layout Plain Layout
4626 file is a sequence of declarations of the form
4629 \begin_layout LyX-Code
4642 \begin_layout Standard
4643 For example, in order to map
4644 \begin_inset Flex CharStyle:MenuItem
4647 \begin_layout Plain Layout
4657 to the corresponding character in the iso-8859-1 set (233), the following
4661 \begin_layout LyX-Code
4669 \begin_layout Standard
4671 \begin_inset Flex CharStyle:Code
4674 \begin_layout Plain Layout
4683 \begin_inset Flex CharStyle:Code
4686 \begin_layout Plain Layout
4704 the same character can apply to more than one string.
4706 \begin_inset Flex CharStyle:Code
4709 \begin_layout Plain Layout
4720 \begin_layout LyX-Code
4732 \begin_inset Newline newline
4748 \begin_layout Standard
4749 If LyX cannot find a mapping for the string produced by the keystroke or
4750 a deadkey sequence, it will check if it looks like an accented char and
4751 try to draw an accent over the character on screen.
4754 \begin_layout Subsection
4758 \begin_layout Standard
4759 There is a second way to add support for international characters through
4760 so-called dead-keys.
4761 A dead-key works in combination with a letter to produce an accented character.
4762 Here, we'll explain how to create a really simple dead-key to illustrate
4766 \begin_layout Standard
4767 Suppose you happen to need the circumflex character,
4768 \begin_inset Quotes eld
4772 \begin_inset Quotes erd
4777 \begin_inset Flex CharStyle:MenuItem
4780 \begin_layout Plain Layout
4787 \begin_inset space ~
4791 \begin_inset Flex CharStyle:MenuItem
4794 \begin_layout Plain Layout
4800 ] to the LyX command
4801 \begin_inset Flex CharStyle:Code
4804 \begin_layout Plain Layout
4811 \begin_inset Flex CharStyle:Code
4814 \begin_layout Plain Layout
4821 Now, whenever you type the
4822 \begin_inset Flex CharStyle:MenuItem
4825 \begin_layout Plain Layout
4831 -key followed by a letter, that letter will have a circumflex accent on
4833 For example, the sequence
4834 \begin_inset Quotes eld
4838 \begin_inset Flex CharStyle:MenuItem
4841 \begin_layout Plain Layout
4848 \begin_inset Quotes erd
4851 produces the letter:
4852 \begin_inset Quotes eld
4856 \begin_inset Quotes erd
4860 If you tried to type
4861 \begin_inset Quotes eld
4865 \begin_inset Flex CharStyle:MenuItem
4868 \begin_layout Plain Layout
4875 \begin_inset Quotes erd
4878 , however, LyX will complain with a beep, since a
4879 \begin_inset Quotes eld
4883 \begin_inset Flex CharStyle:MenuItem
4886 \begin_layout Plain Layout
4893 \begin_inset Quotes erd
4896 never takes a circumflex accent.
4898 \begin_inset Flex CharStyle:MenuItem
4901 \begin_layout Plain Layout
4907 after a dead-key produces the bare-accent.
4908 Please note this last point! If you bind a key to a dead-key, you'll need
4909 to rebind the character on that key to yet another key.
4911 \begin_inset Flex CharStyle:MenuItem
4914 \begin_layout Plain Layout
4920 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
4923 \begin_layout Standard
4924 One common way to bind dead-keys is to use
4925 \begin_inset Flex CharStyle:MenuItem
4928 \begin_layout Plain Layout
4935 \begin_inset Flex CharStyle:MenuItem
4938 \begin_layout Plain Layout
4945 \begin_inset Flex CharStyle:MenuItem
4948 \begin_layout Plain Layout
4954 in combination with an accent, like
4955 \begin_inset Quotes eld
4959 \begin_inset Flex CharStyle:MenuItem
4962 \begin_layout Plain Layout
4969 \begin_inset Quotes erd
4973 \begin_inset Quotes eld
4977 \begin_inset Flex CharStyle:MenuItem
4980 \begin_layout Plain Layout
4987 \begin_inset Quotes erd
4991 \begin_inset Quotes eld
4995 \begin_inset Flex CharStyle:MenuItem
4998 \begin_layout Plain Layout
5005 \begin_inset Quotes erd
5009 Another way involves using
5010 \begin_inset Flex CharStyle:Code
5013 \begin_layout Plain Layout
5020 \begin_inset Flex CharStyle:Code
5023 \begin_layout Plain Layout
5029 to set up the special
5030 \begin_inset Flex CharStyle:Code
5033 \begin_layout Plain Layout
5041 \begin_inset Flex CharStyle:Code
5044 \begin_layout Plain Layout
5050 acts in some ways just like
5051 \begin_inset Flex CharStyle:MenuItem
5054 \begin_layout Plain Layout
5060 and permits you to bind keys to accented characters.
5061 You can also turn keys into dead-keys by binding them to something like
5063 \begin_inset Flex CharStyle:Code
5066 \begin_layout Plain Layout
5072 and then binding this symbolic key to the corresponding LyX command.
5076 \begin_layout Plain Layout
5081 : This is exactly what I do in my
5082 \begin_inset Flex CharStyle:Code
5085 \begin_layout Plain Layout
5092 \begin_inset Flex CharStyle:Code
5095 \begin_layout Plain Layout
5103 \begin_inset Flex CharStyle:MenuItem
5106 \begin_layout Plain Layout
5108 \begin_inset space ~
5117 \begin_inset Flex CharStyle:Code
5120 \begin_layout Plain Layout
5126 and a bunch of these
5127 \begin_inset Quotes eld
5131 \begin_inset Flex CharStyle:Code
5134 \begin_layout Plain Layout
5141 \begin_inset Quotes erd
5144 symbolic keys bound such things as
5145 \begin_inset Flex CharStyle:MenuItem
5148 \begin_layout Plain Layout
5150 \begin_inset space ~
5159 \begin_inset Flex CharStyle:MenuItem
5162 \begin_layout Plain Layout
5164 \begin_inset space ~
5173 This is how I produce my accented characters.
5178 You can make just about anything into the
5179 \begin_inset Flex CharStyle:Code
5182 \begin_layout Plain Layout
5189 \begin_inset Flex CharStyle:MenuItem
5192 \begin_layout Plain Layout
5198 keys, a spare function key, etc.
5199 As for the LyX commands that produce accents, check the entry for
5200 \begin_inset Flex CharStyle:Code
5203 \begin_layout Plain Layout
5214 You'll find the complete list there.
5217 \begin_layout Subsection
5218 Saving your Language Configuration
5221 \begin_layout Standard
5222 You can edit your preferences so that your desired language environment
5223 is automatically configured when LyX starts up, via the
5224 \begin_inset Flex CharStyle:MenuItem
5227 \begin_layout Plain Layout
5228 Edit\SpecialChar \menuseparator
5237 \begin_layout Chapter
5238 Installing New Document Classes, Layouts, and Templates
5239 \begin_inset CommandInset label
5241 name "cha:Installing-New-Document"
5246 \begin_inset Argument
5249 \begin_layout Plain Layout
5250 Installing New Document Classes
5258 \begin_layout Standard
5259 In this chapter, we describe the procedures for creating and installing
5260 new LyX layout and template files, as well as offer a refresher on correctly
5261 installing new LaTeX document classes.
5265 \begin_layout Standard
5266 First, let us a say a few words about how one ought to think about the relation
5267 between LyX and LaTeX.
5268 The thing to understand is that, in a certain sense, LyX doesn't know anything
5270 Indeed, from LyX's point of view, LaTeX is just one of several
5271 \begin_inset Quotes eld
5275 \begin_inset Quotes erd
5278 in which it is capable of producing output.
5279 Other such formats are DocBook, plaintext, and XHTML.
5280 LaTeX is, of course, a particularly important format, but very little of
5281 the information LyX has about LaTeX is actually contained in the program
5286 \begin_layout Plain Layout
5287 Some commands are sufficiently complex that they are
5288 \begin_inset Quotes eld
5292 \begin_inset Quotes erd
5296 But the developers generally regard this as a Bad Thing.
5301 Rather, that information, even for the standard classes like
5302 \begin_inset Flex CharStyle:Code
5305 \begin_layout Plain Layout
5311 , is contained in `layout files'.
5312 Similarly, LyX itself does not know much about DocBook or XHTML.
5313 What it knows is contained in layout files.
5316 \begin_layout Standard
5317 You can think of the layout file for a given document class as a translation
5318 manual between LyX constructs---paragraphs with their corresponding styles,
5319 certain sorts of insets, etc---and the corresponding LaTeX, DocBook, or
5321 Almost everything LyX knows about
5322 \begin_inset Flex CharStyle:Code
5325 \begin_layout Plain Layout
5331 , for example, is contained in the file
5332 \begin_inset Flex CharStyle:Code
5335 \begin_layout Plain Layout
5341 and in various other files it includes.
5342 For this reason, anyone intending to write layout files should plan to
5343 study the existing files.
5344 A good place to start is with
5345 \begin_inset Flex CharStyle:Code
5348 \begin_layout Plain Layout
5354 , which is included in
5355 \begin_inset Flex CharStyle:Code
5358 \begin_layout Plain Layout
5365 \begin_inset Flex CharStyle:Code
5368 \begin_layout Plain Layout
5374 , and many of the other layout files for document classes.
5375 This file is where sections and the like are defined:
5376 \begin_inset Flex CharStyle:Code
5379 \begin_layout Plain Layout
5385 tells LyX how paragraphs that are marked with the Section, Subsection,
5386 etc, styles can be translated into corresponding LaTeX, DocBook, and XHTML
5389 \begin_inset Flex CharStyle:Code
5392 \begin_layout Plain Layout
5398 file basically just includes several of these
5399 \begin_inset Flex CharStyle:Code
5402 \begin_layout Plain Layout
5411 \begin_layout Standard
5412 Defining the LyX--LaTeX correspondence is not the only thing layout files
5414 Their other job is to define how the LyX constructs themselves will appear
5416 The fact that layout files have these two jobs is often a source of confusion,
5417 because they are completely separate.
5418 Telling LyX how to translate a certain paragraph style into LaTeX does
5419 not tell LyX how to display it; conversely, telling LyX how to display
5420 a certain paragraph style does not tell LyX how to translate it into LaTeX
5421 (let alone tell LaTeX how to display it).
5422 So, in general, when you define a new LyX construct, you must always do
5423 two quite separate things: (i)
5424 \begin_inset space ~
5427 tell LyX how to translate it into LaTeX and (ii)
5428 \begin_inset space ~
5431 tell LyX how to display it.
5434 \begin_layout Standard
5435 Much the same is true, of course, as regards LyX's other backend formats,
5436 though XHTML is in some ways different, because in that case LyX
5440 able, to some extent, to use information about how it should display a
5441 paragraph on the screen to output information (in the form of CSS) about
5442 how the paragraph should be displayed in a browser.
5443 Even in this case, however, the distinction between what LyX does internally
5444 and how things are rendered externally remains in force, and the two can
5445 be controlled separately.
5447 \begin_inset CommandInset ref
5449 reference "sec:Tags-for-XHTML"
5456 \begin_layout Section
5457 Installing new LaTeX files
5460 \begin_layout Standard
5461 Some installations may not include a LaTeX package or class file that you
5462 would like to use within LyX.
5463 For example, you might need FoilTeX, a package for preparing slides for
5464 overhead projectors.
5465 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5466 a user interface for installing such packages.
5467 For example, with MiKTeX, you start the program
5468 \begin_inset Quotes eld
5472 \begin_inset space ~
5476 \begin_inset Quotes erd
5479 to get a list of available packages.
5480 To install one of them, right click on it or use the corresponding toolbar
5484 \begin_layout Standard
5485 If your LaTeX distribution does not provide such a `package manager', or
5486 if the package is not available from your distribution, then follow these
5487 steps to install it manually:
5490 \begin_layout Enumerate
5491 Get the package from
5492 \begin_inset CommandInset href
5495 target "http://www.ctan.org/"
5502 \begin_layout Enumerate
5503 If the package contains a file with the ending
5504 \begin_inset Quotes eld
5508 \begin_inset Flex CharStyle:Code
5511 \begin_layout Plain Layout
5518 \begin_inset Quotes erd
5521 (is the case for FoilTeX) then open a console, change to the folder of
5522 this file and execute the command
5523 \begin_inset Flex CharStyle:Code
5526 \begin_layout Plain Layout
5533 You have now unpacked the package and have all files to install it.
5534 Most LaTeX-packages are not packed and you can skip this step.
5537 \begin_layout Enumerate
5538 Now we need to decide where to install the package.
5542 \begin_layout Enumerate
5543 On *nix systems (Linux, OSX, etc), you have several choices.
5544 If you want the new package to be available for all users on your system,
5545 then you should install it in your `local' TeX tree; if you want (or need)
5546 it to be available just for you, then you can install it in your own `user'
5548 Where these trees should be created, if they do not already exist, depends
5549 upon the details of your system.
5550 To find out where they are, look in the file
5551 \begin_inset Flex CharStyle:Code
5554 \begin_layout Plain Layout
5564 \begin_layout Plain Layout
5565 This usually lives in the directory
5566 \begin_inset Flex CharStyle:Code
5569 \begin_layout Plain Layout
5575 , though you can run
5576 \begin_inset Flex CharStyle:Code
5579 \begin_layout Plain Layout
5590 The location of the `local' TeX tree is defined by the
5591 \begin_inset Flex CharStyle:Code
5594 \begin_layout Plain Layout
5600 variable; this is usually somewhere like
5601 \begin_inset Flex URL
5604 \begin_layout Plain Layout
5606 /usr/local/share/texmf/
5612 The location of the `user' TeX tree is defined by
5613 \begin_inset Flex CharStyle:Code
5616 \begin_layout Plain Layout
5623 \begin_inset Flex CharStyle:Code
5626 \begin_layout Plain Layout
5633 (If these variables are not predefined, you can define them.) You'll probably
5634 need root permissions to create or modify the `local' tree, but your `user'
5635 tree shouldn't have such limitations.
5636 \begin_inset Newline newline
5639 In general, we'd recommend installing in the user tree unless you have reason
5641 One advantage to this is that your user tree is less likely to be over-written
5642 or deleted when you upgrade, and it will typically be backed up together
5643 with everything else when you backup your home directory (which, of course,
5644 you do on a regular basis).
5647 \begin_layout Enumerate
5648 On Windows, change to the folder where LaTeX is installed and then change
5650 \begin_inset Flex URL
5653 \begin_layout Plain Layout
5665 (For MiKTeX, this would be by default the folder
5666 \begin_inset Flex URL
5669 \begin_layout Plain Layout
5685 \begin_inset Note Note
5688 \begin_layout Plain Layout
5689 Note: These should be URLs, so that lines can be broken properly.
5690 Also, the path is wrong, in general.
5692 \begin_inset Quotes eld
5696 \begin_inset Quotes erd
5699 is a German word, obviously, and on systems installed with English it would
5701 \begin_inset Quotes eld
5705 \begin_inset Quotes erd
5709 Who knows what it is elsewhere.
5710 I also don't know myself what the
5711 \begin_inset Quotes eld
5715 \begin_inset Quotes erd
5718 means in Windows pathnames.
5719 Does it mean something like
5720 \begin_inset Quotes eld
5724 \begin_inset Quotes erd
5727 ? I don't know how to fix this.
5728 Maybe one could say something like
5729 \begin_inset Quotes eld
5739 \begin_inset Quotes erd
5742 , and then say: where
5743 \begin_inset Quotes eld
5747 \begin_inset Quotes erd
5750 is the default program installation location, something like
5751 \begin_inset Quotes eld
5759 \begin_inset Quotes erd
5763 \begin_inset Quotes eld
5771 \begin_inset Quotes erd
5774 , depending upon your language, boot drive, etc.
5779 Create there a new folder
5780 \begin_inset Flex CharStyle:Code
5783 \begin_layout Plain Layout
5789 and copy all files of the package into it.
5794 \begin_layout Enumerate
5795 Now one only need to tell LaTeX that there are new files.
5796 This depends on the used LaTeX-Distribution:
5800 \begin_layout Enumerate
5801 For TeXLive execute the command
5802 \begin_inset Flex CharStyle:Code
5805 \begin_layout Plain Layout
5812 If you installed the package somewhere you needed root permissions, then
5813 you will need to run
5814 \begin_inset Flex CharStyle:Code
5817 \begin_layout Plain Layout
5823 with root permissions also.
5826 \begin_layout Enumerate
5827 For MiKTeX, start the program Settings
5828 \begin_inset space ~
5831 (admin) and press the button marked
5832 \begin_inset Quotes eld
5836 \begin_inset Quotes erd
5843 \begin_layout Enumerate
5844 Finally, we need to tell LyX what we have done.
5846 \begin_inset Flex CharStyle:MenuItem
5849 \begin_layout Plain Layout
5852 \SpecialChar \menuseparator
5858 and then restart LyX so it will recognize the new package.
5861 \begin_layout Standard
5862 Now the package is installed.
5863 In our example, till now appear as
5864 \begin_inset Flex CharStyle:Code
5867 \begin_layout Plain Layout
5872 \begin_layout Plain Layout
5885 \begin_inset Flex CharStyle:MenuItem
5888 \begin_layout Plain Layout
5889 Document\SpecialChar \menuseparator
5890 Settings\SpecialChar \menuseparator
5900 \begin_layout Standard
5901 Sometimes, you will want to use a LaTeX class or package that does not automatic
5903 If so, then you need to create a `layout' file for it.
5904 That is the topic of the next section.
5907 \begin_layout Section
5908 Types of layout files
5911 \begin_layout Standard
5912 This section describes the various sorts of LyX files that contain layout
5914 These files describe various paragraph and character styles, determining
5915 how LyX should display them and how they should be translated into LaTeX,
5916 DocBook, XHTML, or whatever output format is being used.
5920 \begin_layout Standard
5921 We shall try to provide a thorough description of the process of writing
5923 However, there are so many different types of documents supported even
5924 by just LaTeX that we can't hope to cover every different possibility or
5925 problem you might encounter.
5926 The LyX users' list is frequented by people with lots of experience with
5927 layout design who are willing to share what they've learned, so please
5928 feel free to ask questions there.
5931 \begin_layout Standard
5932 As you prepare to write a new layout, it is extremely helpful to look at
5933 the layouts distributed with LyX.
5934 If you write a LyX layout for a LaTeX document class that might also be
5935 used by others, or write a module that might be useful to others, then
5936 you should consider posting your layout to the
5937 \begin_inset CommandInset href
5939 name "layout section on the LyX wiki"
5940 target "http://wiki.lyx.org/Layouts/Layouts"
5944 or even to the LyX developers' list, so that it might be included in LyX
5949 \begin_layout Plain Layout
5950 Note that LyX is licensed under the General Public License, so any material
5951 that is contribued to LyX must be similarly licensed.
5959 \begin_layout Subsection
5961 \begin_inset CommandInset label
5963 name "sub:Layout-modules"
5970 \begin_layout Standard
5971 We have spoken to this point about `layout files'.
5972 But there are different sorts of files that contain layout information.
5973 Layout files, strictly so called, have the
5974 \begin_inset Flex CharStyle:Code
5977 \begin_layout Plain Layout
5983 extension and provide LyX with information about document classes.
5984 As of LyX 1.6, however, layout information can also be contained in layout
5990 \begin_inset Flex CharStyle:Code
5993 \begin_layout Plain Layout
6000 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
6001 some modules—such as the
6002 \begin_inset Flex CharStyle:Code
6005 \begin_layout Plain Layout
6011 module—specifcally provide support for one package.
6012 In a sense, layout modules are similar to included
6016 \begin_layout Plain Layout
6017 These can have any extension, but by convention have the
6018 \begin_inset Flex CharStyle:Code
6021 \begin_layout Plain Layout
6033 \begin_inset Flex CharStyle:Code
6036 \begin_layout Plain Layout
6042 —in that modules are not specific to a given document class but may be used
6043 with many different classes.
6044 The difference is that using an included file with
6045 \begin_inset Flex CharStyle:Code
6048 \begin_layout Plain Layout
6054 requires editing that file.
6055 Modules, by contrast, are selected in the
6056 \begin_inset Flex CharStyle:MenuItem
6059 \begin_layout Plain Layout
6060 Document\SpecialChar \menuseparator
6069 \begin_layout Standard
6070 Building modules is the easiest way to get started with layout editing,
6071 since it can be as simple as adding a single new paragraph style or flex
6073 But modules may, in principle, contain anything a layout file can contain.
6076 \begin_layout Standard
6077 After creating a new module and copying it to the
6078 \begin_inset Flex CharStyle:Code
6081 \begin_layout Plain Layout
6087 folder, you will need to reconfigure and then restart LyX for the module
6088 to appear in the menu.
6089 However, changes you make to the module will be seen immediately, if you
6091 \begin_inset Flex CharStyle:MenuItem
6094 \begin_layout Plain Layout
6095 Document\SpecialChar \menuseparator
6101 , highlight something, and then hit
6102 \begin_inset Quotes eld
6106 \begin_inset Quotes erd
6112 It is strongly recommended that you save your work before doing this
6117 it is strongly recommended that you not attempt to edit modules while simultaneo
6118 usly working on actual documents
6121 Though of course the developers strive to keep LyX stable in such situations,
6122 syntax errors and the like in your module file could cause strange behavior.
6125 \begin_layout Subsection
6127 \begin_inset Flex CharStyle:MenuItem
6130 \begin_layout Plain Layout
6139 \begin_layout Standard
6140 There are two situations you are likely to encounter when wanting to support
6141 a new LaTeX document class, involving LaTeX2e class (
6142 \begin_inset Flex CharStyle:Code
6145 \begin_layout Plain Layout
6152 \begin_inset Flex CharStyle:Code
6155 \begin_layout Plain Layout
6162 Supporting a style file is usually fairly easy.
6163 Supporting a new class file is a bit harder.
6164 We'll discuss the former in this section and the latter in the next.
6165 Similar remarks apply, of course, if you want to support a new DocBook
6169 \begin_layout Standard
6170 The easier case is the one in which your new document class is provided
6171 as a style file that is to be used in conjunction with an already supported
6173 For the sake of the example, we'll assume that the style file is called
6175 \begin_inset Flex CharStyle:MenuItem
6178 \begin_layout Plain Layout
6184 and that it is meant to be used with
6185 \begin_inset Flex CharStyle:MenuItem
6188 \begin_layout Plain Layout
6194 , which is a standard class.
6198 \begin_layout Standard
6199 Start by copying the existing class's layout file into your local directory:
6203 \begin_layout Plain Layout
6204 Of course, which directory is your local directory will vary by platform,
6205 and LyX allows you to specify your local directory on startup, too, using
6207 \begin_inset Flex CharStyle:Code
6210 \begin_layout Plain Layout
6224 \begin_layout LyX-Code
6225 cp report.layout ~/.lyx/layouts/myclass.layout
6228 \begin_layout Standard
6230 \begin_inset Flex CharStyle:Code
6233 \begin_layout Plain Layout
6239 and change the line:
6242 \begin_layout LyX-Code
6245 DeclareLaTeXClass{report}
6248 \begin_layout Standard
6252 \begin_layout LyX-Code
6255 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6258 \begin_layout Standard
6262 \begin_layout LyX-Code
6264 \begin_inset Newline newline
6270 \begin_inset Newline newline
6276 \begin_layout Standard
6277 near the top of the file.
6280 \begin_layout Standard
6281 Start LyX and select
6282 \begin_inset Flex CharStyle:MenuItem
6285 \begin_layout Plain Layout
6286 Tools\SpecialChar \menuseparator
6293 Then restart LyX and try creating a new document.
6295 \begin_inset Flex CharStyle:MenuItem
6298 \begin_layout Plain Layout
6304 " as a document class option in the
6305 \begin_inset Flex CharStyle:MenuItem
6308 \begin_layout Plain Layout
6309 Document\SpecialChar \menuseparator
6316 It is likely that some of the sectioning commands and such in your new
6317 class will work differently from how they worked in the base class—
6318 \begin_inset Flex CharStyle:Code
6321 \begin_layout Plain Layout
6327 in this example—so you can fiddle around with the settings for the different
6328 sections if you wish.
6329 The layout information for sections is contained in
6330 \begin_inset Flex CharStyle:Code
6333 \begin_layout Plain Layout
6339 , but you do not need to copy and change this file.
6340 Instead, you can simply add your changes to your layout file, after the
6342 \begin_inset Flex CharStyle:Code
6345 \begin_layout Plain Layout
6351 , which itself includes
6352 \begin_inset Flex CharStyle:Code
6355 \begin_layout Plain Layout
6362 For example, you might add these lines:
6365 \begin_layout LyX-Code
6369 \begin_layout LyX-Code
6373 \begin_layout LyX-Code
6377 \begin_layout LyX-Code
6381 \begin_layout LyX-Code
6385 \begin_layout Standard
6386 to change the font for chapter headings to sans-serif.
6387 This will override (or, in this case, add to) the existing declaration
6388 for the Chapter style.
6392 \begin_layout Standard
6393 Your new package may also provide commands or environments not present in
6395 In this case, you will want to add these to the layout file.
6397 \begin_inset CommandInset ref
6399 reference "sec:TextClass"
6403 for information on how to do so.
6406 \begin_layout Standard
6408 \begin_inset Flex CharStyle:MenuItem
6411 \begin_layout Plain Layout
6417 can be used with several different document classes, and even if it cannot,
6418 you might find it easiest just to write a module that you can load with
6420 The simplest possible such module would be:
6423 \begin_layout LyX-Code
6426 DeclareLyXModule{My Package}
6429 \begin_layout LyX-Code
6433 \begin_layout LyX-Code
6434 #Support for mypkg.sty.
6437 \begin_layout LyX-Code
6439 \begin_inset Newline newline
6445 \begin_layout LyX-Code
6447 \begin_inset Newline newline
6453 \begin_layout LyX-Code
6455 \begin_inset Newline newline
6461 \begin_inset Newline newline
6467 \begin_layout Standard
6468 A more complex module might modify the behavior of some existing constructs
6469 or define some new ones.
6471 \begin_inset CommandInset ref
6473 reference "sec:TextClass"
6480 \begin_layout Subsection
6482 \begin_inset Flex CharStyle:MenuItem
6485 \begin_layout Plain Layout
6494 \begin_layout Standard
6495 There are two possibilities here.
6496 One is that the class file is itself based upon an existing document class.
6497 For example, many thesis classes are based upon
6498 \begin_inset Flex CharStyle:MenuItem
6501 \begin_layout Plain Layout
6508 To see whether yours is, look for a line like
6511 \begin_layout LyX-Code
6517 \begin_layout Standard
6519 If so, then you may proceed largely as in the previous section, though
6521 \begin_inset Flex CharStyle:Code
6524 \begin_layout Plain Layout
6530 line will be different.
6531 If your new class is
6532 \begin_inset Flex CharStyle:Code
6535 \begin_layout Plain Layout
6541 and it is based upon
6542 \begin_inset Flex CharStyle:Code
6545 \begin_layout Plain Layout
6551 , then the line should read:
6555 \begin_layout Plain Layout
6556 And it will be easiest if you save the file to
6557 \begin_inset Flex CharStyle:Code
6560 \begin_layout Plain Layout
6566 : LyX assumes that the document class has the same name as the layout file.
6575 \begin_layout LyX-Code
6578 DeclareLaTeXClass[thesis,book]{thesis}
6581 \begin_layout Standard
6582 If, on the other hand, the new class is not based upon an existing class,
6583 you will probably have to
6584 \begin_inset Quotes eld
6588 \begin_inset Quotes erd
6592 We strongly suggest copying an existing layout file which uses a similar
6593 LaTeX class and then modifying it, if you can do so.
6594 At least use an existing file as a starting point so you can find out what
6595 items you need to worry about.
6596 Again, the specifics are covered below.
6599 \begin_layout Subsection
6601 \begin_inset CommandInset label
6603 name "sub:Creating-Templates"
6610 \begin_layout Standard
6611 Once you have written a layout file for a new document class, you might
6612 want to consider writing a
6617 A template acts as a kind of tutorial for your layout, showing how it might
6618 be used, though containing dummy content.
6619 You can of course look at the various templates included with LyX for ideas.
6622 \begin_layout Standard
6623 Templates are created just like usual documents: using LyX.
6624 The only difference is that usual documents contain all possible settings,
6625 including the font scheme and the paper size.
6626 Usually a user doesn't want a template to overwrite his preferred settings
6627 for such parameters.
6628 For that reason, the designer of a template should remove the corresponding
6630 \begin_inset Flex CharStyle:Code
6633 \begin_layout Plain Layout
6642 \begin_inset Flex CharStyle:Code
6645 \begin_layout Plain Layout
6653 from the template LyX file.
6654 This can be done with any simple text-editor, for example
6655 \begin_inset Flex CharStyle:Code
6658 \begin_layout Plain Layout
6665 \begin_inset Flex CharStyle:Code
6668 \begin_layout Plain Layout
6678 \begin_layout Standard
6679 Put the edited template files you create in
6680 \begin_inset Flex CharStyle:Code
6683 \begin_layout Plain Layout
6689 , copy the ones you use from the global template directory in
6690 \begin_inset Flex CharStyle:Code
6693 \begin_layout Plain Layout
6699 to the same place, and redefine the template path in the
6700 \begin_inset Flex CharStyle:MenuItem
6703 \begin_layout Plain Layout
6704 Tools\SpecialChar \menuseparator
6705 Preferences\SpecialChar \menuseparator
6714 \begin_layout Standard
6715 Note, by the way, that there is a template which has a particular meaning:
6717 \begin_inset Flex CharStyle:Code
6720 \begin_layout Plain Layout
6727 This template is loaded every time you create a new document with
6728 \begin_inset Flex CharStyle:MenuItem
6731 \begin_layout Plain Layout
6732 File\SpecialChar \menuseparator
6738 in order to provide useful defaults.
6739 To create this template from inside LyX, all you have to do is to open
6740 a document with the correct settings, and use the
6741 \begin_inset Flex CharStyle:MenuItem
6744 \begin_layout Plain Layout
6745 Save as Document Defaults
6753 \begin_layout Subsection
6754 Upgrading old layout files
6757 \begin_layout Standard
6758 The format of layout files changes with each LyX release, so old layout
6759 files need to be converted to the new format.
6760 This process has been automated since LyX 1.4: If LyX reads a layout file
6761 in an older format, it automatically calls the script
6762 \begin_inset Flex CharStyle:Code
6765 \begin_layout Plain Layout
6771 to convert it to a temporary file in current format.
6772 The original file is left untouched.
6773 If you use the layout file often, then, you may want to convert it permanently,
6774 so that LyX does not have to do so itself every time.
6775 To do this, you can call the converter manually:
6778 \begin_layout LyX-Code
6779 mv myclass.layout myclass.old
6782 \begin_layout LyX-Code
6783 python LyXDir/scripts/layout2layout.py myclass.old myclass.layout
6786 \begin_layout Standard
6788 \begin_inset Flex CharStyle:Code
6791 \begin_layout Plain Layout
6797 with the name of your LyX system directory, of course.
6800 \begin_layout Standard
6801 Note that manual conversion does not affect included files, so these will
6802 have to be converted separately.
6805 \begin_layout Section
6806 \begin_inset CommandInset label
6808 name "sec:TextClass"
6812 The layout file format
6815 \begin_layout Standard
6816 When it's finally time to get your hands dirty and create or edit your own
6817 layout file, the following sections describe what you're up against.
6818 Our advice is to go slowly, save and test often, listen to soothing music,
6819 and enjoy one or two of your favorite adult beverages; more if you are
6820 getting particularly stuck.
6821 It's really not that hard, except that the multitude of options can become
6822 overwhelming if you try to do too much in one sitting.
6823 Go have another adult beverage, just for good measure.
6826 \begin_layout Standard
6827 Note that all the tags used in layout files are case-insensitive.
6829 \begin_inset Flex CharStyle:Code
6832 \begin_layout Plain Layout
6839 \begin_inset Flex CharStyle:Code
6842 \begin_layout Plain Layout
6849 \begin_inset Flex CharStyle:Code
6852 \begin_layout Plain Layout
6858 are really the same tag.
6859 The possible values are printed in brackets after the feature's name.
6860 The default value if a feature isn't specified inside a text class-description
6862 \begin_inset Flex CharStyle:Code
6865 \begin_layout Plain Layout
6874 If the argument has a data type like
6875 \begin_inset Quotes eld
6879 \begin_inset Quotes erd
6883 \begin_inset Quotes eld
6887 \begin_inset Quotes erd
6890 , the default is shown like this:
6891 \begin_inset Flex CharStyle:Code
6894 \begin_layout Plain Layout
6905 \begin_layout Subsection
6906 The document class declaration
6909 \begin_layout Standard
6910 Lines in a layout file which begin with
6911 \begin_inset Flex CharStyle:Code
6914 \begin_layout Plain Layout
6921 There is one exception to this rule.
6923 \begin_inset Flex CharStyle:Code
6926 \begin_layout Plain Layout
6932 files should begin with a line like:
6935 \begin_layout LyX-Code
6938 #% Do not delete the line below; configure depends on this
6941 \begin_layout LyX-Code
6946 DeclareLaTeXClass{article}
6949 \begin_layout Standard
6950 The second line is used when you (re)configure LyX.
6951 The layout file is read by the LaTeX script
6952 \begin_inset Flex CharStyle:Code
6955 \begin_layout Plain Layout
6961 , in a special mode where
6962 \begin_inset Flex CharStyle:Code
6965 \begin_layout Plain Layout
6972 The first line is just a LaTeX comment, and the second one contains the
6973 declaration of the text class.
6974 If these lines appear in a file named
6975 \begin_inset Flex CharStyle:Code
6978 \begin_layout Plain Layout
6984 , then they define a text class of name
6985 \begin_inset Flex CharStyle:Code
6988 \begin_layout Plain Layout
6994 (the name of the layout file) which uses the LaTeX document class
6995 \begin_inset Flex CharStyle:Code
6998 \begin_layout Plain Layout
7004 (the default is to use the same name as the layout).
7006 \begin_inset Quotes eld
7010 \begin_inset Quotes erd
7013 that appears above is used as a description of the text class in the
7014 \begin_inset Flex CharStyle:MenuItem
7017 \begin_layout Plain Layout
7018 Document\SpecialChar \menuseparator
7027 \begin_layout Standard
7028 Let's assume that you wrote your own text class that uses the
7029 \begin_inset Flex CharStyle:Code
7032 \begin_layout Plain Layout
7038 document class, but where you changed the appearance of the section headings.
7039 If you put it in a file
7040 \begin_inset Flex CharStyle:Code
7043 \begin_layout Plain Layout
7049 , the header of this file should be:
7052 \begin_layout LyX-Code
7055 #% Do not delete the line below; configure depends on this
7058 \begin_layout LyX-Code
7063 DeclareLaTeXClass[article]{article (with my own headings)}
7066 \begin_layout Standard
7067 This declares a text class
7068 \begin_inset Flex CharStyle:Code
7071 \begin_layout Plain Layout
7077 , associated with the LaTeX document class
7078 \begin_inset Flex CharStyle:Code
7081 \begin_layout Plain Layout
7088 \begin_inset Quotes eld
7091 article (with my own headings)
7092 \begin_inset Quotes erd
7096 If your text class depends on several packages, you can declare it as:
7099 \begin_layout LyX-Code
7102 #% Do not delete the line below; configure depends on this
7105 \begin_layout LyX-Code
7110 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
7113 \begin_layout Standard
7114 This indicates that your text class uses the
7115 \begin_inset Flex CharStyle:Code
7118 \begin_layout Plain Layout
7125 Finally, it is also possible to declare classes for DocBook code.
7126 Typical declarations will look like:
7129 \begin_layout LyX-Code
7132 #% Do not delete the line below; configure depends on this
7135 \begin_layout LyX-Code
7140 DeclareDocBookClass[article]{SGML (DocBook article)}
7143 \begin_layout Standard
7144 Note that these declarations can also be given an optional parameter declaring
7145 the name of the document class (but not a list).
7148 \begin_layout Standard
7149 So, to be as explicit as possible, the form of the layout declaration is:
7152 \begin_layout LyX-Code
7157 DeclareLaTeXClass[class,package.sty]{layout description}
7160 \begin_layout Standard
7161 The class need only be specified if the name of the LaTeX class file and
7162 the name of the layout file are different or if there are packages to load.
7163 If the name of the class file is not specified, then LyX will simply assume
7164 that it is the same as the name of the layout file.
7167 \begin_layout Standard
7168 When the text class has been modified to your taste, all you have to do
7169 is to copy it either to
7170 \begin_inset Flex CharStyle:Code
7173 \begin_layout Plain Layout
7180 \begin_inset Flex CharStyle:Code
7183 \begin_layout Plain Layout
7190 \begin_inset Flex CharStyle:MenuItem
7193 \begin_layout Plain Layout
7194 Tools\SpecialChar \menuseparator
7200 , exit LyX and restart.
7201 Then your new text class should be available along with the others.
7204 \begin_layout Standard
7205 Once the layout file is installed, you can edit it and see your changes
7206 without having to reconfigure or to restart LyX.
7211 \begin_layout Plain Layout
7212 In versions of LyX prior to 1.6, this was not true.
7213 As a result, editing layout files was very time consuming, since you had
7214 constantly to restart LyX to see changes.
7219 You can force a reload of the current layout by using the LyX function
7221 \begin_inset Flex CharStyle:MenuItem
7224 \begin_layout Plain Layout
7231 There is no default binding for this function—though, of course, you can
7232 bind it to a key yourself.
7233 But you will normally use this function simply by entering it in the mini-buffe
7238 \begin_layout Standard
7244 \begin_inset Flex CharStyle:MenuItem
7247 \begin_layout Plain Layout
7253 is very much an `advanced feature'.
7258 recommended that you save your work before using this function.
7263 recommended that you not attempt to edit layout information while simultaneousl
7264 y working on a document that you care about.
7265 Use a test document.
7266 Syntax errors and the like in your layout file could cause peculiar behavior.
7267 In particular, such errors could cause LyX to regard the current layout
7268 as invalid and to attempt to switch to some other layout.
7272 \begin_layout Plain Layout
7273 Really bad syntax errors may even caused LyX to exit.
7274 This is because certain sorts of errors may make LyX unable to read
7284 The LyX team strives to keep LyX stable in such situations, but safe is
7289 \begin_layout Plain Layout
7290 While we're giving advice: make regular backups.
7291 And be nice to your mother.
7299 \begin_layout Subsection
7300 The Module declaration
7303 \begin_layout Standard
7304 A module must begin with a line like the following:
7307 \begin_layout LyX-Code
7310 DeclareLyXModule[endnotes.sty]{Endnotes}
7313 \begin_layout Standard
7314 The mandatory argument, in curly brackets, is the name of the module, as
7316 \begin_inset Flex CharStyle:MenuItem
7319 \begin_layout Plain Layout
7320 Document\SpecialChar \menuseparator
7327 The argument in square brackets is optional: It declares any LaTeX packages
7328 on which the module depends.
7329 Please note that only packages about which LyX knows should be listed in
7330 the square brackets.
7334 \begin_layout Plain Layout
7335 The list of such packages is documented only in the source code.
7340 LyX will not check for arbitrary packages.
7341 It is also possible to use the form
7342 \begin_inset Flex CharStyle:MenuItem
7345 \begin_layout Plain Layout
7351 as an optional argument, which declares that the module can only be used
7352 when there exists a conversion chain between the formats `
7353 \begin_inset Flex CharStyle:Code
7356 \begin_layout Plain Layout
7363 \begin_inset Flex CharStyle:Code
7366 \begin_layout Plain Layout
7375 \begin_layout Standard
7376 The module declaration should then be followed by lines like the following:
7379 \begin_layout LyX-Code
7383 \begin_layout LyX-Code
7384 #Adds an endnote command, in addition to footnotes.
7388 \begin_layout LyX-Code
7389 #You will need to add
7391 theendnotes in TeX code where you
7394 \begin_layout LyX-Code
7395 #want the endnotes to appear.
7399 \begin_layout LyX-Code
7403 \begin_layout LyX-Code
7404 #Requires: somemodule | othermodule
7407 \begin_layout LyX-Code
7408 #Excludes: badmodule
7411 \begin_layout Standard
7412 The description is used in
7413 \begin_inset Flex CharStyle:MenuItem
7416 \begin_layout Plain Layout
7417 Document\SpecialChar \menuseparator
7423 to provide the user with information about what the module does.
7425 \begin_inset Flex CharStyle:Code
7428 \begin_layout Plain Layout
7434 line is used to identify other modules with which this one must be used;
7436 \begin_inset Flex CharStyle:Code
7439 \begin_layout Plain Layout
7445 line is used to identify modules with which this one may not be used.
7446 Both are optional, and, as shown, multiple modules should be separated
7447 with the pipe symbol: |.
7448 Note that the required modules are treated disjunctively:
7452 of the required modules must be used.
7457 excluded module may be used.
7458 Note that modules are identified here by their
7463 \begin_inset Flex CharStyle:Code
7466 \begin_layout Plain Layout
7474 \begin_inset Flex CharStyle:Code
7477 \begin_layout Plain Layout
7484 \begin_inset Flex CharStyle:Code
7487 \begin_layout Plain Layout
7496 \begin_layout Subsection
7500 \begin_layout Standard
7501 The first non-comment line of any layout file, included file, or module
7506 contain the file format number:
7509 \begin_layout Description
7510 \begin_inset Flex CharStyle:Code
7513 \begin_layout Plain Layout
7520 \begin_inset Flex CharStyle:Code
7523 \begin_layout Plain Layout
7529 ] The format of the layout file.
7532 \begin_layout Standard
7533 This tag was introduced with LyX 1.4.0.
7534 Layout files from LyX 1.3.x and earlier don't have an explicit file format
7535 and are considered to be of format 1.
7536 The format for the present version of LyX is format 21.
7537 But each version of LyX is capable of reading earlier versions' layout
7538 files, just as they are capable of reading files produced by earlier versions
7540 There is, however, no provision for converting to earlier formats.
7541 So LyX 1.6.x will not read layout files in format 21 but only files in format
7545 \begin_layout Subsection
7546 \begin_inset CommandInset label
7548 name "sub:General-text-class"
7552 General text class parameters
7555 \begin_layout Standard
7556 These are general parameters that govern the behavior of an entire document
7562 mean that they must appear in
7563 \begin_inset Flex CharStyle:Code
7566 \begin_layout Plain Layout
7572 files rather than in modules.
7573 A module can contain any layout tag.)
7576 \begin_layout Description
7577 \begin_inset Flex CharStyle:Code
7580 \begin_layout Plain Layout
7586 Adds information that will be output in the
7587 \begin_inset Flex CharStyle:Code
7590 \begin_layout Plain Layout
7596 block when this document class is output to XHTML.
7597 Typically, this would be used to output CSS style information, but it can
7598 be used for anything that can appear in
7599 \begin_inset Flex CharStyle:Code
7602 \begin_layout Plain Layout
7610 \begin_inset Quotes eld
7614 \begin_inset Flex CharStyle:Code
7617 \begin_layout Plain Layout
7624 \begin_inset Quotes erd
7630 \begin_layout Description
7631 \begin_inset Flex CharStyle:Code
7634 \begin_layout Plain Layout
7640 Adds information to the document preamble.
7642 \begin_inset Quotes eld
7646 \begin_inset Flex CharStyle:Code
7649 \begin_layout Plain Layout
7656 \begin_inset Quotes erd
7662 \begin_layout Description
7663 \begin_inset Flex CharStyle:Code
7666 \begin_layout Plain Layout
7672 Defines formats for use in the display of bibliographic information.
7674 \begin_inset CommandInset ref
7676 reference "sub:Citation-format-description"
7682 \begin_inset Quotes eld
7686 \begin_inset Flex CharStyle:Code
7689 \begin_layout Plain Layout
7696 \begin_inset Quotes erd
7702 \begin_layout Description
7703 \begin_inset Flex CharStyle:Code
7706 \begin_layout Plain Layout
7712 Describes various global options supported by the document class.
7714 \begin_inset space ~
7718 \begin_inset CommandInset ref
7720 reference "sub:ClassOptions"
7726 \begin_inset Quotes eld
7730 \begin_inset Flex CharStyle:Code
7733 \begin_layout Plain Layout
7740 \begin_inset Quotes erd
7746 \begin_layout Description
7747 \begin_inset Flex CharStyle:Code
7750 \begin_layout Plain Layout
7757 \begin_inset Flex CharStyle:Code
7760 \begin_layout Plain Layout
7769 \begin_inset Flex CharStyle:Code
7772 \begin_layout Plain Layout
7778 ] Whether the class should
7782 to having one or two columns.
7783 Can be changed in the
7784 \begin_inset Flex CharStyle:MenuItem
7787 \begin_layout Plain Layout
7788 Document\SpecialChar \menuseparator
7797 \begin_layout Description
7798 \begin_inset Flex CharStyle:Code
7801 \begin_layout Plain Layout
7808 \begin_inset Flex CharStyle:Code
7811 \begin_layout Plain Layout
7817 ] This sequence defines the properties for a counter.
7818 If the counter does not yet exist, it is created; if it does exist, it
7821 \begin_inset Quotes eld
7825 \begin_inset Flex CharStyle:Code
7828 \begin_layout Plain Layout
7835 \begin_inset Quotes erd
7839 \begin_inset Newline newline
7843 \begin_inset space ~
7847 \begin_inset CommandInset ref
7849 reference "sub:Counters"
7853 for details on counters.
7856 \begin_layout Description
7857 \begin_inset Flex CharStyle:Code
7860 \begin_layout Plain Layout
7866 Sets the default font used to display the document.
7868 \begin_inset space ~
7872 \begin_inset CommandInset ref
7874 reference "sub:Font-description"
7878 for how to declare fonts.
7880 \begin_inset Quotes eld
7884 \begin_inset Flex CharStyle:Code
7887 \begin_layout Plain Layout
7894 \begin_inset Quotes erd
7900 \begin_layout Description
7901 \begin_inset Flex CharStyle:Code
7904 \begin_layout Plain Layout
7911 \begin_inset Flex CharStyle:Code
7914 \begin_layout Plain Layout
7920 Specifies a module to be included by default with this document class.
7921 The module should be specified by filename without the
7922 \begin_inset Flex CharStyle:Code
7925 \begin_layout Plain Layout
7932 The user can still remove the module, but it will be active at the outset.
7933 (This applies only when new files are created, or when this class is chosen
7934 for an existing document.)
7937 \begin_layout Description
7938 \begin_inset Flex CharStyle:Code
7941 \begin_layout Plain Layout
7948 \begin_inset Flex CharStyle:Code
7951 \begin_layout Plain Layout
7957 ] This is the style that will be assigned to new paragraphs, usually
7958 \begin_inset Flex CharStyle:MenuItem
7961 \begin_layout Plain Layout
7968 This will default to the first defined style if not given, but you are
7969 encouraged to use this directive.
7972 \begin_layout Description
7973 \begin_inset Flex CharStyle:Code
7976 \begin_layout Plain Layout
7983 \begin_inset Flex CharStyle:Code
7986 \begin_layout Plain Layout
7992 ] This tag indicates that the module in question—which should be specified
7993 by filename without the
7994 \begin_inset Flex CharStyle:Code
7997 \begin_layout Plain Layout
8003 extension—cannot be used with this document class.
8004 This might be used in a journal-specific layout file to prevent, say, the
8006 \begin_inset Flex CharStyle:Code
8009 \begin_layout Plain Layout
8015 module that numbers theorems by section.
8020 be used in a module.
8021 Modules have their own way of excluding other modules (see
8022 \begin_inset CommandInset ref
8024 reference "sub:Layout-modules"
8031 \begin_layout Description
8032 \begin_inset Flex CharStyle:Code
8035 \begin_layout Plain Layout
8041 Defines a new float.
8043 \begin_inset space ~
8047 \begin_inset CommandInset ref
8049 reference "sub:Floats"
8055 \begin_inset Quotes eld
8059 \begin_inset Flex CharStyle:Code
8062 \begin_layout Plain Layout
8069 \begin_inset Quotes erd
8075 \begin_layout Description
8076 \begin_inset Flex CharStyle:Code
8079 \begin_layout Plain Layout
8085 Sets the information that will be output in the
8086 \begin_inset Flex CharStyle:Code
8089 \begin_layout Plain Layout
8095 block when this document class is output to XHTML.
8096 Note that this will completely override any prior
8097 \begin_inset Flex CharStyle:Code
8100 \begin_layout Plain Layout
8107 \begin_inset Flex CharStyle:Code
8110 \begin_layout Plain Layout
8118 \begin_inset Flex CharStyle:Code
8121 \begin_layout Plain Layout
8127 if you just want to add material to the preamble.) Must end with
8128 \begin_inset Quotes eld
8132 \begin_inset Flex CharStyle:Code
8135 \begin_layout Plain Layout
8142 \begin_inset Quotes erd
8148 \begin_layout Description
8149 \begin_inset Flex CharStyle:Code
8152 \begin_layout Plain Layout
8159 \begin_inset Flex CharStyle:Code
8162 \begin_layout Plain Layout
8168 ] The layout to use for the table of contents, bibliography, and so forth,
8169 when the document is output to HTML.
8170 For articles, this should normally be Section; for books, Chapter.
8171 If it is not given, then LyX will attempt to figure out which layout to
8175 \begin_layout Description
8176 \begin_inset Flex CharStyle:Code
8179 \begin_layout Plain Layout
8186 \begin_inset Flex CharStyle:Code
8189 \begin_layout Plain Layout
8195 ] Modifies the properties of the given counter.
8196 If the counter does not exist, the section is ignored.
8198 \begin_inset Quotes eld
8202 \begin_inset Flex CharStyle:Code
8205 \begin_layout Plain Layout
8212 \begin_inset Quotes erd
8216 \begin_inset Newline newline
8220 \begin_inset space ~
8224 \begin_inset CommandInset ref
8226 reference "sub:Counters"
8230 for details on counters.
8233 \begin_layout Description
8234 \begin_inset Flex CharStyle:Code
8237 \begin_layout Plain Layout
8244 \begin_inset Flex CharStyle:Code
8247 \begin_layout Plain Layout
8253 ] Modifies the properties of the given paragraph style.
8254 If the style does not exist, the section is ignored.
8256 \begin_inset Quotes eld
8260 \begin_inset Flex CharStyle:Code
8263 \begin_layout Plain Layout
8270 \begin_inset Quotes erd
8276 \begin_layout Description
8277 \begin_inset Flex CharStyle:Code
8280 \begin_layout Plain Layout
8286 As its name implies, this command allows you to include another layout
8287 definition file within yours to avoid duplicating commands.
8288 Common examples are the standard layout files, for example,
8289 \begin_inset Flex CharStyle:Code
8292 \begin_layout Plain Layout
8298 , which contains most of the basic layouts.
8301 \begin_layout Description
8302 \begin_inset Flex CharStyle:Code
8305 \begin_layout Plain Layout
8311 This section (re-)defines the layout of an inset.
8312 It can be applied to an existing inset or to a new, user-defined inset,
8313 e.g., a new character style.
8315 \begin_inset Quotes eld
8319 \begin_inset Flex CharStyle:Code
8322 \begin_layout Plain Layout
8329 \begin_inset Quotes erd
8333 \begin_inset Newline newline
8337 \begin_inset space ~
8341 \begin_inset CommandInset ref
8343 reference "sub:Flex-insets-and"
8347 for more information.
8351 \begin_layout Description
8352 \begin_inset Flex CharStyle:Code
8355 \begin_layout Plain Layout
8362 \begin_inset Flex CharStyle:Code
8365 \begin_layout Plain Layout
8371 ] A string that indicates the width of the left margin on the screen, for
8373 \begin_inset Quotes eld
8377 \begin_inset Quotes erd
8381 (Note that this is not a `length', like
8382 \begin_inset Quotes eld
8386 \begin_inset Quotes erd
8392 \begin_layout Description
8393 \begin_inset Flex CharStyle:Code
8396 \begin_layout Plain Layout
8402 This command deletes an existing float.
8403 This is particularly useful when you want to suppress a float that has
8404 been defined in an input file.
8407 \begin_layout Description
8408 \begin_inset Flex CharStyle:Code
8411 \begin_layout Plain Layout
8417 This command deletes an existing style.
8418 This is particularly useful when you want to suppress a style that has
8419 be defined in an input file.
8422 \begin_layout Description
8423 \begin_inset Flex CharStyle:Code
8426 \begin_layout Plain Layout
8432 A string indicating the file format (as defined in the Preferences dialog)
8433 produced by this class.
8434 It is mainly useful when
8435 \begin_inset Flex CharStyle:Code
8438 \begin_layout Plain Layout
8444 is `literate' and one wants to define a new type of literate document.
8445 This string is reset to `docbook', `latex', or `literate' when the correspondin
8447 \begin_inset Flex CharStyle:Code
8450 \begin_layout Plain Layout
8456 parameter is encountered.
8459 \begin_layout Description
8460 \begin_inset Flex CharStyle:Code
8463 \begin_layout Plain Layout
8469 A string indicating what sort of output documents using this class will
8471 At present, the options are: `docbook', `latex', and `literate'.
8474 \begin_layout Description
8475 \begin_inset Flex CharStyle:Code
8478 \begin_layout Plain Layout
8485 \begin_inset Flex CharStyle:Code
8488 \begin_layout Plain Layout
8497 \begin_inset Flex CharStyle:Code
8500 \begin_layout Plain Layout
8507 \begin_inset Flex CharStyle:Code
8510 \begin_layout Plain Layout
8516 ] The default pagestyle.
8517 Can be changed in the
8518 \begin_inset Flex CharStyle:MenuItem
8521 \begin_layout Plain Layout
8522 Document\SpecialChar \menuseparator
8531 \begin_layout Description
8532 \begin_inset Flex CharStyle:Code
8535 \begin_layout Plain Layout
8541 Sets the preamble for the LaTeX document.
8542 Note that this will completely override any prior
8543 \begin_inset Flex CharStyle:Code
8546 \begin_layout Plain Layout
8553 \begin_inset Flex CharStyle:Code
8556 \begin_layout Plain Layout
8564 \begin_inset Flex CharStyle:Code
8567 \begin_layout Plain Layout
8573 if you just want to add material to the preamble.) Must end with
8574 \begin_inset Quotes eld
8578 \begin_inset Flex CharStyle:Code
8581 \begin_layout Plain Layout
8588 \begin_inset Quotes erd
8594 \begin_layout Description
8595 \begin_inset Flex CharStyle:Code
8598 \begin_layout Plain Layout
8605 \begin_inset Flex CharStyle:Code
8608 \begin_layout Plain Layout
8615 \begin_inset Flex CharStyle:Code
8618 \begin_layout Plain Layout
8627 \begin_inset Flex CharStyle:Code
8630 \begin_layout Plain Layout
8636 ] Whether the class already provides the feature
8637 \begin_inset Flex CharStyle:Code
8640 \begin_layout Plain Layout
8647 A feature is in general the name of a package (
8648 \begin_inset Flex CharStyle:Code
8651 \begin_layout Plain Layout
8658 \begin_inset Flex CharStyle:Code
8661 \begin_layout Plain Layout
8667 , \SpecialChar \ldots{}
8669 \begin_inset Flex CharStyle:Code
8672 \begin_layout Plain Layout
8679 \begin_inset Flex CharStyle:Code
8682 \begin_layout Plain Layout
8688 ,\SpecialChar \ldots{}
8689 ); the complete list of supported features is unfortunately not documented
8690 outside the LyX source code—but see
8691 \begin_inset Flex CharStyle:Code
8694 \begin_layout Plain Layout
8700 if you're interested.
8702 \begin_inset Flex CharStyle:MenuItem
8705 \begin_layout Plain Layout
8706 Help\SpecialChar \menuseparator
8712 also gives an overview of the supported packages.
8715 \begin_layout Description
8716 \begin_inset Flex CharStyle:Code
8719 \begin_layout Plain Layout
8726 \begin_inset Flex CharStyle:Code
8729 \begin_layout Plain Layout
8735 ] Indicates that this layout provides the functionality of the module mentioned,
8736 which should be specified by the filename without the
8737 \begin_inset Flex CharStyle:Code
8740 \begin_layout Plain Layout
8747 This will typically be used if the layout includes the module directly,
8748 rather than using the
8749 \begin_inset Flex CharStyle:Code
8752 \begin_layout Plain Layout
8758 tag to indicate that it ought to be used.
8759 It could also be used in a module that provided an alternate implementation
8760 of the same functionality.
8763 \begin_layout Description
8764 \begin_inset Flex CharStyle:Code
8767 \begin_layout Plain Layout
8774 \begin_inset Flex CharStyle:Code
8777 \begin_layout Plain Layout
8783 ] Whether the class requires the feature
8784 \begin_inset Flex CharStyle:Code
8787 \begin_layout Plain Layout
8794 Multiple features must be separated by commas.
8795 Note that you can only request supported features.
8797 \begin_inset Flex CharStyle:Code
8800 \begin_layout Plain Layout
8806 for a list of these.)
8809 \begin_layout Description
8810 \begin_inset Flex CharStyle:Code
8813 \begin_layout Plain Layout
8819 A string that indicates the width of the right margin on the screen, for
8821 \begin_inset Quotes eld
8825 \begin_inset Quotes erd
8831 \begin_layout Description
8832 \begin_inset Flex CharStyle:Code
8835 \begin_layout Plain Layout
8841 Sets which divisions get numbered.
8843 \begin_inset Flex CharStyle:Code
8846 \begin_layout Plain Layout
8855 \begin_layout Description
8856 \begin_inset Flex CharStyle:Code
8859 \begin_layout Plain Layout
8866 \begin_inset Flex CharStyle:Code
8869 \begin_layout Plain Layout
8878 \begin_inset Flex CharStyle:Code
8881 \begin_layout Plain Layout
8887 ] Whether the class-default should be printing on one or both sides of the
8889 Can be changed in the
8890 \begin_inset Flex CharStyle:MenuItem
8893 \begin_layout Plain Layout
8894 Document\SpecialChar \menuseparator
8903 \begin_layout Description
8904 \begin_inset Flex CharStyle:Code
8907 \begin_layout Plain Layout
8913 This sequence defines a paragraph style.
8914 If the style does not yet exist, it is created; if it does exist, its parameter
8917 \begin_inset Quotes eld
8921 \begin_inset Flex CharStyle:Code
8924 \begin_layout Plain Layout
8931 \begin_inset Quotes erd
8935 \begin_inset Newline newline
8939 \begin_inset space ~
8943 \begin_inset CommandInset ref
8945 reference "sub:Paragraph-Styles"
8949 for details on paragraph styles.
8952 \begin_layout Description
8953 \begin_inset Flex CharStyle:Code
8956 \begin_layout Plain Layout
8963 \begin_inset Flex CharStyle:Code
8966 \begin_layout Plain Layout
8972 ] The name of the command or environment to be used with
8973 \begin_inset Flex CharStyle:Code
8976 \begin_layout Plain Layout
8985 \begin_layout Description
8986 \begin_inset Flex CharStyle:Code
8989 \begin_layout Plain Layout
8996 \begin_inset Flex CharStyle:Code
8999 \begin_layout Plain Layout
9008 \begin_inset Flex CharStyle:Code
9011 \begin_layout Plain Layout
9017 ] Indicates what kind of markup is used to define the title of a document.
9019 \begin_inset Flex CharStyle:Code
9022 \begin_layout Plain Layout
9028 means that the macro with name
9029 \begin_inset Flex CharStyle:Code
9032 \begin_layout Plain Layout
9038 will be inserted after the last layout which has
9039 \begin_inset Quotes eld
9043 \begin_inset Flex CharStyle:Code
9046 \begin_layout Plain Layout
9053 \begin_inset Quotes erd
9058 \begin_inset Flex CharStyle:Code
9061 \begin_layout Plain Layout
9067 corresponds to the case where the block of paragraphs which have
9068 \begin_inset Quotes eld
9072 \begin_inset Flex CharStyle:Code
9075 \begin_layout Plain Layout
9082 \begin_inset Quotes erd
9085 should be enclosed into the
9086 \begin_inset Flex CharStyle:Code
9089 \begin_layout Plain Layout
9098 \begin_layout Description
9099 \begin_inset Flex CharStyle:Code
9102 \begin_layout Plain Layout
9108 Sets which divisions are included in the table of contents.
9110 \begin_inset Flex CharStyle:Code
9113 \begin_layout Plain Layout
9122 \begin_layout Subsection
9123 \begin_inset Flex CharStyle:Code
9126 \begin_layout Plain Layout
9133 \begin_inset CommandInset label
9135 name "sub:ClassOptions"
9142 \begin_layout Standard
9144 \begin_inset Flex CharStyle:Code
9147 \begin_layout Plain Layout
9153 section can contain the following entries:
9156 \begin_layout Description
9157 \begin_inset Flex CharStyle:Code
9160 \begin_layout Plain Layout
9167 \begin_inset Flex CharStyle:Code
9170 \begin_layout Plain Layout
9176 ] The list of available font sizes for the document's main font, separated
9178 \begin_inset Quotes eld
9182 \begin_inset Flex CharStyle:Code
9185 \begin_layout Plain Layout
9192 \begin_inset Quotes erd
9198 \begin_layout Description
9199 \begin_inset Flex CharStyle:Code
9202 \begin_layout Plain Layout
9208 Used to set the DTD line with XML-based output classes.
9210 \begin_inset space \thinspace{}
9214 \begin_inset Quotes eld
9217 -//OASIS//DTD DocBook V4.2//EN
9218 \begin_inset Quotes erd
9224 \begin_layout Description
9225 \begin_inset Flex CharStyle:Code
9228 \begin_layout Plain Layout
9235 \begin_inset Flex CharStyle:Code
9238 \begin_layout Plain Layout
9239 string="empty|plain|headings|fancy"
9244 ] The list of available page styles, separated by
9245 \begin_inset Quotes eld
9249 \begin_inset Flex CharStyle:Code
9252 \begin_layout Plain Layout
9259 \begin_inset Quotes erd
9265 \begin_layout Description
9266 \begin_inset Flex CharStyle:Code
9269 \begin_layout Plain Layout
9276 \begin_inset Flex CharStyle:Code
9279 \begin_layout Plain Layout
9285 ] Some document class options, separated by a comma, that will be added
9286 to the optional part of the
9287 \begin_inset Flex CharStyle:Code
9290 \begin_layout Plain Layout
9301 \begin_layout Standard
9303 \begin_inset Flex CharStyle:Code
9306 \begin_layout Plain Layout
9312 section must end with
9313 \begin_inset Quotes eld
9317 \begin_inset Flex CharStyle:Code
9320 \begin_layout Plain Layout
9327 \begin_inset Quotes erd
9333 \begin_layout Subsection
9335 \begin_inset CommandInset label
9337 name "sub:Paragraph-Styles"
9344 \begin_layout Standard
9345 A paragraph style description looks like this:
9349 \begin_layout Plain Layout
9350 Note that this will either define a new layout or modify an existing one.
9358 \begin_layout LyX-Code
9365 \begin_layout LyX-Code
9369 \begin_layout LyX-Code
9373 \begin_layout Standard
9374 where the following commands are allowed:
9377 \begin_layout Description
9378 \begin_inset Flex CharStyle:Code
9381 \begin_layout Plain Layout
9388 \begin_inset Flex CharStyle:Code
9391 \begin_layout Plain Layout
9396 , left, right, center
9401 ] Paragraph alignment.
9404 \begin_layout Description
9405 \begin_inset Flex CharStyle:Code
9408 \begin_layout Plain Layout
9415 \begin_inset Flex CharStyle:Code
9418 \begin_layout Plain Layout
9423 , left, right, center
9428 ] A comma separated list of permitted alignments.
9429 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
9431 For example a right-aligned or centered enumeration isn't possible.)
9434 \begin_layout Description
9435 \begin_inset Flex CharStyle:Code
9438 \begin_layout Plain Layout
9444 Note that this will completely override any prior
9445 \begin_inset Flex CharStyle:Code
9448 \begin_layout Plain Layout
9454 declaration for this style.
9456 \begin_inset Quotes eld
9460 \begin_inset Flex CharStyle:Code
9463 \begin_layout Plain Layout
9470 \begin_inset Quotes erd
9475 \begin_inset CommandInset ref
9477 reference "sub:I18n"
9481 for details on its use.
9484 \begin_layout Description
9485 \begin_inset Flex CharStyle:Code
9488 \begin_layout Plain Layout
9495 \begin_inset Flex CharStyle:Code
9498 \begin_layout Plain Layout
9508 \begin_layout Plain Layout
9509 Note that a `float' here is a real number, such as: 1.5.
9514 The vertical space with which the last of a chain of paragraphs with this
9515 layout is separated from the following paragraph.
9516 If the next paragraph has another layout, the separations are not simply
9517 added, but the maximum is taken.
9520 \begin_layout Description
9521 \begin_inset Flex CharStyle:Code
9524 \begin_layout Plain Layout
9531 \begin_inset Flex CharStyle:Code
9534 \begin_layout Plain Layout
9540 The category for this style.
9541 This is used to group related styles in the Layout combobox on the toolbar.
9542 Any string can be used, but you may want to use existing categories with
9547 \begin_layout Description
9548 \begin_inset Flex CharStyle:Code
9551 \begin_layout Plain Layout
9557 Depth of XML command.
9558 Used only with XML-type formats.
9561 \begin_layout Description
9562 \begin_inset Flex CharStyle:Code
9565 \begin_layout Plain Layout
9572 \begin_inset CommandInset label
9574 name "des:CopyStyle"
9579 \begin_inset Flex CharStyle:Code
9582 \begin_layout Plain Layout
9588 Copies all the features of an existing style into the current one.
9592 \begin_layout Description
9593 \begin_inset Flex CharStyle:Code
9596 \begin_layout Plain Layout
9602 The name of a style whose preamble should be output
9607 This allows to ensure some ordering of the preamble snippets when macros
9608 definitions depend on one another.
9612 \begin_layout Plain Layout
9613 Note that, besides that functionality, there is no way to ensure any ordering
9615 The ordering that you see in a given version of LyX may change without
9616 warning in later versions.
9624 \begin_layout Description
9625 \begin_inset Flex CharStyle:Code
9628 \begin_layout Plain Layout
9635 \begin_inset Flex CharStyle:Code
9638 \begin_layout Plain Layout
9643 , Box, Filled_Box, Static
9648 ] The type of label that stands at the end of the paragraph (or sequence
9650 \begin_inset Flex CharStyle:Code
9653 \begin_layout Plain Layout
9660 \begin_inset Flex CharStyle:Code
9663 \begin_layout Plain Layout
9670 \begin_inset Flex CharStyle:Code
9673 \begin_layout Plain Layout
9680 \begin_inset Flex CharStyle:Code
9683 \begin_layout Plain Layout
9691 \begin_inset Flex CharStyle:Code
9694 \begin_layout Plain Layout
9701 \begin_inset Quotes eld
9705 \begin_inset Quotes erd
9709 \begin_inset Flex CharStyle:Code
9712 \begin_layout Plain Layout
9719 \begin_inset Flex CharStyle:Code
9722 \begin_layout Plain Layout
9723 \begin_inset space ~
9732 \begin_inset space ~
9735 black) square suitable for end of proof markers,
9736 \begin_inset Flex CharStyle:Code
9739 \begin_layout Plain Layout
9745 is an explicit text string.
9748 \begin_layout Description
9749 \begin_inset Flex CharStyle:Code
9752 \begin_layout Plain Layout
9759 \begin_inset Flex CharStyle:Code
9762 \begin_layout Plain Layout
9768 ] The string used for a label with a
9769 \begin_inset Flex CharStyle:Code
9772 \begin_layout Plain Layout
9779 \begin_inset Flex CharStyle:Code
9782 \begin_layout Plain Layout
9792 \begin_layout Description
9793 \begin_inset Flex CharStyle:Code
9796 \begin_layout Plain Layout
9803 \begin_inset Flex CharStyle:Code
9806 \begin_layout Plain Layout
9817 \begin_inset Flex CharStyle:Code
9820 \begin_layout Plain Layout
9829 \begin_layout Description
9830 \begin_inset Flex CharStyle:Code
9833 \begin_layout Plain Layout
9840 \begin_inset Flex CharStyle:Code
9843 \begin_layout Plain Layout
9853 ] With this parameter the
9854 \begin_inset Flex CharStyle:MenuItem
9857 \begin_layout Plain Layout
9864 \begin_inset Quotes eld
9867 Vertical space above
9868 \begin_inset Quotes erd
9872 \begin_inset Flex CharStyle:MenuItem
9875 \begin_layout Plain Layout
9876 Edit\SpecialChar \menuseparator
9878 \begin_inset space ~
9886 dialog can be set when initializing a paragraph with this style.
9890 \begin_layout Plain Layout
9893 Note from Jean-Marc:
9895 I'm not sure that this setting has much use, and it should probably be
9896 removed in later versions.
9904 \begin_layout Description
9905 \begin_inset Flex CharStyle:Code
9908 \begin_layout Plain Layout
9914 The font used for both the text body
9920 \begin_inset space ~
9924 \begin_inset CommandInset ref
9926 reference "sub:Font-description"
9931 Note that defining this font automatically defines the
9932 \begin_inset Flex CharStyle:Code
9935 \begin_layout Plain Layout
9942 So you should define this one first if you also want to define
9943 \begin_inset Flex CharStyle:Code
9946 \begin_layout Plain Layout
9955 \begin_layout Description
9956 \begin_inset Flex CharStyle:Code
9959 \begin_layout Plain Layout
9966 \begin_inset CommandInset label
9968 name "des:FreeSpacing"
9973 \begin_inset Flex CharStyle:Code
9976 \begin_layout Plain Layout
9985 \begin_inset Flex CharStyle:Code
9988 \begin_layout Plain Layout
9994 ] Usually LyX doesn't allow you to insert more than one space between words,
9995 since a space is considered as the separation between two words, not a
9996 character or symbol of its own.
9997 This is a very fine thing but sometimes annoying, for example, when typing
9998 program code or plain LaTeX code.
10000 \begin_inset Flex CharStyle:Code
10003 \begin_layout Plain Layout
10010 Note that LyX will create protected blanks for the additional blanks when
10011 in another mode than LaTeX-mode.
10014 \begin_layout Description
10015 \begin_inset Flex CharStyle:Code
10018 \begin_layout Plain Layout
10024 These tags are used with XHTML output.
10026 \begin_inset CommandInset ref
10028 reference "sub:Paragraph-Style-XHTML"
10035 \begin_layout Description
10036 \begin_inset Flex CharStyle:Code
10039 \begin_layout Plain Layout
10045 [[FIXME]] (Used only with XML-type formats.)
10048 \begin_layout Description
10049 \begin_inset Flex CharStyle:Code
10052 \begin_layout Plain Layout
10059 \begin_inset Flex CharStyle:Code
10062 \begin_layout Plain Layout
10068 If 1, marks the layout as to be included in the document preamble rather
10069 than in the document body.
10070 This is useful for document classes that want such information as the title
10071 and author to appear in the preamble.
10072 Note that this works only for layouts for which the
10073 \begin_inset Flex CharStyle:Code
10076 \begin_layout Plain Layout
10083 \begin_inset Flex CharStyle:Code
10086 \begin_layout Plain Layout
10095 \begin_layout Description
10096 \begin_inset Flex CharStyle:Code
10099 \begin_layout Plain Layout
10106 \begin_inset Flex CharStyle:Code
10109 \begin_layout Plain Layout
10115 If 1, marks the layout as being part of a title block (see also the
10116 \begin_inset Flex CharStyle:Code
10119 \begin_layout Plain Layout
10126 \begin_inset Flex CharStyle:Code
10129 \begin_layout Plain Layout
10138 \begin_layout Description
10139 \begin_inset Flex CharStyle:Code
10142 \begin_layout Plain Layout
10149 \begin_inset Flex CharStyle:Code
10152 \begin_layout Plain Layout
10158 ] This provides extra space between paragraphs that have the same layout.
10159 If you put other layouts into an environment, each is separated with the
10161 \begin_inset Flex CharStyle:Code
10164 \begin_layout Plain Layout
10171 But the whole items of the environment are additionally separated with
10173 \begin_inset Flex CharStyle:Code
10176 \begin_layout Plain Layout
10183 Note that this is a
10188 \begin_layout Description
10189 \begin_inset Flex CharStyle:Code
10192 \begin_layout Plain Layout
10198 [[FIXME]] (Used only with XML-type formats.)
10201 \begin_layout Description
10202 \begin_inset Flex CharStyle:Code
10205 \begin_layout Plain Layout
10212 \begin_inset CommandInset label
10214 name "des:KeepEmpty"
10219 \begin_inset Flex CharStyle:Code
10222 \begin_layout Plain Layout
10231 \begin_inset Flex CharStyle:Code
10234 \begin_layout Plain Layout
10240 ] Usually LyX does not allow you to leave a paragraph empty, since it would
10241 lead to empty LaTeX output.
10242 There are some cases where this could be desirable however: in a letter
10243 template, the required fields can be provided as empty fields, so that
10244 people do not forget them; in some special classes, a layout can be used
10245 as some kind of break, which does not contain actual text.
10248 \begin_layout Description
10249 \begin_inset Flex CharStyle:Code
10252 \begin_layout Plain Layout
10258 [float=0] The vertical space between the label and the text body.
10259 Only used for labels that are above the text body (
10260 \begin_inset Flex CharStyle:Code
10263 \begin_layout Plain Layout
10270 \begin_inset Flex CharStyle:Code
10273 \begin_layout Plain Layout
10274 Centered_Top_Environment
10282 \begin_layout Description
10283 \begin_inset Flex CharStyle:Code
10286 \begin_layout Plain Layout
10293 \begin_inset Flex CharStyle:Code
10296 \begin_layout Plain Layout
10303 \begin_inset Newline newline
10306 The name of the counter for automatic numbering.
10308 \begin_inset Newline newline
10316 \begin_inset Flex CharStyle:Code
10319 \begin_layout Plain Layout
10326 \begin_inset Flex CharStyle:Code
10329 \begin_layout Plain Layout
10336 In that case, the counter will be stepped each time the layout appears.
10338 \begin_inset Newline newline
10346 \begin_inset Flex CharStyle:Code
10349 \begin_layout Plain Layout
10356 \begin_inset Flex CharStyle:Code
10359 \begin_layout Plain Layout
10365 , though this case is a bit complicated.
10366 Suppose you declare
10367 \begin_inset Quotes eld
10371 \begin_inset Flex CharStyle:Code
10374 \begin_layout Plain Layout
10375 LabelCounter myenum
10381 \begin_inset Quotes erd
10385 Then the actual counters used are
10386 \begin_inset Flex CharStyle:Code
10389 \begin_layout Plain Layout
10396 \begin_inset Flex CharStyle:Code
10399 \begin_layout Plain Layout
10406 \begin_inset Flex CharStyle:Code
10409 \begin_layout Plain Layout
10416 \begin_inset Flex CharStyle:Code
10419 \begin_layout Plain Layout
10425 , much as in LaTeX.
10426 These counters must all be declared separately.
10427 \begin_inset Newline newline
10431 \begin_inset CommandInset ref
10433 reference "sub:Counters"
10437 for details on counters.
10440 \begin_layout Description
10441 \begin_inset Flex CharStyle:Code
10444 \begin_layout Plain Layout
10450 The font used for the label.
10452 \begin_inset space ~
10456 \begin_inset CommandInset ref
10458 reference "sub:Font-description"
10465 \begin_layout Description
10466 \begin_inset Flex CharStyle:Code
10469 \begin_layout Plain Layout
10475 Text that indicates how far a label should be indented.
10478 \begin_layout Description
10479 \begin_inset Flex CharStyle:Code
10482 \begin_layout Plain Layout
10489 \begin_inset Flex CharStyle:Code
10492 \begin_layout Plain Layout
10498 ] The horizontal space between the label and the text body.
10499 Only used for labels that are not above the text body.
10502 \begin_layout Description
10503 \begin_inset Flex CharStyle:Code
10506 \begin_layout Plain Layout
10513 \begin_inset Flex CharStyle:Code
10516 \begin_layout Plain Layout
10522 ] The string used for a label with a
10523 \begin_inset Flex CharStyle:Code
10526 \begin_layout Plain Layout
10534 \begin_inset Flex CharStyle:Code
10537 \begin_layout Plain Layout
10543 is set, this string can be contain the special formatting commands described
10545 \begin_inset CommandInset ref
10547 reference "sub:Counters"
10555 \begin_layout Plain Layout
10556 For the sake of backwards compatibility, the string
10557 \begin_inset Flex CharStyle:Code
10560 \begin_layout Plain Layout
10570 will be replaced by the expanded
10571 \begin_inset Flex CharStyle:Code
10574 \begin_layout Plain Layout
10581 \begin_inset Flex CharStyle:Code
10584 \begin_layout Plain Layout
10593 This feature is now obsolete and should be replaced by the mechanisms of
10595 \begin_inset CommandInset ref
10597 reference "sub:Counters"
10609 \begin_layout Description
10610 \begin_inset Flex CharStyle:Code
10613 \begin_layout Plain Layout
10614 LabelStringAppendix
10620 \begin_inset Flex CharStyle:Code
10623 \begin_layout Plain Layout
10629 ] This is used inside the appendix instead of
10630 \begin_inset Flex CharStyle:Code
10633 \begin_layout Plain Layout
10641 \begin_inset Flex CharStyle:Code
10644 \begin_layout Plain Layout
10651 \begin_inset Flex CharStyle:Code
10654 \begin_layout Plain Layout
10655 LabelStringAppendix
10663 \begin_layout Description
10664 \begin_inset Flex CharStyle:Code
10667 \begin_layout Plain Layout
10673 [FIXME] (Used only with XML-type formats.)
10676 \begin_layout Description
10677 \begin_inset Flex CharStyle:Code
10680 \begin_layout Plain Layout
10687 \begin_inset Flex CharStyle:Code
10690 \begin_layout Plain Layout
10695 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
10696 Enumerate, Itemize, Bibliography
10705 \begin_layout Itemize
10706 \begin_inset Flex CharStyle:Code
10709 \begin_layout Plain Layout
10715 means the label is the very first word (up to the first real blank).
10716 Use protected spaces (like
10717 \begin_inset space ~
10720 that one) if you want more than one word as the label.
10724 \begin_layout Itemize
10725 \begin_inset Flex CharStyle:Code
10728 \begin_layout Plain Layout
10734 means the label is simply whatever
10735 \begin_inset Flex CharStyle:Code
10738 \begin_layout Plain Layout
10745 Note that this really is `static'.
10748 \begin_layout Itemize
10749 \begin_inset Flex CharStyle:Code
10752 \begin_layout Plain Layout
10759 \begin_inset Flex CharStyle:Code
10762 \begin_layout Plain Layout
10763 Centered_Top_Environment
10768 are special cases of
10769 \begin_inset Flex CharStyle:Code
10772 \begin_layout Plain Layout
10779 The label will be printed above the paragraph, but only at the top of an
10780 environment or the top of a chain of paragraphs with this layout.
10781 This might be used with the
10782 \begin_inset Flex CharStyle:MenuItem
10785 \begin_layout Plain Layout
10791 layout, for example.
10794 \begin_layout Itemize
10795 \begin_inset Flex CharStyle:Code
10798 \begin_layout Plain Layout
10804 is a special case for the caption-labels
10805 \begin_inset Quotes eld
10809 \begin_inset Quotes erd
10813 \begin_inset Quotes eld
10817 \begin_inset Quotes erd
10822 \begin_inset Flex CharStyle:Code
10825 \begin_layout Plain Layout
10831 means the (hardcoded) label string depends on the kind of float: It is
10832 hardcoded to be `FloatType N', where N is the value of the counter associated
10836 \begin_layout Itemize
10838 \begin_inset Flex CharStyle:Code
10841 \begin_layout Plain Layout
10847 label type defines automatically numbered labels.
10849 \begin_inset Flex CharStyle:Code
10852 \begin_layout Plain Layout
10858 will be expanded to resolve any counter references it contains: For example,
10860 \begin_inset Quotes eld
10864 \begin_inset Flex CharStyle:Code
10867 \begin_layout Plain Layout
10878 \begin_inset Quotes erd
10883 \begin_inset CommandInset ref
10885 reference "sub:Counters"
10889 for more information on counters.
10892 \begin_layout Itemize
10893 \begin_inset Flex CharStyle:Code
10896 \begin_layout Plain Layout
10902 produces the usual sort of enumeration labels.
10903 At present, it is hardcoded to use Arabic numerals, lowercase letters,
10904 small Roman numerals, and uppercase letters for the four possible depths.
10907 \begin_layout Itemize
10908 \begin_inset Flex CharStyle:Code
10911 \begin_layout Plain Layout
10917 produces various bullets at the different levels.
10918 It is also hardcoded.
10921 \begin_layout Itemize
10922 \begin_inset Flex CharStyle:Code
10925 \begin_layout Plain Layout
10931 is used internally by LyX and should be used only with
10932 \begin_inset Flex CharStyle:Code
10935 \begin_layout Plain Layout
10936 LatexType BibEnvironment
10945 \begin_layout Description
10946 \begin_inset Flex CharStyle:Code
10949 \begin_layout Plain Layout
10955 Note that this will completely override any prior
10956 \begin_inset Flex CharStyle:Code
10959 \begin_layout Plain Layout
10965 declaration for this style.
10967 \begin_inset Quotes eld
10971 \begin_inset Flex CharStyle:Code
10974 \begin_layout Plain Layout
10981 \begin_inset Quotes erd
10986 \begin_inset CommandInset ref
10988 reference "sub:I18n"
10992 for details on its use.
10995 \begin_layout Description
10996 \begin_inset Flex CharStyle:Code
10999 \begin_layout Plain Layout
11005 The name of the corresponding LaTeX stuff.
11006 Either the environment or command name.
11009 \begin_layout Description
11010 \begin_inset Flex CharStyle:Code
11013 \begin_layout Plain Layout
11019 An optional parameter for the corresponding
11020 \begin_inset Flex CharStyle:Code
11023 \begin_layout Plain Layout
11030 This parameter cannot be changed from within LyX.
11033 \begin_layout Description
11034 \begin_inset Flex CharStyle:Code
11037 \begin_layout Plain Layout
11044 \begin_inset CommandInset label
11046 name "des:LatexType"
11051 \begin_inset Flex CharStyle:Code
11054 \begin_layout Plain Layout
11059 , Command, Environment, Item_Environment,
11065 \begin_inset Flex CharStyle:Code
11068 \begin_layout Plain Layout
11069 List_Environment, Bib_Environment
11074 ] How the layout should be translated into LaTeX.
11078 \begin_layout Plain Layout
11079 \begin_inset Flex CharStyle:Code
11082 \begin_layout Plain Layout
11088 is perhaps a bit misleading, since these rules apply to SGML classes, too.
11089 Visit the SGML class files for specific examples.
11098 \begin_layout Itemize
11099 \begin_inset Flex CharStyle:Code
11102 \begin_layout Plain Layout
11108 means nothing special.
11112 \begin_layout Itemize
11113 \begin_inset Flex CharStyle:Code
11116 \begin_layout Plain Layout
11123 \begin_inset Flex CharStyle:Code
11126 \begin_layout Plain Layout
11133 {\SpecialChar \ldots{}
11142 \begin_layout Itemize
11143 \begin_inset Flex CharStyle:Code
11146 \begin_layout Plain Layout
11153 \begin_inset Flex CharStyle:Code
11156 \begin_layout Plain Layout
11163 }\SpecialChar \ldots{}
11179 \begin_layout Itemize
11180 \begin_inset Flex CharStyle:Code
11183 \begin_layout Plain Layout
11190 \begin_inset Flex CharStyle:Code
11193 \begin_layout Plain Layout
11200 \begin_inset Flex CharStyle:Code
11203 \begin_layout Plain Layout
11211 is generated for each paragraph of this environment.
11215 \begin_layout Itemize
11216 \begin_inset Flex CharStyle:Code
11219 \begin_layout Plain Layout
11226 \begin_inset Flex CharStyle:Code
11229 \begin_layout Plain Layout
11236 \begin_inset Flex CharStyle:Code
11239 \begin_layout Plain Layout
11245 is passed as an argument to the environment.
11247 \begin_inset Flex CharStyle:Code
11250 \begin_layout Plain Layout
11256 can be defined in the
11257 \begin_inset Flex CharStyle:MenuItem
11260 \begin_layout Plain Layout
11265 ayout\SpecialChar \menuseparator
11279 \begin_layout Standard
11280 Putting the last few things together, the LaTeX output will be either:
11283 \begin_layout LyX-Code
11286 latexname[latexparam]{\SpecialChar \ldots{}
11290 \begin_layout Standard
11294 \begin_layout LyX-Code
11297 begin{latexname}[latexparam] \SpecialChar \ldots{}
11303 \begin_layout Standard
11304 depending upon the LaTeX type.
11308 \begin_layout Description
11309 \begin_inset Flex CharStyle:Code
11312 \begin_layout Plain Layout
11319 \begin_inset Flex CharStyle:Code
11322 \begin_layout Plain Layout
11328 ] If you put layouts into environments, the leftmargins are not simply added,
11329 but added with a factor
11330 \begin_inset Formula $\frac{4}{depth+4}$
11334 Note that this parameter is also used when the margin is defined as
11335 \begin_inset Flex CharStyle:Code
11338 \begin_layout Plain Layout
11345 \begin_inset Flex CharStyle:Code
11348 \begin_layout Plain Layout
11355 Then it is added to the manual or dynamic margin.
11357 \begin_inset Newline newline
11360 The argument is passed as a string.
11362 \begin_inset Quotes eld
11366 \begin_inset Flex CharStyle:Code
11369 \begin_layout Plain Layout
11376 \begin_inset Quotes erd
11379 means that the paragraph is indented with the width of
11380 \begin_inset Quotes eld
11384 \begin_inset Flex CharStyle:Code
11387 \begin_layout Plain Layout
11394 \begin_inset Quotes erd
11397 in the normal font.
11398 You can get a negative width by prefixing the string with
11399 \begin_inset Quotes eld
11403 \begin_inset Flex CharStyle:Code
11406 \begin_layout Plain Layout
11413 \begin_inset Quotes erd
11417 This way was chosen so that the look is the same with each used screen
11422 \begin_layout Description
11423 \begin_inset Flex CharStyle:Code
11426 \begin_layout Plain Layout
11433 \begin_inset Flex CharStyle:Code
11436 \begin_layout Plain Layout
11441 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11447 \begin_inset Newline newline
11450 The kind of margin that the layout has on the left side.
11452 \begin_inset Flex CharStyle:Code
11455 \begin_layout Plain Layout
11461 just means a fixed margin.
11463 \begin_inset Flex CharStyle:Code
11466 \begin_layout Plain Layout
11472 means that the left margin depends on the string entered in the
11473 \begin_inset Flex CharStyle:MenuItem
11476 \begin_layout Plain Layout
11477 Edit\SpecialChar \menuseparator
11479 \begin_inset space ~
11488 This is used to typeset nice lists without tabulators.
11490 \begin_inset Flex CharStyle:Code
11493 \begin_layout Plain Layout
11499 means that the margin depends on the size of the label.
11500 This is used for automatic enumerated headlines.
11501 It is obvious that the headline
11502 \begin_inset Quotes eld
11505 5.4.3.2.1 Very long headline
11506 \begin_inset Quotes erd
11509 must have a wider left margin (as wide as
11510 \begin_inset Quotes eld
11514 \begin_inset Quotes erd
11517 plus the space) than
11518 \begin_inset Quotes eld
11521 3.2 Very long headline
11522 \begin_inset Quotes erd
11526 \begin_inset Quotes eld
11530 \begin_inset Quotes erd
11533 are not able to do this.
11535 \begin_inset Flex CharStyle:Code
11538 \begin_layout Plain Layout
11544 is similar, but only the very first row of the paragraph is dynamic, while
11545 the others are static; this is used, for example, for descriptions.
11547 \begin_inset Flex CharStyle:Code
11550 \begin_layout Plain Layout
11556 means the margin is chosen in a way that the longest row of this paragraph
11557 fits to the right margin.
11558 This is used to typeset an address on the right edge of the page.
11561 \begin_layout Description
11562 \begin_inset Flex CharStyle:Code
11565 \begin_layout Plain Layout
11572 \begin_inset Flex CharStyle:Code
11575 \begin_layout Plain Layout
11584 \begin_inset Flex CharStyle:Code
11587 \begin_layout Plain Layout
11593 ] Whether fragile commands in this layout should be
11594 \begin_inset Flex CharStyle:Code
11597 \begin_layout Plain Layout
11610 whether this command should itself be protected.)
11613 \begin_layout Description
11614 \begin_inset Flex CharStyle:Code
11617 \begin_layout Plain Layout
11624 \begin_inset Flex CharStyle:Code
11627 \begin_layout Plain Layout
11634 \begin_inset Flex CharStyle:Code
11637 \begin_layout Plain Layout
11645 ] Whether newlines are translated into LaTeX newlines (
11646 \begin_inset Flex CharStyle:Code
11649 \begin_layout Plain Layout
11660 The translation can be switched off to allow more comfortable LaTeX editing
11664 \begin_layout Description
11665 \begin_inset Flex CharStyle:Code
11668 \begin_layout Plain Layout
11675 \begin_inset Flex CharStyle:Code
11678 \begin_layout Plain Layout
11685 \begin_inset Flex CharStyle:Code
11688 \begin_layout Plain Layout
11696 ] Whether the following Paragraph is allowed to indent its very first row.
11698 \begin_inset Flex CharStyle:Code
11701 \begin_layout Plain Layout
11707 means that it is not allowed to do so;
11708 \begin_inset Flex CharStyle:Code
11711 \begin_layout Plain Layout
11717 means it could do so if it wants to.
11720 \begin_layout Description
11721 \begin_inset Flex CharStyle:Code
11724 \begin_layout Plain Layout
11730 Name of a layout that has replaced this layout.
11731 This is used to rename a layout, while keeping backward compatibility.
11734 \begin_layout Description
11735 \begin_inset Flex CharStyle:Code
11738 \begin_layout Plain Layout
11745 \begin_inset Flex CharStyle:Code
11748 \begin_layout Plain Layout
11754 ] The number of optional arguments that can be used with this layout.
11755 This is useful for things like section headings, and only makes sense with
11757 Note that, on output, the optional arguments will all precede any required
11758 arguments (see below).
11759 So one can have constructs like:
11763 \begin_layout LyX-Code
11766 mycmd[opt1]{req1}{contents of paragraph}
11769 \begin_layout Standard
11770 but one cannot have things like:
11773 \begin_layout LyX-Code
11776 mycmd[opt1]{req1}[opt2]{contents of paragraph}
11779 \begin_layout Standard
11780 at least, not without ERT (with which you can have anything).
11785 \begin_layout Description
11786 \begin_inset Flex CharStyle:Code
11789 \begin_layout Plain Layout
11796 \begin_inset CommandInset label
11798 name "des:ParbreakIsNewline"
11803 \begin_inset Flex CharStyle:Code
11806 \begin_layout Plain Layout
11815 \begin_inset Flex CharStyle:Code
11818 \begin_layout Plain Layout
11824 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
11825 output, but only by a line break; together with
11826 \begin_inset Flex CharStyle:Code
11829 \begin_layout Plain Layout
11835 , this allows to emulate a plain text editor (like the ERT inset).
11838 \begin_layout Description
11839 \begin_inset Flex CharStyle:Code
11842 \begin_layout Plain Layout
11849 \begin_inset Flex CharStyle:Code
11852 \begin_layout Plain Layout
11858 ] The indent of the very first line of a paragraph.
11860 \begin_inset Flex CharStyle:Code
11863 \begin_layout Plain Layout
11869 will be fixed for a certain layout.
11870 The exception is Standard layout, since the indentation of a Standard layout
11871 paragraph can be prohibited with
11872 \begin_inset Flex CharStyle:Code
11875 \begin_layout Plain Layout
11882 Also, Standard layout paragraphs inside environments use the
11883 \begin_inset Flex CharStyle:Code
11886 \begin_layout Plain Layout
11892 of the environment, not their native one.
11893 For example, Standard paragraphs inside an enumeration are not indented.
11896 \begin_layout Description
11897 \begin_inset Flex CharStyle:Code
11900 \begin_layout Plain Layout
11907 \begin_inset Flex CharStyle:Code
11910 \begin_layout Plain Layout
11916 ] The vertical space between two paragraphs of this layout.
11919 \begin_layout Description
11920 \begin_inset Flex CharStyle:Code
11923 \begin_layout Plain Layout
11930 \begin_inset Flex CharStyle:Code
11933 \begin_layout Plain Layout
11939 ] LyX allows the user to choose either
11940 \begin_inset Quotes eld
11944 \begin_inset Quotes erd
11948 \begin_inset Quotes eld
11952 \begin_inset Quotes erd
11955 to typeset a document.
11957 \begin_inset Quotes eld
11961 \begin_inset Quotes erd
11964 is chosen, this value is completely ignored.
11966 \begin_inset Quotes eld
11970 \begin_inset Quotes erd
11973 is chosen, the parindent of a LaTeXtype
11974 \begin_inset Quotes eld
11978 \begin_inset Quotes erd
11981 layout is ignored and all paragraphs are separated by this parskip argument.
11982 The vertical space is calculated with
11983 \begin_inset Flex CharStyle:Code
11986 \begin_layout Plain Layout
11988 \begin_inset space ~
11997 \begin_inset Flex CharStyle:Code
12000 \begin_layout Plain Layout
12006 is the height of a row with the normal font.
12007 This way, the look stays the same with different screen fonts.
12010 \begin_layout Description
12011 \begin_inset Flex CharStyle:Code
12014 \begin_layout Plain Layout
12021 \begin_inset CommandInset label
12023 name "des:PassThru"
12028 \begin_inset Flex CharStyle:Code
12031 \begin_layout Plain Layout
12040 \begin_inset Flex CharStyle:Code
12043 \begin_layout Plain Layout
12049 ] Whether the contents of this paragraph should be output in raw form, meaning
12050 without special translations that LaTeX would require.
12053 \begin_layout Description
12054 \begin_inset Flex CharStyle:Code
12057 \begin_layout Plain Layout
12064 \begin_inset CommandInset label
12066 name "des:Preamble"
12070 Information to be included in the LaTeX preamble when this style is used.
12071 Used to define macros, load packages, etc., required by this particular
12074 \begin_inset Quotes eld
12078 \begin_inset Flex CharStyle:Code
12081 \begin_layout Plain Layout
12088 \begin_inset Quotes erd
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 prefix to use when creating labels referring to paragraphs of this
12116 This allows the use of formatted references.
12119 \begin_layout Description
12120 \begin_inset Flex CharStyle:Code
12123 \begin_layout Plain Layout
12130 \begin_inset Flex CharStyle:Code
12133 \begin_layout Plain Layout
12139 ] The number of required arguments that the LaTeX command or environment
12140 corresponding to this layout expects.
12141 In the case of a command, these are required arguments
12145 that associated with the content of the paragraph itself.
12146 These do not actually have to be provided: LyX will output empty arguments
12148 Note that optional arguments will be output before required arguments.
12149 See the discussion of the
12150 \begin_inset Flex CharStyle:Code
12153 \begin_layout Plain Layout
12159 tag above for more information.
12162 \begin_layout Description
12163 \begin_inset Flex CharStyle:Code
12166 \begin_layout Plain Layout
12173 \begin_inset Flex CharStyle:Code
12176 \begin_layout Plain Layout
12183 \begin_inset CommandInset label
12185 name "des:Requires"
12189 Whether the layout requires the feature
12190 \begin_inset Flex CharStyle:Code
12193 \begin_layout Plain Layout
12200 See the description of
12201 \begin_inset Flex CharStyle:Code
12204 \begin_layout Plain Layout
12211 \begin_inset CommandInset ref
12212 LatexCommand pageref
12213 reference "des:FreeSpacing"
12217 ) for information on `features'.
12221 \begin_layout Description
12222 \begin_inset Flex CharStyle:Code
12225 \begin_layout Plain Layout
12232 \begin_inset Flex CharStyle:Code
12235 \begin_layout Plain Layout
12242 \begin_inset Flex CharStyle:Code
12245 \begin_layout Plain Layout
12254 \begin_layout Description
12255 \begin_inset Flex CharStyle:Code
12258 \begin_layout Plain Layout
12265 \begin_inset Flex CharStyle:Code
12268 \begin_layout Plain Layout
12273 , onehalf, double, other
12282 ] This defines what the default spacing should be in the layout.
12284 \begin_inset Flex CharStyle:Code
12287 \begin_layout Plain Layout
12294 \begin_inset Flex CharStyle:Code
12297 \begin_layout Plain Layout
12304 \begin_inset Flex CharStyle:Code
12307 \begin_layout Plain Layout
12313 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
12314 If you specify the argument
12315 \begin_inset Flex CharStyle:Code
12318 \begin_layout Plain Layout
12324 , then you should also provide a numerical argument which will be the actual
12326 Note that, contrary to other parameters,
12327 \begin_inset Flex CharStyle:Code
12330 \begin_layout Plain Layout
12336 implies the generation of specific LaTeX code, using the package
12339 \begin_inset Flex CharStyle:Code
12342 \begin_layout Plain Layout
12351 \begin_layout Description
12352 \begin_inset Flex CharStyle:Code
12355 \begin_layout Plain Layout
12362 \begin_inset Flex CharStyle:Code
12365 \begin_layout Plain Layout
12372 \begin_inset Flex CharStyle:Code
12375 \begin_layout Plain Layout
12383 ] Spellcheck paragraphs of this style.
12387 \begin_layout Description
12388 \begin_inset Flex CharStyle:Code
12391 \begin_layout Plain Layout
12397 The font used for the text body .
12399 \begin_inset CommandInset ref
12401 reference "sub:Font-description"
12408 \begin_layout Description
12409 \begin_inset Flex CharStyle:Code
12412 \begin_layout Plain Layout
12421 \begin_inset Flex CharStyle:Code
12424 \begin_layout Plain Layout
12434 The level of the style in the table of contents.
12435 This is used for automatic numbering of section headings.
12438 \begin_layout Description
12439 \begin_inset Flex CharStyle:Code
12442 \begin_layout Plain Layout
12449 \begin_inset Flex CharStyle:Code
12452 \begin_layout Plain Layout
12458 ] The vertical space with which the very first of a chain of paragraphs
12459 with this layout is separated from the previous paragraph.
12460 If the previous paragraph has another layout, the separations are not simply
12461 added, but the maximum is taken.
12464 \begin_layout Subsection
12465 \begin_inset CommandInset label
12471 Internationalization of Paragraph Styles
12474 \begin_layout Standard
12475 LyX has long supported internationalization of layout information, but,
12476 until version 2.0, this applied only to the user interface and not to, say,
12478 Thus, French authors were forced to resort to ugly hacks if they wanted
12483 1' instead of `Theorem 1'.
12484 Thanks to Georg Baum, that is no longer the case.
12487 \begin_layout Standard
12489 \begin_inset Flex CharStyle:Code
12492 \begin_layout Plain Layout
12498 defines text that is to appear in the typeset document, it may use
12499 \begin_inset Flex CharStyle:Code
12502 \begin_layout Plain Layout
12509 \begin_inset Flex CharStyle:Code
12512 \begin_layout Plain Layout
12518 to support non-English and even multi-language documents correctly.
12519 The following excerpt (from the
12520 \begin_inset Flex CharStyle:Code
12523 \begin_layout Plain Layout
12529 file) shows how this works:
12532 \begin_layout LyX-Code
12537 \begin_layout LyX-Code
12540 theoremstyle{remark}
12543 \begin_layout LyX-Code
12546 newtheorem{claim}[thm]{
12553 \begin_layout LyX-Code
12557 \begin_layout LyX-Code
12561 \begin_layout LyX-Code
12566 claimname}{_(Claim)}
12569 \begin_layout LyX-Code
12573 \begin_layout LyX-Code
12577 \begin_layout LyX-Code
12586 claimname}{_(Claim)}}
12589 \begin_layout LyX-Code
12594 \begin_layout Standard
12595 In principle, any legal LaTeX may appear in the
12596 \begin_inset Flex CharStyle:Code
12599 \begin_layout Plain Layout
12606 \begin_inset Flex CharStyle:Code
12609 \begin_layout Plain Layout
12615 tags, but in practice they will typically look as they do here.
12616 The key to correct translation of the typeset text is the definition of
12618 \begin_inset Flex CharStyle:Code
12621 \begin_layout Plain Layout
12630 \begin_inset Flex CharStyle:Code
12633 \begin_layout Plain Layout
12645 \begin_layout Standard
12647 \begin_inset Flex CharStyle:Code
12650 \begin_layout Plain Layout
12656 tag provides for internationalization based upon the overall language of
12658 The contents of the tag will be included in the preamble, just as with
12660 \begin_inset Flex CharStyle:Code
12663 \begin_layout Plain Layout
12670 What makes it special is the use of the
12671 \begin_inset Quotes eld
12675 \begin_inset Quotes erd
12679 \begin_inset Flex CharStyle:Code
12682 \begin_layout Plain Layout
12688 , which will be replaced, when LyX produces LaTeX output, with the translation
12689 of its argument into the document language.
12692 \begin_layout Standard
12694 \begin_inset Flex CharStyle:Code
12697 \begin_layout Plain Layout
12703 tag is more complex, since it is meant to provide support for multi-language
12704 documents and so offers an interface to the
12705 \begin_inset Flex CharStyle:Code
12708 \begin_layout Plain Layout
12715 Its contents will be added to the preamble once for each language that
12716 appears in the document.
12717 In this case, the argument to
12718 \begin_inset Flex CharStyle:Code
12721 \begin_layout Plain Layout
12727 will be replaced with its translation into the language in question; the
12729 \begin_inset Flex CharStyle:Code
12732 \begin_layout Plain Layout
12738 is replaced by the language name (as used by the babel package).
12741 \begin_layout Standard
12742 A German document that also included a French section would thus have the
12743 following in the preamble:
12746 \begin_layout LyX-Code
12755 claimname}{Affirmation}}
12763 claimname}{Behauptung}}
12767 claimname}{Behauptung}
12770 \begin_layout Standard
12772 \begin_inset Flex CharStyle:Code
12775 \begin_layout Plain Layout
12781 will then conspire to produce the correct text in the output.
12784 \begin_layout Standard
12785 One important point to note here is that the translations are provided by
12786 LyX itself, through the same mechanism it uses for internationalization
12787 of the user interface.
12788 This means, in effect, that
12789 \begin_inset Flex CharStyle:Code
12792 \begin_layout Plain Layout
12799 \begin_inset Flex CharStyle:Code
12802 \begin_layout Plain Layout
12808 are really only of use in layout files that are provided with LyX, since
12809 text entered in user-created layout files will not be seen by LyX's internation
12810 alization routines.
12811 That said, however, any layout created with the intention that it will
12812 be included with LyX should use these tags where appropriate.
12815 \begin_layout Subsection
12817 \begin_inset CommandInset label
12826 \begin_layout Standard
12827 Since version 1.3.0 of LyX, it is has been both possible and necessary to
12828 define the floats (
12829 \begin_inset Flex CharStyle:MenuItem
12832 \begin_layout Plain Layout
12839 \begin_inset Flex CharStyle:MenuItem
12842 \begin_layout Plain Layout
12848 , \SpecialChar \ldots{}
12849 ) in the text class itself.
12850 Standard floats are included in the file
12851 \begin_inset Flex CharStyle:Code
12854 \begin_layout Plain Layout
12860 , so you may have to do no more than add
12863 \begin_layout LyX-Code
12864 Input stdfloats.inc
12867 \begin_layout Standard
12868 to your layout file.
12869 If you want to implement a text class that proposes some other float types
12870 (like the AGU class bundled with LyX), the information below will hopefully
12874 \begin_layout Description
12875 \begin_inset Flex CharStyle:Code
12878 \begin_layout Plain Layout
12885 \begin_inset Flex CharStyle:Code
12888 \begin_layout Plain Layout
12895 \begin_inset Quotes erd
12899 \begin_inset Quotes erd
12902 ] The file name extension of an auxiliary file for the list of figures (or
12904 LaTeX writes the captions to this file.
12907 \begin_layout Description
12908 \begin_inset Flex CharStyle:Code
12911 \begin_layout Plain Layout
12918 \begin_inset Flex CharStyle:Code
12921 \begin_layout Plain Layout
12928 \begin_inset Quotes erd
12932 \begin_inset Quotes erd
12935 ] The string that will be used in the menus and also for the caption.
12936 This is translated to the current language if babel is used.
12939 \begin_layout Description
12940 \begin_inset Flex CharStyle:Code
12943 \begin_layout Plain Layout
12949 These are used for XHTML output.
12951 \begin_inset CommandInset ref
12953 reference "sec:Tags-for-XHTML"
12960 \begin_layout Description
12961 \begin_inset Flex CharStyle:Code
12964 \begin_layout Plain Layout
12971 \begin_inset Flex CharStyle:Code
12974 \begin_layout Plain Layout
12981 \begin_inset Quotes erd
12985 \begin_inset Quotes erd
12988 ] The command used to generate a list of floats of this type; the leading
12991 ' should be omitted.
12997 \begin_inset Flex CharStyle:Code
13000 \begin_layout Plain Layout
13006 is false, since there is no standard way to generate this command.
13008 \begin_inset Flex CharStyle:Code
13011 \begin_layout Plain Layout
13017 is true, since in that case there is a standard way.
13020 \begin_layout Description
13021 \begin_inset Flex CharStyle:Code
13024 \begin_layout Plain Layout
13031 \begin_inset Flex CharStyle:Code
13034 \begin_layout Plain Layout
13041 \begin_inset Quotes erd
13045 \begin_inset Quotes erd
13048 ] A title for a list of floats of this kind (list of figures, tables, or
13050 It is used for the screen label within LyX; it is passed to LaTeX for use
13051 as the title there; and it is used as the title in XHTML output.
13052 It will be translated to the document language.
13055 \begin_layout Description
13056 \begin_inset Flex CharStyle:Code
13059 \begin_layout Plain Layout
13066 \begin_inset Flex CharStyle:Code
13069 \begin_layout Plain Layout
13076 \begin_inset Flex CharStyle:Code
13079 \begin_layout Plain Layout
13087 ] Indicates whether the float is already defined in the document class or
13088 if we instead need to load
13089 \begin_inset Flex CharStyle:Code
13092 \begin_layout Plain Layout
13098 and use what it provides.
13100 \begin_inset Flex CharStyle:Code
13103 \begin_layout Plain Layout
13110 \begin_inset Flex CharStyle:Code
13113 \begin_layout Plain Layout
13120 It should be set to
13121 \begin_inset Flex CharStyle:Code
13124 \begin_layout Plain Layout
13130 if the float is already defined by the LaTeX document class.
13133 \begin_layout Description
13134 \begin_inset Flex CharStyle:Code
13137 \begin_layout Plain Layout
13144 \begin_inset Flex CharStyle:Code
13147 \begin_layout Plain Layout
13154 \begin_inset Quotes erd
13158 \begin_inset Quotes erd
13161 ] This (optional) argument determines whether floats of this class will
13162 be numbered within some sectional unit of the document.
13163 For example, if within is equal to
13164 \begin_inset Flex CharStyle:Code
13167 \begin_layout Plain Layout
13173 , the floats will be numbered within chapters.
13177 \begin_layout Description
13178 \begin_inset Flex CharStyle:Code
13181 \begin_layout Plain Layout
13188 \begin_inset Flex CharStyle:Code
13191 \begin_layout Plain Layout
13198 \begin_inset Quotes erd
13202 \begin_inset Quotes erd
13205 ] The default placement for the given class of floats.
13206 The string should be as in standard LaTeX:
13207 \begin_inset Flex CharStyle:Code
13210 \begin_layout Plain Layout
13217 \begin_inset Flex CharStyle:Code
13220 \begin_layout Plain Layout
13227 \begin_inset Flex CharStyle:Code
13230 \begin_layout Plain Layout
13237 \begin_inset Flex CharStyle:Code
13240 \begin_layout Plain Layout
13246 for top, bottom, page, and here, respectively.
13250 \begin_layout Plain Layout
13251 Note that the order of these letters in the string is irrelevant, like in
13257 On top of that there is a new type,
13258 \begin_inset Flex CharStyle:Code
13261 \begin_layout Plain Layout
13267 , which does not really correspond to a float, since it means: put it
13268 \begin_inset Quotes eld
13272 \begin_inset Quotes erd
13276 Note however that the
13277 \begin_inset Flex CharStyle:Code
13280 \begin_layout Plain Layout
13286 specifier is special and, because of implementation details, cannot be
13287 used in non-built in float types.
13288 If you do not understand what this means, just use
13289 \begin_inset Quotes eld
13293 \begin_inset Flex CharStyle:Code
13296 \begin_layout Plain Layout
13303 \begin_inset Quotes erd
13309 \begin_layout Description
13310 \begin_inset Flex CharStyle:Code
13313 \begin_layout Plain Layout
13320 \begin_inset Flex CharStyle:Code
13323 \begin_layout Plain Layout
13329 ] The prefix to use when creating labels referring to floats of this type.
13330 This allows the use of formatted references.
13331 Note that you can remove any
13332 \begin_inset Flex CharStyle:Code
13335 \begin_layout Plain Layout
13341 set by a copied style by using the special value
13342 \begin_inset Quotes eld
13346 \begin_inset Quotes erd
13349 , which must be all caps.
13352 \begin_layout Description
13353 \begin_inset Flex CharStyle:Code
13356 \begin_layout Plain Layout
13363 \begin_inset Flex CharStyle:Code
13366 \begin_layout Plain Layout
13373 \begin_inset Quotes erd
13377 \begin_inset Quotes erd
13380 ] The style used when defining the float using
13381 \begin_inset Flex CharStyle:Code
13384 \begin_layout Plain Layout
13395 \begin_layout Description
13396 \begin_inset Flex CharStyle:Code
13399 \begin_layout Plain Layout
13406 \begin_inset Flex CharStyle:Code
13409 \begin_layout Plain Layout
13416 \begin_inset Quotes erd
13420 \begin_inset Quotes erd
13424 \begin_inset Quotes eld
13428 \begin_inset Quotes erd
13431 of the new class of floats, like program or algorithm.
13432 After the appropriate
13433 \begin_inset Flex CharStyle:Code
13436 \begin_layout Plain Layout
13445 \begin_inset Flex CharStyle:Code
13448 \begin_layout Plain Layout
13457 \begin_inset Flex CharStyle:Code
13460 \begin_layout Plain Layout
13471 \begin_layout Standard
13472 Note that defining a float with type
13473 \begin_inset Flex CharStyle:Code
13476 \begin_layout Plain Layout
13484 automatically defines the corresponding counter with name
13485 \begin_inset Flex CharStyle:Code
13488 \begin_layout Plain Layout
13499 \begin_layout Subsection
13500 Flex insets and InsetLayout
13501 \begin_inset CommandInset label
13503 name "sub:Flex-insets-and"
13510 \begin_layout Standard
13511 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
13512 these are called Flex insets.
13516 \begin_layout Standard
13517 Flex insets come in three different kinds:
13520 \begin_layout Itemize
13522 \begin_inset Flex CharStyle:Code
13525 \begin_layout Plain Layout
13531 ): These define semantic markup corresponding to such LaTeX commands as
13533 \begin_inset Flex CharStyle:Code
13536 \begin_layout Plain Layout
13545 \begin_inset Flex CharStyle:Code
13548 \begin_layout Plain Layout
13559 \begin_layout Itemize
13561 \begin_inset Flex CharStyle:Code
13564 \begin_layout Plain Layout
13570 ): These can be used to define custom collapsible insets, similar to TeX
13571 code, footnote, and the like.
13572 An obvious example is an endnote inset, which is defined in the
13573 \begin_inset Flex CharStyle:Code
13576 \begin_layout Plain Layout
13585 \begin_layout Itemize
13587 \begin_inset Flex CharStyle:Code
13590 \begin_layout Plain Layout
13596 ): For use with DocBook classes.
13599 \begin_layout Standard
13600 Flex insets are defined using the
13601 \begin_inset Flex CharStyle:Code
13604 \begin_layout Plain Layout
13610 tag, which shall be explained in a moment.
13613 \begin_layout Standard
13615 \begin_inset Flex CharStyle:Code
13618 \begin_layout Plain Layout
13624 tag also serves another function: It can be used to customize the general
13625 layout of many different types of insets.
13627 \begin_inset Flex CharStyle:Code
13630 \begin_layout Plain Layout
13636 can be used to customize the layout parameters for footnotes, marginal
13637 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
13638 boxes, tables, algorithms, URLs, and optional arguments, as well as to
13639 define Flex insets.
13642 \begin_layout Standard
13644 \begin_inset Flex CharStyle:Code
13647 \begin_layout Plain Layout
13653 definition must begin with a line of the form:
13656 \begin_layout LyX-Code
13660 \begin_layout Standard
13662 \begin_inset Flex CharStyle:Code
13665 \begin_layout Plain Layout
13671 indicates the inset whose layout is being defined, and here there are two
13675 \begin_layout Enumerate
13676 The layout for a pre-existing inset is being modified.
13677 In this case, can be
13678 \begin_inset Flex CharStyle:Code
13681 \begin_layout Plain Layout
13687 any one of the following:
13688 \begin_inset Flex CharStyle:Code
13691 \begin_layout Plain Layout
13698 \begin_inset Flex CharStyle:Code
13701 \begin_layout Plain Layout
13708 \begin_inset Flex CharStyle:Code
13711 \begin_layout Plain Layout
13718 \begin_inset Flex CharStyle:Code
13721 \begin_layout Plain Layout
13728 \begin_inset Flex CharStyle:Code
13731 \begin_layout Plain Layout
13738 \begin_inset Flex CharStyle:Code
13741 \begin_layout Plain Layout
13748 \begin_inset Flex CharStyle:Code
13751 \begin_layout Plain Layout
13758 \begin_inset Flex CharStyle:Code
13761 \begin_layout Plain Layout
13768 \begin_inset Flex CharStyle:Code
13771 \begin_layout Plain Layout
13778 \begin_inset Flex CharStyle:Code
13781 \begin_layout Plain Layout
13788 \begin_inset Flex CharStyle:Code
13791 \begin_layout Plain Layout
13798 \begin_inset Flex CharStyle:Code
13801 \begin_layout Plain Layout
13808 \begin_inset Flex CharStyle:Code
13811 \begin_layout Plain Layout
13818 \begin_inset Flex CharStyle:Code
13821 \begin_layout Plain Layout
13828 \begin_inset Flex CharStyle:Code
13831 \begin_layout Plain Layout
13838 \begin_inset Flex CharStyle:Code
13841 \begin_layout Plain Layout
13848 \begin_inset Flex CharStyle:Code
13851 \begin_layout Plain Layout
13858 \begin_inset Flex CharStyle:Code
13861 \begin_layout Plain Layout
13868 \begin_inset Flex CharStyle:Code
13871 \begin_layout Plain Layout
13878 \begin_inset Flex CharStyle:Code
13881 \begin_layout Plain Layout
13890 \begin_layout Enumerate
13891 The layout for a Flex inset is being defined.
13893 \begin_inset Flex CharStyle:Code
13896 \begin_layout Plain Layout
13902 can be any valid identifier not used by a pre-existing inset.
13903 Note that the definition of a flex inset
13908 \begin_inset Flex CharStyle:Code
13911 \begin_layout Plain Layout
13917 entry, declaring which type of inset this is.
13920 \begin_layout Standard
13922 \begin_inset Flex CharStyle:Code
13925 \begin_layout Plain Layout
13931 definition can contain the following entries:
13934 \begin_layout Description
13935 \begin_inset Flex CharStyle:Code
13938 \begin_layout Plain Layout
13944 The color for the inset's background.
13945 The valid colors are defined in
13946 \begin_inset Flex CharStyle:Code
13949 \begin_layout Plain Layout
13958 \begin_layout Description
13959 \begin_inset Flex CharStyle:Code
13962 \begin_layout Plain Layout
13969 \begin_inset Flex CharStyle:Code
13972 \begin_layout Plain Layout
13981 \begin_inset Flex CharStyle:Code
13984 \begin_layout Plain Layout
13990 ] Whether to use the content of the inset as the label, when the inset is
13995 \begin_layout Description
13996 \begin_inset Flex CharStyle:Code
13999 \begin_layout Plain Layout
14005 As with paragraph styles (see page
14006 \begin_inset CommandInset ref
14008 reference "des:CopyStyle"
14015 \begin_layout Description
14016 \begin_inset Flex CharStyle:Code
14019 \begin_layout Plain Layout
14026 \begin_inset Flex CharStyle:Code
14029 \begin_layout Plain Layout
14038 \begin_inset Flex CharStyle:Code
14041 \begin_layout Plain Layout
14047 ] Indicates whether the user may employ the Paragraph Settings dialog to
14048 customize the paragraph.
14051 \begin_layout Description
14052 \begin_inset Flex CharStyle:Code
14055 \begin_layout Plain Layout
14062 \begin_inset Flex CharStyle:Code
14065 \begin_layout Plain Layout
14072 \begin_inset Flex CharStyle:Code
14075 \begin_layout Plain Layout
14082 \begin_inset Flex CharStyle:Code
14085 \begin_layout Plain Layout
14091 , describing the rendering style used for the inset's frame and buttons.
14092 Footnotes generally use
14093 \begin_inset Flex CharStyle:Code
14096 \begin_layout Plain Layout
14102 , ERT insets generally
14103 \begin_inset Flex CharStyle:Code
14106 \begin_layout Plain Layout
14112 , and character styles
14113 \begin_inset Flex CharStyle:Code
14116 \begin_layout Plain Layout
14125 \begin_layout Description
14126 \begin_inset Flex CharStyle:Code
14129 \begin_layout Plain Layout
14135 Required at the end of the InsetLayout declarations.
14138 \begin_layout Description
14139 \begin_inset Flex CharStyle:Code
14142 \begin_layout Plain Layout
14148 The font used for both the text body
14154 \begin_inset space ~
14158 \begin_inset CommandInset ref
14160 reference "sub:Font-description"
14165 Note that defining this font automatically defines the
14166 \begin_inset Flex CharStyle:Code
14169 \begin_layout Plain Layout
14175 to the same value, so define this first and define
14176 \begin_inset Flex CharStyle:Code
14179 \begin_layout Plain Layout
14185 later if you want them to be different.
14188 \begin_layout Description
14189 \begin_inset Flex CharStyle:Code
14192 \begin_layout Plain Layout
14199 \begin_inset Quotes eld
14203 \begin_inset Quotes erd
14206 language, leading to Left-to-Right (latin) output, e.
14207 \begin_inset space \thinspace{}
14211 \begin_inset space \space{}
14214 in TeX code or URL.
14218 \begin_layout Description
14219 \begin_inset Flex CharStyle:Code
14222 \begin_layout Plain Layout
14229 \begin_inset Flex CharStyle:Code
14232 \begin_layout Plain Layout
14241 \begin_inset Flex CharStyle:Code
14244 \begin_layout Plain Layout
14250 ] Indicates whether the PlainLayout should be used or, instead, the user
14251 can change the paragraph style used in the inset.
14255 \begin_layout Description
14256 \begin_inset Flex CharStyle:Code
14259 \begin_layout Plain Layout
14265 As with paragraph styles (see page
14266 \begin_inset CommandInset ref
14267 LatexCommand pageref
14268 reference "des:FreeSpacing"
14276 \begin_layout Description
14277 \begin_inset Flex CharStyle:Code
14280 \begin_layout Plain Layout
14286 These tags control XHTML output.
14290 \begin_layout Description
14291 \begin_inset Flex CharStyle:Code
14294 \begin_layout Plain Layout
14301 \begin_inset Flex CharStyle:Code
14304 \begin_layout Plain Layout
14313 \begin_inset Flex CharStyle:Code
14316 \begin_layout Plain Layout
14322 ] Whether to include the contents of this inset in the strings generated
14323 for the `Outline' pane.
14324 One would not, for example, want the content of a footnote in a section
14325 header to be included in the TOC displayed in the outline, but one would
14326 normally want the content of a character style displayed.
14327 Default is false: not to include.
14330 \begin_layout Description
14331 \begin_inset Flex CharStyle:Code
14334 \begin_layout Plain Layout
14340 As with paragraph styles (see page
14341 \begin_inset CommandInset ref
14342 LatexCommand pageref
14343 reference "des:KeepEmpty"
14351 \begin_layout Description
14352 \begin_inset Flex CharStyle:Code
14355 \begin_layout Plain Layout
14361 The font used for the label.
14363 \begin_inset space ~
14367 \begin_inset CommandInset ref
14369 reference "sub:Font-description"
14374 Note that this definition can never appear before
14375 \begin_inset Flex CharStyle:Code
14378 \begin_layout Plain Layout
14384 , lest it be ineffective.
14387 \begin_layout Description
14388 \begin_inset Flex CharStyle:Code
14391 \begin_layout Plain Layout
14397 What will be displayed on the button or elsewhere as the inset label.
14398 Some inset types (TeX code and Branch) modify this label on the fly.
14401 \begin_layout Description
14402 \begin_inset Flex CharStyle:Code
14405 \begin_layout Plain Layout
14411 The name of the corresponding LaTeX stuff.
14412 Either the environment or command name.
14415 \begin_layout Description
14416 \begin_inset Flex CharStyle:Code
14419 \begin_layout Plain Layout
14425 The optional parameter for the corresponding
14426 \begin_inset Flex CharStyle:Code
14429 \begin_layout Plain Layout
14435 stuff, including possible bracket pairs like
14436 \begin_inset Flex CharStyle:Code
14439 \begin_layout Plain Layout
14446 This parameter cannot be changed from within LyX.
14449 \begin_layout Description
14450 \begin_inset Flex CharStyle:Code
14453 \begin_layout Plain Layout
14459 As with paragraph styles (see page
14460 \begin_inset CommandInset ref
14461 LatexCommand pageref
14462 reference "des:LatexType"
14469 \begin_layout Description
14470 \begin_inset Flex CharStyle:Code
14473 \begin_layout Plain Layout
14480 \begin_inset Flex CharStyle:Code
14483 \begin_layout Plain Layout
14490 \begin_inset Flex CharStyle:Code
14493 \begin_layout Plain Layout
14500 \begin_inset Flex CharStyle:Code
14503 \begin_layout Plain Layout
14510 \begin_inset Flex CharStyle:Code
14513 \begin_layout Plain Layout
14519 (indicating a dummy definition ending definitions of charstyles, etc).
14520 This entry is required in and is only meaningful for Flex insets.
14521 Among other things, it determines on which menu this inset will appear.
14523 \begin_inset Flex CharStyle:Code
14526 \begin_layout Plain Layout
14533 \begin_inset Flex CharStyle:Code
14536 \begin_layout Plain Layout
14543 \begin_inset Flex CharStyle:Code
14546 \begin_layout Plain Layout
14554 \begin_inset Flex CharStyle:Code
14557 \begin_layout Plain Layout
14563 can be set to true for charstyle insets, if you wish, by setting it
14568 \begin_inset Flex CharStyle:Code
14571 \begin_layout Plain Layout
14580 \begin_layout Description
14581 \begin_inset Flex CharStyle:Code
14584 \begin_layout Plain Layout
14591 \begin_inset Flex CharStyle:Code
14594 \begin_layout Plain Layout
14603 \begin_inset Flex CharStyle:Code
14606 \begin_layout Plain Layout
14612 ] Whether multiple paragraphs are permitted in this inset.
14614 \begin_inset Flex CharStyle:Code
14617 \begin_layout Plain Layout
14623 to the same value and
14624 \begin_inset Flex CharStyle:Code
14627 \begin_layout Plain Layout
14633 to the opposite value.
14634 These can be reset to other values, if they are used
14639 \begin_inset Flex CharStyle:Code
14642 \begin_layout Plain Layout
14652 \begin_layout Description
14653 \begin_inset Flex CharStyle:Code
14656 \begin_layout Plain Layout
14663 \begin_inset Flex CharStyle:Code
14666 \begin_layout Plain Layout
14675 \begin_inset Flex CharStyle:Code
14678 \begin_layout Plain Layout
14684 ] Whether fragile commands in this layout should be
14685 \begin_inset Flex CharStyle:Code
14688 \begin_layout Plain Layout
14701 whether the command should itself be protected.) Default is false.
14704 \begin_layout Description
14705 \begin_inset Flex CharStyle:Code
14708 \begin_layout Plain Layout
14715 \begin_inset Flex CharStyle:Code
14718 \begin_layout Plain Layout
14727 \begin_inset Flex CharStyle:Code
14730 \begin_layout Plain Layout
14736 ] As with paragraph styles (see page
14737 \begin_inset CommandInset ref
14738 LatexCommand pageref
14739 reference "des:ParbreakIsNewline"
14747 \begin_layout Description
14748 \begin_inset Flex CharStyle:Code
14751 \begin_layout Plain Layout
14758 \begin_inset Flex CharStyle:Code
14761 \begin_layout Plain Layout
14770 \begin_inset Flex CharStyle:Code
14773 \begin_layout Plain Layout
14779 ] As with paragraph styles (see page
14780 \begin_inset CommandInset ref
14781 LatexCommand pageref
14782 reference "des:PassThru"
14790 \begin_layout Description
14791 \begin_inset Flex CharStyle:Code
14794 \begin_layout Plain Layout
14800 As with paragraph styles (see page
14801 \begin_inset CommandInset ref
14802 LatexCommand pageref
14803 reference "des:Preamble"
14810 \begin_layout Description
14811 \begin_inset Flex CharStyle:Code
14814 \begin_layout Plain Layout
14821 \begin_inset Flex CharStyle:Code
14824 \begin_layout Plain Layout
14830 ] The prefix to use when creating labels referring to insets of this type.
14831 This allows the use of formatted references.
14834 \begin_layout Description
14835 \begin_inset Flex CharStyle:Code
14838 \begin_layout Plain Layout
14845 \begin_inset Flex CharStyle:Code
14848 \begin_layout Plain Layout
14854 ] As with paragraph styles (see page
14855 \begin_inset CommandInset ref
14856 LatexCommand pageref
14857 reference "des:Requires"
14864 \begin_layout Description
14865 \begin_inset Flex CharStyle:Code
14868 \begin_layout Plain Layout
14875 \begin_inset Flex CharStyle:Code
14878 \begin_layout Plain Layout
14885 \begin_inset Flex CharStyle:Code
14888 \begin_layout Plain Layout
14896 ] Spellcheck the contents of this inset.
14900 \begin_layout Subsection
14902 \begin_inset CommandInset label
14904 name "sub:Counters"
14911 \begin_layout Standard
14912 Since version 1.3.0 of LyX, it is both possible and necessary to define the
14914 \begin_inset Flex CharStyle:MenuItem
14917 \begin_layout Plain Layout
14924 \begin_inset Flex CharStyle:MenuItem
14927 \begin_layout Plain Layout
14933 , \SpecialChar \ldots{}
14934 ) in the text class itself.
14935 The standard counters are defined in the file
14936 \begin_inset Flex CharStyle:Code
14939 \begin_layout Plain Layout
14945 , so you may have to do no more than add
14948 \begin_layout LyX-Code
14949 Input stdcounters.inc
14952 \begin_layout Standard
14953 to your layout file to get them to work.
14954 But if you want to define custom counters, then you can do so.
14955 The counter declaration must begin with:
14958 \begin_layout LyX-Code
14959 Counter CounterName
14962 \begin_layout Standard
14964 \begin_inset Flex CharStyle:Code
14967 \begin_layout Plain Layout
14973 ' is replaced by the name of the counter.
14974 And it must end with
14975 \begin_inset Quotes eld
14979 \begin_inset Flex CharStyle:Code
14982 \begin_layout Plain Layout
14989 \begin_inset Quotes erd
14993 The following parameters can also be used:
14996 \begin_layout Description
14997 \begin_inset Flex CharStyle:Code
15000 \begin_layout Plain Layout
15007 \begin_inset Flex CharStyle:Code
15010 \begin_layout Plain Layout
15017 \begin_inset Quotes erd
15021 \begin_inset Quotes erd
15024 ] When defined, this string defines how the counter is displayed.
15025 Setting this value sets
15026 \begin_inset Flex CharStyle:Code
15029 \begin_layout Plain Layout
15030 LabelStringAppendix
15036 The following special constructs can be used in the string:
15040 \begin_layout Itemize
15041 \begin_inset Flex CharStyle:Code
15044 \begin_layout Plain Layout
15052 will be replaced by the expansion of the
15053 \begin_inset Flex CharStyle:Code
15056 \begin_layout Plain Layout
15063 \begin_inset Flex CharStyle:Code
15066 \begin_layout Plain Layout
15067 LabelStringAppendix
15073 \begin_inset Flex CharStyle:Code
15076 \begin_layout Plain Layout
15086 \begin_layout Itemize
15087 counter values can be expressed using LaTeX-like macros
15088 \begin_inset Flex CharStyle:Code
15091 \begin_layout Plain Layout
15108 \begin_inset Flex CharStyle:Code
15111 \begin_layout Plain Layout
15123 \begin_layout Plain Layout
15133 Actually, the situation is a bit more complicated: any
15152 other than those described below will produce arabic numerals.
15153 It would not be surprising to see this change in the future.
15159 \begin_inset Flex CharStyle:Code
15162 \begin_layout Plain Layout
15168 : 1, 2, 3,\SpecialChar \ldots{}
15170 \begin_inset Flex CharStyle:Code
15173 \begin_layout Plain Layout
15179 for lower-case letters: a, b, c, \SpecialChar \ldots{}
15181 \begin_inset Flex CharStyle:Code
15184 \begin_layout Plain Layout
15190 for upper-case letters: A, B, C, \SpecialChar \ldots{}
15192 \begin_inset Flex CharStyle:Code
15195 \begin_layout Plain Layout
15201 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
15203 \begin_inset Flex CharStyle:Code
15206 \begin_layout Plain Layout
15212 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
15214 \begin_inset Flex CharStyle:Code
15217 \begin_layout Plain Layout
15223 for hebrew numerals.
15227 \begin_layout Standard
15228 If LabelString is not defined, a default value is constructed as follows:
15229 if the counter has a master counter
15230 \begin_inset Flex CharStyle:Code
15233 \begin_layout Plain Layout
15240 \begin_inset Flex CharStyle:Code
15243 \begin_layout Plain Layout
15250 \begin_inset Flex CharStyle:Code
15253 \begin_layout Plain Layout
15263 is used; otherwise the string
15264 \begin_inset Flex CharStyle:Code
15267 \begin_layout Plain Layout
15278 \begin_layout Description
15279 \begin_inset Flex CharStyle:Code
15282 \begin_layout Plain Layout
15283 LabelStringAppendix
15289 \begin_inset Flex CharStyle:Code
15292 \begin_layout Plain Layout
15299 \begin_inset Quotes erd
15303 \begin_inset Quotes erd
15307 \begin_inset Flex CharStyle:Code
15310 \begin_layout Plain Layout
15316 , but for use in the Appendix.
15319 \begin_layout Description
15320 \begin_inset Flex CharStyle:Code
15323 \begin_layout Plain Layout
15330 \begin_inset Flex CharStyle:Code
15333 \begin_layout Plain Layout
15340 \begin_inset Quotes erd
15344 \begin_inset Quotes erd
15347 ] A format for use with formatted references to this counter.
15348 For example, one might want to have references to section numbers appear
15350 \begin_inset Quotes eld
15354 \begin_inset Quotes erd
15358 The string should contain
15359 \begin_inset Quotes eld
15363 \begin_inset Quotes erd
15367 This will be replaced by the counter number itself.
15368 So, for sections, it would be: Section ##.
15371 \begin_layout Description
15372 \begin_inset Flex CharStyle:Code
15375 \begin_layout Plain Layout
15382 \begin_inset Flex CharStyle:Code
15385 \begin_layout Plain Layout
15392 \begin_inset Quotes erd
15396 \begin_inset Quotes erd
15399 ] If this is set to the name of another counter, the present counter will
15400 be reset every time the other one is increased.
15402 \begin_inset Flex CharStyle:Code
15405 \begin_layout Plain Layout
15412 \begin_inset Flex CharStyle:Code
15415 \begin_layout Plain Layout
15424 \begin_layout Subsection
15426 \begin_inset CommandInset label
15428 name "sub:Font-description"
15435 \begin_layout Standard
15436 A font description looks like this:
15439 \begin_layout LyX-Code
15449 \begin_layout LyX-Code
15453 \begin_layout LyX-Code
15457 \begin_layout Standard
15458 The following commands are available:
15461 \begin_layout Description
15462 \begin_inset Flex CharStyle:Code
15465 \begin_layout Plain Layout
15472 \begin_inset Flex CharStyle:Code
15475 \begin_layout Plain Layout
15484 \begin_inset Flex CharStyle:Code
15487 \begin_layout Plain Layout
15494 \begin_inset Flex CharStyle:Code
15497 \begin_layout Plain Layout
15504 \begin_inset Flex CharStyle:Code
15507 \begin_layout Plain Layout
15514 \begin_inset Flex CharStyle:Code
15517 \begin_layout Plain Layout
15524 \begin_inset Flex CharStyle:Code
15527 \begin_layout Plain Layout
15534 \begin_inset Flex CharStyle:Code
15537 \begin_layout Plain Layout
15544 \begin_inset Flex CharStyle:Code
15547 \begin_layout Plain Layout
15554 \begin_inset Flex CharStyle:Code
15557 \begin_layout Plain Layout
15566 \begin_layout Description
15567 \begin_inset Flex CharStyle:Code
15570 \begin_layout Plain Layout
15577 \begin_inset Flex CharStyle:Code
15580 \begin_layout Plain Layout
15589 \begin_inset Flex CharStyle:Code
15592 \begin_layout Plain Layout
15599 \begin_inset Flex CharStyle:Code
15602 \begin_layout Plain Layout
15611 \begin_layout Description
15612 \begin_inset Flex CharStyle:Code
15615 \begin_layout Plain Layout
15622 \begin_inset Flex CharStyle:Code
15625 \begin_layout Plain Layout
15631 ] Valid arguments are:
15632 \begin_inset Flex CharStyle:Code
15635 \begin_layout Plain Layout
15642 \begin_inset Flex CharStyle:Code
15645 \begin_layout Plain Layout
15652 \begin_inset Flex CharStyle:Code
15655 \begin_layout Plain Layout
15662 \begin_inset Flex CharStyle:Code
15665 \begin_layout Plain Layout
15672 \begin_inset Flex CharStyle:Code
15675 \begin_layout Plain Layout
15682 \begin_inset Flex CharStyle:Code
15685 \begin_layout Plain Layout
15692 Each of these turns on or off the corresponding attribute.
15694 \begin_inset Flex CharStyle:Code
15697 \begin_layout Plain Layout
15703 turns on emphasis, and
15704 \begin_inset Flex CharStyle:Code
15707 \begin_layout Plain Layout
15715 \begin_inset Newline newline
15718 If the latter seems puzzling, remember that the font settings for the present
15719 context are generally inherited from the surrounding context.
15721 \begin_inset Flex CharStyle:Code
15724 \begin_layout Plain Layout
15730 would turn off the emphasis that was anyway in effect, say, in a theorem
15734 \begin_layout Description
15735 \begin_inset Flex CharStyle:Code
15738 \begin_layout Plain Layout
15745 \begin_inset Flex CharStyle:Code
15748 \begin_layout Plain Layout
15757 \begin_inset Flex CharStyle:Code
15760 \begin_layout Plain Layout
15769 \begin_layout Description
15770 \begin_inset Flex CharStyle:Code
15773 \begin_layout Plain Layout
15780 \begin_inset Flex CharStyle:Code
15783 \begin_layout Plain Layout
15792 \begin_inset Flex CharStyle:Code
15795 \begin_layout Plain Layout
15802 \begin_inset Flex CharStyle:Code
15805 \begin_layout Plain Layout
15812 \begin_inset Flex CharStyle:Code
15815 \begin_layout Plain Layout
15824 \begin_layout Description
15825 \begin_inset Flex CharStyle:Code
15828 \begin_layout Plain Layout
15835 \begin_inset Flex CharStyle:Code
15838 \begin_layout Plain Layout
15845 \begin_inset Flex CharStyle:Code
15848 \begin_layout Plain Layout
15855 \begin_inset Flex CharStyle:Code
15858 \begin_layout Plain Layout
15867 \begin_inset Flex CharStyle:Code
15870 \begin_layout Plain Layout
15877 \begin_inset Flex CharStyle:Code
15880 \begin_layout Plain Layout
15887 \begin_inset Flex CharStyle:Code
15890 \begin_layout Plain Layout
15897 \begin_inset Flex CharStyle:Code
15900 \begin_layout Plain Layout
15907 \begin_inset Flex CharStyle:Code
15910 \begin_layout Plain Layout
15919 \begin_layout Subsection
15920 \begin_inset CommandInset label
15922 name "sub:Citation-format-description"
15926 Citation format description
15929 \begin_layout Standard
15931 \begin_inset Flex CharStyle:Code
15934 \begin_layout Plain Layout
15940 blocks are used to describe how bibliographic information should be displayed,
15941 both within LyX itself (in the citation dialog and in tooltips, for example)
15942 and in XHTML output.
15943 Such a block might look like this:
15946 \begin_layout LyX-Code
15950 \begin_layout LyX-Code
15954 \begin_layout LyX-Code
15958 \begin_layout LyX-Code
15962 \begin_layout Standard
15963 The individual lines define how the bibliographic information associated
15964 with an article or book, respectively, is to be displayed, and such a definitio
15965 n can be given for any `entry type' that might be present in a BibTeX file.
15966 LyX defines a default format in the source code that will be used if no
15967 specific definition has been given.
15968 LyX predefines several formats in the file
15969 \begin_inset Flex CharStyle:Code
15972 \begin_layout Plain Layout
15978 , which is included in most of LyX's document classes.
15981 \begin_layout Standard
15982 The definitions use a simple language that allows BibTeX keys to be replaced
15984 Keys should be enclosed in
15985 \begin_inset Flex CharStyle:Code
15988 \begin_layout Plain Layout
15995 \begin_inset Flex CharStyle:Code
15998 \begin_layout Plain Layout
16005 So a simple definition might look like this:
16008 \begin_layout LyX-Code
16010 \begin_inset Quotes eld
16014 \begin_inset Quotes erd
16020 \begin_layout Standard
16021 This would print the author, followed by a comma, followed by the title,
16022 in quotes, followed by a period.
16025 \begin_layout Standard
16026 Of course, sometimes you may want to print a key only if it exists.
16027 This can be done by using a conditional construction, such as:
16028 \begin_inset Flex CharStyle:Code
16031 \begin_layout Plain Layout
16033 \begin_inset space ~
16043 \begin_inset Flex CharStyle:Code
16046 \begin_layout Plain Layout
16052 key exists, then print
16053 \begin_inset Quotes eld
16057 \begin_inset space ~
16061 \begin_inset Quotes erd
16064 followed by the volume key.
16065 It is also possible to have an else clause in the conditional, such as:
16067 \begin_inset Flex CharStyle:Code
16070 \begin_layout Plain Layout
16071 {%author%[[%author%]][[%editor%, ed.]]}
16078 \begin_inset Flex CharStyle:Code
16081 \begin_layout Plain Layout
16087 key is printed if it exists; otherwise, the editor key is printed, followed
16089 \begin_inset Quotes eld
16093 \begin_inset space ~
16097 \begin_inset Quotes erd
16100 Note that the key is again enclosed in
16101 \begin_inset Flex CharStyle:Code
16104 \begin_layout Plain Layout
16110 signs; the entire conditional is enclosed in braces; and the if and else
16111 clauses are enclosed in double brackets,
16112 \begin_inset Quotes eld
16116 \begin_inset Flex CharStyle:Code
16119 \begin_layout Plain Layout
16126 \begin_inset Quotes eld
16130 \begin_inset Quotes eld
16134 \begin_inset Flex CharStyle:Code
16137 \begin_layout Plain Layout
16144 \begin_inset Quotes erd
16148 There must be no space between any of these.
16151 \begin_layout Standard
16152 There is one other piece of syntax available in definitions, which looks
16154 \begin_inset Flex CharStyle:Code
16157 \begin_layout Plain Layout
16164 This defines a piece of formatting information that is to be used when
16166 \begin_inset Quotes eld
16170 \begin_inset Quotes erd
16174 Obviously, we do not want to output HTML tags when writing plain text,
16175 so they should be wrapped in
16176 \begin_inset Quotes eld
16180 \begin_inset Quotes erd
16184 \begin_inset Quotes eld
16188 \begin_inset Quotes erd
16194 \begin_layout Standard
16195 Two special sorts of definitions are also possible in a
16196 \begin_inset Flex CharStyle:Code
16199 \begin_layout Plain Layout
16206 An example of the first would be:
16209 \begin_layout LyX-Code
16211 \begin_inset Quotes eld
16215 \begin_inset Quotes erd
16221 \begin_layout Standard
16222 This is an abbreviation, or macro, and it can be used by treating it as
16224 \begin_inset Flex CharStyle:Code
16227 \begin_layout Plain Layout
16235 \begin_inset Flex CharStyle:Code
16238 \begin_layout Plain Layout
16244 exactly as it would treat its definition.
16245 So, let us issue the obvious
16253 \begin_layout LyX-Code
16257 \begin_layout Standard
16258 or anything like it.
16259 LyX shouldn't go into an infinite loop, but it may go into a long one before
16263 \begin_layout Standard
16264 The second sort of special definition might look like this:
16267 \begin_layout LyX-Code
16271 \begin_layout Standard
16272 This defines a translatable piece of text, which allows relevant parts of
16273 the bibliography to be translated.
16274 It can be included in a definition by treating it as a key:
16275 \begin_inset Flex CharStyle:Code
16278 \begin_layout Plain Layout
16285 Several of these are predefined in
16286 \begin_inset Flex CharStyle:Code
16289 \begin_layout Plain Layout
16296 Note that these are not macros, in the sense just defined.
16297 They will not be expanded.
16300 \begin_layout Standard
16301 So here then is an example that use all these features:
16304 \begin_layout LyX-Code
16305 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
16308 \begin_layout Standard
16309 The defines a macro that prints the author, followed by a comma, if the
16311 \begin_inset Flex CharStyle:Code
16314 \begin_layout Plain Layout
16320 key is defined, or else prints the name of the editor, followed by the
16322 \begin_inset Flex CharStyle:Code
16325 \begin_layout Plain Layout
16331 or its translation (it is by default
16332 \begin_inset Quotes eld
16336 \begin_inset Quotes erd
16340 \begin_inset Flex CharStyle:Code
16343 \begin_layout Plain Layout
16350 Note that this is in fact defined in
16351 \begin_inset Flex CharStyle:Code
16354 \begin_layout Plain Layout
16360 , so you can use it in your own definitions, or re-definitions, if you load
16364 \begin_layout Section
16365 \begin_inset CommandInset label
16367 name "sec:Tags-for-XHTML"
16371 Tags for XHTML output
16374 \begin_layout Standard
16375 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
16376 by layout information.
16377 In general, LyX provides sensible defaults and, as mentioned earlier, it
16378 will even construct default CSS style rules from the other layout tags.
16379 For example, LyX will attempt to use the information provided in the
16380 \begin_inset Flex CharStyle:Code
16383 \begin_layout Plain Layout
16389 declaration for the Chapter style to write CSS that will appropriately
16390 format chapter headings.
16393 \begin_layout Standard
16394 In many cases, then, you may not have to do anything at all to get acceptable
16395 XHTML output for your own environments, custom insets, and so forth.
16396 But in some cases you will, and so LyX provides a number of layout tags
16397 that can be used to customize the XHTML and CSS that are generated.
16400 \begin_layout Standard
16401 Note that there are two tags,
16402 \begin_inset Flex CharStyle:Code
16405 \begin_layout Plain Layout
16412 \begin_inset Flex CharStyle:Code
16415 \begin_layout Plain Layout
16421 that may appear outside style and inset declarations.
16423 \begin_inset CommandInset ref
16425 reference "sub:General-text-class"
16429 for details on these.
16432 \begin_layout Subsection
16433 \begin_inset CommandInset label
16435 name "sub:Paragraph-Style-XHTML"
16442 \begin_layout Standard
16443 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
16444 dealing with a normal paragraph, a command, or an environment, where this
16445 is itself determined by the contents of the corresponding
16446 \begin_inset Flex CharStyle:Code
16449 \begin_layout Plain Layout
16459 \begin_layout Standard
16460 For a command or normal paragraph, the output XHTML has the following form:
16463 \begin_layout LyX-Code
16465 \begin_inset Quotes erd
16469 \begin_inset Quotes erd
16475 \begin_layout LyX-Code
16477 \begin_inset Quotes erd
16481 \begin_inset Quotes erd
16487 \begin_layout LyX-Code
16488 Contents of the paragraph.
16491 \begin_layout LyX-Code
16495 \begin_layout Standard
16496 The label tags are of course omitted if the paragraph does not have a label.
16499 \begin_layout Standard
16500 For an environment that is not some sort of list, the XHTML takes this form:
16503 \begin_layout LyX-Code
16505 \begin_inset Quotes erd
16509 \begin_inset Quotes erd
16515 \begin_layout LyX-Code
16517 \begin_inset Quotes erd
16521 \begin_inset Quotes erd
16525 \begin_inset Quotes erd
16529 \begin_inset Quotes erd
16532 >Environment Label</labeltag>First paragraph.</itemtag>
16535 \begin_layout LyX-Code
16536 <itemtag>Second paragraph.</itemtag>
16539 \begin_layout LyX-Code
16543 \begin_layout Standard
16544 Note that the label is output only for the first paragraph, as it should
16545 be for a theorem, for example.
16549 \begin_layout Standard
16550 For a list, we have one of these forms:
16553 \begin_layout LyX-Code
16555 \begin_inset Quotes erd
16559 \begin_inset Quotes erd
16565 \begin_layout LyX-Code
16567 \begin_inset Quotes erd
16571 \begin_inset Quotes erd
16575 \begin_inset Quotes erd
16579 \begin_inset Quotes erd
16582 >List Label</labeltag>First item.</itemtag>
16585 \begin_layout LyX-Code
16587 \begin_inset Quotes erd
16591 \begin_inset Quotes erd
16595 \begin_inset Quotes erd
16599 \begin_inset Quotes erd
16602 >List Label</labeltag>Second item.</itemtag>
16605 \begin_layout LyX-Code
16609 \begin_layout LyX-Code
16613 \begin_layout LyX-Code
16615 \begin_inset Quotes erd
16619 \begin_inset Quotes erd
16625 \begin_layout LyX-Code
16627 \begin_inset Quotes erd
16631 \begin_inset Quotes erd
16634 >List Label</labeltag><itemtag attr=
16635 \begin_inset Quotes erd
16639 \begin_inset Quotes erd
16642 >First item.</itemtag>
16645 \begin_layout LyX-Code
16647 \begin_inset Quotes erd
16651 \begin_inset Quotes erd
16654 >List Label</labeltag><itemtag attr=
16655 \begin_inset Quotes erd
16659 \begin_inset Quotes erd
16662 >Second item.</itemtag>
16665 \begin_layout LyX-Code
16669 \begin_layout Standard
16670 Note the different orders of
16671 \begin_inset Flex CharStyle:Code
16674 \begin_layout Plain Layout
16681 \begin_inset Flex CharStyle:Code
16684 \begin_layout Plain Layout
16691 Which order we get depends upon the setting of
16692 \begin_inset Flex CharStyle:Code
16695 \begin_layout Plain Layout
16702 \begin_inset Flex CharStyle:Code
16705 \begin_layout Plain Layout
16711 is false (the default), you get the first of these, with the label within
16712 the item; if true, you get the second, with the label outside the item.
16715 \begin_layout Standard
16716 The specific tags and attributes output for each paragraph type can be controlle
16717 d by means of the layout tags we are about to describe.
16718 As mentioned earlier, however, LyX uses sensible defaults for many of these,
16719 so you often may not need to do very much to get good XHTML output.
16720 Think of the available tags as there so you can tweak things to your liking.
16723 \begin_layout Description
16724 \begin_inset Flex CharStyle:Code
16727 \begin_layout Plain Layout
16734 \begin_inset Flex CharStyle:Code
16737 \begin_layout Plain Layout
16743 ] Specifies attribute information to be output with the main tag.
16745 \begin_inset Quotes eld
16749 \begin_inset Flex CharStyle:Code
16752 \begin_layout Plain Layout
16759 \begin_inset Quotes erd
16763 By default, LyX will output
16764 \begin_inset Quotes eld
16768 \begin_inset Flex CharStyle:Code
16771 \begin_layout Plain Layout
16778 \begin_inset Quotes erd
16782 \begin_inset Flex CharStyle:Code
16785 \begin_layout Plain Layout
16791 is the LyX name of the layout, made lowercase, for example: chapter.
16796 contain any style information.
16798 \begin_inset Flex CharStyle:Code
16801 \begin_layout Plain Layout
16810 \begin_layout Description
16811 \begin_inset Flex CharStyle:Code
16814 \begin_layout Plain Layout
16821 \begin_inset Flex CharStyle:Code
16824 \begin_layout Plain Layout
16834 ] Whether to output the default CSS information LyX generates for this layout,
16835 even if additional information is explicitly provided via
16836 \begin_inset Flex CharStyle:Code
16839 \begin_layout Plain Layout
16847 \begin_inset Flex CharStyle:Code
16850 \begin_layout Plain Layout
16856 allows you to alter or augment the generated CSS, rather than to override
16859 \begin_inset Flex CharStyle:Code
16862 \begin_layout Plain Layout
16871 \begin_layout Description
16872 \begin_inset Flex CharStyle:Code
16875 \begin_layout Plain Layout
16882 \begin_inset Flex CharStyle:Code
16885 \begin_layout Plain Layout
16891 ] The tag to be used for individual paragraphs of environments, replacing
16893 \begin_inset Flex CharStyle:Code
16896 \begin_layout Plain Layout
16902 in the examples above.
16904 \begin_inset Flex CharStyle:Code
16907 \begin_layout Plain Layout
16916 \begin_layout Description
16917 \begin_inset Flex CharStyle:Code
16920 \begin_layout Plain Layout
16927 \begin_inset Flex CharStyle:Code
16930 \begin_layout Plain Layout
16936 ] Attributes for the item tag.
16938 \begin_inset Quotes eld
16942 \begin_inset Flex CharStyle:Code
16945 \begin_layout Plain Layout
16946 class=`layoutname_item'
16952 \begin_inset Quotes erd
16960 contain any style information.
16962 \begin_inset Flex CharStyle:Code
16965 \begin_layout Plain Layout
16974 \begin_layout Description
16975 \begin_inset Flex CharStyle:Code
16978 \begin_layout Plain Layout
16985 \begin_inset Flex CharStyle:Code
16988 \begin_layout Plain Layout
16994 ] The tag to be used for paragraph and item labels, replacing
16995 \begin_inset Flex CharStyle:Code
16998 \begin_layout Plain Layout
17004 in the examples above.
17006 \begin_inset Flex CharStyle:Code
17009 \begin_layout Plain Layout
17016 \begin_inset Flex CharStyle:Code
17019 \begin_layout Plain Layout
17026 \begin_inset Flex CharStyle:Code
17029 \begin_layout Plain Layout
17036 \begin_inset Flex CharStyle:Code
17039 \begin_layout Plain Layout
17040 Centered_Top_Environment
17045 , in which case it defaults to
17046 \begin_inset Flex CharStyle:Code
17049 \begin_layout Plain Layout
17058 \begin_layout Description
17059 \begin_inset Flex CharStyle:Code
17062 \begin_layout Plain Layout
17069 \begin_inset Flex CharStyle:Code
17072 \begin_layout Plain Layout
17078 ] Attributes for the label tag.
17080 \begin_inset Quotes eld
17084 \begin_inset Flex CharStyle:Code
17087 \begin_layout Plain Layout
17088 class=`layoutname_label'
17094 \begin_inset Quotes erd
17102 contain any style information.
17104 \begin_inset Flex CharStyle:Code
17107 \begin_layout Plain Layout
17116 \begin_layout Description
17117 \begin_inset Flex CharStyle:Code
17120 \begin_layout Plain Layout
17127 \begin_inset Flex CharStyle:Code
17130 \begin_layout Plain Layout
17140 ] Meaningful only for list-like environments, this tag controls whether
17141 the label tag is output before or inside the item tag.
17142 This is used, for example, in the description environment, where we want
17144 \begin_inset Flex CharStyle:Code
17147 \begin_layout Plain Layout
17148 <dt>\SpecialChar \ldots{}
17149 </dt><dd>\SpecialChar \ldots{}
17157 \begin_inset Flex CharStyle:Code
17160 \begin_layout Plain Layout
17166 : The label tag is output inside the item tag.
17169 \begin_layout Description
17170 \begin_inset Flex CharStyle:Code
17173 \begin_layout Plain Layout
17179 Information to be output in the
17180 \begin_inset Flex CharStyle:Code
17183 \begin_layout Plain Layout
17189 section when this style is used.
17190 This might, for example, be used to include a
17191 \begin_inset Flex CharStyle:Code
17194 \begin_layout Plain Layout
17201 \begin_inset Flex CharStyle:Code
17204 \begin_layout Plain Layout
17213 \begin_layout Description
17214 \begin_inset Flex CharStyle:Code
17217 \begin_layout Plain Layout
17223 CSS style information to be included when this style is used.
17224 Note that this will automatically be wrapped in a layout-generated
17225 \begin_inset Flex CharStyle:Code
17228 \begin_layout Plain Layout
17234 block, so only the CSS itself need be included.
17237 \begin_layout Description
17238 \begin_inset Flex CharStyle:Code
17241 \begin_layout Plain Layout
17248 \begin_inset Flex CharStyle:Code
17251 \begin_layout Plain Layout
17257 ] The tag to be used for the main label, replacing
17258 \begin_inset Flex CharStyle:Code
17261 \begin_layout Plain Layout
17267 in the examples above.
17269 \begin_inset Flex CharStyle:Code
17272 \begin_layout Plain Layout
17281 \begin_layout Description
17282 \begin_inset Flex CharStyle:Code
17285 \begin_layout Plain Layout
17292 \begin_inset Flex CharStyle:Code
17295 \begin_layout Plain Layout
17305 ] Marks this style as the one to be used to generate the
17306 \begin_inset Flex CharStyle:Code
17309 \begin_layout Plain Layout
17315 tag for the XHTML file.
17316 By default, it is false.
17318 \begin_inset Flex CharStyle:Code
17321 \begin_layout Plain Layout
17327 file sets it to true for the
17328 \begin_inset Flex CharStyle:Code
17331 \begin_layout Plain Layout
17341 \begin_layout Subsection
17345 \begin_layout Standard
17346 The XHTML output of insets can also be controlled by information in layout
17351 \begin_layout Plain Layout
17352 At present, this is true only for
17353 \begin_inset Quotes eld
17357 \begin_inset Quotes erd
17360 insets (insets you can type into) and is not true for
17361 \begin_inset Quotes eld
17365 \begin_inset Quotes erd
17368 insets (insets that are associated with dialog boxes).
17373 Here, too, LyX tries to provide sensible defaults, and it constructs default
17375 But everything can be customized.
17378 \begin_layout Standard
17379 The XHTML LyX outputs for an inset has the following form:
17382 \begin_layout LyX-Code
17384 \begin_inset Quotes erd
17388 \begin_inset Quotes erd
17394 \begin_layout LyX-Code
17395 <labeltag>Label</labeltag>
17398 \begin_layout LyX-Code
17400 \begin_inset Quotes erd
17404 \begin_inset Quotes erd
17407 >Contents of the inset.</innertag>
17410 \begin_layout LyX-Code
17414 \begin_layout Standard
17415 If the inset permits multiple paragraphs---that is, if
17416 \begin_inset Flex CharStyle:Code
17419 \begin_layout Plain Layout
17425 is true---then the contents of the inset will itself be output as paragraphs
17426 formatted according to the styles used for those paragraphs (standard,
17427 quote, and the like).
17428 The label tag is of course omitted if the paragraph does not have a label
17429 and, at present, is always
17430 \begin_inset Flex CharStyle:Code
17433 \begin_layout Plain Layout
17440 The inner tag is optional and, by default, does not appear.
17443 \begin_layout Standard
17444 The specific tags and attributes output for each inset can be controlled
17445 by means of the following layout tags.
17448 \begin_layout Description
17449 \begin_inset Flex CharStyle:Code
17452 \begin_layout Plain Layout
17459 \begin_inset Flex CharStyle:Code
17462 \begin_layout Plain Layout
17468 ] Specifies attribute information to be output with the main tag.
17470 \begin_inset Quotes eld
17474 \begin_inset Flex CharStyle:Code
17477 \begin_layout Plain Layout
17478 class=`myinset' onclick=`\SpecialChar \ldots{}
17485 \begin_inset Quotes erd
17489 By default, LyX will output
17490 \begin_inset Quotes eld
17494 \begin_inset Flex CharStyle:Code
17497 \begin_layout Plain Layout
17504 \begin_inset Quotes erd
17508 \begin_inset Flex CharStyle:Code
17511 \begin_layout Plain Layout
17517 is the LyX name of the inset, made lowercase and with non-alphanumeric
17518 characters converted to underscores, for example: footnote.
17521 \begin_layout Description
17522 \begin_inset Flex CharStyle:Code
17525 \begin_layout Plain Layout
17532 \begin_inset Flex CharStyle:Code
17535 \begin_layout Plain Layout
17545 ] Whether to output the default CSS information LyX generates for this layout,
17546 even if additional information is explicitly provided via
17547 \begin_inset Flex CharStyle:Code
17550 \begin_layout Plain Layout
17558 \begin_inset Flex CharStyle:Code
17561 \begin_layout Plain Layout
17567 allows you to alter or augment the generated CSS, rather than to override
17572 \begin_layout Description
17573 \begin_inset Flex CharStyle:Code
17576 \begin_layout Plain Layout
17583 \begin_inset Flex CharStyle:Code
17586 \begin_layout Plain Layout
17592 ] Attributes for the inner tag.
17594 \begin_inset Quotes eld
17598 \begin_inset Flex CharStyle:Code
17601 \begin_layout Plain Layout
17602 class=`insetname_inner'
17608 \begin_inset Quotes erd
17614 \begin_layout Description
17615 \begin_inset Flex CharStyle:Code
17618 \begin_layout Plain Layout
17625 \begin_inset Flex CharStyle:Code
17628 \begin_layout Plain Layout
17634 ] The inner tag, replacing
17635 \begin_inset Flex CharStyle:Code
17638 \begin_layout Plain Layout
17644 in the examples above.
17645 By default, there is none.
17648 \begin_layout Description
17649 \begin_inset Flex CharStyle:Code
17652 \begin_layout Plain Layout
17659 \begin_inset Flex CharStyle:Code
17662 \begin_layout Plain Layout
17670 ] Whether this inset represents a standalone block of text (such as a footnote)
17671 or instead represents material that is included in the surrounding text
17672 (such as a branch).
17676 \begin_layout Description
17677 \begin_inset Flex CharStyle:Code
17680 \begin_layout Plain Layout
17687 \begin_inset Flex CharStyle:Code
17690 \begin_layout Plain Layout
17696 ] A label for this inset, possibly including a reference to a counter.
17697 For example, for footnote, it might be:
17698 \begin_inset Flex CharStyle:Code
17701 \begin_layout Plain Layout
17710 This is optional, and there is no default.
17713 \begin_layout Description
17714 \begin_inset Flex CharStyle:Code
17717 \begin_layout Plain Layout
17723 Information to be output in the
17724 \begin_inset Flex CharStyle:Code
17727 \begin_layout Plain Layout
17733 section when this style is used.
17734 This might, for example, be used to include a
17735 \begin_inset Flex CharStyle:Code
17738 \begin_layout Plain Layout
17745 \begin_inset Flex CharStyle:Code
17748 \begin_layout Plain Layout
17757 \begin_layout Description
17758 \begin_inset Flex CharStyle:Code
17761 \begin_layout Plain Layout
17767 CSS style information to be included when this style is used.
17768 Note that this will automatically be wrapped in a layout-generated
17769 \begin_inset Flex CharStyle:Code
17772 \begin_layout Plain Layout
17778 block, so only the CSS itself need be included.
17781 \begin_layout Description
17782 \begin_inset Flex CharStyle:Code
17785 \begin_layout Plain Layout
17792 \begin_inset Flex CharStyle:Code
17795 \begin_layout Plain Layout
17801 ] The tag to be used for the main label, replacing
17802 \begin_inset Flex CharStyle:Code
17805 \begin_layout Plain Layout
17811 in the examples above.
17812 The default depends upon the setting of
17813 \begin_inset Flex CharStyle:Code
17816 \begin_layout Plain Layout
17823 \begin_inset Flex CharStyle:Code
17826 \begin_layout Plain Layout
17832 is true, the default is
17833 \begin_inset Flex CharStyle:Code
17836 \begin_layout Plain Layout
17842 ; if it is false, the default is
17843 \begin_inset Flex CharStyle:Code
17846 \begin_layout Plain Layout
17855 \begin_layout Subsection
17859 \begin_layout Standard
17860 The XHTML output for floats too can be controlled by layout information.
17861 The output has the following form:
17864 \begin_layout LyX-Code
17866 \begin_inset Quotes erd
17870 \begin_inset Quotes erd
17876 \begin_layout LyX-Code
17877 Contents of the float.
17880 \begin_layout LyX-Code
17884 \begin_layout Standard
17885 The caption, if there is one, is a separate inset and will be output as
17887 Its appearance can be controlled via the InsetLayout for caption insets.
17891 \begin_layout Description
17892 \begin_inset Flex CharStyle:Code
17895 \begin_layout Plain Layout
17902 \begin_inset Flex CharStyle:Code
17905 \begin_layout Plain Layout
17911 ] Specifies attribute information to be output with the main tag.
17913 \begin_inset Quotes eld
17917 \begin_inset Flex CharStyle:Code
17920 \begin_layout Plain Layout
17921 class=`myfloat' onclick=`\SpecialChar \ldots{}
17928 \begin_inset Quotes erd
17932 By default, LyX will output
17933 \begin_inset Quotes eld
17937 \begin_inset Flex CharStyle:Code
17940 \begin_layout Plain Layout
17941 class=`float float-floattype'
17947 \begin_inset Quotes erd
17951 \begin_inset Flex CharStyle:Code
17954 \begin_layout Plain Layout
17960 is LyX's name for this type of float, as determined by the float delcaration
17962 \begin_inset CommandInset ref
17964 reference "sub:Floats"
17968 ), though made lowercase and with non-alphanumeric characters converted
17969 to underscores, for example: float-table.
17972 \begin_layout Description
17973 \begin_inset Flex CharStyle:Code
17976 \begin_layout Plain Layout
17982 CSS style information to be included when this float is used.
17983 Note that this will automatically be wrapped in a layout-generated
17984 \begin_inset Flex CharStyle:Code
17987 \begin_layout Plain Layout
17993 block, so only the CSS itself need be included.
17996 \begin_layout Description
17997 \begin_inset Flex CharStyle:Code
18000 \begin_layout Plain Layout
18007 \begin_inset Flex CharStyle:Code
18010 \begin_layout Plain Layout
18016 ] The tag to be used for this float, replacing
18017 \begin_inset Quotes eld
18021 \begin_inset Flex CharStyle:Code
18024 \begin_layout Plain Layout
18031 \begin_inset Quotes erd
18034 in the example above.
18036 \begin_inset Flex CharStyle:Code
18039 \begin_layout Plain Layout
18045 and will rarely need changing.
18048 \begin_layout Subsection
18049 Bibliography formatting
18052 \begin_layout Standard
18053 The bibliography can be formatted using
18054 \begin_inset Flex CharStyle:Code
18057 \begin_layout Plain Layout
18065 \begin_inset CommandInset ref
18067 reference "sub:Citation-format-description"
18074 \begin_layout Subsection
18078 \begin_layout Standard
18079 We have several times mentioned that LyX will generate default CSS style
18080 rules for both insets and paragraph styles, based upon the other layout
18081 information that is provided.
18082 In this section, we shall say a word about which layout information LyX
18086 \begin_layout Standard
18087 At present, LyX auto-generates CSS only for font information, making use
18089 \begin_inset Flex CharStyle:Code
18092 \begin_layout Plain Layout
18099 \begin_inset Flex CharStyle:Code
18102 \begin_layout Plain Layout
18109 \begin_inset Flex CharStyle:Code
18112 \begin_layout Plain Layout
18119 \begin_inset Flex CharStyle:Code
18122 \begin_layout Plain Layout
18129 \begin_inset Flex CharStyle:Code
18132 \begin_layout Plain Layout
18140 \begin_inset CommandInset ref
18142 reference "sub:Font-description"
18146 .) The translation is mostly straightforward and obvious.
18148 \begin_inset Quotes eld
18152 \begin_inset Flex CharStyle:Code
18155 \begin_layout Plain Layout
18162 \begin_inset Quotes erd
18166 \begin_inset Quotes eld
18170 \begin_inset Flex CharStyle:Code
18173 \begin_layout Plain Layout
18174 font-family: sans-serif;
18180 \begin_inset Quotes erd
18184 The correspondence of LyX sizes and CSS sizes is a little less obvious
18185 but nonetheless intuitive.
18187 \begin_inset Flex CharStyle:Code
18190 \begin_layout Plain Layout
18197 \begin_inset Flex URL
18200 \begin_layout Plain Layout
18211 \begin_layout Chapter
18212 Including External Material
18215 \begin_layout Standard
18216 \begin_inset Box Shadowbox
18226 height_special "totalheight"
18229 \begin_layout Plain Layout
18230 WARNING: This portion of the documentation has not been updated for some
18232 We certainly hope that it is still accurate, but there are no guarantees.
18240 \begin_layout Standard
18241 The use of material from sources external to LyX is covered in detail in
18247 This part of the manual covers what needs to happen behind the scenes for
18248 new sorts of material to be included.
18251 \begin_layout Section
18255 \begin_layout Standard
18256 The external material feature is based on the concept of a
18261 A template is a specification of how LyX should interface with a certain
18263 As bundled, LyX comes with predefined templates for Xfig figures, various
18264 raster format images, chess diagrams, and LilyPond music notation.
18265 You can check the actual list by using the menu
18266 \begin_inset Flex CharStyle:MenuItem
18269 \begin_layout Plain Layout
18270 Insert\SpecialChar \menuseparator
18271 File\SpecialChar \menuseparator
18278 Furthermore, it is possible to roll your own template to support a specific
18280 Later we'll describe in more detail what is involved, and hopefully you
18281 will submit all the templates you create so we can include them in a later
18285 \begin_layout Standard
18286 Another basic idea of the external material feature is to distinguish between
18287 the original file that serves as a base for final material and the produced
18288 file that is included in your exported or printed document.
18289 For example, consider the case of a figure produced with
18290 \begin_inset Flex CharStyle:Code
18293 \begin_layout Plain Layout
18300 The Xfig application itself works on an original file with the
18301 \begin_inset Flex CharStyle:Code
18304 \begin_layout Plain Layout
18311 Within Xfig, you create and change your figure, and when you are done,
18313 \begin_inset Flex CharStyle:Code
18316 \begin_layout Plain Layout
18323 When you want to include the figure in your document, you invoke
18324 \begin_inset Flex CharStyle:Code
18327 \begin_layout Plain Layout
18333 in order to create a PostScript file that can readily be included in your
18336 \begin_inset Flex CharStyle:Code
18339 \begin_layout Plain Layout
18345 file is the original file, and the PostScript file is the produced file.
18348 \begin_layout Standard
18349 This distinction is important in order to allow updating of the material
18350 while you are in the process of writing the document.
18351 Furthermore, it provides us with the flexibility that is needed to support
18352 multiple export formats.
18353 For instance, in the case of a plain text file, it is not exactly an award-winn
18354 ing idea to include the figure as raw PostScript.
18355 Instead, you'd either prefer to just include a reference to the figure
18356 or try to invoke some graphics to ASCII converter to make the final result
18357 look similar to the real graphics.
18358 The external material management allows you to do this, because it is parametri
18359 zed on the different export formats that LyX supports.
18362 \begin_layout Standard
18363 Besides supporting the production of different products according to the
18364 exported format, it supports tight integration with editing and viewing
18366 In the case of an Xfig figure, you are able to invoke Xfig on the original
18367 file with a single click from within the external material dialog in LyX,
18368 and also preview the produced PostScript file with Ghostview with another
18370 No more fiddling around with the command line and/or file browsers to locate
18371 and manipulate the original or produced files.
18372 In this way, you are finally able to take full advantage of the many different
18373 applications that are relevant to use when you write your documents, and
18374 ultimately be more productive.
18377 \begin_layout Section
18378 The external template configuration file
18381 \begin_layout Standard
18382 It is relatively easy to add custom external template definitions to LyX.
18383 However, be aware that doing this in an careless manner most probably
18387 introduce an easily exploitable security hole.
18388 So before you do this, please read the discussion about security in section
18390 \begin_inset CommandInset ref
18392 reference "sec:Security-discussion"
18399 \begin_layout Standard
18400 Having said that, we encourage you to submit any interesting templates that
18405 \begin_layout Standard
18406 The external templates are defined in the
18407 \begin_inset Flex CharStyle:Code
18410 \begin_layout Plain Layout
18411 LyXDir/lib/external_templates
18417 You can place your own version in
18418 \begin_inset Flex CharStyle:Code
18421 \begin_layout Plain Layout
18422 UserDir/external_templates
18430 \begin_layout Standard
18431 A typical template looks like this:
18434 \begin_layout LyX-Code
18438 \begin_layout LyX-Code
18439 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
18442 \begin_layout LyX-Code
18446 \begin_layout LyX-Code
18450 \begin_layout LyX-Code
18454 \begin_layout LyX-Code
18458 \begin_layout LyX-Code
18462 \begin_layout LyX-Code
18463 AutomaticProduction true
18466 \begin_layout LyX-Code
18470 \begin_layout LyX-Code
18474 \begin_layout LyX-Code
18478 \begin_layout LyX-Code
18479 TransformCommand Rotate RotationLatexCommand
18482 \begin_layout LyX-Code
18483 TransformCommand Resize ResizeLatexCommand
18486 \begin_layout LyX-Code
18487 Product "$$RotateFront$$ResizeFront
18490 \begin_layout LyX-Code
18495 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
18498 \begin_layout LyX-Code
18499 $$ResizeBack$$RotateBack"
18502 \begin_layout LyX-Code
18506 \begin_layout LyX-Code
18507 UpdateResult "$$AbsPath$$Basename.pstex_t"
18510 \begin_layout LyX-Code
18511 Requirement "graphicx"
18514 \begin_layout LyX-Code
18515 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
18518 \begin_layout LyX-Code
18519 ReferencedFile latex "$$AbsPath$$Basename.eps"
18522 \begin_layout LyX-Code
18523 ReferencedFile dvi "$$AbsPath$$Basename.eps"
18526 \begin_layout LyX-Code
18530 \begin_layout LyX-Code
18534 \begin_layout LyX-Code
18535 TransformCommand Rotate RotationLatexCommand
18538 \begin_layout LyX-Code
18539 TransformCommand Resize ResizeLatexCommand
18542 \begin_layout LyX-Code
18543 Product "$$RotateFront$$ResizeFront
18546 \begin_layout LyX-Code
18551 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
18554 \begin_layout LyX-Code
18555 $$ResizeBack$$RotateBack"
18558 \begin_layout LyX-Code
18559 UpdateFormat pdftex
18562 \begin_layout LyX-Code
18563 UpdateResult "$$AbsPath$$Basename.pdftex_t"
18566 \begin_layout LyX-Code
18567 Requirement "graphicx"
18570 \begin_layout LyX-Code
18571 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
18574 \begin_layout LyX-Code
18575 ReferencedFile latex "$$AbsPath$$Basename.pdf"
18578 \begin_layout LyX-Code
18582 \begin_layout LyX-Code
18586 \begin_layout LyX-Code
18587 Product "$$Contents(
18589 "$$AbsPath$$Basename.asc
18594 \begin_layout LyX-Code
18595 UpdateFormat asciixfig
18598 \begin_layout LyX-Code
18599 UpdateResult "$$AbsPath$$Basename.asc"
18602 \begin_layout LyX-Code
18606 \begin_layout LyX-Code
18610 \begin_layout LyX-Code
18611 Product "<graphic fileref=
18613 "$$AbsOrRelPathMaster$$Basename.eps
18618 \begin_layout LyX-Code
18622 \begin_layout LyX-Code
18626 \begin_layout LyX-Code
18627 UpdateResult "$$AbsPath$$Basename.eps"
18630 \begin_layout LyX-Code
18631 ReferencedFile docbook "$$AbsPath$$Basename.eps"
18634 \begin_layout LyX-Code
18635 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
18638 \begin_layout LyX-Code
18642 \begin_layout LyX-Code
18643 Product "[XFig: $$FName]"
18646 \begin_layout LyX-Code
18650 \begin_layout LyX-Code
18654 \begin_layout Standard
18655 As you can see, the template is enclosed in
18656 \begin_inset Flex CharStyle:Code
18659 \begin_layout Plain Layout
18665 \SpecialChar \ldots{}
18667 \begin_inset Flex CharStyle:Code
18670 \begin_layout Plain Layout
18677 It contains a header specifying some general settings and, for each supported
18678 primary document file format, a section
18679 \begin_inset Flex CharStyle:Code
18682 \begin_layout Plain Layout
18688 \SpecialChar \ldots{}
18690 \begin_inset Flex CharStyle:Code
18693 \begin_layout Plain Layout
18702 \begin_layout Subsection
18703 The template header
18706 \begin_layout Description
18707 \begin_inset Flex CharStyle:Code
18710 \begin_layout Plain Layout
18711 AutomaticProduction
18712 \begin_inset space ~
18720 Whether the file represented by the template must be generated by LyX.
18721 This command must occur exactly once.
18724 \begin_layout Description
18725 \begin_inset Flex CharStyle:Code
18728 \begin_layout Plain Layout
18730 \begin_inset space ~
18738 A glob pattern that is used in the file dialog to filter out the desired
18740 If there is more than one possible file extension (e.
18741 \begin_inset space \thinspace{}
18745 \begin_inset space \space{}
18749 \begin_inset Flex CharStyle:Code
18752 \begin_layout Plain Layout
18759 \begin_inset Flex CharStyle:Code
18762 \begin_layout Plain Layout
18768 ), use something like
18769 \begin_inset Flex CharStyle:Code
18772 \begin_layout Plain Layout
18779 This command must occur exactly once.
18782 \begin_layout Description
18783 \begin_inset Flex CharStyle:Code
18786 \begin_layout Plain Layout
18788 \begin_inset space ~
18796 The text that is displayed on the button.
18797 This command must occur exactly once.
18800 \begin_layout Description
18801 \begin_inset Flex CharStyle:Code
18804 \begin_layout Plain Layout
18806 \begin_inset space ~
18810 \begin_inset space ~
18818 The help text that is used in the External dialog.
18819 Provide enough information to explain to the user just what the template
18820 can provide him with.
18821 This command must occur exactly once.
18824 \begin_layout Description
18825 \begin_inset Flex CharStyle:Code
18828 \begin_layout Plain Layout
18830 \begin_inset space ~
18838 The file format of the original file.
18839 This must be the name of a format that is known to LyX (see section
18840 \begin_inset CommandInset ref
18842 reference "sec:Formats"
18848 \begin_inset Quotes eld
18852 \begin_inset Flex CharStyle:Code
18855 \begin_layout Plain Layout
18862 \begin_inset Quotes erd
18865 if the template can handle original files of more than one format.
18866 LyX will attempt to interrogate the file itself in order to deduce its
18867 format in this case.
18868 This command must occur exactly once.
18871 \begin_layout Description
18872 \begin_inset Flex CharStyle:Code
18875 \begin_layout Plain Layout
18877 \begin_inset space ~
18885 A unique name for the template.
18886 It must not contain substitution macros (see below).
18889 \begin_layout Description
18890 \begin_inset Flex CharStyle:Code
18893 \begin_layout Plain Layout
18895 \begin_inset space ~
18898 Rotate|Resize|Clip|Extra
18903 This command specifies which transformations are supported by this template.
18904 It may occur zero or more times.
18905 This command enables the corresponding tabs in the external dialog.
18907 \begin_inset Flex CharStyle:Code
18910 \begin_layout Plain Layout
18916 command must have either a corresponding
18917 \begin_inset Flex CharStyle:Code
18920 \begin_layout Plain Layout
18927 \begin_inset Flex CharStyle:Code
18930 \begin_layout Plain Layout
18937 \begin_inset Flex CharStyle:Code
18940 \begin_layout Plain Layout
18947 Otherwise the transformation will not be supported by that format.
18950 \begin_layout Subsection
18954 \begin_layout Description
18955 \begin_inset Flex CharStyle:Code
18958 \begin_layout Plain Layout
18960 \begin_inset space ~
18963 LaTeX|PDFLaTeX|PlainText|DocBook
18968 The primary document file format that this format definition is for.
18969 Not every template has a sensible representation in all document file formats.
18970 Please define nevertheless a
18971 \begin_inset Flex CharStyle:Code
18974 \begin_layout Plain Layout
18980 section for all formats.
18981 Use a dummy text when no representation is available.
18982 Then you can at least see a reference to the external material in the exported
18986 \begin_layout Description
18987 \begin_inset Flex CharStyle:Code
18990 \begin_layout Plain Layout
18992 \begin_inset space ~
18996 \begin_inset space ~
19004 This command defines an additional macro
19005 \begin_inset Flex CharStyle:Code
19008 \begin_layout Plain Layout
19014 for substitution in
19015 \begin_inset Flex CharStyle:Code
19018 \begin_layout Plain Layout
19026 \begin_inset Flex CharStyle:Code
19029 \begin_layout Plain Layout
19035 itself may contain substitution macros.
19036 The advantage over using
19037 \begin_inset Flex CharStyle:Code
19040 \begin_layout Plain Layout
19047 \begin_inset Flex CharStyle:Code
19050 \begin_layout Plain Layout
19056 is that the substituted value of
19057 \begin_inset Flex CharStyle:Code
19060 \begin_layout Plain Layout
19066 is sanitized so that it is a valid optional argument in the document format.
19067 This command may occur zero or more times.
19070 \begin_layout Description
19071 \begin_inset Flex CharStyle:Code
19074 \begin_layout Plain Layout
19076 \begin_inset space ~
19084 The text that is inserted in the exported document.
19085 This is actually the most important command and can be quite complex.
19086 This command must occur exactly once.
19089 \begin_layout Description
19090 \begin_inset Flex CharStyle:Code
19093 \begin_layout Plain Layout
19095 \begin_inset space ~
19103 This command specifies a preamble snippet that will be included in the
19105 It has to be defined using
19106 \begin_inset Flex CharStyle:Code
19109 \begin_layout Plain Layout
19115 \SpecialChar \ldots{}
19117 \begin_inset Flex CharStyle:Code
19120 \begin_layout Plain Layout
19127 This command may occur zero or more times.
19130 \begin_layout Description
19131 \begin_inset Flex CharStyle:Code
19134 \begin_layout Plain Layout
19136 \begin_inset space ~
19140 \begin_inset space ~
19148 This command denotes files that are created by the conversion process and
19149 are needed for a particular export format.
19150 If the filename is relative, it is interpreted relative to the master document.
19151 This command may be given zero or more times.
19154 \begin_layout Description
19155 \begin_inset Flex CharStyle:Code
19158 \begin_layout Plain Layout
19160 \begin_inset space ~
19168 The name of a required LaTeX package.
19169 The package is included via
19170 \begin_inset Flex CharStyle:Code
19173 \begin_layout Plain Layout
19181 in the LaTeX preamble.
19182 This command may occur zero or more times.
19185 \begin_layout Description
19186 \begin_inset Flex CharStyle:Code
19189 \begin_layout Plain Layout
19191 \begin_inset space ~
19195 \begin_inset space ~
19198 RotationLatexCommand
19203 This command specifies that the built in LaTeX command should be used for
19205 This command may occur once or not at all.
19208 \begin_layout Description
19209 \begin_inset Flex CharStyle:Code
19212 \begin_layout Plain Layout
19214 \begin_inset space ~
19218 \begin_inset space ~
19226 This command specifies that the built in LaTeX command should be used for
19228 This command may occur once or not at all.
19231 \begin_layout Description
19232 \begin_inset Flex CharStyle:Code
19235 \begin_layout Plain Layout
19237 \begin_inset space ~
19241 \begin_inset space ~
19244 RotationLatexOption
19249 This command specifies that rotation is done via an optional argument.
19250 This command may occur once or not at all.
19253 \begin_layout Description
19254 \begin_inset Flex CharStyle:Code
19257 \begin_layout Plain Layout
19259 \begin_inset space ~
19263 \begin_inset space ~
19271 This command specifies that resizing is done via an optional argument.
19272 This command may occur once or not at all.
19275 \begin_layout Description
19276 \begin_inset Flex CharStyle:Code
19279 \begin_layout Plain Layout
19281 \begin_inset space ~
19285 \begin_inset space ~
19293 This command specifies that clipping is done via an optional argument.
19294 This command may occur once or not at all.
19297 \begin_layout Description
19298 \begin_inset Flex CharStyle:Code
19301 \begin_layout Plain Layout
19303 \begin_inset space ~
19307 \begin_inset space ~
19315 This command specifies that an extra optional argument is used.
19316 This command may occur once or not at all.
19319 \begin_layout Description
19320 \begin_inset Flex CharStyle:Code
19323 \begin_layout Plain Layout
19325 \begin_inset space ~
19333 The file format of the converted file.
19334 This must be the name of a format that is known to LyX (see the
19335 \begin_inset Flex CharStyle:MenuItem
19338 \begin_layout Plain Layout
19343 ools\SpecialChar \menuseparator
19348 references:Conversion
19354 This command must occur exactly once.
19357 \begin_layout Description
19358 \begin_inset Flex CharStyle:Code
19361 \begin_layout Plain Layout
19363 \begin_inset space ~
19371 The file name of the converted file.
19372 The file name must be absolute.
19373 This command must occur exactly once.
19376 \begin_layout Subsection
19377 Preamble definitions
19380 \begin_layout Standard
19381 The external template configuration file may contain additional preamble
19382 definitions enclosed by
19383 \begin_inset Flex CharStyle:Code
19386 \begin_layout Plain Layout
19392 \SpecialChar \ldots{}
19394 \begin_inset Flex CharStyle:Code
19397 \begin_layout Plain Layout
19404 They can be used by the templates in the
19405 \begin_inset Flex CharStyle:Code
19408 \begin_layout Plain Layout
19417 \begin_layout Section
19418 The substitution mechanism
19421 \begin_layout Standard
19422 When the external material facility invokes an external program, it is done
19423 on the basis of a command defined in the template configuration file.
19424 These commands can contain various macros that are expanded before execution.
19425 Execution always take place in the directory of the containing document.
19428 \begin_layout Standard
19429 Also, whenever external material is to be displayed, the name will be produced
19430 by the substitution mechanism, and most other commands in the template
19431 definition support substitution as well.
19434 \begin_layout Standard
19435 The available macros are the following:
19438 \begin_layout Description
19439 \begin_inset Flex CharStyle:Code
19442 \begin_layout Plain Layout
19443 $$AbsOrRelPathMaster
19448 The file path, absolute or relative to the master LyX document.
19451 \begin_layout Description
19452 \begin_inset Flex CharStyle:Code
19455 \begin_layout Plain Layout
19456 $$AbsOrRelPathParent
19461 The file path, absolute or relative to the LyX document.
19464 \begin_layout Description
19465 \begin_inset Flex CharStyle:Code
19468 \begin_layout Plain Layout
19474 The absolute file path.
19477 \begin_layout Description
19478 \begin_inset Flex CharStyle:Code
19481 \begin_layout Plain Layout
19487 The filename without path and without the extension.
19490 \begin_layout Description
19491 \begin_inset Flex CharStyle:Code
19494 \begin_layout Plain Layout
19496 \begin_inset Quotes eld
19500 \begin_inset Quotes erd
19508 This macro will expand to the contents of the file with the name
19509 \begin_inset Flex CharStyle:Code
19512 \begin_layout Plain Layout
19521 \begin_layout Description
19522 \begin_inset Flex CharStyle:Code
19525 \begin_layout Plain Layout
19531 The file extension (including the dot).
19534 \begin_layout Description
19535 \begin_inset Flex CharStyle:Code
19538 \begin_layout Plain Layout
19544 The filename of the file specified in the external material dialog.
19545 This is either an absolute name, or it is relative to the LyX document.
19548 \begin_layout Description
19549 \begin_inset Flex CharStyle:Code
19552 \begin_layout Plain Layout
19559 \begin_inset Flex CharStyle:Code
19562 \begin_layout Plain Layout
19568 (absolute name or relative to the LyX document).
19571 \begin_layout Description
19572 \begin_inset Flex CharStyle:Code
19575 \begin_layout Plain Layout
19581 The file path, relative to the master LyX document.
19584 \begin_layout Description
19585 \begin_inset Flex CharStyle:Code
19588 \begin_layout Plain Layout
19594 The file path, relative to the LyX document.
19597 \begin_layout Description
19598 \begin_inset Flex CharStyle:Code
19601 \begin_layout Plain Layout
19607 This macro will expand to the absolute path of the system directory.
19608 This is typically used to point to the various helper scripts that are
19612 \begin_layout Description
19613 \begin_inset Flex CharStyle:Code
19616 \begin_layout Plain Layout
19622 A name and full path to a temporary file which will be automatically deleted
19623 whenever the containing document is closed, or the external material insertion
19627 \begin_layout Standard
19628 All path macros contain a trailing directory separator, so you can construct
19630 \begin_inset space \thinspace{}
19634 \begin_inset space \space{}
19637 the absolute filename with
19638 \begin_inset Flex CharStyle:Code
19641 \begin_layout Plain Layout
19642 $$AbsPath$$Basename$$Extension
19650 \begin_layout Standard
19651 The macros above are substituted in all commands unless otherwise noted.
19653 \begin_inset Flex CharStyle:Code
19656 \begin_layout Plain Layout
19662 supports additionally the following substitutions if they are enabled by
19664 \begin_inset Flex CharStyle:Code
19667 \begin_layout Plain Layout
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
19696 The front part of the resize command.
19699 \begin_layout Description
19700 \begin_inset Flex CharStyle:Code
19703 \begin_layout Plain Layout
19709 The back part of the resize command.
19712 \begin_layout Description
19713 \begin_inset Flex CharStyle:Code
19716 \begin_layout Plain Layout
19722 The front part of the rotation command.
19725 \begin_layout Description
19726 \begin_inset Flex CharStyle:Code
19729 \begin_layout Plain Layout
19735 The back part of the rotation command.
19738 \begin_layout Standard
19739 The value string of the
19740 \begin_inset Flex CharStyle:Code
19743 \begin_layout Plain Layout
19749 command supports additionally the following substitutions if they are enabled
19751 \begin_inset Flex CharStyle:Code
19754 \begin_layout Plain Layout
19761 \begin_inset Flex CharStyle:Code
19764 \begin_layout Plain Layout
19773 \begin_layout Description
19774 \begin_inset Flex CharStyle:Code
19777 \begin_layout Plain Layout
19786 \begin_layout Description
19787 \begin_inset Flex CharStyle:Code
19790 \begin_layout Plain Layout
19799 \begin_layout Description
19800 \begin_inset Flex CharStyle:Code
19803 \begin_layout Plain Layout
19812 \begin_layout Description
19813 \begin_inset Flex CharStyle:Code
19816 \begin_layout Plain Layout
19822 The rotation option.
19825 \begin_layout Standard
19826 You may ask why there are so many path macros.
19827 There are mainly two reasons:
19830 \begin_layout Enumerate
19831 Relative and absolute file names should remain relative or absolute, respectivel
19833 Users may have reasons to prefer either form.
19834 Relative names are useful for portable documents that should work on different
19835 machines, for example.
19836 Absolute names may be required by some programs.
19839 \begin_layout Enumerate
19840 LaTeX treats relative file names differently than LyX and other programs
19841 in nested included files.
19842 For LyX, a relative file name is always relative to the document that contains
19844 For LaTeX, it is always relative to the master document.
19845 These two definitions are identical if you have only one document, but
19846 differ if you have a master document that includes part documents.
19847 That means that relative filenames must be transformed when presented to
19849 Fortunately LyX does this automatically for you if you choose the right
19853 \begin_layout Standard
19854 So which path macro should be used in new template definitions? The rule
19858 \begin_layout Itemize
19860 \begin_inset Flex CharStyle:Code
19863 \begin_layout Plain Layout
19869 if an absolute path is required.
19872 \begin_layout Itemize
19874 \begin_inset Flex CharStyle:Code
19877 \begin_layout Plain Layout
19878 $$AbsOrRelPathMaster
19883 if the substituted string is some kind of LaTeX input.
19886 \begin_layout Itemize
19888 \begin_inset Flex CharStyle:Code
19891 \begin_layout Plain Layout
19892 $$AbsOrRelPathParent
19897 in order to preserve the user's choice.
19900 \begin_layout Standard
19901 There are special cases where this rule does not work and e.
19902 \begin_inset space \thinspace{}
19906 \begin_inset space \space{}
19909 relative names are needed, but normally it will work just fine.
19910 One example for such a case is the command
19911 \begin_inset Flex CharStyle:Code
19914 \begin_layout Plain Layout
19915 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
19920 in the XFig template above: We can't use the absolute name because the
19922 \begin_inset Flex CharStyle:Code
19925 \begin_layout Plain Layout
19931 files needs the relative name in order to rewrite the file content.
19934 \begin_layout Section
19935 Security discussion
19936 \begin_inset CommandInset label
19938 name "sec:Security-discussion"
19945 \begin_layout Standard
19946 The external material feature interfaces with a lot of external programs
19947 and does so automatically, so we have to consider the security implications
19949 In particular, since you have the option of including your own filenames
19950 and/or parameter strings and those are expanded into a command, it seems
19951 that it would be possible to create a malicious document which executes
19952 arbitrary commands when a user views or prints the document.
19953 This is something we definitely want to avoid.
19956 \begin_layout Standard
19957 However, since the external program commands are specified in the template
19958 configuration file only, there are no security issues if LyX is properly
19959 configured with safe templates only.
19960 This is so because the external programs are invoked with the
19961 \begin_inset Flex CharStyle:Code
19964 \begin_layout Plain Layout
19970 -system call rather than the
19971 \begin_inset Flex CharStyle:Code
19974 \begin_layout Plain Layout
19980 system-call, so it's not possible to execute arbitrary commands from the
19981 filename or parameter section via the shell.
19984 \begin_layout Standard
19985 This also implies that you are restricted in what command strings you can
19986 use in the external material templates.
19987 In particular, pipes and redirection are not readily available.
19988 This has to be so if LyX should remain safe.
19989 If you want to use some of the shell features, you should write a safe
19990 script to do this in a controlled manner, and then invoke the script from
19991 the command string.
19995 \begin_layout Standard
19996 It is possible to design a template that interacts directly with the shell,
19997 but since this would allow a malicious user to execute arbitrary commands
19998 by writing clever filenames and/or parameters, we generally recommend that
19999 you only use safe scripts that work with the
20000 \begin_inset Flex CharStyle:Code
20003 \begin_layout Plain Layout
20009 system call in a controlled manner.
20010 Of course, for use in a controlled environment, it can be tempting to just
20011 fall back to use ordinary shell scripts.
20012 If you do so, be aware that you
20016 provide an easily exploitable security hole in your system.
20017 Of course it stands to reason that such unsafe templates will never be
20018 included in the standard LyX distribution, although we do encourage people
20019 to submit new templates in the open source tradition.
20020 But LyX as shipped from the official distribution channels will never have
20024 \begin_layout Standard
20025 Including external material provides a lot of power, and you have to be
20026 careful not to introduce security hazards with this power.
20027 A subtle error in a single line in an innocent looking script can open
20028 the door to huge security problems.
20029 So if you do not fully understand the issues, we recommend that you consult
20030 a knowledgeable security professional or the LyX development team if you
20031 have any questions about whether a given template is safe or not.
20032 And do this before you use it in an uncontrolled environment.