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 Quotes erd
5475 to get a list of available packages.
5476 To install one, right click on it or use the toolbar button to install
5481 \begin_layout Standard
5482 If your LaTeX distribution doesn't provide such a `package manager', or
5483 if the file is not available from your distribution, then you can follow
5484 these steps to install it manually.
5487 \begin_layout Enumerate
5488 Get the package from
5489 \begin_inset CommandInset href
5492 target "http://www.ctan.org/"
5499 \begin_layout Enumerate
5500 You can install the package in several different places.
5501 If you want it to be available for all users on your system, then you should
5502 install it in your `local' TeX tree; if you want (or need) it to be available
5503 just for you, then you can install it in your own `user' TeX tree.
5504 Where these trees should be created, if they do not already exist, depends
5505 upon the details of your system.
5506 To find out where they are, look in the file
5507 \begin_inset Flex CharStyle:Code
5510 \begin_layout Plain Layout
5520 \begin_layout Plain Layout
5521 This usually lives in the directory
5522 \begin_inset Flex CharStyle:Code
5525 \begin_layout Plain Layout
5531 , though you can run
5532 \begin_inset Flex CharStyle:Code
5535 \begin_layout Plain Layout
5546 The location of the `local' TeX tree is defined by the
5547 \begin_inset Flex CharStyle:Code
5550 \begin_layout Plain Layout
5556 variable; this is usually somewhere like
5557 \begin_inset Flex URL
5560 \begin_layout Plain Layout
5562 /usr/local/share/texmf/
5568 The location of the `user' TeX tree is defined by
5569 \begin_inset Flex CharStyle:Code
5572 \begin_layout Plain Layout
5579 \begin_inset Flex CharStyle:Code
5582 \begin_layout Plain Layout
5589 (If these variables are not predefined, you can define them.) You'll probably
5590 need root permissions to create or modify the `local' tree, but your `user'
5591 tree shouldn't have such limitations.
5594 \begin_layout Enumerate
5596 \begin_inset Flex CharStyle:Code
5599 \begin_layout Plain Layout
5606 \begin_inset Flex CharStyle:Code
5609 \begin_layout Plain Layout
5616 \begin_inset Flex CharStyle:Code
5619 \begin_layout Plain Layout
5626 \begin_inset space \thinspace{}
5630 \begin_inset Newline newline
5634 \begin_inset Flex CharStyle:Code
5637 \begin_layout Plain Layout
5638 TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
5644 \begin_inset Newline newline
5650 \begin_layout Enumerate
5651 Your local and user trees
5655 have the same sort of directory structure as your main existing
5656 \begin_inset Flex CharStyle:Code
5659 \begin_layout Plain Layout
5665 directory, which will be found at
5666 \begin_inset Flex CharStyle:Code
5669 \begin_layout Plain Layout
5676 \begin_inset Flex CharStyle:Code
5679 \begin_layout Plain Layout
5685 .) For example, latex packages should go under
5686 \begin_inset Flex CharStyle:Code
5689 \begin_layout Plain Layout
5690 $TEXMFLOCAL/tex/latex/
5696 \begin_inset Flex CharStyle:Code
5699 \begin_layout Plain Layout
5700 $TEXMFHOME/tex/latex/
5706 If you do not put them here, they probably will not work.
5709 \begin_layout Enumerate
5710 Once your tree is properly set up, you can install the package into an appropria
5712 If you are lucky, your package will have been provided as a so-called `TDS'
5713 (TeX Directory Structure) zip file.
5714 To install it, you want to unzip it from the top of your tree.
5715 So, for example, you can copy the file
5716 \begin_inset Flex CharStyle:Code
5719 \begin_layout Plain Layout
5726 \begin_inset Flex CharStyle:Code
5729 \begin_layout Plain Layout
5730 /home/yourname/texmf/
5735 and then, from inside that directory, just run:
5736 \begin_inset Flex CharStyle:Code
5739 \begin_layout Plain Layout
5746 This will extract the needed files and copy them where they need to be.
5747 \begin_inset Newline newline
5750 If you do not have a TDS file, then you have to do this manually.
5751 For example, you might install the FoilTeX files into
5752 \begin_inset Flex URL
5755 \begin_layout Plain Layout
5757 $TEXMFLOCAL/tex/latex/contrib/foiltex
5763 Why there? The CTAN download directories are themselves organized much
5764 like a TeX tree, and it isn't a bad idea to follow its structure when you
5765 install your own files.
5766 FoilTeX, as it happens, is found at
5767 \begin_inset Flex URL
5770 \begin_layout Plain Layout
5772 http://ctan.org/texarchive/macros/latex/contrib/foiltex/
5781 \begin_layout Enumerate
5782 Finally, you must update the database TeX uses to find files.
5783 On MiKTeX, this is done by pressing the button
5786 \begin_inset space ~
5791 that you find in MiKTeX's
5792 \begin_inset Quotes eld
5796 \begin_inset Quotes erd
5801 \begin_inset Flex CharStyle:Code
5804 \begin_layout Plain Layout
5805 $TEXMFLOCAL/tex/latex/
5811 Under TeXLive and the like, you should run
5812 \begin_inset Flex CharStyle:Code
5815 \begin_layout Plain Layout
5821 from a terminal, with root permissions if necessary.
5825 \begin_layout Standard
5826 Your package is now installed and available to LaTeX.
5827 You can verify this from a terminal by typing `
5828 \begin_inset Flex CharStyle:Code
5831 \begin_layout Plain Layout
5832 kpsewhich yourfile.ext
5838 To make LyX aware of it, however, you will need to reconfigure (
5839 \begin_inset Flex CharStyle:MenuItem
5842 \begin_layout Plain Layout
5843 Tools\SpecialChar \menuseparator
5849 ) and then restart LyX.
5850 If the new package was a document class, such as FoilTeX again, you will
5851 now see it available under
5852 \begin_inset Flex CharStyle:MenuItem
5855 \begin_layout Plain Layout
5856 Document\SpecialChar \menuseparator
5857 Settings\SpecialChar \menuseparator
5864 \begin_inset Flex CharStyle:MenuItem
5867 \begin_layout Plain Layout
5876 \begin_layout Standard
5877 What if there isn't a layout file is available for your new document class?
5878 Then, unfortunately, LyX will know nothing about it until you create a
5879 layout file yourself (or get someone else to do it).
5880 That is the topic of the next section.
5883 \begin_layout Section
5884 Types of layout files
5887 \begin_layout Standard
5888 This section describes the various sorts of LyX files that contain layout
5890 These files describe various paragraph and character styles, determining
5891 how LyX should display them and how they should be translated into LaTeX,
5892 DocBook, XHTML, or whatever output format is being used.
5896 \begin_layout Standard
5897 We shall try to provide a thorough description of the process of writing
5899 However, there are so many different types of documents supported even
5900 by just LaTeX that we can't hope to cover every different possibility or
5901 problem you might encounter.
5902 The LyX users' list is frequented by people with lots of experience with
5903 layout design who are willing to share what they've learned, so please
5904 feel free to ask questions there.
5907 \begin_layout Standard
5908 As you prepare to write a new layout, it is extremely helpful to look at
5909 the layouts distributed with LyX.
5910 If you write a LyX layout for a LaTeX document class that might also be
5911 used by others, or write a module that might be useful to others, then
5912 you should consider posting your layout to the
5913 \begin_inset CommandInset href
5915 name "layout section on the LyX wiki"
5916 target "http://wiki.lyx.org/Layouts/Layouts"
5920 or even to the LyX developers' list, so that it might be included in LyX
5925 \begin_layout Plain Layout
5926 Note that LyX is licensed under the General Public License, so any material
5927 that is contribued to LyX must be similarly licensed.
5935 \begin_layout Subsection
5937 \begin_inset CommandInset label
5939 name "sub:Layout-modules"
5946 \begin_layout Standard
5947 We have spoken to this point about `layout files'.
5948 But there are different sorts of files that contain layout information.
5949 Layout files, strictly so called, have the
5950 \begin_inset Flex CharStyle:Code
5953 \begin_layout Plain Layout
5959 extension and provide LyX with information about document classes.
5960 As of LyX 1.6, however, layout information can also be contained in layout
5966 \begin_inset Flex CharStyle:Code
5969 \begin_layout Plain Layout
5976 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
5977 some modules—such as the
5978 \begin_inset Flex CharStyle:Code
5981 \begin_layout Plain Layout
5987 module—specifcally provide support for one package.
5988 In a sense, layout modules are similar to included
5992 \begin_layout Plain Layout
5993 These can have any extension, but by convention have the
5994 \begin_inset Flex CharStyle:Code
5997 \begin_layout Plain Layout
6009 \begin_inset Flex CharStyle:Code
6012 \begin_layout Plain Layout
6018 —in that modules are not specific to a given document class but may be used
6019 with many different classes.
6020 The difference is that using an included file with
6021 \begin_inset Flex CharStyle:Code
6024 \begin_layout Plain Layout
6030 requires editing that file.
6031 Modules, by contrast, are selected in the
6032 \begin_inset Flex CharStyle:MenuItem
6035 \begin_layout Plain Layout
6036 Document\SpecialChar \menuseparator
6045 \begin_layout Standard
6046 Building modules is the easiest way to get started with layout editing,
6047 since it can be as simple as adding a single new paragraph style or flex
6049 But modules may, in principle, contain anything a layout file can contain.
6052 \begin_layout Standard
6053 After creating a new module and copying it to the
6054 \begin_inset Flex CharStyle:Code
6057 \begin_layout Plain Layout
6063 folder, you will need to reconfigure and then restart LyX for the module
6064 to appear in the menu.
6065 However, changes you make to the module will be seen immediately, if you
6067 \begin_inset Flex CharStyle:MenuItem
6070 \begin_layout Plain Layout
6071 Document\SpecialChar \menuseparator
6077 , highlight something, and then hit
6078 \begin_inset Quotes eld
6082 \begin_inset Quotes erd
6088 It is strongly recommended that you save your work before doing this
6093 it is strongly recommended that you not attempt to edit modules while simultaneo
6094 usly working on actual documents
6097 Though of course the developers strive to keep LyX stable in such situations,
6098 syntax errors and the like in your module file could cause strange behavior.
6101 \begin_layout Subsection
6103 \begin_inset Flex CharStyle:MenuItem
6106 \begin_layout Plain Layout
6115 \begin_layout Standard
6116 There are two situations you are likely to encounter when wanting to support
6117 a new LaTeX document class, involving LaTeX2e class (
6118 \begin_inset Flex CharStyle:Code
6121 \begin_layout Plain Layout
6128 \begin_inset Flex CharStyle:Code
6131 \begin_layout Plain Layout
6138 Supporting a style file is usually fairly easy.
6139 Supporting a new class file is a bit harder.
6140 We'll discuss the former in this section and the latter in the next.
6141 Similar remarks apply, of course, if you want to support a new DocBook
6145 \begin_layout Standard
6146 The easier case is the one in which your new document class is provided
6147 as a style file that is to be used in conjunction with an already supported
6149 For the sake of the example, we'll assume that the style file is called
6151 \begin_inset Flex CharStyle:MenuItem
6154 \begin_layout Plain Layout
6160 and that it is meant to be used with
6161 \begin_inset Flex CharStyle:MenuItem
6164 \begin_layout Plain Layout
6170 , which is a standard class.
6174 \begin_layout Standard
6175 Start by copying the existing class's layout file into your local directory:
6179 \begin_layout Plain Layout
6180 Of course, which directory is your local directory will vary by platform,
6181 and LyX allows you to specify your local directory on startup, too, using
6183 \begin_inset Flex CharStyle:Code
6186 \begin_layout Plain Layout
6200 \begin_layout LyX-Code
6201 cp report.layout ~/.lyx/layouts/myclass.layout
6204 \begin_layout Standard
6206 \begin_inset Flex CharStyle:Code
6209 \begin_layout Plain Layout
6215 and change the line:
6218 \begin_layout LyX-Code
6221 DeclareLaTeXClass{report}
6224 \begin_layout Standard
6228 \begin_layout LyX-Code
6231 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6234 \begin_layout Standard
6238 \begin_layout LyX-Code
6240 \begin_inset Newline newline
6246 \begin_inset Newline newline
6252 \begin_layout Standard
6253 near the top of the file.
6256 \begin_layout Standard
6257 Start LyX and select
6258 \begin_inset Flex CharStyle:MenuItem
6261 \begin_layout Plain Layout
6262 Tools\SpecialChar \menuseparator
6269 Then restart LyX and try creating a new document.
6271 \begin_inset Flex CharStyle:MenuItem
6274 \begin_layout Plain Layout
6280 " as a document class option in the
6281 \begin_inset Flex CharStyle:MenuItem
6284 \begin_layout Plain Layout
6285 Document\SpecialChar \menuseparator
6292 It is likely that some of the sectioning commands and such in your new
6293 class will work differently from how they worked in the base class—
6294 \begin_inset Flex CharStyle:Code
6297 \begin_layout Plain Layout
6303 in this example—so you can fiddle around with the settings for the different
6304 sections if you wish.
6305 The layout information for sections is contained in
6306 \begin_inset Flex CharStyle:Code
6309 \begin_layout Plain Layout
6315 , but you do not need to copy and change this file.
6316 Instead, you can simply add your changes to your layout file, after the
6318 \begin_inset Flex CharStyle:Code
6321 \begin_layout Plain Layout
6327 , which itself includes
6328 \begin_inset Flex CharStyle:Code
6331 \begin_layout Plain Layout
6338 For example, you might add these lines:
6341 \begin_layout LyX-Code
6345 \begin_layout LyX-Code
6349 \begin_layout LyX-Code
6353 \begin_layout LyX-Code
6357 \begin_layout LyX-Code
6361 \begin_layout Standard
6362 to change the font for chapter headings to sans-serif.
6363 This will override (or, in this case, add to) the existing declaration
6364 for the Chapter style.
6368 \begin_layout Standard
6369 Your new package may also provide commands or environments not present in
6371 In this case, you will want to add these to the layout file.
6373 \begin_inset CommandInset ref
6375 reference "sec:TextClass"
6379 for information on how to do so.
6382 \begin_layout Standard
6384 \begin_inset Flex CharStyle:MenuItem
6387 \begin_layout Plain Layout
6393 can be used with several different document classes, and even if it cannot,
6394 you might find it easiest just to write a module that you can load with
6396 The simplest possible such module would be:
6399 \begin_layout LyX-Code
6402 DeclareLyXModule{My Package}
6405 \begin_layout LyX-Code
6409 \begin_layout LyX-Code
6410 #Support for mypkg.sty.
6413 \begin_layout LyX-Code
6415 \begin_inset Newline newline
6421 \begin_layout LyX-Code
6423 \begin_inset Newline newline
6429 \begin_layout LyX-Code
6431 \begin_inset Newline newline
6437 \begin_inset Newline newline
6443 \begin_layout Standard
6444 A more complex module might modify the behavior of some existing constructs
6445 or define some new ones.
6447 \begin_inset CommandInset ref
6449 reference "sec:TextClass"
6456 \begin_layout Subsection
6458 \begin_inset Flex CharStyle:MenuItem
6461 \begin_layout Plain Layout
6470 \begin_layout Standard
6471 There are two possibilities here.
6472 One is that the class file is itself based upon an existing document class.
6473 For example, many thesis classes are based upon
6474 \begin_inset Flex CharStyle:MenuItem
6477 \begin_layout Plain Layout
6484 To see whether yours is, look for a line like
6487 \begin_layout LyX-Code
6493 \begin_layout Standard
6495 If so, then you may proceed largely as in the previous section, though
6497 \begin_inset Flex CharStyle:Code
6500 \begin_layout Plain Layout
6506 line will be different.
6507 If your new class is
6508 \begin_inset Flex CharStyle:Code
6511 \begin_layout Plain Layout
6517 and it is based upon
6518 \begin_inset Flex CharStyle:Code
6521 \begin_layout Plain Layout
6527 , then the line should read:
6531 \begin_layout Plain Layout
6532 And it will be easiest if you save the file to
6533 \begin_inset Flex CharStyle:Code
6536 \begin_layout Plain Layout
6542 : LyX assumes that the document class has the same name as the layout file.
6551 \begin_layout LyX-Code
6554 DeclareLaTeXClass[thesis,book]{thesis}
6557 \begin_layout Standard
6558 If, on the other hand, the new class is not based upon an existing class,
6559 you will probably have to
6560 \begin_inset Quotes eld
6564 \begin_inset Quotes erd
6568 We strongly suggest copying an existing layout file which uses a similar
6569 LaTeX class and then modifying it, if you can do so.
6570 At least use an existing file as a starting point so you can find out what
6571 items you need to worry about.
6572 Again, the specifics are covered below.
6575 \begin_layout Subsection
6577 \begin_inset CommandInset label
6579 name "sub:Creating-Templates"
6586 \begin_layout Standard
6587 Once you have written a layout file for a new document class, you might
6588 want to consider writing a
6593 A template acts as a kind of tutorial for your layout, showing how it might
6594 be used, though containing dummy content.
6595 You can of course look at the various templates included with LyX for ideas.
6598 \begin_layout Standard
6599 Templates are created just like usual documents: using LyX.
6600 The only difference is that usual documents contain all possible settings,
6601 including the font scheme and the paper size.
6602 Usually a user doesn't want a template to overwrite his preferred settings
6603 for such parameters.
6604 For that reason, the designer of a template should remove the corresponding
6606 \begin_inset Flex CharStyle:Code
6609 \begin_layout Plain Layout
6618 \begin_inset Flex CharStyle:Code
6621 \begin_layout Plain Layout
6629 from the template LyX file.
6630 This can be done with any simple text-editor, for example
6631 \begin_inset Flex CharStyle:Code
6634 \begin_layout Plain Layout
6641 \begin_inset Flex CharStyle:Code
6644 \begin_layout Plain Layout
6654 \begin_layout Standard
6655 Put the edited template files you create in
6656 \begin_inset Flex CharStyle:Code
6659 \begin_layout Plain Layout
6665 , copy the ones you use from the global template directory in
6666 \begin_inset Flex CharStyle:Code
6669 \begin_layout Plain Layout
6675 to the same place, and redefine the template path in the
6676 \begin_inset Flex CharStyle:MenuItem
6679 \begin_layout Plain Layout
6680 Tools\SpecialChar \menuseparator
6681 Preferences\SpecialChar \menuseparator
6690 \begin_layout Standard
6691 Note, by the way, that there is a template which has a particular meaning:
6693 \begin_inset Flex CharStyle:Code
6696 \begin_layout Plain Layout
6703 This template is loaded every time you create a new document with
6704 \begin_inset Flex CharStyle:MenuItem
6707 \begin_layout Plain Layout
6708 File\SpecialChar \menuseparator
6714 in order to provide useful defaults.
6715 To create this template from inside LyX, all you have to do is to open
6716 a document with the correct settings, and use the
6717 \begin_inset Flex CharStyle:MenuItem
6720 \begin_layout Plain Layout
6721 Save as Document Defaults
6729 \begin_layout Subsection
6730 Upgrading old layout files
6733 \begin_layout Standard
6734 The format of layout files changes with each LyX release, so old layout
6735 files need to be converted to the new format.
6736 This process has been automated since LyX 1.4: If LyX reads a layout file
6737 in an older format, it automatically calls the script
6738 \begin_inset Flex CharStyle:Code
6741 \begin_layout Plain Layout
6747 to convert it to a temporary file in current format.
6748 The original file is left untouched.
6749 If you use the layout file often, then, you may want to convert it permanently,
6750 so that LyX does not have to do so itself every time.
6751 To do this, you can call the converter manually:
6754 \begin_layout LyX-Code
6755 mv myclass.layout myclass.old
6758 \begin_layout LyX-Code
6759 python LyXDir/scripts/layout2layout.py myclass.old myclass.layout
6762 \begin_layout Standard
6764 \begin_inset Flex CharStyle:Code
6767 \begin_layout Plain Layout
6773 with the name of your LyX system directory, of course.
6776 \begin_layout Standard
6777 Note that manual conversion does not affect included files, so these will
6778 have to be converted separately.
6781 \begin_layout Section
6782 \begin_inset CommandInset label
6784 name "sec:TextClass"
6788 The layout file format
6791 \begin_layout Standard
6792 When it's finally time to get your hands dirty and create or edit your own
6793 layout file, the following sections describe what you're up against.
6794 Our advice is to go slowly, save and test often, listen to soothing music,
6795 and enjoy one or two of your favorite adult beverages; more if you are
6796 getting particularly stuck.
6797 It's really not that hard, except that the multitude of options can become
6798 overwhelming if you try to do too much in one sitting.
6799 Go have another adult beverage, just for good measure.
6802 \begin_layout Standard
6803 Note that all the tags used in layout files are case-insensitive.
6805 \begin_inset Flex CharStyle:Code
6808 \begin_layout Plain Layout
6815 \begin_inset Flex CharStyle:Code
6818 \begin_layout Plain Layout
6825 \begin_inset Flex CharStyle:Code
6828 \begin_layout Plain Layout
6834 are really the same tag.
6835 The possible values are printed in brackets after the feature's name.
6836 The default value if a feature isn't specified inside a text class-description
6838 \begin_inset Flex CharStyle:Code
6841 \begin_layout Plain Layout
6850 If the argument has a data type like
6851 \begin_inset Quotes eld
6855 \begin_inset Quotes erd
6859 \begin_inset Quotes eld
6863 \begin_inset Quotes erd
6866 , the default is shown like this:
6867 \begin_inset Flex CharStyle:Code
6870 \begin_layout Plain Layout
6881 \begin_layout Subsection
6882 The document class declaration
6885 \begin_layout Standard
6886 Lines in a layout file which begin with
6887 \begin_inset Flex CharStyle:Code
6890 \begin_layout Plain Layout
6897 There is one exception to this rule.
6899 \begin_inset Flex CharStyle:Code
6902 \begin_layout Plain Layout
6908 files should begin with a line like:
6911 \begin_layout LyX-Code
6914 #% Do not delete the line below; configure depends on this
6917 \begin_layout LyX-Code
6922 DeclareLaTeXClass{article}
6925 \begin_layout Standard
6926 The second line is used when you (re)configure LyX.
6927 The layout file is read by the LaTeX script
6928 \begin_inset Flex CharStyle:Code
6931 \begin_layout Plain Layout
6937 , in a special mode where
6938 \begin_inset Flex CharStyle:Code
6941 \begin_layout Plain Layout
6948 The first line is just a LaTeX comment, and the second one contains the
6949 declaration of the text class.
6950 If these lines appear in a file named
6951 \begin_inset Flex CharStyle:Code
6954 \begin_layout Plain Layout
6960 , then they define a text class of name
6961 \begin_inset Flex CharStyle:Code
6964 \begin_layout Plain Layout
6970 (the name of the layout file) which uses the LaTeX document class
6971 \begin_inset Flex CharStyle:Code
6974 \begin_layout Plain Layout
6980 (the default is to use the same name as the layout).
6982 \begin_inset Quotes eld
6986 \begin_inset Quotes erd
6989 that appears above is used as a description of the text class in the
6990 \begin_inset Flex CharStyle:MenuItem
6993 \begin_layout Plain Layout
6994 Document\SpecialChar \menuseparator
7003 \begin_layout Standard
7004 Let's assume that you wrote your own text class that uses the
7005 \begin_inset Flex CharStyle:Code
7008 \begin_layout Plain Layout
7014 document class, but where you changed the appearance of the section headings.
7015 If you put it in a file
7016 \begin_inset Flex CharStyle:Code
7019 \begin_layout Plain Layout
7025 , the header of this file should be:
7028 \begin_layout LyX-Code
7031 #% Do not delete the line below; configure depends on this
7034 \begin_layout LyX-Code
7039 DeclareLaTeXClass[article]{article (with my own headings)}
7042 \begin_layout Standard
7043 This declares a text class
7044 \begin_inset Flex CharStyle:Code
7047 \begin_layout Plain Layout
7053 , associated with the LaTeX document class
7054 \begin_inset Flex CharStyle:Code
7057 \begin_layout Plain Layout
7064 \begin_inset Quotes eld
7067 article (with my own headings)
7068 \begin_inset Quotes erd
7072 If your text class depends on several packages, you can declare it as:
7075 \begin_layout LyX-Code
7078 #% Do not delete the line below; configure depends on this
7081 \begin_layout LyX-Code
7086 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
7089 \begin_layout Standard
7090 This indicates that your text class uses the
7091 \begin_inset Flex CharStyle:Code
7094 \begin_layout Plain Layout
7101 Finally, it is also possible to declare classes for DocBook code.
7102 Typical declarations will look like:
7105 \begin_layout LyX-Code
7108 #% Do not delete the line below; configure depends on this
7111 \begin_layout LyX-Code
7116 DeclareDocBookClass[article]{SGML (DocBook article)}
7119 \begin_layout Standard
7120 Note that these declarations can also be given an optional parameter declaring
7121 the name of the document class (but not a list).
7124 \begin_layout Standard
7125 So, to be as explicit as possible, the form of the layout declaration is:
7128 \begin_layout LyX-Code
7133 DeclareLaTeXClass[class,package.sty]{layout description}
7136 \begin_layout Standard
7137 The class need only be specified if the name of the LaTeX class file and
7138 the name of the layout file are different or if there are packages to load.
7139 If the name of the class file is not specified, then LyX will simply assume
7140 that it is the same as the name of the layout file.
7143 \begin_layout Standard
7144 When the text class has been modified to your taste, all you have to do
7145 is to copy it either to
7146 \begin_inset Flex CharStyle:Code
7149 \begin_layout Plain Layout
7156 \begin_inset Flex CharStyle:Code
7159 \begin_layout Plain Layout
7166 \begin_inset Flex CharStyle:MenuItem
7169 \begin_layout Plain Layout
7170 Tools\SpecialChar \menuseparator
7176 , exit LyX and restart.
7177 Then your new text class should be available along with the others.
7180 \begin_layout Standard
7181 Once the layout file is installed, you can edit it and see your changes
7182 without having to reconfigure or to restart LyX.
7187 \begin_layout Plain Layout
7188 In versions of LyX prior to 1.6, this was not true.
7189 As a result, editing layout files was very time consuming, since you had
7190 constantly to restart LyX to see changes.
7195 You can force a reload of the current layout by using the LyX function
7197 \begin_inset Flex CharStyle:MenuItem
7200 \begin_layout Plain Layout
7207 There is no default binding for this function—though, of course, you can
7208 bind it to a key yourself.
7209 But you will normally use this function simply by entering it in the mini-buffe
7214 \begin_layout Standard
7220 \begin_inset Flex CharStyle:MenuItem
7223 \begin_layout Plain Layout
7229 is very much an `advanced feature'.
7234 recommended that you save your work before using this function.
7239 recommended that you not attempt to edit layout information while simultaneousl
7240 y working on a document that you care about.
7241 Use a test document.
7242 Syntax errors and the like in your layout file could cause peculiar behavior.
7243 In particular, such errors could cause LyX to regard the current layout
7244 as invalid and to attempt to switch to some other layout.
7248 \begin_layout Plain Layout
7249 Really bad syntax errors may even caused LyX to exit.
7250 This is because certain sorts of errors may make LyX unable to read
7260 The LyX team strives to keep LyX stable in such situations, but safe is
7265 \begin_layout Plain Layout
7266 While we're giving advice: make regular backups.
7267 And be nice to your mother.
7275 \begin_layout Subsection
7276 The Module declaration
7279 \begin_layout Standard
7280 A module must begin with a line like the following:
7283 \begin_layout LyX-Code
7286 DeclareLyXModule[endnotes.sty]{Endnotes}
7289 \begin_layout Standard
7290 The mandatory argument, in curly brackets, is the name of the module, as
7292 \begin_inset Flex CharStyle:MenuItem
7295 \begin_layout Plain Layout
7296 Document\SpecialChar \menuseparator
7303 The argument in square brackets is optional: It declares any LaTeX packages
7304 on which the module depends.
7305 Please note that only packages about which LyX knows should be listed in
7306 the square brackets.
7310 \begin_layout Plain Layout
7311 The list of such packages is documented only in the source code.
7316 LyX will not check for arbitrary packages.
7317 It is also possible to use the form
7318 \begin_inset Flex CharStyle:MenuItem
7321 \begin_layout Plain Layout
7327 as an optional argument, which declares that the module can only be used
7328 when there exists a conversion chain between the formats `
7329 \begin_inset Flex CharStyle:Code
7332 \begin_layout Plain Layout
7339 \begin_inset Flex CharStyle:Code
7342 \begin_layout Plain Layout
7351 \begin_layout Standard
7352 The module declaration should then be followed by lines like the following:
7355 \begin_layout LyX-Code
7359 \begin_layout LyX-Code
7360 #Adds an endnote command, in addition to footnotes.
7364 \begin_layout LyX-Code
7365 #You will need to add
7367 theendnotes in TeX code where you
7370 \begin_layout LyX-Code
7371 #want the endnotes to appear.
7375 \begin_layout LyX-Code
7379 \begin_layout LyX-Code
7380 #Requires: somemodule | othermodule
7383 \begin_layout LyX-Code
7384 #Excludes: badmodule
7387 \begin_layout Standard
7388 The description is used in
7389 \begin_inset Flex CharStyle:MenuItem
7392 \begin_layout Plain Layout
7393 Document\SpecialChar \menuseparator
7399 to provide the user with information about what the module does.
7401 \begin_inset Flex CharStyle:Code
7404 \begin_layout Plain Layout
7410 line is used to identify other modules with which this one must be used;
7412 \begin_inset Flex CharStyle:Code
7415 \begin_layout Plain Layout
7421 line is used to identify modules with which this one may not be used.
7422 Both are optional, and, as shown, multiple modules should be separated
7423 with the pipe symbol: |.
7424 Note that the required modules are treated disjunctively:
7428 of the required modules must be used.
7433 excluded module may be used.
7434 Note that modules are identified here by their
7439 \begin_inset Flex CharStyle:Code
7442 \begin_layout Plain Layout
7450 \begin_inset Flex CharStyle:Code
7453 \begin_layout Plain Layout
7460 \begin_inset Flex CharStyle:Code
7463 \begin_layout Plain Layout
7472 \begin_layout Subsection
7476 \begin_layout Standard
7477 The first non-comment line of any layout file, included file, or module
7482 contain the file format number:
7485 \begin_layout Description
7486 \begin_inset Flex CharStyle:Code
7489 \begin_layout Plain Layout
7496 \begin_inset Flex CharStyle:Code
7499 \begin_layout Plain Layout
7505 ] The format of the layout file.
7508 \begin_layout Standard
7509 This tag was introduced with LyX 1.4.0.
7510 Layout files from LyX 1.3.x and earlier don't have an explicit file format
7511 and are considered to be of format 1.
7512 The format for the present version of LyX is format 21.
7513 But each version of LyX is capable of reading earlier versions' layout
7514 files, just as they are capable of reading files produced by earlier versions
7516 There is, however, no provision for converting to earlier formats.
7517 So LyX 1.6.x will not read layout files in format 21 but only files in format
7521 \begin_layout Subsection
7522 \begin_inset CommandInset label
7524 name "sub:General-text-class"
7528 General text class parameters
7531 \begin_layout Standard
7532 These are general parameters that govern the behavior of an entire document
7538 mean that they must appear in
7539 \begin_inset Flex CharStyle:Code
7542 \begin_layout Plain Layout
7548 files rather than in modules.
7549 A module can contain any layout tag.)
7552 \begin_layout Description
7553 \begin_inset Flex CharStyle:Code
7556 \begin_layout Plain Layout
7562 Adds information that will be output in the
7563 \begin_inset Flex CharStyle:Code
7566 \begin_layout Plain Layout
7572 block when this document class is output to XHTML.
7573 Typically, this would be used to output CSS style information, but it can
7574 be used for anything that can appear in
7575 \begin_inset Flex CharStyle:Code
7578 \begin_layout Plain Layout
7586 \begin_inset Quotes eld
7590 \begin_inset Flex CharStyle:Code
7593 \begin_layout Plain Layout
7600 \begin_inset Quotes erd
7606 \begin_layout Description
7607 \begin_inset Flex CharStyle:Code
7610 \begin_layout Plain Layout
7616 Adds information to the document preamble.
7618 \begin_inset Quotes eld
7622 \begin_inset Flex CharStyle:Code
7625 \begin_layout Plain Layout
7632 \begin_inset Quotes erd
7638 \begin_layout Description
7639 \begin_inset Flex CharStyle:Code
7642 \begin_layout Plain Layout
7648 Defines formats for use in the display of bibliographic information.
7650 \begin_inset CommandInset ref
7652 reference "sub:Citation-format-description"
7658 \begin_inset Quotes eld
7662 \begin_inset Flex CharStyle:Code
7665 \begin_layout Plain Layout
7672 \begin_inset Quotes erd
7678 \begin_layout Description
7679 \begin_inset Flex CharStyle:Code
7682 \begin_layout Plain Layout
7688 Describes various global options supported by the document class.
7690 \begin_inset space ~
7694 \begin_inset CommandInset ref
7696 reference "sub:ClassOptions"
7702 \begin_inset Quotes eld
7706 \begin_inset Flex CharStyle:Code
7709 \begin_layout Plain Layout
7716 \begin_inset Quotes erd
7722 \begin_layout Description
7723 \begin_inset Flex CharStyle:Code
7726 \begin_layout Plain Layout
7733 \begin_inset Flex CharStyle:Code
7736 \begin_layout Plain Layout
7745 \begin_inset Flex CharStyle:Code
7748 \begin_layout Plain Layout
7754 ] Whether the class should
7758 to having one or two columns.
7759 Can be changed in the
7760 \begin_inset Flex CharStyle:MenuItem
7763 \begin_layout Plain Layout
7764 Document\SpecialChar \menuseparator
7773 \begin_layout Description
7774 \begin_inset Flex CharStyle:Code
7777 \begin_layout Plain Layout
7784 \begin_inset Flex CharStyle:Code
7787 \begin_layout Plain Layout
7793 ] This sequence defines the properties for a counter.
7794 If the counter does not yet exist, it is created; if it does exist, it
7797 \begin_inset Quotes eld
7801 \begin_inset Flex CharStyle:Code
7804 \begin_layout Plain Layout
7811 \begin_inset Quotes erd
7815 \begin_inset Newline newline
7819 \begin_inset space ~
7823 \begin_inset CommandInset ref
7825 reference "sub:Counters"
7829 for details on counters.
7832 \begin_layout Description
7833 \begin_inset Flex CharStyle:Code
7836 \begin_layout Plain Layout
7842 Sets the default font used to display the document.
7844 \begin_inset space ~
7848 \begin_inset CommandInset ref
7850 reference "sub:Font-description"
7854 for how to declare fonts.
7856 \begin_inset Quotes eld
7860 \begin_inset Flex CharStyle:Code
7863 \begin_layout Plain Layout
7870 \begin_inset Quotes erd
7876 \begin_layout Description
7877 \begin_inset Flex CharStyle:Code
7880 \begin_layout Plain Layout
7887 \begin_inset Flex CharStyle:Code
7890 \begin_layout Plain Layout
7896 Specifies a module to be included by default with this document class.
7897 The module should be specified by filename without the
7898 \begin_inset Flex CharStyle:Code
7901 \begin_layout Plain Layout
7908 The user can still remove the module, but it will be active at the outset.
7909 (This applies only when new files are created, or when this class is chosen
7910 for an existing document.)
7913 \begin_layout Description
7914 \begin_inset Flex CharStyle:Code
7917 \begin_layout Plain Layout
7924 \begin_inset Flex CharStyle:Code
7927 \begin_layout Plain Layout
7933 ] This is the style that will be assigned to new paragraphs, usually
7934 \begin_inset Flex CharStyle:MenuItem
7937 \begin_layout Plain Layout
7944 This will default to the first defined style if not given, but you are
7945 encouraged to use this directive.
7948 \begin_layout Description
7949 \begin_inset Flex CharStyle:Code
7952 \begin_layout Plain Layout
7959 \begin_inset Flex CharStyle:Code
7962 \begin_layout Plain Layout
7968 ] This tag indicates that the module in question—which should be specified
7969 by filename without the
7970 \begin_inset Flex CharStyle:Code
7973 \begin_layout Plain Layout
7979 extension—cannot be used with this document class.
7980 This might be used in a journal-specific layout file to prevent, say, the
7982 \begin_inset Flex CharStyle:Code
7985 \begin_layout Plain Layout
7991 module that numbers theorems by section.
7996 be used in a module.
7997 Modules have their own way of excluding other modules (see
7998 \begin_inset CommandInset ref
8000 reference "sub:Layout-modules"
8007 \begin_layout Description
8008 \begin_inset Flex CharStyle:Code
8011 \begin_layout Plain Layout
8017 Defines a new float.
8019 \begin_inset space ~
8023 \begin_inset CommandInset ref
8025 reference "sub:Floats"
8031 \begin_inset Quotes eld
8035 \begin_inset Flex CharStyle:Code
8038 \begin_layout Plain Layout
8045 \begin_inset Quotes erd
8051 \begin_layout Description
8052 \begin_inset Flex CharStyle:Code
8055 \begin_layout Plain Layout
8061 Sets the information that will be output in the
8062 \begin_inset Flex CharStyle:Code
8065 \begin_layout Plain Layout
8071 block when this document class is output to XHTML.
8072 Note that this will completely override any prior
8073 \begin_inset Flex CharStyle:Code
8076 \begin_layout Plain Layout
8083 \begin_inset Flex CharStyle:Code
8086 \begin_layout Plain Layout
8094 \begin_inset Flex CharStyle:Code
8097 \begin_layout Plain Layout
8103 if you just want to add material to the preamble.) Must end with
8104 \begin_inset Quotes eld
8108 \begin_inset Flex CharStyle:Code
8111 \begin_layout Plain Layout
8118 \begin_inset Quotes erd
8124 \begin_layout Description
8125 \begin_inset Flex CharStyle:Code
8128 \begin_layout Plain Layout
8135 \begin_inset Flex CharStyle:Code
8138 \begin_layout Plain Layout
8144 ] The layout to use for the table of contents, bibliography, and so forth,
8145 when the document is output to HTML.
8146 For articles, this should normally be Section; for books, Chapter.
8147 If it is not given, then LyX will attempt to figure out which layout to
8151 \begin_layout Description
8152 \begin_inset Flex CharStyle:Code
8155 \begin_layout Plain Layout
8162 \begin_inset Flex CharStyle:Code
8165 \begin_layout Plain Layout
8171 ] Modifies the properties of the given counter.
8172 If the counter does not exist, the section is ignored.
8174 \begin_inset Quotes eld
8178 \begin_inset Flex CharStyle:Code
8181 \begin_layout Plain Layout
8188 \begin_inset Quotes erd
8192 \begin_inset Newline newline
8196 \begin_inset space ~
8200 \begin_inset CommandInset ref
8202 reference "sub:Counters"
8206 for details on counters.
8209 \begin_layout Description
8210 \begin_inset Flex CharStyle:Code
8213 \begin_layout Plain Layout
8220 \begin_inset Flex CharStyle:Code
8223 \begin_layout Plain Layout
8229 ] Modifies the properties of the given paragraph style.
8230 If the style does not exist, the section is ignored.
8232 \begin_inset Quotes eld
8236 \begin_inset Flex CharStyle:Code
8239 \begin_layout Plain Layout
8246 \begin_inset Quotes erd
8252 \begin_layout Description
8253 \begin_inset Flex CharStyle:Code
8256 \begin_layout Plain Layout
8262 As its name implies, this command allows you to include another layout
8263 definition file within yours to avoid duplicating commands.
8264 Common examples are the standard layout files, for example,
8265 \begin_inset Flex CharStyle:Code
8268 \begin_layout Plain Layout
8274 , which contains most of the basic layouts.
8277 \begin_layout Description
8278 \begin_inset Flex CharStyle:Code
8281 \begin_layout Plain Layout
8287 This section (re-)defines the layout of an inset.
8288 It can be applied to an existing inset or to a new, user-defined inset,
8289 e.g., a new character style.
8291 \begin_inset Quotes eld
8295 \begin_inset Flex CharStyle:Code
8298 \begin_layout Plain Layout
8305 \begin_inset Quotes erd
8309 \begin_inset Newline newline
8313 \begin_inset space ~
8317 \begin_inset CommandInset ref
8319 reference "sub:Flex-insets-and"
8323 for more information.
8327 \begin_layout Description
8328 \begin_inset Flex CharStyle:Code
8331 \begin_layout Plain Layout
8338 \begin_inset Flex CharStyle:Code
8341 \begin_layout Plain Layout
8347 ] A string that indicates the width of the left margin on the screen, for
8349 \begin_inset Quotes eld
8353 \begin_inset Quotes erd
8357 (Note that this is not a `length', like
8358 \begin_inset Quotes eld
8362 \begin_inset Quotes erd
8368 \begin_layout Description
8369 \begin_inset Flex CharStyle:Code
8372 \begin_layout Plain Layout
8378 This command deletes an existing float.
8379 This is particularly useful when you want to suppress a float that has
8380 been defined in an input file.
8383 \begin_layout Description
8384 \begin_inset Flex CharStyle:Code
8387 \begin_layout Plain Layout
8393 This command deletes an existing style.
8394 This is particularly useful when you want to suppress a style that has
8395 be defined in an input file.
8398 \begin_layout Description
8399 \begin_inset Flex CharStyle:Code
8402 \begin_layout Plain Layout
8408 A string indicating the file format (as defined in the Preferences dialog)
8409 produced by this class.
8410 It is mainly useful when
8411 \begin_inset Flex CharStyle:Code
8414 \begin_layout Plain Layout
8420 is `literate' and one wants to define a new type of literate document.
8421 This string is reset to `docbook', `latex', or `literate' when the correspondin
8423 \begin_inset Flex CharStyle:Code
8426 \begin_layout Plain Layout
8432 parameter is encountered.
8435 \begin_layout Description
8436 \begin_inset Flex CharStyle:Code
8439 \begin_layout Plain Layout
8445 A string indicating what sort of output documents using this class will
8447 At present, the options are: `docbook', `latex', and `literate'.
8450 \begin_layout Description
8451 \begin_inset Flex CharStyle:Code
8454 \begin_layout Plain Layout
8461 \begin_inset Flex CharStyle:Code
8464 \begin_layout Plain Layout
8473 \begin_inset Flex CharStyle:Code
8476 \begin_layout Plain Layout
8483 \begin_inset Flex CharStyle:Code
8486 \begin_layout Plain Layout
8492 ] The default pagestyle.
8493 Can be changed in the
8494 \begin_inset Flex CharStyle:MenuItem
8497 \begin_layout Plain Layout
8498 Document\SpecialChar \menuseparator
8507 \begin_layout Description
8508 \begin_inset Flex CharStyle:Code
8511 \begin_layout Plain Layout
8517 Sets the preamble for the LaTeX document.
8518 Note that this will completely override any prior
8519 \begin_inset Flex CharStyle:Code
8522 \begin_layout Plain Layout
8529 \begin_inset Flex CharStyle:Code
8532 \begin_layout Plain Layout
8540 \begin_inset Flex CharStyle:Code
8543 \begin_layout Plain Layout
8549 if you just want to add material to the preamble.) Must end with
8550 \begin_inset Quotes eld
8554 \begin_inset Flex CharStyle:Code
8557 \begin_layout Plain Layout
8564 \begin_inset Quotes erd
8570 \begin_layout Description
8571 \begin_inset Flex CharStyle:Code
8574 \begin_layout Plain Layout
8581 \begin_inset Flex CharStyle:Code
8584 \begin_layout Plain Layout
8591 \begin_inset Flex CharStyle:Code
8594 \begin_layout Plain Layout
8603 \begin_inset Flex CharStyle:Code
8606 \begin_layout Plain Layout
8612 ] Whether the class already provides the feature
8613 \begin_inset Flex CharStyle:Code
8616 \begin_layout Plain Layout
8623 A feature is in general the name of a package (
8624 \begin_inset Flex CharStyle:Code
8627 \begin_layout Plain Layout
8634 \begin_inset Flex CharStyle:Code
8637 \begin_layout Plain Layout
8643 , \SpecialChar \ldots{}
8645 \begin_inset Flex CharStyle:Code
8648 \begin_layout Plain Layout
8655 \begin_inset Flex CharStyle:Code
8658 \begin_layout Plain Layout
8664 ,\SpecialChar \ldots{}
8665 ); the complete list of supported features is unfortunately not documented
8666 outside the LyX source code—but see
8667 \begin_inset Flex CharStyle:Code
8670 \begin_layout Plain Layout
8676 if you're interested.
8678 \begin_inset Flex CharStyle:MenuItem
8681 \begin_layout Plain Layout
8682 Help\SpecialChar \menuseparator
8688 also gives an overview of the supported packages.
8691 \begin_layout Description
8692 \begin_inset Flex CharStyle:Code
8695 \begin_layout Plain Layout
8702 \begin_inset Flex CharStyle:Code
8705 \begin_layout Plain Layout
8711 ] Indicates that this layout provides the functionality of the module mentioned,
8712 which should be specified by the filename without the
8713 \begin_inset Flex CharStyle:Code
8716 \begin_layout Plain Layout
8723 This will typically be used if the layout includes the module directly,
8724 rather than using the
8725 \begin_inset Flex CharStyle:Code
8728 \begin_layout Plain Layout
8734 tag to indicate that it ought to be used.
8735 It could also be used in a module that provided an alternate implementation
8736 of the same functionality.
8739 \begin_layout Description
8740 \begin_inset Flex CharStyle:Code
8743 \begin_layout Plain Layout
8750 \begin_inset Flex CharStyle:Code
8753 \begin_layout Plain Layout
8759 ] Whether the class requires the feature
8760 \begin_inset Flex CharStyle:Code
8763 \begin_layout Plain Layout
8770 Multiple features must be separated by commas.
8771 Note that you can only request supported features.
8773 \begin_inset Flex CharStyle:Code
8776 \begin_layout Plain Layout
8782 for a list of these.)
8785 \begin_layout Description
8786 \begin_inset Flex CharStyle:Code
8789 \begin_layout Plain Layout
8795 A string that indicates the width of the right margin on the screen, for
8797 \begin_inset Quotes eld
8801 \begin_inset Quotes erd
8807 \begin_layout Description
8808 \begin_inset Flex CharStyle:Code
8811 \begin_layout Plain Layout
8817 Sets which divisions get numbered.
8819 \begin_inset Flex CharStyle:Code
8822 \begin_layout Plain Layout
8831 \begin_layout Description
8832 \begin_inset Flex CharStyle:Code
8835 \begin_layout Plain Layout
8842 \begin_inset Flex CharStyle:Code
8845 \begin_layout Plain Layout
8854 \begin_inset Flex CharStyle:Code
8857 \begin_layout Plain Layout
8863 ] Whether the class-default should be printing on one or both sides of the
8865 Can be changed in the
8866 \begin_inset Flex CharStyle:MenuItem
8869 \begin_layout Plain Layout
8870 Document\SpecialChar \menuseparator
8879 \begin_layout Description
8880 \begin_inset Flex CharStyle:Code
8883 \begin_layout Plain Layout
8889 This sequence defines a paragraph style.
8890 If the style does not yet exist, it is created; if it does exist, its parameter
8893 \begin_inset Quotes eld
8897 \begin_inset Flex CharStyle:Code
8900 \begin_layout Plain Layout
8907 \begin_inset Quotes erd
8911 \begin_inset Newline newline
8915 \begin_inset space ~
8919 \begin_inset CommandInset ref
8921 reference "sub:Paragraph-Styles"
8925 for details on paragraph styles.
8928 \begin_layout Description
8929 \begin_inset Flex CharStyle:Code
8932 \begin_layout Plain Layout
8939 \begin_inset Flex CharStyle:Code
8942 \begin_layout Plain Layout
8948 ] The name of the command or environment to be used with
8949 \begin_inset Flex CharStyle:Code
8952 \begin_layout Plain Layout
8961 \begin_layout Description
8962 \begin_inset Flex CharStyle:Code
8965 \begin_layout Plain Layout
8972 \begin_inset Flex CharStyle:Code
8975 \begin_layout Plain Layout
8984 \begin_inset Flex CharStyle:Code
8987 \begin_layout Plain Layout
8993 ] Indicates what kind of markup is used to define the title of a document.
8995 \begin_inset Flex CharStyle:Code
8998 \begin_layout Plain Layout
9004 means that the macro with name
9005 \begin_inset Flex CharStyle:Code
9008 \begin_layout Plain Layout
9014 will be inserted after the last layout which has
9015 \begin_inset Quotes eld
9019 \begin_inset Flex CharStyle:Code
9022 \begin_layout Plain Layout
9029 \begin_inset Quotes erd
9034 \begin_inset Flex CharStyle:Code
9037 \begin_layout Plain Layout
9043 corresponds to the case where the block of paragraphs which have
9044 \begin_inset Quotes eld
9048 \begin_inset Flex CharStyle:Code
9051 \begin_layout Plain Layout
9058 \begin_inset Quotes erd
9061 should be enclosed into the
9062 \begin_inset Flex CharStyle:Code
9065 \begin_layout Plain Layout
9074 \begin_layout Description
9075 \begin_inset Flex CharStyle:Code
9078 \begin_layout Plain Layout
9084 Sets which divisions are included in the table of contents.
9086 \begin_inset Flex CharStyle:Code
9089 \begin_layout Plain Layout
9098 \begin_layout Subsection
9099 \begin_inset Flex CharStyle:Code
9102 \begin_layout Plain Layout
9109 \begin_inset CommandInset label
9111 name "sub:ClassOptions"
9118 \begin_layout Standard
9120 \begin_inset Flex CharStyle:Code
9123 \begin_layout Plain Layout
9129 section can contain the following entries:
9132 \begin_layout Description
9133 \begin_inset Flex CharStyle:Code
9136 \begin_layout Plain Layout
9143 \begin_inset Flex CharStyle:Code
9146 \begin_layout Plain Layout
9152 ] The list of available font sizes for the document's main font, separated
9154 \begin_inset Quotes eld
9158 \begin_inset Flex CharStyle:Code
9161 \begin_layout Plain Layout
9168 \begin_inset Quotes erd
9174 \begin_layout Description
9175 \begin_inset Flex CharStyle:Code
9178 \begin_layout Plain Layout
9184 Used to set the DTD line with XML-based output classes.
9186 \begin_inset space \thinspace{}
9190 \begin_inset Quotes eld
9193 -//OASIS//DTD DocBook V4.2//EN
9194 \begin_inset Quotes erd
9200 \begin_layout Description
9201 \begin_inset Flex CharStyle:Code
9204 \begin_layout Plain Layout
9211 \begin_inset Flex CharStyle:Code
9214 \begin_layout Plain Layout
9215 string="empty|plain|headings|fancy"
9220 ] The list of available page styles, separated by
9221 \begin_inset Quotes eld
9225 \begin_inset Flex CharStyle:Code
9228 \begin_layout Plain Layout
9235 \begin_inset Quotes erd
9241 \begin_layout Description
9242 \begin_inset Flex CharStyle:Code
9245 \begin_layout Plain Layout
9252 \begin_inset Flex CharStyle:Code
9255 \begin_layout Plain Layout
9261 ] Some document class options, separated by a comma, that will be added
9262 to the optional part of the
9263 \begin_inset Flex CharStyle:Code
9266 \begin_layout Plain Layout
9277 \begin_layout Standard
9279 \begin_inset Flex CharStyle:Code
9282 \begin_layout Plain Layout
9288 section must end with
9289 \begin_inset Quotes eld
9293 \begin_inset Flex CharStyle:Code
9296 \begin_layout Plain Layout
9303 \begin_inset Quotes erd
9309 \begin_layout Subsection
9311 \begin_inset CommandInset label
9313 name "sub:Paragraph-Styles"
9320 \begin_layout Standard
9321 A paragraph style description looks like this:
9325 \begin_layout Plain Layout
9326 Note that this will either define a new layout or modify an existing one.
9334 \begin_layout LyX-Code
9341 \begin_layout LyX-Code
9345 \begin_layout LyX-Code
9349 \begin_layout Standard
9350 where the following commands are allowed:
9353 \begin_layout Description
9354 \begin_inset Flex CharStyle:Code
9357 \begin_layout Plain Layout
9364 \begin_inset Flex CharStyle:Code
9367 \begin_layout Plain Layout
9372 , left, right, center
9377 ] Paragraph alignment.
9380 \begin_layout Description
9381 \begin_inset Flex CharStyle:Code
9384 \begin_layout Plain Layout
9391 \begin_inset Flex CharStyle:Code
9394 \begin_layout Plain Layout
9399 , left, right, center
9404 ] A comma separated list of permitted alignments.
9405 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
9407 For example a right-aligned or centered enumeration isn't possible.)
9410 \begin_layout Description
9411 \begin_inset Flex CharStyle:Code
9414 \begin_layout Plain Layout
9420 Note that this will completely override any prior
9421 \begin_inset Flex CharStyle:Code
9424 \begin_layout Plain Layout
9430 declaration for this style.
9432 \begin_inset Quotes eld
9436 \begin_inset Flex CharStyle:Code
9439 \begin_layout Plain Layout
9446 \begin_inset Quotes erd
9451 \begin_inset CommandInset ref
9453 reference "sub:I18n"
9457 for details on its use.
9460 \begin_layout Description
9461 \begin_inset Flex CharStyle:Code
9464 \begin_layout Plain Layout
9471 \begin_inset Flex CharStyle:Code
9474 \begin_layout Plain Layout
9484 \begin_layout Plain Layout
9485 Note that a `float' here is a real number, such as: 1.5.
9490 The vertical space with which the last of a chain of paragraphs with this
9491 layout is separated from the following paragraph.
9492 If the next paragraph has another layout, the separations are not simply
9493 added, but the maximum is taken.
9496 \begin_layout Description
9497 \begin_inset Flex CharStyle:Code
9500 \begin_layout Plain Layout
9507 \begin_inset Flex CharStyle:Code
9510 \begin_layout Plain Layout
9516 The category for this style.
9517 This is used to group related styles in the Layout combobox on the toolbar.
9518 Any string can be used, but you may want to use existing categories with
9523 \begin_layout Description
9524 \begin_inset Flex CharStyle:Code
9527 \begin_layout Plain Layout
9533 Depth of XML command.
9534 Used only with XML-type formats.
9537 \begin_layout Description
9538 \begin_inset Flex CharStyle:Code
9541 \begin_layout Plain Layout
9548 \begin_inset CommandInset label
9550 name "des:CopyStyle"
9555 \begin_inset Flex CharStyle:Code
9558 \begin_layout Plain Layout
9564 Copies all the features of an existing style into the current one.
9568 \begin_layout Description
9569 \begin_inset Flex CharStyle:Code
9572 \begin_layout Plain Layout
9578 The name of a style whose preamble should be output
9583 This allows to ensure some ordering of the preamble snippets when macros
9584 definitions depend on one another.
9588 \begin_layout Plain Layout
9589 Note that, besides that functionality, there is no way to ensure any ordering
9591 The ordering that you see in a given version of LyX may change without
9592 warning in later versions.
9600 \begin_layout Description
9601 \begin_inset Flex CharStyle:Code
9604 \begin_layout Plain Layout
9611 \begin_inset Flex CharStyle:Code
9614 \begin_layout Plain Layout
9619 , Box, Filled_Box, Static
9624 ] The type of label that stands at the end of the paragraph (or sequence
9626 \begin_inset Flex CharStyle:Code
9629 \begin_layout Plain Layout
9636 \begin_inset Flex CharStyle:Code
9639 \begin_layout Plain Layout
9646 \begin_inset Flex CharStyle:Code
9649 \begin_layout Plain Layout
9656 \begin_inset Flex CharStyle:Code
9659 \begin_layout Plain Layout
9667 \begin_inset Flex CharStyle:Code
9670 \begin_layout Plain Layout
9677 \begin_inset Quotes eld
9681 \begin_inset Quotes erd
9685 \begin_inset Flex CharStyle:Code
9688 \begin_layout Plain Layout
9695 \begin_inset Flex CharStyle:Code
9698 \begin_layout Plain Layout
9699 \begin_inset space ~
9708 \begin_inset space ~
9711 black) square suitable for end of proof markers,
9712 \begin_inset Flex CharStyle:Code
9715 \begin_layout Plain Layout
9721 is an explicit text string.
9724 \begin_layout Description
9725 \begin_inset Flex CharStyle:Code
9728 \begin_layout Plain Layout
9735 \begin_inset Flex CharStyle:Code
9738 \begin_layout Plain Layout
9744 ] The string used for a label with a
9745 \begin_inset Flex CharStyle:Code
9748 \begin_layout Plain Layout
9755 \begin_inset Flex CharStyle:Code
9758 \begin_layout Plain Layout
9768 \begin_layout Description
9769 \begin_inset Flex CharStyle:Code
9772 \begin_layout Plain Layout
9779 \begin_inset Flex CharStyle:Code
9782 \begin_layout Plain Layout
9793 \begin_inset Flex CharStyle:Code
9796 \begin_layout Plain Layout
9805 \begin_layout Description
9806 \begin_inset Flex CharStyle:Code
9809 \begin_layout Plain Layout
9816 \begin_inset Flex CharStyle:Code
9819 \begin_layout Plain Layout
9829 ] With this parameter the
9830 \begin_inset Flex CharStyle:MenuItem
9833 \begin_layout Plain Layout
9840 \begin_inset Quotes eld
9843 Vertical space above
9844 \begin_inset Quotes erd
9848 \begin_inset Flex CharStyle:MenuItem
9851 \begin_layout Plain Layout
9852 Edit\SpecialChar \menuseparator
9854 \begin_inset space ~
9862 dialog can be set when initializing a paragraph with this style.
9866 \begin_layout Plain Layout
9869 Note from Jean-Marc:
9871 I'm not sure that this setting has much use, and it should probably be
9872 removed in later versions.
9880 \begin_layout Description
9881 \begin_inset Flex CharStyle:Code
9884 \begin_layout Plain Layout
9890 The font used for both the text body
9896 \begin_inset space ~
9900 \begin_inset CommandInset ref
9902 reference "sub:Font-description"
9907 Note that defining this font automatically defines the
9908 \begin_inset Flex CharStyle:Code
9911 \begin_layout Plain Layout
9918 So you should define this one first if you also want to define
9919 \begin_inset Flex CharStyle:Code
9922 \begin_layout Plain Layout
9931 \begin_layout Description
9932 \begin_inset Flex CharStyle:Code
9935 \begin_layout Plain Layout
9942 \begin_inset CommandInset label
9944 name "des:FreeSpacing"
9949 \begin_inset Flex CharStyle:Code
9952 \begin_layout Plain Layout
9961 \begin_inset Flex CharStyle:Code
9964 \begin_layout Plain Layout
9970 ] Usually LyX doesn't allow you to insert more than one space between words,
9971 since a space is considered as the separation between two words, not a
9972 character or symbol of its own.
9973 This is a very fine thing but sometimes annoying, for example, when typing
9974 program code or plain LaTeX code.
9976 \begin_inset Flex CharStyle:Code
9979 \begin_layout Plain Layout
9986 Note that LyX will create protected blanks for the additional blanks when
9987 in another mode than LaTeX-mode.
9990 \begin_layout Description
9991 \begin_inset Flex CharStyle:Code
9994 \begin_layout Plain Layout
10000 These tags are used with XHTML output.
10002 \begin_inset CommandInset ref
10004 reference "sub:Paragraph-Style-XHTML"
10011 \begin_layout Description
10012 \begin_inset Flex CharStyle:Code
10015 \begin_layout Plain Layout
10021 [[FIXME]] (Used only with XML-type formats.)
10024 \begin_layout Description
10025 \begin_inset Flex CharStyle:Code
10028 \begin_layout Plain Layout
10035 \begin_inset Flex CharStyle:Code
10038 \begin_layout Plain Layout
10044 If 1, marks the layout as to be included in the document preamble rather
10045 than in the document body.
10046 This is useful for document classes that want such information as the title
10047 and author to appear in the preamble.
10048 Note that this works only for layouts for which the
10049 \begin_inset Flex CharStyle:Code
10052 \begin_layout Plain Layout
10059 \begin_inset Flex CharStyle:Code
10062 \begin_layout Plain Layout
10071 \begin_layout Description
10072 \begin_inset Flex CharStyle:Code
10075 \begin_layout Plain Layout
10082 \begin_inset Flex CharStyle:Code
10085 \begin_layout Plain Layout
10091 If 1, marks the layout as being part of a title block (see also the
10092 \begin_inset Flex CharStyle:Code
10095 \begin_layout Plain Layout
10102 \begin_inset Flex CharStyle:Code
10105 \begin_layout Plain Layout
10114 \begin_layout Description
10115 \begin_inset Flex CharStyle:Code
10118 \begin_layout Plain Layout
10125 \begin_inset Flex CharStyle:Code
10128 \begin_layout Plain Layout
10134 ] This provides extra space between paragraphs that have the same layout.
10135 If you put other layouts into an environment, each is separated with the
10137 \begin_inset Flex CharStyle:Code
10140 \begin_layout Plain Layout
10147 But the whole items of the environment are additionally separated with
10149 \begin_inset Flex CharStyle:Code
10152 \begin_layout Plain Layout
10159 Note that this is a
10164 \begin_layout Description
10165 \begin_inset Flex CharStyle:Code
10168 \begin_layout Plain Layout
10174 [[FIXME]] (Used only with XML-type formats.)
10177 \begin_layout Description
10178 \begin_inset Flex CharStyle:Code
10181 \begin_layout Plain Layout
10188 \begin_inset CommandInset label
10190 name "des:KeepEmpty"
10195 \begin_inset Flex CharStyle:Code
10198 \begin_layout Plain Layout
10207 \begin_inset Flex CharStyle:Code
10210 \begin_layout Plain Layout
10216 ] Usually LyX does not allow you to leave a paragraph empty, since it would
10217 lead to empty LaTeX output.
10218 There are some cases where this could be desirable however: in a letter
10219 template, the required fields can be provided as empty fields, so that
10220 people do not forget them; in some special classes, a layout can be used
10221 as some kind of break, which does not contain actual text.
10224 \begin_layout Description
10225 \begin_inset Flex CharStyle:Code
10228 \begin_layout Plain Layout
10234 [float=0] The vertical space between the label and the text body.
10235 Only used for labels that are above the text body (
10236 \begin_inset Flex CharStyle:Code
10239 \begin_layout Plain Layout
10246 \begin_inset Flex CharStyle:Code
10249 \begin_layout Plain Layout
10250 Centered_Top_Environment
10258 \begin_layout Description
10259 \begin_inset Flex CharStyle:Code
10262 \begin_layout Plain Layout
10269 \begin_inset Flex CharStyle:Code
10272 \begin_layout Plain Layout
10279 \begin_inset Newline newline
10282 The name of the counter for automatic numbering.
10284 \begin_inset Newline newline
10292 \begin_inset Flex CharStyle:Code
10295 \begin_layout Plain Layout
10302 \begin_inset Flex CharStyle:Code
10305 \begin_layout Plain Layout
10312 In that case, the counter will be stepped each time the layout appears.
10314 \begin_inset Newline newline
10322 \begin_inset Flex CharStyle:Code
10325 \begin_layout Plain Layout
10332 \begin_inset Flex CharStyle:Code
10335 \begin_layout Plain Layout
10341 , though this case is a bit complicated.
10342 Suppose you declare
10343 \begin_inset Quotes eld
10347 \begin_inset Flex CharStyle:Code
10350 \begin_layout Plain Layout
10351 LabelCounter myenum
10357 \begin_inset Quotes erd
10361 Then the actual counters used are
10362 \begin_inset Flex CharStyle:Code
10365 \begin_layout Plain Layout
10372 \begin_inset Flex CharStyle:Code
10375 \begin_layout Plain Layout
10382 \begin_inset Flex CharStyle:Code
10385 \begin_layout Plain Layout
10392 \begin_inset Flex CharStyle:Code
10395 \begin_layout Plain Layout
10401 , much as in LaTeX.
10402 These counters must all be declared separately.
10403 \begin_inset Newline newline
10407 \begin_inset CommandInset ref
10409 reference "sub:Counters"
10413 for details on counters.
10416 \begin_layout Description
10417 \begin_inset Flex CharStyle:Code
10420 \begin_layout Plain Layout
10426 The font used for the label.
10428 \begin_inset space ~
10432 \begin_inset CommandInset ref
10434 reference "sub:Font-description"
10441 \begin_layout Description
10442 \begin_inset Flex CharStyle:Code
10445 \begin_layout Plain Layout
10451 Text that indicates how far a label should be indented.
10454 \begin_layout Description
10455 \begin_inset Flex CharStyle:Code
10458 \begin_layout Plain Layout
10465 \begin_inset Flex CharStyle:Code
10468 \begin_layout Plain Layout
10474 ] The horizontal space between the label and the text body.
10475 Only used for labels that are not above the text body.
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 string used for a label with a
10499 \begin_inset Flex CharStyle:Code
10502 \begin_layout Plain Layout
10510 \begin_inset Flex CharStyle:Code
10513 \begin_layout Plain Layout
10519 is set, this string can be contain the special formatting commands described
10521 \begin_inset CommandInset ref
10523 reference "sub:Counters"
10531 \begin_layout Plain Layout
10532 For the sake of backwards compatibility, the string
10533 \begin_inset Flex CharStyle:Code
10536 \begin_layout Plain Layout
10546 will be replaced by the expanded
10547 \begin_inset Flex CharStyle:Code
10550 \begin_layout Plain Layout
10557 \begin_inset Flex CharStyle:Code
10560 \begin_layout Plain Layout
10569 This feature is now obsolete and should be replaced by the mechanisms of
10571 \begin_inset CommandInset ref
10573 reference "sub:Counters"
10585 \begin_layout Description
10586 \begin_inset Flex CharStyle:Code
10589 \begin_layout Plain Layout
10590 LabelStringAppendix
10596 \begin_inset Flex CharStyle:Code
10599 \begin_layout Plain Layout
10605 ] This is used inside the appendix instead of
10606 \begin_inset Flex CharStyle:Code
10609 \begin_layout Plain Layout
10617 \begin_inset Flex CharStyle:Code
10620 \begin_layout Plain Layout
10627 \begin_inset Flex CharStyle:Code
10630 \begin_layout Plain Layout
10631 LabelStringAppendix
10639 \begin_layout Description
10640 \begin_inset Flex CharStyle:Code
10643 \begin_layout Plain Layout
10649 [FIXME] (Used only with XML-type formats.)
10652 \begin_layout Description
10653 \begin_inset Flex CharStyle:Code
10656 \begin_layout Plain Layout
10663 \begin_inset Flex CharStyle:Code
10666 \begin_layout Plain Layout
10671 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
10672 Enumerate, Itemize, Bibliography
10681 \begin_layout Itemize
10682 \begin_inset Flex CharStyle:Code
10685 \begin_layout Plain Layout
10691 means the label is the very first word (up to the first real blank).
10692 Use protected spaces (like
10693 \begin_inset space ~
10696 that one) if you want more than one word as the label.
10700 \begin_layout Itemize
10701 \begin_inset Flex CharStyle:Code
10704 \begin_layout Plain Layout
10710 means the label is simply whatever
10711 \begin_inset Flex CharStyle:Code
10714 \begin_layout Plain Layout
10721 Note that this really is `static'.
10724 \begin_layout Itemize
10725 \begin_inset Flex CharStyle:Code
10728 \begin_layout Plain Layout
10735 \begin_inset Flex CharStyle:Code
10738 \begin_layout Plain Layout
10739 Centered_Top_Environment
10744 are special cases of
10745 \begin_inset Flex CharStyle:Code
10748 \begin_layout Plain Layout
10755 The label will be printed above the paragraph, but only at the top of an
10756 environment or the top of a chain of paragraphs with this layout.
10757 This might be used with the
10758 \begin_inset Flex CharStyle:MenuItem
10761 \begin_layout Plain Layout
10767 layout, for example.
10770 \begin_layout Itemize
10771 \begin_inset Flex CharStyle:Code
10774 \begin_layout Plain Layout
10780 is a special case for the caption-labels
10781 \begin_inset Quotes eld
10785 \begin_inset Quotes erd
10789 \begin_inset Quotes eld
10793 \begin_inset Quotes erd
10798 \begin_inset Flex CharStyle:Code
10801 \begin_layout Plain Layout
10807 means the (hardcoded) label string depends on the kind of float: It is
10808 hardcoded to be `FloatType N', where N is the value of the counter associated
10812 \begin_layout Itemize
10814 \begin_inset Flex CharStyle:Code
10817 \begin_layout Plain Layout
10823 label type defines automatically numbered labels.
10825 \begin_inset Flex CharStyle:Code
10828 \begin_layout Plain Layout
10834 will be expanded to resolve any counter references it contains: For example,
10836 \begin_inset Quotes eld
10840 \begin_inset Flex CharStyle:Code
10843 \begin_layout Plain Layout
10854 \begin_inset Quotes erd
10859 \begin_inset CommandInset ref
10861 reference "sub:Counters"
10865 for more information on counters.
10868 \begin_layout Itemize
10869 \begin_inset Flex CharStyle:Code
10872 \begin_layout Plain Layout
10878 produces the usual sort of enumeration labels.
10879 At present, it is hardcoded to use Arabic numerals, lowercase letters,
10880 small Roman numerals, and uppercase letters for the four possible depths.
10883 \begin_layout Itemize
10884 \begin_inset Flex CharStyle:Code
10887 \begin_layout Plain Layout
10893 produces various bullets at the different levels.
10894 It is also hardcoded.
10897 \begin_layout Itemize
10898 \begin_inset Flex CharStyle:Code
10901 \begin_layout Plain Layout
10907 is used internally by LyX and should be used only with
10908 \begin_inset Flex CharStyle:Code
10911 \begin_layout Plain Layout
10912 LatexType BibEnvironment
10921 \begin_layout Description
10922 \begin_inset Flex CharStyle:Code
10925 \begin_layout Plain Layout
10931 Note that this will completely override any prior
10932 \begin_inset Flex CharStyle:Code
10935 \begin_layout Plain Layout
10941 declaration for this style.
10943 \begin_inset Quotes eld
10947 \begin_inset Flex CharStyle:Code
10950 \begin_layout Plain Layout
10957 \begin_inset Quotes erd
10962 \begin_inset CommandInset ref
10964 reference "sub:I18n"
10968 for details on its use.
10971 \begin_layout Description
10972 \begin_inset Flex CharStyle:Code
10975 \begin_layout Plain Layout
10981 The name of the corresponding LaTeX stuff.
10982 Either the environment or command name.
10985 \begin_layout Description
10986 \begin_inset Flex CharStyle:Code
10989 \begin_layout Plain Layout
10995 An optional parameter for the corresponding
10996 \begin_inset Flex CharStyle:Code
10999 \begin_layout Plain Layout
11006 This parameter cannot be changed from within LyX.
11009 \begin_layout Description
11010 \begin_inset Flex CharStyle:Code
11013 \begin_layout Plain Layout
11020 \begin_inset CommandInset label
11022 name "des:LatexType"
11027 \begin_inset Flex CharStyle:Code
11030 \begin_layout Plain Layout
11035 , Command, Environment, Item_Environment,
11041 \begin_inset Flex CharStyle:Code
11044 \begin_layout Plain Layout
11045 List_Environment, Bib_Environment
11050 ] How the layout should be translated into LaTeX.
11054 \begin_layout Plain Layout
11055 \begin_inset Flex CharStyle:Code
11058 \begin_layout Plain Layout
11064 is perhaps a bit misleading, since these rules apply to SGML classes, too.
11065 Visit the SGML class files for specific examples.
11074 \begin_layout Itemize
11075 \begin_inset Flex CharStyle:Code
11078 \begin_layout Plain Layout
11084 means nothing special.
11088 \begin_layout Itemize
11089 \begin_inset Flex CharStyle:Code
11092 \begin_layout Plain Layout
11099 \begin_inset Flex CharStyle:Code
11102 \begin_layout Plain Layout
11109 {\SpecialChar \ldots{}
11118 \begin_layout Itemize
11119 \begin_inset Flex CharStyle:Code
11122 \begin_layout Plain Layout
11129 \begin_inset Flex CharStyle:Code
11132 \begin_layout Plain Layout
11139 }\SpecialChar \ldots{}
11155 \begin_layout Itemize
11156 \begin_inset Flex CharStyle:Code
11159 \begin_layout Plain Layout
11166 \begin_inset Flex CharStyle:Code
11169 \begin_layout Plain Layout
11176 \begin_inset Flex CharStyle:Code
11179 \begin_layout Plain Layout
11187 is generated for each paragraph of this environment.
11191 \begin_layout Itemize
11192 \begin_inset Flex CharStyle:Code
11195 \begin_layout Plain Layout
11202 \begin_inset Flex CharStyle:Code
11205 \begin_layout Plain Layout
11212 \begin_inset Flex CharStyle:Code
11215 \begin_layout Plain Layout
11221 is passed as an argument to the environment.
11223 \begin_inset Flex CharStyle:Code
11226 \begin_layout Plain Layout
11232 can be defined in the
11233 \begin_inset Flex CharStyle:MenuItem
11236 \begin_layout Plain Layout
11241 ayout\SpecialChar \menuseparator
11255 \begin_layout Standard
11256 Putting the last few things together, the LaTeX output will be either:
11259 \begin_layout LyX-Code
11262 latexname[latexparam]{\SpecialChar \ldots{}
11266 \begin_layout Standard
11270 \begin_layout LyX-Code
11273 begin{latexname}[latexparam] \SpecialChar \ldots{}
11279 \begin_layout Standard
11280 depending upon the LaTeX type.
11284 \begin_layout Description
11285 \begin_inset Flex CharStyle:Code
11288 \begin_layout Plain Layout
11295 \begin_inset Flex CharStyle:Code
11298 \begin_layout Plain Layout
11304 ] If you put layouts into environments, the leftmargins are not simply added,
11305 but added with a factor
11306 \begin_inset Formula $\frac{4}{depth+4}$
11310 Note that this parameter is also used when the margin is defined as
11311 \begin_inset Flex CharStyle:Code
11314 \begin_layout Plain Layout
11321 \begin_inset Flex CharStyle:Code
11324 \begin_layout Plain Layout
11331 Then it is added to the manual or dynamic margin.
11333 \begin_inset Newline newline
11336 The argument is passed as a string.
11338 \begin_inset Quotes eld
11342 \begin_inset Flex CharStyle:Code
11345 \begin_layout Plain Layout
11352 \begin_inset Quotes erd
11355 means that the paragraph is indented with the width of
11356 \begin_inset Quotes eld
11360 \begin_inset Flex CharStyle:Code
11363 \begin_layout Plain Layout
11370 \begin_inset Quotes erd
11373 in the normal font.
11374 You can get a negative width by prefixing the string with
11375 \begin_inset Quotes eld
11379 \begin_inset Flex CharStyle:Code
11382 \begin_layout Plain Layout
11389 \begin_inset Quotes erd
11393 This way was chosen so that the look is the same with each used screen
11398 \begin_layout Description
11399 \begin_inset Flex CharStyle:Code
11402 \begin_layout Plain Layout
11409 \begin_inset Flex CharStyle:Code
11412 \begin_layout Plain Layout
11417 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11423 \begin_inset Newline newline
11426 The kind of margin that the layout has on the left side.
11428 \begin_inset Flex CharStyle:Code
11431 \begin_layout Plain Layout
11437 just means a fixed margin.
11439 \begin_inset Flex CharStyle:Code
11442 \begin_layout Plain Layout
11448 means that the left margin depends on the string entered in the
11449 \begin_inset Flex CharStyle:MenuItem
11452 \begin_layout Plain Layout
11453 Edit\SpecialChar \menuseparator
11455 \begin_inset space ~
11464 This is used to typeset nice lists without tabulators.
11466 \begin_inset Flex CharStyle:Code
11469 \begin_layout Plain Layout
11475 means that the margin depends on the size of the label.
11476 This is used for automatic enumerated headlines.
11477 It is obvious that the headline
11478 \begin_inset Quotes eld
11481 5.4.3.2.1 Very long headline
11482 \begin_inset Quotes erd
11485 must have a wider left margin (as wide as
11486 \begin_inset Quotes eld
11490 \begin_inset Quotes erd
11493 plus the space) than
11494 \begin_inset Quotes eld
11497 3.2 Very long headline
11498 \begin_inset Quotes erd
11502 \begin_inset Quotes eld
11506 \begin_inset Quotes erd
11509 are not able to do this.
11511 \begin_inset Flex CharStyle:Code
11514 \begin_layout Plain Layout
11520 is similar, but only the very first row of the paragraph is dynamic, while
11521 the others are static; this is used, for example, for descriptions.
11523 \begin_inset Flex CharStyle:Code
11526 \begin_layout Plain Layout
11532 means the margin is chosen in a way that the longest row of this paragraph
11533 fits to the right margin.
11534 This is used to typeset an address on the right edge of the page.
11537 \begin_layout Description
11538 \begin_inset Flex CharStyle:Code
11541 \begin_layout Plain Layout
11548 \begin_inset Flex CharStyle:Code
11551 \begin_layout Plain Layout
11560 \begin_inset Flex CharStyle:Code
11563 \begin_layout Plain Layout
11569 ] Whether fragile commands in this layout should be
11570 \begin_inset Flex CharStyle:Code
11573 \begin_layout Plain Layout
11586 whether this command should itself be protected.)
11589 \begin_layout Description
11590 \begin_inset Flex CharStyle:Code
11593 \begin_layout Plain Layout
11600 \begin_inset Flex CharStyle:Code
11603 \begin_layout Plain Layout
11610 \begin_inset Flex CharStyle:Code
11613 \begin_layout Plain Layout
11621 ] Whether newlines are translated into LaTeX newlines (
11622 \begin_inset Flex CharStyle:Code
11625 \begin_layout Plain Layout
11636 The translation can be switched off to allow more comfortable LaTeX editing
11640 \begin_layout Description
11641 \begin_inset Flex CharStyle:Code
11644 \begin_layout Plain Layout
11651 \begin_inset Flex CharStyle:Code
11654 \begin_layout Plain Layout
11661 \begin_inset Flex CharStyle:Code
11664 \begin_layout Plain Layout
11672 ] Whether the following Paragraph is allowed to indent its very first row.
11674 \begin_inset Flex CharStyle:Code
11677 \begin_layout Plain Layout
11683 means that it is not allowed to do so;
11684 \begin_inset Flex CharStyle:Code
11687 \begin_layout Plain Layout
11693 means it could do so if it wants to.
11696 \begin_layout Description
11697 \begin_inset Flex CharStyle:Code
11700 \begin_layout Plain Layout
11706 Name of a layout that has replaced this layout.
11707 This is used to rename a layout, while keeping backward compatibility.
11710 \begin_layout Description
11711 \begin_inset Flex CharStyle:Code
11714 \begin_layout Plain Layout
11721 \begin_inset Flex CharStyle:Code
11724 \begin_layout Plain Layout
11730 ] The number of optional arguments that can be used with this layout.
11731 This is useful for things like section headings, and only makes sense with
11733 Note that, on output, the optional arguments will all precede any required
11734 arguments (see below).
11735 So one can have constructs like:
11739 \begin_layout LyX-Code
11742 mycmd[opt1]{req1}{contents of paragraph}
11745 \begin_layout Standard
11746 but one cannot have things like:
11749 \begin_layout LyX-Code
11752 mycmd[opt1]{req1}[opt2]{contents of paragraph}
11755 \begin_layout Standard
11756 at least, not without ERT (with which you can have anything).
11761 \begin_layout Description
11762 \begin_inset Flex CharStyle:Code
11765 \begin_layout Plain Layout
11772 \begin_inset CommandInset label
11774 name "des:ParbreakIsNewline"
11779 \begin_inset Flex CharStyle:Code
11782 \begin_layout Plain Layout
11791 \begin_inset Flex CharStyle:Code
11794 \begin_layout Plain Layout
11800 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
11801 output, but only by a line break; together with
11802 \begin_inset Flex CharStyle:Code
11805 \begin_layout Plain Layout
11811 , this allows to emulate a plain text editor (like the ERT inset).
11814 \begin_layout Description
11815 \begin_inset Flex CharStyle:Code
11818 \begin_layout Plain Layout
11825 \begin_inset Flex CharStyle:Code
11828 \begin_layout Plain Layout
11834 ] The indent of the very first line of a paragraph.
11836 \begin_inset Flex CharStyle:Code
11839 \begin_layout Plain Layout
11845 will be fixed for a certain layout.
11846 The exception is Standard layout, since the indentation of a Standard layout
11847 paragraph can be prohibited with
11848 \begin_inset Flex CharStyle:Code
11851 \begin_layout Plain Layout
11858 Also, Standard layout paragraphs inside environments use the
11859 \begin_inset Flex CharStyle:Code
11862 \begin_layout Plain Layout
11868 of the environment, not their native one.
11869 For example, Standard paragraphs inside an enumeration are not indented.
11872 \begin_layout Description
11873 \begin_inset Flex CharStyle:Code
11876 \begin_layout Plain Layout
11883 \begin_inset Flex CharStyle:Code
11886 \begin_layout Plain Layout
11892 ] The vertical space between two paragraphs of this layout.
11895 \begin_layout Description
11896 \begin_inset Flex CharStyle:Code
11899 \begin_layout Plain Layout
11906 \begin_inset Flex CharStyle:Code
11909 \begin_layout Plain Layout
11915 ] LyX allows the user to choose either
11916 \begin_inset Quotes eld
11920 \begin_inset Quotes erd
11924 \begin_inset Quotes eld
11928 \begin_inset Quotes erd
11931 to typeset a document.
11933 \begin_inset Quotes eld
11937 \begin_inset Quotes erd
11940 is chosen, this value is completely ignored.
11942 \begin_inset Quotes eld
11946 \begin_inset Quotes erd
11949 is chosen, the parindent of a LaTeXtype
11950 \begin_inset Quotes eld
11954 \begin_inset Quotes erd
11957 layout is ignored and all paragraphs are separated by this parskip argument.
11958 The vertical space is calculated with
11959 \begin_inset Flex CharStyle:Code
11962 \begin_layout Plain Layout
11964 \begin_inset space ~
11973 \begin_inset Flex CharStyle:Code
11976 \begin_layout Plain Layout
11982 is the height of a row with the normal font.
11983 This way, the look stays the same with different screen fonts.
11986 \begin_layout Description
11987 \begin_inset Flex CharStyle:Code
11990 \begin_layout Plain Layout
11997 \begin_inset CommandInset label
11999 name "des:PassThru"
12004 \begin_inset Flex CharStyle:Code
12007 \begin_layout Plain Layout
12016 \begin_inset Flex CharStyle:Code
12019 \begin_layout Plain Layout
12025 ] Whether the contents of this paragraph should be output in raw form, meaning
12026 without special translations that LaTeX would require.
12029 \begin_layout Description
12030 \begin_inset Flex CharStyle:Code
12033 \begin_layout Plain Layout
12040 \begin_inset CommandInset label
12042 name "des:Preamble"
12046 Information to be included in the LaTeX preamble when this style is used.
12047 Used to define macros, load packages, etc., required by this particular
12050 \begin_inset Quotes eld
12054 \begin_inset Flex CharStyle:Code
12057 \begin_layout Plain Layout
12064 \begin_inset Quotes erd
12070 \begin_layout Description
12071 \begin_inset Flex CharStyle:Code
12074 \begin_layout Plain Layout
12081 \begin_inset Flex CharStyle:Code
12084 \begin_layout Plain Layout
12090 ] The prefix to use when creating labels referring to paragraphs of this
12092 This allows the use of formatted references.
12095 \begin_layout Description
12096 \begin_inset Flex CharStyle:Code
12099 \begin_layout Plain Layout
12106 \begin_inset Flex CharStyle:Code
12109 \begin_layout Plain Layout
12115 ] The number of required arguments that the LaTeX command or environment
12116 corresponding to this layout expects.
12117 In the case of a command, these are required arguments
12121 that associated with the content of the paragraph itself.
12122 These do not actually have to be provided: LyX will output empty arguments
12124 Note that optional arguments will be output before required arguments.
12125 See the discussion of the
12126 \begin_inset Flex CharStyle:Code
12129 \begin_layout Plain Layout
12135 tag above for more information.
12138 \begin_layout Description
12139 \begin_inset Flex CharStyle:Code
12142 \begin_layout Plain Layout
12149 \begin_inset Flex CharStyle:Code
12152 \begin_layout Plain Layout
12159 \begin_inset CommandInset label
12161 name "des:Requires"
12165 Whether the layout requires the feature
12166 \begin_inset Flex CharStyle:Code
12169 \begin_layout Plain Layout
12176 See the description of
12177 \begin_inset Flex CharStyle:Code
12180 \begin_layout Plain Layout
12187 \begin_inset CommandInset ref
12188 LatexCommand pageref
12189 reference "des:FreeSpacing"
12193 ) for information on `features'.
12197 \begin_layout Description
12198 \begin_inset Flex CharStyle:Code
12201 \begin_layout Plain Layout
12208 \begin_inset Flex CharStyle:Code
12211 \begin_layout Plain Layout
12218 \begin_inset Flex CharStyle:Code
12221 \begin_layout Plain Layout
12230 \begin_layout Description
12231 \begin_inset Flex CharStyle:Code
12234 \begin_layout Plain Layout
12241 \begin_inset Flex CharStyle:Code
12244 \begin_layout Plain Layout
12249 , onehalf, double, other
12258 ] This defines what the default spacing should be in the layout.
12260 \begin_inset Flex CharStyle:Code
12263 \begin_layout Plain Layout
12270 \begin_inset Flex CharStyle:Code
12273 \begin_layout Plain Layout
12280 \begin_inset Flex CharStyle:Code
12283 \begin_layout Plain Layout
12289 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
12290 If you specify the argument
12291 \begin_inset Flex CharStyle:Code
12294 \begin_layout Plain Layout
12300 , then you should also provide a numerical argument which will be the actual
12302 Note that, contrary to other parameters,
12303 \begin_inset Flex CharStyle:Code
12306 \begin_layout Plain Layout
12312 implies the generation of specific LaTeX code, using the package
12315 \begin_inset Flex CharStyle:Code
12318 \begin_layout Plain Layout
12327 \begin_layout Description
12328 \begin_inset Flex CharStyle:Code
12331 \begin_layout Plain Layout
12338 \begin_inset Flex CharStyle:Code
12341 \begin_layout Plain Layout
12348 \begin_inset Flex CharStyle:Code
12351 \begin_layout Plain Layout
12359 ] Spellcheck paragraphs of this style.
12363 \begin_layout Description
12364 \begin_inset Flex CharStyle:Code
12367 \begin_layout Plain Layout
12373 The font used for the text body .
12375 \begin_inset CommandInset ref
12377 reference "sub:Font-description"
12384 \begin_layout Description
12385 \begin_inset Flex CharStyle:Code
12388 \begin_layout Plain Layout
12397 \begin_inset Flex CharStyle:Code
12400 \begin_layout Plain Layout
12410 The level of the style in the table of contents.
12411 This is used for automatic numbering of section headings.
12414 \begin_layout Description
12415 \begin_inset Flex CharStyle:Code
12418 \begin_layout Plain Layout
12425 \begin_inset Flex CharStyle:Code
12428 \begin_layout Plain Layout
12434 ] The vertical space with which the very first of a chain of paragraphs
12435 with this layout is separated from the previous paragraph.
12436 If the previous paragraph has another layout, the separations are not simply
12437 added, but the maximum is taken.
12440 \begin_layout Subsection
12441 \begin_inset CommandInset label
12447 Internationalization of Paragraph Styles
12450 \begin_layout Standard
12451 LyX has long supported internationalization of layout information, but,
12452 until version 2.0, this applied only to the user interface and not to, say,
12454 Thus, French authors were forced to resort to ugly hacks if they wanted
12459 1' instead of `Theorem 1'.
12460 Thanks to Georg Baum, that is no longer the case.
12463 \begin_layout Standard
12465 \begin_inset Flex CharStyle:Code
12468 \begin_layout Plain Layout
12474 defines text that is to appear in the typeset document, it may use
12475 \begin_inset Flex CharStyle:Code
12478 \begin_layout Plain Layout
12485 \begin_inset Flex CharStyle:Code
12488 \begin_layout Plain Layout
12494 to support non-English and even multi-language documents correctly.
12495 The following excerpt (from the
12496 \begin_inset Flex CharStyle:Code
12499 \begin_layout Plain Layout
12505 file) shows how this works:
12508 \begin_layout LyX-Code
12513 \begin_layout LyX-Code
12516 theoremstyle{remark}
12519 \begin_layout LyX-Code
12522 newtheorem{claim}[thm]{
12529 \begin_layout LyX-Code
12533 \begin_layout LyX-Code
12537 \begin_layout LyX-Code
12542 claimname}{_(Claim)}
12545 \begin_layout LyX-Code
12549 \begin_layout LyX-Code
12553 \begin_layout LyX-Code
12562 claimname}{_(Claim)}}
12565 \begin_layout LyX-Code
12570 \begin_layout Standard
12571 In principle, any legal LaTeX may appear in the
12572 \begin_inset Flex CharStyle:Code
12575 \begin_layout Plain Layout
12582 \begin_inset Flex CharStyle:Code
12585 \begin_layout Plain Layout
12591 tags, but in practice they will typically look as they do here.
12592 The key to correct translation of the typeset text is the definition of
12594 \begin_inset Flex CharStyle:Code
12597 \begin_layout Plain Layout
12606 \begin_inset Flex CharStyle:Code
12609 \begin_layout Plain Layout
12621 \begin_layout Standard
12623 \begin_inset Flex CharStyle:Code
12626 \begin_layout Plain Layout
12632 tag provides for internationalization based upon the overall language of
12634 The contents of the tag will be included in the preamble, just as with
12636 \begin_inset Flex CharStyle:Code
12639 \begin_layout Plain Layout
12646 What makes it special is the use of the
12647 \begin_inset Quotes eld
12651 \begin_inset Quotes erd
12655 \begin_inset Flex CharStyle:Code
12658 \begin_layout Plain Layout
12664 , which will be replaced, when LyX produces LaTeX output, with the translation
12665 of its argument into the document language.
12668 \begin_layout Standard
12670 \begin_inset Flex CharStyle:Code
12673 \begin_layout Plain Layout
12679 tag is more complex, since it is meant to provide support for multi-language
12680 documents and so offers an interface to the
12681 \begin_inset Flex CharStyle:Code
12684 \begin_layout Plain Layout
12691 Its contents will be added to the preamble once for each language that
12692 appears in the document.
12693 In this case, the argument to
12694 \begin_inset Flex CharStyle:Code
12697 \begin_layout Plain Layout
12703 will be replaced with its translation into the language in question; the
12705 \begin_inset Flex CharStyle:Code
12708 \begin_layout Plain Layout
12714 is replaced by the language name (as used by the babel package).
12717 \begin_layout Standard
12718 A German document that also included a French section would thus have the
12719 following in the preamble:
12722 \begin_layout LyX-Code
12731 claimname}{Affirmation}}
12739 claimname}{Behauptung}}
12743 claimname}{Behauptung}
12746 \begin_layout Standard
12748 \begin_inset Flex CharStyle:Code
12751 \begin_layout Plain Layout
12757 will then conspire to produce the correct text in the output.
12760 \begin_layout Standard
12761 One important point to note here is that the translations are provided by
12762 LyX itself, through the same mechanism it uses for internationalization
12763 of the user interface.
12764 This means, in effect, that
12765 \begin_inset Flex CharStyle:Code
12768 \begin_layout Plain Layout
12775 \begin_inset Flex CharStyle:Code
12778 \begin_layout Plain Layout
12784 are really only of use in layout files that are provided with LyX, since
12785 text entered in user-created layout files will not be seen by LyX's internation
12786 alization routines.
12787 That said, however, any layout created with the intention that it will
12788 be included with LyX should use these tags where appropriate.
12791 \begin_layout Subsection
12793 \begin_inset CommandInset label
12802 \begin_layout Standard
12803 Since version 1.3.0 of LyX, it is has been both possible and necessary to
12804 define the floats (
12805 \begin_inset Flex CharStyle:MenuItem
12808 \begin_layout Plain Layout
12815 \begin_inset Flex CharStyle:MenuItem
12818 \begin_layout Plain Layout
12824 , \SpecialChar \ldots{}
12825 ) in the text class itself.
12826 Standard floats are included in the file
12827 \begin_inset Flex CharStyle:Code
12830 \begin_layout Plain Layout
12836 , so you may have to do no more than add
12839 \begin_layout LyX-Code
12840 Input stdfloats.inc
12843 \begin_layout Standard
12844 to your layout file.
12845 If you want to implement a text class that proposes some other float types
12846 (like the AGU class bundled with LyX), the information below will hopefully
12850 \begin_layout Description
12851 \begin_inset Flex CharStyle:Code
12854 \begin_layout Plain Layout
12861 \begin_inset Flex CharStyle:Code
12864 \begin_layout Plain Layout
12871 \begin_inset Quotes erd
12875 \begin_inset Quotes erd
12878 ] The file name extension of an auxiliary file for the list of figures (or
12880 LaTeX writes the captions to this file.
12883 \begin_layout Description
12884 \begin_inset Flex CharStyle:Code
12887 \begin_layout Plain Layout
12894 \begin_inset Flex CharStyle:Code
12897 \begin_layout Plain Layout
12904 \begin_inset Quotes erd
12908 \begin_inset Quotes erd
12911 ] The string that will be used in the menus and also for the caption.
12912 This is translated to the current language if babel is used.
12915 \begin_layout Description
12916 \begin_inset Flex CharStyle:Code
12919 \begin_layout Plain Layout
12925 These are used for XHTML output.
12927 \begin_inset CommandInset ref
12929 reference "sec:Tags-for-XHTML"
12936 \begin_layout Description
12937 \begin_inset Flex CharStyle:Code
12940 \begin_layout Plain Layout
12947 \begin_inset Flex CharStyle:Code
12950 \begin_layout Plain Layout
12957 \begin_inset Quotes erd
12961 \begin_inset Quotes erd
12964 ] The command used to generate a list of floats of this type; the leading
12967 ' should be omitted.
12973 \begin_inset Flex CharStyle:Code
12976 \begin_layout Plain Layout
12982 is false, since there is no standard way to generate this command.
12984 \begin_inset Flex CharStyle:Code
12987 \begin_layout Plain Layout
12993 is true, since in that case there is a standard way.
12996 \begin_layout Description
12997 \begin_inset Flex CharStyle:Code
13000 \begin_layout Plain Layout
13007 \begin_inset Flex CharStyle:Code
13010 \begin_layout Plain Layout
13017 \begin_inset Quotes erd
13021 \begin_inset Quotes erd
13024 ] A title for a list of floats of this kind (list of figures, tables, or
13026 It is used for the screen label within LyX; it is passed to LaTeX for use
13027 as the title there; and it is used as the title in XHTML output.
13028 It will be translated to the document language.
13031 \begin_layout Description
13032 \begin_inset Flex CharStyle:Code
13035 \begin_layout Plain Layout
13042 \begin_inset Flex CharStyle:Code
13045 \begin_layout Plain Layout
13052 \begin_inset Flex CharStyle:Code
13055 \begin_layout Plain Layout
13063 ] Indicates whether the float is already defined in the document class or
13064 if we instead need to load
13065 \begin_inset Flex CharStyle:Code
13068 \begin_layout Plain Layout
13074 and use what it provides.
13076 \begin_inset Flex CharStyle:Code
13079 \begin_layout Plain Layout
13086 \begin_inset Flex CharStyle:Code
13089 \begin_layout Plain Layout
13096 It should be set to
13097 \begin_inset Flex CharStyle:Code
13100 \begin_layout Plain Layout
13106 if the float is already defined by the LaTeX document class.
13109 \begin_layout Description
13110 \begin_inset Flex CharStyle:Code
13113 \begin_layout Plain Layout
13120 \begin_inset Flex CharStyle:Code
13123 \begin_layout Plain Layout
13130 \begin_inset Quotes erd
13134 \begin_inset Quotes erd
13137 ] This (optional) argument determines whether floats of this class will
13138 be numbered within some sectional unit of the document.
13139 For example, if within is equal to
13140 \begin_inset Flex CharStyle:Code
13143 \begin_layout Plain Layout
13149 , the floats will be numbered within chapters.
13153 \begin_layout Description
13154 \begin_inset Flex CharStyle:Code
13157 \begin_layout Plain Layout
13164 \begin_inset Flex CharStyle:Code
13167 \begin_layout Plain Layout
13174 \begin_inset Quotes erd
13178 \begin_inset Quotes erd
13181 ] The default placement for the given class of floats.
13182 The string should be as in standard LaTeX:
13183 \begin_inset Flex CharStyle:Code
13186 \begin_layout Plain Layout
13193 \begin_inset Flex CharStyle:Code
13196 \begin_layout Plain Layout
13203 \begin_inset Flex CharStyle:Code
13206 \begin_layout Plain Layout
13213 \begin_inset Flex CharStyle:Code
13216 \begin_layout Plain Layout
13222 for top, bottom, page, and here, respectively.
13226 \begin_layout Plain Layout
13227 Note that the order of these letters in the string is irrelevant, like in
13233 On top of that there is a new type,
13234 \begin_inset Flex CharStyle:Code
13237 \begin_layout Plain Layout
13243 , which does not really correspond to a float, since it means: put it
13244 \begin_inset Quotes eld
13248 \begin_inset Quotes erd
13252 Note however that the
13253 \begin_inset Flex CharStyle:Code
13256 \begin_layout Plain Layout
13262 specifier is special and, because of implementation details, cannot be
13263 used in non-built in float types.
13264 If you do not understand what this means, just use
13265 \begin_inset Quotes eld
13269 \begin_inset Flex CharStyle:Code
13272 \begin_layout Plain Layout
13279 \begin_inset Quotes erd
13285 \begin_layout Description
13286 \begin_inset Flex CharStyle:Code
13289 \begin_layout Plain Layout
13296 \begin_inset Flex CharStyle:Code
13299 \begin_layout Plain Layout
13305 ] The prefix to use when creating labels referring to floats of this type.
13306 This allows the use of formatted references.
13307 Note that you can remove any
13308 \begin_inset Flex CharStyle:Code
13311 \begin_layout Plain Layout
13317 set by a copied style by using the special value
13318 \begin_inset Quotes eld
13322 \begin_inset Quotes erd
13325 , which must be all caps.
13328 \begin_layout Description
13329 \begin_inset Flex CharStyle:Code
13332 \begin_layout Plain Layout
13339 \begin_inset Flex CharStyle:Code
13342 \begin_layout Plain Layout
13349 \begin_inset Quotes erd
13353 \begin_inset Quotes erd
13356 ] The style used when defining the float using
13357 \begin_inset Flex CharStyle:Code
13360 \begin_layout Plain Layout
13371 \begin_layout Description
13372 \begin_inset Flex CharStyle:Code
13375 \begin_layout Plain Layout
13382 \begin_inset Flex CharStyle:Code
13385 \begin_layout Plain Layout
13392 \begin_inset Quotes erd
13396 \begin_inset Quotes erd
13400 \begin_inset Quotes eld
13404 \begin_inset Quotes erd
13407 of the new class of floats, like program or algorithm.
13408 After the appropriate
13409 \begin_inset Flex CharStyle:Code
13412 \begin_layout Plain Layout
13421 \begin_inset Flex CharStyle:Code
13424 \begin_layout Plain Layout
13433 \begin_inset Flex CharStyle:Code
13436 \begin_layout Plain Layout
13447 \begin_layout Standard
13448 Note that defining a float with type
13449 \begin_inset Flex CharStyle:Code
13452 \begin_layout Plain Layout
13460 automatically defines the corresponding counter with name
13461 \begin_inset Flex CharStyle:Code
13464 \begin_layout Plain Layout
13475 \begin_layout Subsection
13476 Flex insets and InsetLayout
13477 \begin_inset CommandInset label
13479 name "sub:Flex-insets-and"
13486 \begin_layout Standard
13487 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
13488 these are called Flex insets.
13492 \begin_layout Standard
13493 Flex insets come in three different kinds:
13496 \begin_layout Itemize
13498 \begin_inset Flex CharStyle:Code
13501 \begin_layout Plain Layout
13507 ): These define semantic markup corresponding to such LaTeX commands as
13509 \begin_inset Flex CharStyle:Code
13512 \begin_layout Plain Layout
13521 \begin_inset Flex CharStyle:Code
13524 \begin_layout Plain Layout
13535 \begin_layout Itemize
13537 \begin_inset Flex CharStyle:Code
13540 \begin_layout Plain Layout
13546 ): These can be used to define custom collapsible insets, similar to TeX
13547 code, footnote, and the like.
13548 An obvious example is an endnote inset, which is defined in the
13549 \begin_inset Flex CharStyle:Code
13552 \begin_layout Plain Layout
13561 \begin_layout Itemize
13563 \begin_inset Flex CharStyle:Code
13566 \begin_layout Plain Layout
13572 ): For use with DocBook classes.
13575 \begin_layout Standard
13576 Flex insets are defined using the
13577 \begin_inset Flex CharStyle:Code
13580 \begin_layout Plain Layout
13586 tag, which shall be explained in a moment.
13589 \begin_layout Standard
13591 \begin_inset Flex CharStyle:Code
13594 \begin_layout Plain Layout
13600 tag also serves another function: It can be used to customize the general
13601 layout of many different types of insets.
13603 \begin_inset Flex CharStyle:Code
13606 \begin_layout Plain Layout
13612 can be used to customize the layout parameters for footnotes, marginal
13613 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
13614 boxes, tables, algorithms, URLs, and optional arguments, as well as to
13615 define Flex insets.
13618 \begin_layout Standard
13620 \begin_inset Flex CharStyle:Code
13623 \begin_layout Plain Layout
13629 definition must begin with a line of the form:
13632 \begin_layout LyX-Code
13636 \begin_layout Standard
13638 \begin_inset Flex CharStyle:Code
13641 \begin_layout Plain Layout
13647 indicates the inset whose layout is being defined, and here there are two
13651 \begin_layout Enumerate
13652 The layout for a pre-existing inset is being modified.
13653 In this case, can be
13654 \begin_inset Flex CharStyle:Code
13657 \begin_layout Plain Layout
13663 any one of the following:
13664 \begin_inset Flex CharStyle:Code
13667 \begin_layout Plain Layout
13674 \begin_inset Flex CharStyle:Code
13677 \begin_layout Plain Layout
13684 \begin_inset Flex CharStyle:Code
13687 \begin_layout Plain Layout
13694 \begin_inset Flex CharStyle:Code
13697 \begin_layout Plain Layout
13704 \begin_inset Flex CharStyle:Code
13707 \begin_layout Plain Layout
13714 \begin_inset Flex CharStyle:Code
13717 \begin_layout Plain Layout
13724 \begin_inset Flex CharStyle:Code
13727 \begin_layout Plain Layout
13734 \begin_inset Flex CharStyle:Code
13737 \begin_layout Plain Layout
13744 \begin_inset Flex CharStyle:Code
13747 \begin_layout Plain Layout
13754 \begin_inset Flex CharStyle:Code
13757 \begin_layout Plain Layout
13764 \begin_inset Flex CharStyle:Code
13767 \begin_layout Plain Layout
13774 \begin_inset Flex CharStyle:Code
13777 \begin_layout Plain Layout
13784 \begin_inset Flex CharStyle:Code
13787 \begin_layout Plain Layout
13794 \begin_inset Flex CharStyle:Code
13797 \begin_layout Plain Layout
13804 \begin_inset Flex CharStyle:Code
13807 \begin_layout Plain Layout
13814 \begin_inset Flex CharStyle:Code
13817 \begin_layout Plain Layout
13824 \begin_inset Flex CharStyle:Code
13827 \begin_layout Plain Layout
13834 \begin_inset Flex CharStyle:Code
13837 \begin_layout Plain Layout
13844 \begin_inset Flex CharStyle:Code
13847 \begin_layout Plain Layout
13854 \begin_inset Flex CharStyle:Code
13857 \begin_layout Plain Layout
13866 \begin_layout Enumerate
13867 The layout for a Flex inset is being defined.
13869 \begin_inset Flex CharStyle:Code
13872 \begin_layout Plain Layout
13878 can be any valid identifier not used by a pre-existing inset.
13879 Note that the definition of a flex inset
13884 \begin_inset Flex CharStyle:Code
13887 \begin_layout Plain Layout
13893 entry, declaring which type of inset this is.
13896 \begin_layout Standard
13898 \begin_inset Flex CharStyle:Code
13901 \begin_layout Plain Layout
13907 definition can contain the following entries:
13910 \begin_layout Description
13911 \begin_inset Flex CharStyle:Code
13914 \begin_layout Plain Layout
13920 The color for the inset's background.
13921 The valid colors are defined in
13922 \begin_inset Flex CharStyle:Code
13925 \begin_layout Plain Layout
13934 \begin_layout Description
13935 \begin_inset Flex CharStyle:Code
13938 \begin_layout Plain Layout
13945 \begin_inset Flex CharStyle:Code
13948 \begin_layout Plain Layout
13957 \begin_inset Flex CharStyle:Code
13960 \begin_layout Plain Layout
13966 ] Whether to use the content of the inset as the label, when the inset is
13971 \begin_layout Description
13972 \begin_inset Flex CharStyle:Code
13975 \begin_layout Plain Layout
13981 As with paragraph styles (see page
13982 \begin_inset CommandInset ref
13984 reference "des:CopyStyle"
13991 \begin_layout Description
13992 \begin_inset Flex CharStyle:Code
13995 \begin_layout Plain Layout
14002 \begin_inset Flex CharStyle:Code
14005 \begin_layout Plain Layout
14014 \begin_inset Flex CharStyle:Code
14017 \begin_layout Plain Layout
14023 ] Indicates whether the user may employ the Paragraph Settings dialog to
14024 customize the paragraph.
14027 \begin_layout Description
14028 \begin_inset Flex CharStyle:Code
14031 \begin_layout Plain Layout
14038 \begin_inset Flex CharStyle:Code
14041 \begin_layout Plain Layout
14048 \begin_inset Flex CharStyle:Code
14051 \begin_layout Plain Layout
14058 \begin_inset Flex CharStyle:Code
14061 \begin_layout Plain Layout
14067 , describing the rendering style used for the inset's frame and buttons.
14068 Footnotes generally use
14069 \begin_inset Flex CharStyle:Code
14072 \begin_layout Plain Layout
14078 , ERT insets generally
14079 \begin_inset Flex CharStyle:Code
14082 \begin_layout Plain Layout
14088 , and character styles
14089 \begin_inset Flex CharStyle:Code
14092 \begin_layout Plain Layout
14101 \begin_layout Description
14102 \begin_inset Flex CharStyle:Code
14105 \begin_layout Plain Layout
14111 Required at the end of the InsetLayout declarations.
14114 \begin_layout Description
14115 \begin_inset Flex CharStyle:Code
14118 \begin_layout Plain Layout
14124 The font used for both the text body
14130 \begin_inset space ~
14134 \begin_inset CommandInset ref
14136 reference "sub:Font-description"
14141 Note that defining this font automatically defines the
14142 \begin_inset Flex CharStyle:Code
14145 \begin_layout Plain Layout
14151 to the same value, so define this first and define
14152 \begin_inset Flex CharStyle:Code
14155 \begin_layout Plain Layout
14161 later if you want them to be different.
14164 \begin_layout Description
14165 \begin_inset Flex CharStyle:Code
14168 \begin_layout Plain Layout
14175 \begin_inset Quotes eld
14179 \begin_inset Quotes erd
14182 language, leading to Left-to-Right (latin) output, e.
14183 \begin_inset space \thinspace{}
14187 \begin_inset space \space{}
14190 in TeX code or URL.
14194 \begin_layout Description
14195 \begin_inset Flex CharStyle:Code
14198 \begin_layout Plain Layout
14205 \begin_inset Flex CharStyle:Code
14208 \begin_layout Plain Layout
14217 \begin_inset Flex CharStyle:Code
14220 \begin_layout Plain Layout
14226 ] Indicates whether the PlainLayout should be used or, instead, the user
14227 can change the paragraph style used in the inset.
14231 \begin_layout Description
14232 \begin_inset Flex CharStyle:Code
14235 \begin_layout Plain Layout
14241 As with paragraph styles (see page
14242 \begin_inset CommandInset ref
14243 LatexCommand pageref
14244 reference "des:FreeSpacing"
14252 \begin_layout Description
14253 \begin_inset Flex CharStyle:Code
14256 \begin_layout Plain Layout
14262 These tags control XHTML output.
14266 \begin_layout Description
14267 \begin_inset Flex CharStyle:Code
14270 \begin_layout Plain Layout
14277 \begin_inset Flex CharStyle:Code
14280 \begin_layout Plain Layout
14289 \begin_inset Flex CharStyle:Code
14292 \begin_layout Plain Layout
14298 ] Whether to include the contents of this inset in the strings generated
14299 for the `Outline' pane.
14300 One would not, for example, want the content of a footnote in a section
14301 header to be included in the TOC displayed in the outline, but one would
14302 normally want the content of a character style displayed.
14303 Default is false: not to include.
14306 \begin_layout Description
14307 \begin_inset Flex CharStyle:Code
14310 \begin_layout Plain Layout
14316 As with paragraph styles (see page
14317 \begin_inset CommandInset ref
14318 LatexCommand pageref
14319 reference "des:KeepEmpty"
14327 \begin_layout Description
14328 \begin_inset Flex CharStyle:Code
14331 \begin_layout Plain Layout
14337 The font used for the label.
14339 \begin_inset space ~
14343 \begin_inset CommandInset ref
14345 reference "sub:Font-description"
14350 Note that this definition can never appear before
14351 \begin_inset Flex CharStyle:Code
14354 \begin_layout Plain Layout
14360 , lest it be ineffective.
14363 \begin_layout Description
14364 \begin_inset Flex CharStyle:Code
14367 \begin_layout Plain Layout
14373 What will be displayed on the button or elsewhere as the inset label.
14374 Some inset types (TeX code and Branch) modify this label on the fly.
14377 \begin_layout Description
14378 \begin_inset Flex CharStyle:Code
14381 \begin_layout Plain Layout
14387 The name of the corresponding LaTeX stuff.
14388 Either the environment or command name.
14391 \begin_layout Description
14392 \begin_inset Flex CharStyle:Code
14395 \begin_layout Plain Layout
14401 The optional parameter for the corresponding
14402 \begin_inset Flex CharStyle:Code
14405 \begin_layout Plain Layout
14411 stuff, including possible bracket pairs like
14412 \begin_inset Flex CharStyle:Code
14415 \begin_layout Plain Layout
14422 This parameter cannot be changed from within LyX.
14425 \begin_layout Description
14426 \begin_inset Flex CharStyle:Code
14429 \begin_layout Plain Layout
14435 As with paragraph styles (see page
14436 \begin_inset CommandInset ref
14437 LatexCommand pageref
14438 reference "des:LatexType"
14445 \begin_layout Description
14446 \begin_inset Flex CharStyle:Code
14449 \begin_layout Plain Layout
14456 \begin_inset Flex CharStyle:Code
14459 \begin_layout Plain Layout
14466 \begin_inset Flex CharStyle:Code
14469 \begin_layout Plain Layout
14476 \begin_inset Flex CharStyle:Code
14479 \begin_layout Plain Layout
14486 \begin_inset Flex CharStyle:Code
14489 \begin_layout Plain Layout
14495 (indicating a dummy definition ending definitions of charstyles, etc).
14496 This entry is required in and is only meaningful for Flex insets.
14497 Among other things, it determines on which menu this inset will appear.
14499 \begin_inset Flex CharStyle:Code
14502 \begin_layout Plain Layout
14509 \begin_inset Flex CharStyle:Code
14512 \begin_layout Plain Layout
14519 \begin_inset Flex CharStyle:Code
14522 \begin_layout Plain Layout
14530 \begin_inset Flex CharStyle:Code
14533 \begin_layout Plain Layout
14539 can be set to true for charstyle insets, if you wish, by setting it
14544 \begin_inset Flex CharStyle:Code
14547 \begin_layout Plain Layout
14556 \begin_layout Description
14557 \begin_inset Flex CharStyle:Code
14560 \begin_layout Plain Layout
14567 \begin_inset Flex CharStyle:Code
14570 \begin_layout Plain Layout
14579 \begin_inset Flex CharStyle:Code
14582 \begin_layout Plain Layout
14588 ] Whether multiple paragraphs are permitted in this inset.
14590 \begin_inset Flex CharStyle:Code
14593 \begin_layout Plain Layout
14599 to the same value and
14600 \begin_inset Flex CharStyle:Code
14603 \begin_layout Plain Layout
14609 to the opposite value.
14610 These can be reset to other values, if they are used
14615 \begin_inset Flex CharStyle:Code
14618 \begin_layout Plain Layout
14628 \begin_layout Description
14629 \begin_inset Flex CharStyle:Code
14632 \begin_layout Plain Layout
14639 \begin_inset Flex CharStyle:Code
14642 \begin_layout Plain Layout
14651 \begin_inset Flex CharStyle:Code
14654 \begin_layout Plain Layout
14660 ] Whether fragile commands in this layout should be
14661 \begin_inset Flex CharStyle:Code
14664 \begin_layout Plain Layout
14677 whether the command should itself be protected.) Default is false.
14680 \begin_layout Description
14681 \begin_inset Flex CharStyle:Code
14684 \begin_layout Plain Layout
14691 \begin_inset Flex CharStyle:Code
14694 \begin_layout Plain Layout
14703 \begin_inset Flex CharStyle:Code
14706 \begin_layout Plain Layout
14712 ] As with paragraph styles (see page
14713 \begin_inset CommandInset ref
14714 LatexCommand pageref
14715 reference "des:ParbreakIsNewline"
14723 \begin_layout Description
14724 \begin_inset Flex CharStyle:Code
14727 \begin_layout Plain Layout
14734 \begin_inset Flex CharStyle:Code
14737 \begin_layout Plain Layout
14746 \begin_inset Flex CharStyle:Code
14749 \begin_layout Plain Layout
14755 ] As with paragraph styles (see page
14756 \begin_inset CommandInset ref
14757 LatexCommand pageref
14758 reference "des:PassThru"
14766 \begin_layout Description
14767 \begin_inset Flex CharStyle:Code
14770 \begin_layout Plain Layout
14776 As with paragraph styles (see page
14777 \begin_inset CommandInset ref
14778 LatexCommand pageref
14779 reference "des:Preamble"
14786 \begin_layout Description
14787 \begin_inset Flex CharStyle:Code
14790 \begin_layout Plain Layout
14797 \begin_inset Flex CharStyle:Code
14800 \begin_layout Plain Layout
14806 ] The prefix to use when creating labels referring to insets of this type.
14807 This allows the use of formatted references.
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 ] As with paragraph styles (see page
14831 \begin_inset CommandInset ref
14832 LatexCommand pageref
14833 reference "des:Requires"
14840 \begin_layout Description
14841 \begin_inset Flex CharStyle:Code
14844 \begin_layout Plain Layout
14851 \begin_inset Flex CharStyle:Code
14854 \begin_layout Plain Layout
14861 \begin_inset Flex CharStyle:Code
14864 \begin_layout Plain Layout
14872 ] Spellcheck the contents of this inset.
14876 \begin_layout Subsection
14878 \begin_inset CommandInset label
14880 name "sub:Counters"
14887 \begin_layout Standard
14888 Since version 1.3.0 of LyX, it is both possible and necessary to define the
14890 \begin_inset Flex CharStyle:MenuItem
14893 \begin_layout Plain Layout
14900 \begin_inset Flex CharStyle:MenuItem
14903 \begin_layout Plain Layout
14909 , \SpecialChar \ldots{}
14910 ) in the text class itself.
14911 The standard counters are defined in the file
14912 \begin_inset Flex CharStyle:Code
14915 \begin_layout Plain Layout
14921 , so you may have to do no more than add
14924 \begin_layout LyX-Code
14925 Input stdcounters.inc
14928 \begin_layout Standard
14929 to your layout file to get them to work.
14930 But if you want to define custom counters, then you can do so.
14931 The counter declaration must begin with:
14934 \begin_layout LyX-Code
14935 Counter CounterName
14938 \begin_layout Standard
14940 \begin_inset Flex CharStyle:Code
14943 \begin_layout Plain Layout
14949 ' is replaced by the name of the counter.
14950 And it must end with
14951 \begin_inset Quotes eld
14955 \begin_inset Flex CharStyle:Code
14958 \begin_layout Plain Layout
14965 \begin_inset Quotes erd
14969 The following parameters can also be used:
14972 \begin_layout Description
14973 \begin_inset Flex CharStyle:Code
14976 \begin_layout Plain Layout
14983 \begin_inset Flex CharStyle:Code
14986 \begin_layout Plain Layout
14993 \begin_inset Quotes erd
14997 \begin_inset Quotes erd
15000 ] When defined, this string defines how the counter is displayed.
15001 Setting this value sets
15002 \begin_inset Flex CharStyle:Code
15005 \begin_layout Plain Layout
15006 LabelStringAppendix
15012 The following special constructs can be used in the string:
15016 \begin_layout Itemize
15017 \begin_inset Flex CharStyle:Code
15020 \begin_layout Plain Layout
15028 will be replaced by the expansion of the
15029 \begin_inset Flex CharStyle:Code
15032 \begin_layout Plain Layout
15039 \begin_inset Flex CharStyle:Code
15042 \begin_layout Plain Layout
15043 LabelStringAppendix
15049 \begin_inset Flex CharStyle:Code
15052 \begin_layout Plain Layout
15062 \begin_layout Itemize
15063 counter values can be expressed using LaTeX-like macros
15064 \begin_inset Flex CharStyle:Code
15067 \begin_layout Plain Layout
15084 \begin_inset Flex CharStyle:Code
15087 \begin_layout Plain Layout
15099 \begin_layout Plain Layout
15109 Actually, the situation is a bit more complicated: any
15128 other than those described below will produce arabic numerals.
15129 It would not be surprising to see this change in the future.
15135 \begin_inset Flex CharStyle:Code
15138 \begin_layout Plain Layout
15144 : 1, 2, 3,\SpecialChar \ldots{}
15146 \begin_inset Flex CharStyle:Code
15149 \begin_layout Plain Layout
15155 for lower-case letters: a, b, c, \SpecialChar \ldots{}
15157 \begin_inset Flex CharStyle:Code
15160 \begin_layout Plain Layout
15166 for upper-case letters: A, B, C, \SpecialChar \ldots{}
15168 \begin_inset Flex CharStyle:Code
15171 \begin_layout Plain Layout
15177 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
15179 \begin_inset Flex CharStyle:Code
15182 \begin_layout Plain Layout
15188 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
15190 \begin_inset Flex CharStyle:Code
15193 \begin_layout Plain Layout
15199 for hebrew numerals.
15203 \begin_layout Standard
15204 If LabelString is not defined, a default value is constructed as follows:
15205 if the counter has a master counter
15206 \begin_inset Flex CharStyle:Code
15209 \begin_layout Plain Layout
15216 \begin_inset Flex CharStyle:Code
15219 \begin_layout Plain Layout
15226 \begin_inset Flex CharStyle:Code
15229 \begin_layout Plain Layout
15239 is used; otherwise the string
15240 \begin_inset Flex CharStyle:Code
15243 \begin_layout Plain Layout
15254 \begin_layout Description
15255 \begin_inset Flex CharStyle:Code
15258 \begin_layout Plain Layout
15259 LabelStringAppendix
15265 \begin_inset Flex CharStyle:Code
15268 \begin_layout Plain Layout
15275 \begin_inset Quotes erd
15279 \begin_inset Quotes erd
15283 \begin_inset Flex CharStyle:Code
15286 \begin_layout Plain Layout
15292 , but for use in the Appendix.
15295 \begin_layout Description
15296 \begin_inset Flex CharStyle:Code
15299 \begin_layout Plain Layout
15306 \begin_inset Flex CharStyle:Code
15309 \begin_layout Plain Layout
15316 \begin_inset Quotes erd
15320 \begin_inset Quotes erd
15323 ] A format for use with formatted references to this counter.
15324 For example, one might want to have references to section numbers appear
15326 \begin_inset Quotes eld
15330 \begin_inset Quotes erd
15334 The string should contain
15335 \begin_inset Quotes eld
15339 \begin_inset Quotes erd
15343 This will be replaced by the counter number itself.
15344 So, for sections, it would be: Section ##.
15347 \begin_layout Description
15348 \begin_inset Flex CharStyle:Code
15351 \begin_layout Plain Layout
15358 \begin_inset Flex CharStyle:Code
15361 \begin_layout Plain Layout
15368 \begin_inset Quotes erd
15372 \begin_inset Quotes erd
15375 ] If this is set to the name of another counter, the present counter will
15376 be reset every time the other one is increased.
15378 \begin_inset Flex CharStyle:Code
15381 \begin_layout Plain Layout
15388 \begin_inset Flex CharStyle:Code
15391 \begin_layout Plain Layout
15400 \begin_layout Subsection
15402 \begin_inset CommandInset label
15404 name "sub:Font-description"
15411 \begin_layout Standard
15412 A font description looks like this:
15415 \begin_layout LyX-Code
15425 \begin_layout LyX-Code
15429 \begin_layout LyX-Code
15433 \begin_layout Standard
15434 The following commands are available:
15437 \begin_layout Description
15438 \begin_inset Flex CharStyle:Code
15441 \begin_layout Plain Layout
15448 \begin_inset Flex CharStyle:Code
15451 \begin_layout Plain Layout
15460 \begin_inset Flex CharStyle:Code
15463 \begin_layout Plain Layout
15470 \begin_inset Flex CharStyle:Code
15473 \begin_layout Plain Layout
15480 \begin_inset Flex CharStyle:Code
15483 \begin_layout Plain Layout
15490 \begin_inset Flex CharStyle:Code
15493 \begin_layout Plain Layout
15500 \begin_inset Flex CharStyle:Code
15503 \begin_layout Plain Layout
15510 \begin_inset Flex CharStyle:Code
15513 \begin_layout Plain Layout
15520 \begin_inset Flex CharStyle:Code
15523 \begin_layout Plain Layout
15530 \begin_inset Flex CharStyle:Code
15533 \begin_layout Plain Layout
15542 \begin_layout Description
15543 \begin_inset Flex CharStyle:Code
15546 \begin_layout Plain Layout
15553 \begin_inset Flex CharStyle:Code
15556 \begin_layout Plain Layout
15565 \begin_inset Flex CharStyle:Code
15568 \begin_layout Plain Layout
15575 \begin_inset Flex CharStyle:Code
15578 \begin_layout Plain Layout
15587 \begin_layout Description
15588 \begin_inset Flex CharStyle:Code
15591 \begin_layout Plain Layout
15598 \begin_inset Flex CharStyle:Code
15601 \begin_layout Plain Layout
15607 ] Valid arguments are:
15608 \begin_inset Flex CharStyle:Code
15611 \begin_layout Plain Layout
15618 \begin_inset Flex CharStyle:Code
15621 \begin_layout Plain Layout
15628 \begin_inset Flex CharStyle:Code
15631 \begin_layout Plain Layout
15638 \begin_inset Flex CharStyle:Code
15641 \begin_layout Plain Layout
15648 \begin_inset Flex CharStyle:Code
15651 \begin_layout Plain Layout
15658 \begin_inset Flex CharStyle:Code
15661 \begin_layout Plain Layout
15668 Each of these turns on or off the corresponding attribute.
15670 \begin_inset Flex CharStyle:Code
15673 \begin_layout Plain Layout
15679 turns on emphasis, and
15680 \begin_inset Flex CharStyle:Code
15683 \begin_layout Plain Layout
15691 \begin_inset Newline newline
15694 If the latter seems puzzling, remember that the font settings for the present
15695 context are generally inherited from the surrounding context.
15697 \begin_inset Flex CharStyle:Code
15700 \begin_layout Plain Layout
15706 would turn off the emphasis that was anyway in effect, say, in a theorem
15710 \begin_layout Description
15711 \begin_inset Flex CharStyle:Code
15714 \begin_layout Plain Layout
15721 \begin_inset Flex CharStyle:Code
15724 \begin_layout Plain Layout
15733 \begin_inset Flex CharStyle:Code
15736 \begin_layout Plain Layout
15745 \begin_layout Description
15746 \begin_inset Flex CharStyle:Code
15749 \begin_layout Plain Layout
15756 \begin_inset Flex CharStyle:Code
15759 \begin_layout Plain Layout
15768 \begin_inset Flex CharStyle:Code
15771 \begin_layout Plain Layout
15778 \begin_inset Flex CharStyle:Code
15781 \begin_layout Plain Layout
15788 \begin_inset Flex CharStyle:Code
15791 \begin_layout Plain Layout
15800 \begin_layout Description
15801 \begin_inset Flex CharStyle:Code
15804 \begin_layout Plain Layout
15811 \begin_inset Flex CharStyle:Code
15814 \begin_layout Plain Layout
15821 \begin_inset Flex CharStyle:Code
15824 \begin_layout Plain Layout
15831 \begin_inset Flex CharStyle:Code
15834 \begin_layout Plain Layout
15843 \begin_inset Flex CharStyle:Code
15846 \begin_layout Plain Layout
15853 \begin_inset Flex CharStyle:Code
15856 \begin_layout Plain Layout
15863 \begin_inset Flex CharStyle:Code
15866 \begin_layout Plain Layout
15873 \begin_inset Flex CharStyle:Code
15876 \begin_layout Plain Layout
15883 \begin_inset Flex CharStyle:Code
15886 \begin_layout Plain Layout
15895 \begin_layout Subsection
15896 \begin_inset CommandInset label
15898 name "sub:Citation-format-description"
15902 Citation format description
15905 \begin_layout Standard
15907 \begin_inset Flex CharStyle:Code
15910 \begin_layout Plain Layout
15916 blocks are used to describe how bibliographic information should be displayed,
15917 both within LyX itself (in the citation dialog and in tooltips, for example)
15918 and in XHTML output.
15919 Such a block might look like this:
15922 \begin_layout LyX-Code
15926 \begin_layout LyX-Code
15930 \begin_layout LyX-Code
15934 \begin_layout LyX-Code
15938 \begin_layout Standard
15939 The individual lines define how the bibliographic information associated
15940 with an article or book, respectively, is to be displayed, and such a definitio
15941 n can be given for any `entry type' that might be present in a BibTeX file.
15942 LyX defines a default format in the source code that will be used if no
15943 specific definition has been given.
15944 LyX predefines several formats in the file
15945 \begin_inset Flex CharStyle:Code
15948 \begin_layout Plain Layout
15954 , which is included in most of LyX's document classes.
15957 \begin_layout Standard
15958 The definitions use a simple language that allows BibTeX keys to be replaced
15960 Keys should be enclosed in
15961 \begin_inset Flex CharStyle:Code
15964 \begin_layout Plain Layout
15971 \begin_inset Flex CharStyle:Code
15974 \begin_layout Plain Layout
15981 So a simple definition might look like this:
15984 \begin_layout LyX-Code
15986 \begin_inset Quotes eld
15990 \begin_inset Quotes erd
15996 \begin_layout Standard
15997 This would print the author, followed by a comma, followed by the title,
15998 in quotes, followed by a period.
16001 \begin_layout Standard
16002 Of course, sometimes you may want to print a key only if it exists.
16003 This can be done by using a conditional construction, such as:
16004 \begin_inset Flex CharStyle:Code
16007 \begin_layout Plain Layout
16009 \begin_inset space ~
16019 \begin_inset Flex CharStyle:Code
16022 \begin_layout Plain Layout
16028 key exists, then print
16029 \begin_inset Quotes eld
16033 \begin_inset space ~
16037 \begin_inset Quotes erd
16040 followed by the volume key.
16041 It is also possible to have an else clause in the conditional, such as:
16043 \begin_inset Flex CharStyle:Code
16046 \begin_layout Plain Layout
16047 {%author%[[%author%]][[%editor%, ed.]]}
16054 \begin_inset Flex CharStyle:Code
16057 \begin_layout Plain Layout
16063 key is printed if it exists; otherwise, the editor key is printed, followed
16065 \begin_inset Quotes eld
16069 \begin_inset space ~
16073 \begin_inset Quotes erd
16076 Note that the key is again enclosed in
16077 \begin_inset Flex CharStyle:Code
16080 \begin_layout Plain Layout
16086 signs; the entire conditional is enclosed in braces; and the if and else
16087 clauses are enclosed in double brackets,
16088 \begin_inset Quotes eld
16092 \begin_inset Flex CharStyle:Code
16095 \begin_layout Plain Layout
16102 \begin_inset Quotes eld
16106 \begin_inset Quotes eld
16110 \begin_inset Flex CharStyle:Code
16113 \begin_layout Plain Layout
16120 \begin_inset Quotes erd
16124 There must be no space between any of these.
16127 \begin_layout Standard
16128 There is one other piece of syntax available in definitions, which looks
16130 \begin_inset Flex CharStyle:Code
16133 \begin_layout Plain Layout
16140 This defines a piece of formatting information that is to be used when
16142 \begin_inset Quotes eld
16146 \begin_inset Quotes erd
16150 Obviously, we do not want to output HTML tags when writing plain text,
16151 so they should be wrapped in
16152 \begin_inset Quotes eld
16156 \begin_inset Quotes erd
16160 \begin_inset Quotes eld
16164 \begin_inset Quotes erd
16170 \begin_layout Standard
16171 Two special sorts of definitions are also possible in a
16172 \begin_inset Flex CharStyle:Code
16175 \begin_layout Plain Layout
16182 An example of the first would be:
16185 \begin_layout LyX-Code
16187 \begin_inset Quotes eld
16191 \begin_inset Quotes erd
16197 \begin_layout Standard
16198 This is an abbreviation, or macro, and it can be used by treating it as
16200 \begin_inset Flex CharStyle:Code
16203 \begin_layout Plain Layout
16211 \begin_inset Flex CharStyle:Code
16214 \begin_layout Plain Layout
16220 exactly as it would treat its definition.
16221 So, let us issue the obvious
16229 \begin_layout LyX-Code
16233 \begin_layout Standard
16234 or anything like it.
16235 LyX shouldn't go into an infinite loop, but it may go into a long one before
16239 \begin_layout Standard
16240 The second sort of special definition might look like this:
16243 \begin_layout LyX-Code
16247 \begin_layout Standard
16248 This defines a translatable piece of text, which allows relevant parts of
16249 the bibliography to be translated.
16250 It can be included in a definition by treating it as a key:
16251 \begin_inset Flex CharStyle:Code
16254 \begin_layout Plain Layout
16261 Several of these are predefined in
16262 \begin_inset Flex CharStyle:Code
16265 \begin_layout Plain Layout
16272 Note that these are not macros, in the sense just defined.
16273 They will not be expanded.
16276 \begin_layout Standard
16277 So here then is an example that use all these features:
16280 \begin_layout LyX-Code
16281 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
16284 \begin_layout Standard
16285 The defines a macro that prints the author, followed by a comma, if the
16287 \begin_inset Flex CharStyle:Code
16290 \begin_layout Plain Layout
16296 key is defined, or else prints the name of the editor, followed by the
16298 \begin_inset Flex CharStyle:Code
16301 \begin_layout Plain Layout
16307 or its translation (it is by default
16308 \begin_inset Quotes eld
16312 \begin_inset Quotes erd
16316 \begin_inset Flex CharStyle:Code
16319 \begin_layout Plain Layout
16326 Note that this is in fact defined in
16327 \begin_inset Flex CharStyle:Code
16330 \begin_layout Plain Layout
16336 , so you can use it in your own definitions, or re-definitions, if you load
16340 \begin_layout Section
16341 \begin_inset CommandInset label
16343 name "sec:Tags-for-XHTML"
16347 Tags for XHTML output
16350 \begin_layout Standard
16351 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
16352 by layout information.
16353 In general, LyX provides sensible defaults and, as mentioned earlier, it
16354 will even construct default CSS style rules from the other layout tags.
16355 For example, LyX will attempt to use the information provided in the
16356 \begin_inset Flex CharStyle:Code
16359 \begin_layout Plain Layout
16365 declaration for the Chapter style to write CSS that will appropriately
16366 format chapter headings.
16369 \begin_layout Standard
16370 In many cases, then, you may not have to do anything at all to get acceptable
16371 XHTML output for your own environments, custom insets, and so forth.
16372 But in some cases you will, and so LyX provides a number of layout tags
16373 that can be used to customize the XHTML and CSS that are generated.
16376 \begin_layout Standard
16377 Note that there are two tags,
16378 \begin_inset Flex CharStyle:Code
16381 \begin_layout Plain Layout
16388 \begin_inset Flex CharStyle:Code
16391 \begin_layout Plain Layout
16397 that may appear outside style and inset declarations.
16399 \begin_inset CommandInset ref
16401 reference "sub:General-text-class"
16405 for details on these.
16408 \begin_layout Subsection
16409 \begin_inset CommandInset label
16411 name "sub:Paragraph-Style-XHTML"
16418 \begin_layout Standard
16419 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
16420 dealing with a normal paragraph, a command, or an environment, where this
16421 is itself determined by the contents of the corresponding
16422 \begin_inset Flex CharStyle:Code
16425 \begin_layout Plain Layout
16435 \begin_layout Standard
16436 For a command or normal paragraph, the output XHTML has the following form:
16439 \begin_layout LyX-Code
16441 \begin_inset Quotes erd
16445 \begin_inset Quotes erd
16451 \begin_layout LyX-Code
16453 \begin_inset Quotes erd
16457 \begin_inset Quotes erd
16463 \begin_layout LyX-Code
16464 Contents of the paragraph.
16467 \begin_layout LyX-Code
16471 \begin_layout Standard
16472 The label tags are of course omitted if the paragraph does not have a label.
16475 \begin_layout Standard
16476 For an environment that is not some sort of list, the XHTML takes this form:
16479 \begin_layout LyX-Code
16481 \begin_inset Quotes erd
16485 \begin_inset Quotes erd
16491 \begin_layout LyX-Code
16493 \begin_inset Quotes erd
16497 \begin_inset Quotes erd
16501 \begin_inset Quotes erd
16505 \begin_inset Quotes erd
16508 >Environment Label</labeltag>First paragraph.</itemtag>
16511 \begin_layout LyX-Code
16512 <itemtag>Second paragraph.</itemtag>
16515 \begin_layout LyX-Code
16519 \begin_layout Standard
16520 Note that the label is output only for the first paragraph, as it should
16521 be for a theorem, for example.
16525 \begin_layout Standard
16526 For a list, we have one of these forms:
16529 \begin_layout LyX-Code
16531 \begin_inset Quotes erd
16535 \begin_inset Quotes erd
16541 \begin_layout LyX-Code
16543 \begin_inset Quotes erd
16547 \begin_inset Quotes erd
16551 \begin_inset Quotes erd
16555 \begin_inset Quotes erd
16558 >List Label</labeltag>First item.</itemtag>
16561 \begin_layout LyX-Code
16563 \begin_inset Quotes erd
16567 \begin_inset Quotes erd
16571 \begin_inset Quotes erd
16575 \begin_inset Quotes erd
16578 >List Label</labeltag>Second item.</itemtag>
16581 \begin_layout LyX-Code
16585 \begin_layout LyX-Code
16589 \begin_layout LyX-Code
16591 \begin_inset Quotes erd
16595 \begin_inset Quotes erd
16601 \begin_layout LyX-Code
16603 \begin_inset Quotes erd
16607 \begin_inset Quotes erd
16610 >List Label</labeltag><itemtag attr=
16611 \begin_inset Quotes erd
16615 \begin_inset Quotes erd
16618 >First item.</itemtag>
16621 \begin_layout LyX-Code
16623 \begin_inset Quotes erd
16627 \begin_inset Quotes erd
16630 >List Label</labeltag><itemtag attr=
16631 \begin_inset Quotes erd
16635 \begin_inset Quotes erd
16638 >Second item.</itemtag>
16641 \begin_layout LyX-Code
16645 \begin_layout Standard
16646 Note the different orders of
16647 \begin_inset Flex CharStyle:Code
16650 \begin_layout Plain Layout
16657 \begin_inset Flex CharStyle:Code
16660 \begin_layout Plain Layout
16667 Which order we get depends upon the setting of
16668 \begin_inset Flex CharStyle:Code
16671 \begin_layout Plain Layout
16678 \begin_inset Flex CharStyle:Code
16681 \begin_layout Plain Layout
16687 is false (the default), you get the first of these, with the label within
16688 the item; if true, you get the second, with the label outside the item.
16691 \begin_layout Standard
16692 The specific tags and attributes output for each paragraph type can be controlle
16693 d by means of the layout tags we are about to describe.
16694 As mentioned earlier, however, LyX uses sensible defaults for many of these,
16695 so you often may not need to do very much to get good XHTML output.
16696 Think of the available tags as there so you can tweak things to your liking.
16699 \begin_layout Description
16700 \begin_inset Flex CharStyle:Code
16703 \begin_layout Plain Layout
16710 \begin_inset Flex CharStyle:Code
16713 \begin_layout Plain Layout
16719 ] Specifies attribute information to be output with the main tag.
16721 \begin_inset Quotes eld
16725 \begin_inset Flex CharStyle:Code
16728 \begin_layout Plain Layout
16735 \begin_inset Quotes erd
16739 By default, LyX will output
16740 \begin_inset Quotes eld
16744 \begin_inset Flex CharStyle:Code
16747 \begin_layout Plain Layout
16754 \begin_inset Quotes erd
16758 \begin_inset Flex CharStyle:Code
16761 \begin_layout Plain Layout
16767 is the LyX name of the layout, made lowercase, for example: chapter.
16770 \begin_layout Description
16771 \begin_inset Flex CharStyle:Code
16774 \begin_layout Plain Layout
16781 \begin_inset Flex CharStyle:Code
16784 \begin_layout Plain Layout
16794 ] Whether to output the default CSS information LyX generates for this layout,
16795 even if additional information is explicitly provided via
16796 \begin_inset Flex CharStyle:Code
16799 \begin_layout Plain Layout
16807 \begin_inset Flex CharStyle:Code
16810 \begin_layout Plain Layout
16816 allows you to alter or augment the generated CSS, rather than to override
16819 \begin_inset Flex CharStyle:Code
16822 \begin_layout Plain Layout
16831 \begin_layout Description
16832 \begin_inset Flex CharStyle:Code
16835 \begin_layout Plain Layout
16842 \begin_inset Flex CharStyle:Code
16845 \begin_layout Plain Layout
16851 ] The tag to be used for individual paragraphs of environments, replacing
16853 \begin_inset Flex CharStyle:Code
16856 \begin_layout Plain Layout
16862 in the examples above.
16864 \begin_inset Flex CharStyle:Code
16867 \begin_layout Plain Layout
16876 \begin_layout Description
16877 \begin_inset Flex CharStyle:Code
16880 \begin_layout Plain Layout
16887 \begin_inset Flex CharStyle:Code
16890 \begin_layout Plain Layout
16896 ] Attributes for the item tag.
16898 \begin_inset Quotes eld
16902 \begin_inset Flex CharStyle:Code
16905 \begin_layout Plain Layout
16906 class=`layoutname_item'
16912 \begin_inset Quotes erd
16918 \begin_layout Description
16919 \begin_inset Flex CharStyle:Code
16922 \begin_layout Plain Layout
16929 \begin_inset Flex CharStyle:Code
16932 \begin_layout Plain Layout
16938 ] The tag to be used for paragraph and item labels, replacing
16939 \begin_inset Flex CharStyle:Code
16942 \begin_layout Plain Layout
16948 in the examples above.
16950 \begin_inset Flex CharStyle:Code
16953 \begin_layout Plain Layout
16960 \begin_inset Flex CharStyle:Code
16963 \begin_layout Plain Layout
16970 \begin_inset Flex CharStyle:Code
16973 \begin_layout Plain Layout
16980 \begin_inset Flex CharStyle:Code
16983 \begin_layout Plain Layout
16984 Centered_Top_Environment
16989 , in which case it defaults to
16990 \begin_inset Flex CharStyle:Code
16993 \begin_layout Plain Layout
17002 \begin_layout Description
17003 \begin_inset Flex CharStyle:Code
17006 \begin_layout Plain Layout
17013 \begin_inset Flex CharStyle:Code
17016 \begin_layout Plain Layout
17022 ] Attributes for the label tag.
17024 \begin_inset Quotes eld
17028 \begin_inset Flex CharStyle:Code
17031 \begin_layout Plain Layout
17032 class=`layoutname_label'
17038 \begin_inset Quotes erd
17044 \begin_layout Description
17045 \begin_inset Flex CharStyle:Code
17048 \begin_layout Plain Layout
17055 \begin_inset Flex CharStyle:Code
17058 \begin_layout Plain Layout
17068 ] Meaningful only for list-like environments, this tag controls whether
17069 the label tag is output before or inside the item tag.
17070 This is used, for example, in the description environment, where we want
17072 \begin_inset Flex CharStyle:Code
17075 \begin_layout Plain Layout
17076 <dt>\SpecialChar \ldots{}
17077 </dt><dd>\SpecialChar \ldots{}
17085 \begin_inset Flex CharStyle:Code
17088 \begin_layout Plain Layout
17094 : The label tag is output inside the item tag.
17097 \begin_layout Description
17098 \begin_inset Flex CharStyle:Code
17101 \begin_layout Plain Layout
17107 Information to be output in the
17108 \begin_inset Flex CharStyle:Code
17111 \begin_layout Plain Layout
17117 section when this style is used.
17118 This might, for example, be used to include a
17119 \begin_inset Flex CharStyle:Code
17122 \begin_layout Plain Layout
17129 \begin_inset Flex CharStyle:Code
17132 \begin_layout Plain Layout
17141 \begin_layout Description
17142 \begin_inset Flex CharStyle:Code
17145 \begin_layout Plain Layout
17151 CSS style information to be included when this style is used.
17152 Note that this will automatically be wrapped in a layout-generated
17153 \begin_inset Flex CharStyle:Code
17156 \begin_layout Plain Layout
17162 block, so only the CSS itself need be included.
17165 \begin_layout Description
17166 \begin_inset Flex CharStyle:Code
17169 \begin_layout Plain Layout
17176 \begin_inset Flex CharStyle:Code
17179 \begin_layout Plain Layout
17185 ] The tag to be used for the main label, replacing
17186 \begin_inset Flex CharStyle:Code
17189 \begin_layout Plain Layout
17195 in the examples above.
17197 \begin_inset Flex CharStyle:Code
17200 \begin_layout Plain Layout
17209 \begin_layout Description
17210 \begin_inset Flex CharStyle:Code
17213 \begin_layout Plain Layout
17220 \begin_inset Flex CharStyle:Code
17223 \begin_layout Plain Layout
17233 ] Marks this style as the one to be used to generate the
17234 \begin_inset Flex CharStyle:Code
17237 \begin_layout Plain Layout
17243 tag for the XHTML file.
17244 By default, it is false.
17246 \begin_inset Flex CharStyle:Code
17249 \begin_layout Plain Layout
17255 file sets it to true for the
17256 \begin_inset Flex CharStyle:Code
17259 \begin_layout Plain Layout
17269 \begin_layout Subsection
17273 \begin_layout Standard
17274 The XHTML output of insets can also be controlled by information in layout
17279 \begin_layout Plain Layout
17280 At present, this is true only for
17281 \begin_inset Quotes eld
17285 \begin_inset Quotes erd
17288 insets (insets you can type into) and is not true for
17289 \begin_inset Quotes eld
17293 \begin_inset Quotes erd
17296 insets (insets that are associated with dialog boxes).
17301 Here, too, LyX tries to provide sensible defaults, and it constructs default
17303 But everything can be customized.
17306 \begin_layout Standard
17307 The XHTML LyX outputs for an inset has the following form:
17310 \begin_layout LyX-Code
17312 \begin_inset Quotes erd
17316 \begin_inset Quotes erd
17322 \begin_layout LyX-Code
17323 <labeltag>Label</labeltag>
17326 \begin_layout LyX-Code
17328 \begin_inset Quotes erd
17332 \begin_inset Quotes erd
17335 >Contents of the inset.</innertag>
17338 \begin_layout LyX-Code
17342 \begin_layout Standard
17343 If the inset permits multiple paragraphs---that is, if
17344 \begin_inset Flex CharStyle:Code
17347 \begin_layout Plain Layout
17353 is true---then the contents of the inset will itself be output as paragraphs
17354 formatted according to the styles used for those paragraphs (standard,
17355 quote, and the like).
17356 The label tag is of course omitted if the paragraph does not have a label
17357 and, at present, is always
17358 \begin_inset Flex CharStyle:Code
17361 \begin_layout Plain Layout
17368 The inner tag is optional and, by default, does not appear.
17371 \begin_layout Standard
17372 The specific tags and attributes output for each inset can be controlled
17373 by means of the following layout tags.
17376 \begin_layout Description
17377 \begin_inset Flex CharStyle:Code
17380 \begin_layout Plain Layout
17387 \begin_inset Flex CharStyle:Code
17390 \begin_layout Plain Layout
17396 ] Specifies attribute information to be output with the main tag.
17398 \begin_inset Quotes eld
17402 \begin_inset Flex CharStyle:Code
17405 \begin_layout Plain Layout
17406 class=`myinset' onclick=`\SpecialChar \ldots{}
17413 \begin_inset Quotes erd
17417 By default, LyX will output
17418 \begin_inset Quotes eld
17422 \begin_inset Flex CharStyle:Code
17425 \begin_layout Plain Layout
17432 \begin_inset Quotes erd
17436 \begin_inset Flex CharStyle:Code
17439 \begin_layout Plain Layout
17445 is the LyX name of the inset, made lowercase and with non-alphanumeric
17446 characters converted to underscores, for example: footnote.
17449 \begin_layout Description
17450 \begin_inset Flex CharStyle:Code
17453 \begin_layout Plain Layout
17460 \begin_inset Flex CharStyle:Code
17463 \begin_layout Plain Layout
17473 ] Whether to output the default CSS information LyX generates for this layout,
17474 even if additional information is explicitly provided via
17475 \begin_inset Flex CharStyle:Code
17478 \begin_layout Plain Layout
17486 \begin_inset Flex CharStyle:Code
17489 \begin_layout Plain Layout
17495 allows you to alter or augment the generated CSS, rather than to override
17500 \begin_layout Description
17501 \begin_inset Flex CharStyle:Code
17504 \begin_layout Plain Layout
17511 \begin_inset Flex CharStyle:Code
17514 \begin_layout Plain Layout
17520 ] Attributes for the inner tag.
17522 \begin_inset Quotes eld
17526 \begin_inset Flex CharStyle:Code
17529 \begin_layout Plain Layout
17530 class=`insetname_inner'
17536 \begin_inset Quotes erd
17542 \begin_layout Description
17543 \begin_inset Flex CharStyle:Code
17546 \begin_layout Plain Layout
17553 \begin_inset Flex CharStyle:Code
17556 \begin_layout Plain Layout
17562 ] The inner tag, replacing
17563 \begin_inset Flex CharStyle:Code
17566 \begin_layout Plain Layout
17572 in the examples above.
17573 By default, there is none.
17576 \begin_layout Description
17577 \begin_inset Flex CharStyle:Code
17580 \begin_layout Plain Layout
17587 \begin_inset Flex CharStyle:Code
17590 \begin_layout Plain Layout
17598 ] Whether this inset represents a standalone block of text (such as a footnote)
17599 or instead represents material that is included in the surrounding text
17600 (such as a branch).
17604 \begin_layout Description
17605 \begin_inset Flex CharStyle:Code
17608 \begin_layout Plain Layout
17615 \begin_inset Flex CharStyle:Code
17618 \begin_layout Plain Layout
17624 ] A label for this inset, possibly including a reference to a counter.
17625 For example, for footnote, it might be:
17626 \begin_inset Flex CharStyle:Code
17629 \begin_layout Plain Layout
17638 This is optional, and there is no default.
17641 \begin_layout Description
17642 \begin_inset Flex CharStyle:Code
17645 \begin_layout Plain Layout
17651 Information to be output in the
17652 \begin_inset Flex CharStyle:Code
17655 \begin_layout Plain Layout
17661 section when this style is used.
17662 This might, for example, be used to include a
17663 \begin_inset Flex CharStyle:Code
17666 \begin_layout Plain Layout
17673 \begin_inset Flex CharStyle:Code
17676 \begin_layout Plain Layout
17685 \begin_layout Description
17686 \begin_inset Flex CharStyle:Code
17689 \begin_layout Plain Layout
17695 CSS style information to be included when this style is used.
17696 Note that this will automatically be wrapped in a layout-generated
17697 \begin_inset Flex CharStyle:Code
17700 \begin_layout Plain Layout
17706 block, so only the CSS itself need be included.
17709 \begin_layout Description
17710 \begin_inset Flex CharStyle:Code
17713 \begin_layout Plain Layout
17720 \begin_inset Flex CharStyle:Code
17723 \begin_layout Plain Layout
17729 ] The tag to be used for the main label, replacing
17730 \begin_inset Flex CharStyle:Code
17733 \begin_layout Plain Layout
17739 in the examples above.
17740 The default depends upon the setting of
17741 \begin_inset Flex CharStyle:Code
17744 \begin_layout Plain Layout
17751 \begin_inset Flex CharStyle:Code
17754 \begin_layout Plain Layout
17760 is true, the default is
17761 \begin_inset Flex CharStyle:Code
17764 \begin_layout Plain Layout
17770 ; if it is false, the default is
17771 \begin_inset Flex CharStyle:Code
17774 \begin_layout Plain Layout
17783 \begin_layout Subsection
17787 \begin_layout Standard
17788 The XHTML output for floats too can be controlled by layout information.
17789 The output has the following form:
17792 \begin_layout LyX-Code
17794 \begin_inset Quotes erd
17798 \begin_inset Quotes erd
17804 \begin_layout LyX-Code
17805 Contents of the float.
17808 \begin_layout LyX-Code
17812 \begin_layout Standard
17813 The caption, if there is one, is a separate inset and will be output as
17815 Its appearance can be controlled via the InsetLayout for caption insets.
17819 \begin_layout Description
17820 \begin_inset Flex CharStyle:Code
17823 \begin_layout Plain Layout
17830 \begin_inset Flex CharStyle:Code
17833 \begin_layout Plain Layout
17839 ] Specifies attribute information to be output with the main tag.
17841 \begin_inset Quotes eld
17845 \begin_inset Flex CharStyle:Code
17848 \begin_layout Plain Layout
17849 class=`myfloat' onclick=`\SpecialChar \ldots{}
17856 \begin_inset Quotes erd
17860 By default, LyX will output
17861 \begin_inset Quotes eld
17865 \begin_inset Flex CharStyle:Code
17868 \begin_layout Plain Layout
17869 class=`float float-floattype'
17875 \begin_inset Quotes erd
17879 \begin_inset Flex CharStyle:Code
17882 \begin_layout Plain Layout
17888 is LyX's name for this type of float, as determined by the float delcaration
17890 \begin_inset CommandInset ref
17892 reference "sub:Floats"
17896 ), though made lowercase and with non-alphanumeric characters converted
17897 to underscores, for example: float-table.
17900 \begin_layout Description
17901 \begin_inset Flex CharStyle:Code
17904 \begin_layout Plain Layout
17910 CSS style information to be included when this float is used.
17911 Note that this will automatically be wrapped in a layout-generated
17912 \begin_inset Flex CharStyle:Code
17915 \begin_layout Plain Layout
17921 block, so only the CSS itself need be included.
17924 \begin_layout Description
17925 \begin_inset Flex CharStyle:Code
17928 \begin_layout Plain Layout
17935 \begin_inset Flex CharStyle:Code
17938 \begin_layout Plain Layout
17944 ] The tag to be used for this float, replacing
17945 \begin_inset Quotes eld
17949 \begin_inset Flex CharStyle:Code
17952 \begin_layout Plain Layout
17959 \begin_inset Quotes erd
17962 in the example above.
17964 \begin_inset Flex CharStyle:Code
17967 \begin_layout Plain Layout
17973 and will rarely need changing.
17976 \begin_layout Subsection
17977 Bibliography formatting
17980 \begin_layout Standard
17981 The bibliography can be formatted using
17982 \begin_inset Flex CharStyle:Code
17985 \begin_layout Plain Layout
17993 \begin_inset CommandInset ref
17995 reference "sub:Citation-format-description"
18002 \begin_layout Subsection
18006 \begin_layout Standard
18007 We have several times mentioned that LyX will generate default CSS style
18008 rules for both insets and paragraph styles, based upon the other layout
18009 information that is provided.
18010 In this section, we shall say a word about which layout information LyX
18014 \begin_layout Standard
18015 At present, LyX auto-generates CSS only for font information, making use
18017 \begin_inset Flex CharStyle:Code
18020 \begin_layout Plain Layout
18027 \begin_inset Flex CharStyle:Code
18030 \begin_layout Plain Layout
18037 \begin_inset Flex CharStyle:Code
18040 \begin_layout Plain Layout
18047 \begin_inset Flex CharStyle:Code
18050 \begin_layout Plain Layout
18057 \begin_inset Flex CharStyle:Code
18060 \begin_layout Plain Layout
18068 \begin_inset CommandInset ref
18070 reference "sub:Font-description"
18074 .) The translation is mostly straightforward and obvious.
18076 \begin_inset Quotes eld
18080 \begin_inset Flex CharStyle:Code
18083 \begin_layout Plain Layout
18090 \begin_inset Quotes erd
18094 \begin_inset Quotes eld
18098 \begin_inset Flex CharStyle:Code
18101 \begin_layout Plain Layout
18102 font-family: sans-serif;
18108 \begin_inset Quotes erd
18112 The correspondence of LyX sizes and CSS sizes is a little less obvious
18113 but nonetheless intuitive.
18115 \begin_inset Flex CharStyle:Code
18118 \begin_layout Plain Layout
18125 \begin_inset Flex URL
18128 \begin_layout Plain Layout
18139 \begin_layout Chapter
18140 Including External Material
18143 \begin_layout Standard
18144 \begin_inset Box Shadowbox
18154 height_special "totalheight"
18157 \begin_layout Plain Layout
18158 WARNING: This portion of the documentation has not been updated for some
18160 We certainly hope that it is still accurate, but there are no guarantees.
18168 \begin_layout Standard
18169 The use of material from sources external to LyX is covered in detail in
18175 This part of the manual covers what needs to happen behind the scenes for
18176 new sorts of material to be included.
18179 \begin_layout Section
18183 \begin_layout Standard
18184 The external material feature is based on the concept of a
18189 A template is a specification of how LyX should interface with a certain
18191 As bundled, LyX comes with predefined templates for Xfig figures, various
18192 raster format images, chess diagrams, and LilyPond music notation.
18193 You can check the actual list by using the menu
18194 \begin_inset Flex CharStyle:MenuItem
18197 \begin_layout Plain Layout
18198 Insert\SpecialChar \menuseparator
18199 File\SpecialChar \menuseparator
18206 Furthermore, it is possible to roll your own template to support a specific
18208 Later we'll describe in more detail what is involved, and hopefully you
18209 will submit all the templates you create so we can include them in a later
18213 \begin_layout Standard
18214 Another basic idea of the external material feature is to distinguish between
18215 the original file that serves as a base for final material and the produced
18216 file that is included in your exported or printed document.
18217 For example, consider the case of a figure produced with
18218 \begin_inset Flex CharStyle:Code
18221 \begin_layout Plain Layout
18228 The Xfig application itself works on an original file with the
18229 \begin_inset Flex CharStyle:Code
18232 \begin_layout Plain Layout
18239 Within Xfig, you create and change your figure, and when you are done,
18241 \begin_inset Flex CharStyle:Code
18244 \begin_layout Plain Layout
18251 When you want to include the figure in your document, you invoke
18252 \begin_inset Flex CharStyle:Code
18255 \begin_layout Plain Layout
18261 in order to create a PostScript file that can readily be included in your
18264 \begin_inset Flex CharStyle:Code
18267 \begin_layout Plain Layout
18273 file is the original file, and the PostScript file is the produced file.
18276 \begin_layout Standard
18277 This distinction is important in order to allow updating of the material
18278 while you are in the process of writing the document.
18279 Furthermore, it provides us with the flexibility that is needed to support
18280 multiple export formats.
18281 For instance, in the case of a plain text file, it is not exactly an award-winn
18282 ing idea to include the figure as raw PostScript.
18283 Instead, you'd either prefer to just include a reference to the figure
18284 or try to invoke some graphics to ASCII converter to make the final result
18285 look similar to the real graphics.
18286 The external material management allows you to do this, because it is parametri
18287 zed on the different export formats that LyX supports.
18290 \begin_layout Standard
18291 Besides supporting the production of different products according to the
18292 exported format, it supports tight integration with editing and viewing
18294 In the case of an Xfig figure, you are able to invoke Xfig on the original
18295 file with a single click from within the external material dialog in LyX,
18296 and also preview the produced PostScript file with Ghostview with another
18298 No more fiddling around with the command line and/or file browsers to locate
18299 and manipulate the original or produced files.
18300 In this way, you are finally able to take full advantage of the many different
18301 applications that are relevant to use when you write your documents, and
18302 ultimately be more productive.
18305 \begin_layout Section
18306 The external template configuration file
18309 \begin_layout Standard
18310 It is relatively easy to add custom external template definitions to LyX.
18311 However, be aware that doing this in an careless manner most probably
18315 introduce an easily exploitable security hole.
18316 So before you do this, please read the discussion about security in section
18318 \begin_inset CommandInset ref
18320 reference "sec:Security-discussion"
18327 \begin_layout Standard
18328 Having said that, we encourage you to submit any interesting templates that
18333 \begin_layout Standard
18334 The external templates are defined in the
18335 \begin_inset Flex CharStyle:Code
18338 \begin_layout Plain Layout
18339 LyXDir/lib/external_templates
18345 You can place your own version in
18346 \begin_inset Flex CharStyle:Code
18349 \begin_layout Plain Layout
18350 UserDir/external_templates
18358 \begin_layout Standard
18359 A typical template looks like this:
18362 \begin_layout LyX-Code
18366 \begin_layout LyX-Code
18367 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
18370 \begin_layout LyX-Code
18374 \begin_layout LyX-Code
18378 \begin_layout LyX-Code
18382 \begin_layout LyX-Code
18386 \begin_layout LyX-Code
18390 \begin_layout LyX-Code
18391 AutomaticProduction true
18394 \begin_layout LyX-Code
18398 \begin_layout LyX-Code
18402 \begin_layout LyX-Code
18406 \begin_layout LyX-Code
18407 TransformCommand Rotate RotationLatexCommand
18410 \begin_layout LyX-Code
18411 TransformCommand Resize ResizeLatexCommand
18414 \begin_layout LyX-Code
18415 Product "$$RotateFront$$ResizeFront
18418 \begin_layout LyX-Code
18423 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
18426 \begin_layout LyX-Code
18427 $$ResizeBack$$RotateBack"
18430 \begin_layout LyX-Code
18434 \begin_layout LyX-Code
18435 UpdateResult "$$AbsPath$$Basename.pstex_t"
18438 \begin_layout LyX-Code
18439 Requirement "graphicx"
18442 \begin_layout LyX-Code
18443 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
18446 \begin_layout LyX-Code
18447 ReferencedFile latex "$$AbsPath$$Basename.eps"
18450 \begin_layout LyX-Code
18451 ReferencedFile dvi "$$AbsPath$$Basename.eps"
18454 \begin_layout LyX-Code
18458 \begin_layout LyX-Code
18462 \begin_layout LyX-Code
18463 TransformCommand Rotate RotationLatexCommand
18466 \begin_layout LyX-Code
18467 TransformCommand Resize ResizeLatexCommand
18470 \begin_layout LyX-Code
18471 Product "$$RotateFront$$ResizeFront
18474 \begin_layout LyX-Code
18479 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
18482 \begin_layout LyX-Code
18483 $$ResizeBack$$RotateBack"
18486 \begin_layout LyX-Code
18487 UpdateFormat pdftex
18490 \begin_layout LyX-Code
18491 UpdateResult "$$AbsPath$$Basename.pdftex_t"
18494 \begin_layout LyX-Code
18495 Requirement "graphicx"
18498 \begin_layout LyX-Code
18499 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
18502 \begin_layout LyX-Code
18503 ReferencedFile latex "$$AbsPath$$Basename.pdf"
18506 \begin_layout LyX-Code
18510 \begin_layout LyX-Code
18514 \begin_layout LyX-Code
18515 Product "$$Contents(
18517 "$$AbsPath$$Basename.asc
18522 \begin_layout LyX-Code
18523 UpdateFormat asciixfig
18526 \begin_layout LyX-Code
18527 UpdateResult "$$AbsPath$$Basename.asc"
18530 \begin_layout LyX-Code
18534 \begin_layout LyX-Code
18538 \begin_layout LyX-Code
18539 Product "<graphic fileref=
18541 "$$AbsOrRelPathMaster$$Basename.eps
18546 \begin_layout LyX-Code
18550 \begin_layout LyX-Code
18554 \begin_layout LyX-Code
18555 UpdateResult "$$AbsPath$$Basename.eps"
18558 \begin_layout LyX-Code
18559 ReferencedFile docbook "$$AbsPath$$Basename.eps"
18562 \begin_layout LyX-Code
18563 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
18566 \begin_layout LyX-Code
18570 \begin_layout LyX-Code
18571 Product "[XFig: $$FName]"
18574 \begin_layout LyX-Code
18578 \begin_layout LyX-Code
18582 \begin_layout Standard
18583 As you can see, the template is enclosed in
18584 \begin_inset Flex CharStyle:Code
18587 \begin_layout Plain Layout
18593 \SpecialChar \ldots{}
18595 \begin_inset Flex CharStyle:Code
18598 \begin_layout Plain Layout
18605 It contains a header specifying some general settings and, for each supported
18606 primary document file format, a section
18607 \begin_inset Flex CharStyle:Code
18610 \begin_layout Plain Layout
18616 \SpecialChar \ldots{}
18618 \begin_inset Flex CharStyle:Code
18621 \begin_layout Plain Layout
18630 \begin_layout Subsection
18631 The template header
18634 \begin_layout Description
18635 \begin_inset Flex CharStyle:Code
18638 \begin_layout Plain Layout
18639 AutomaticProduction
18640 \begin_inset space ~
18648 Whether the file represented by the template must be generated by LyX.
18649 This command must occur exactly once.
18652 \begin_layout Description
18653 \begin_inset Flex CharStyle:Code
18656 \begin_layout Plain Layout
18658 \begin_inset space ~
18666 A glob pattern that is used in the file dialog to filter out the desired
18668 If there is more than one possible file extension (e.
18669 \begin_inset space \thinspace{}
18673 \begin_inset space \space{}
18677 \begin_inset Flex CharStyle:Code
18680 \begin_layout Plain Layout
18687 \begin_inset Flex CharStyle:Code
18690 \begin_layout Plain Layout
18696 ), use something like
18697 \begin_inset Flex CharStyle:Code
18700 \begin_layout Plain Layout
18707 This command must occur exactly once.
18710 \begin_layout Description
18711 \begin_inset Flex CharStyle:Code
18714 \begin_layout Plain Layout
18716 \begin_inset space ~
18724 The text that is displayed on the button.
18725 This command must occur exactly once.
18728 \begin_layout Description
18729 \begin_inset Flex CharStyle:Code
18732 \begin_layout Plain Layout
18734 \begin_inset space ~
18738 \begin_inset space ~
18746 The help text that is used in the External dialog.
18747 Provide enough information to explain to the user just what the template
18748 can provide him with.
18749 This command must occur exactly once.
18752 \begin_layout Description
18753 \begin_inset Flex CharStyle:Code
18756 \begin_layout Plain Layout
18758 \begin_inset space ~
18766 The file format of the original file.
18767 This must be the name of a format that is known to LyX (see section
18768 \begin_inset CommandInset ref
18770 reference "sec:Formats"
18776 \begin_inset Quotes eld
18780 \begin_inset Flex CharStyle:Code
18783 \begin_layout Plain Layout
18790 \begin_inset Quotes erd
18793 if the template can handle original files of more than one format.
18794 LyX will attempt to interrogate the file itself in order to deduce its
18795 format in this case.
18796 This command must occur exactly once.
18799 \begin_layout Description
18800 \begin_inset Flex CharStyle:Code
18803 \begin_layout Plain Layout
18805 \begin_inset space ~
18813 A unique name for the template.
18814 It must not contain substitution macros (see below).
18817 \begin_layout Description
18818 \begin_inset Flex CharStyle:Code
18821 \begin_layout Plain Layout
18823 \begin_inset space ~
18826 Rotate|Resize|Clip|Extra
18831 This command specifies which transformations are supported by this template.
18832 It may occur zero or more times.
18833 This command enables the corresponding tabs in the external dialog.
18835 \begin_inset Flex CharStyle:Code
18838 \begin_layout Plain Layout
18844 command must have either a corresponding
18845 \begin_inset Flex CharStyle:Code
18848 \begin_layout Plain Layout
18855 \begin_inset Flex CharStyle:Code
18858 \begin_layout Plain Layout
18865 \begin_inset Flex CharStyle:Code
18868 \begin_layout Plain Layout
18875 Otherwise the transformation will not be supported by that format.
18878 \begin_layout Subsection
18882 \begin_layout Description
18883 \begin_inset Flex CharStyle:Code
18886 \begin_layout Plain Layout
18888 \begin_inset space ~
18891 LaTeX|PDFLaTeX|PlainText|DocBook
18896 The primary document file format that this format definition is for.
18897 Not every template has a sensible representation in all document file formats.
18898 Please define nevertheless a
18899 \begin_inset Flex CharStyle:Code
18902 \begin_layout Plain Layout
18908 section for all formats.
18909 Use a dummy text when no representation is available.
18910 Then you can at least see a reference to the external material in the exported
18914 \begin_layout Description
18915 \begin_inset Flex CharStyle:Code
18918 \begin_layout Plain Layout
18920 \begin_inset space ~
18924 \begin_inset space ~
18932 This command defines an additional macro
18933 \begin_inset Flex CharStyle:Code
18936 \begin_layout Plain Layout
18942 for substitution in
18943 \begin_inset Flex CharStyle:Code
18946 \begin_layout Plain Layout
18954 \begin_inset Flex CharStyle:Code
18957 \begin_layout Plain Layout
18963 itself may contain substitution macros.
18964 The advantage over using
18965 \begin_inset Flex CharStyle:Code
18968 \begin_layout Plain Layout
18975 \begin_inset Flex CharStyle:Code
18978 \begin_layout Plain Layout
18984 is that the substituted value of
18985 \begin_inset Flex CharStyle:Code
18988 \begin_layout Plain Layout
18994 is sanitized so that it is a valid optional argument in the document format.
18995 This command may occur zero or more times.
18998 \begin_layout Description
18999 \begin_inset Flex CharStyle:Code
19002 \begin_layout Plain Layout
19004 \begin_inset space ~
19012 The text that is inserted in the exported document.
19013 This is actually the most important command and can be quite complex.
19014 This command must occur exactly once.
19017 \begin_layout Description
19018 \begin_inset Flex CharStyle:Code
19021 \begin_layout Plain Layout
19023 \begin_inset space ~
19031 This command specifies a preamble snippet that will be included in the
19033 It has to be defined using
19034 \begin_inset Flex CharStyle:Code
19037 \begin_layout Plain Layout
19043 \SpecialChar \ldots{}
19045 \begin_inset Flex CharStyle:Code
19048 \begin_layout Plain Layout
19055 This command may occur zero or more times.
19058 \begin_layout Description
19059 \begin_inset Flex CharStyle:Code
19062 \begin_layout Plain Layout
19064 \begin_inset space ~
19068 \begin_inset space ~
19076 This command denotes files that are created by the conversion process and
19077 are needed for a particular export format.
19078 If the filename is relative, it is interpreted relative to the master document.
19079 This command may be given zero or more times.
19082 \begin_layout Description
19083 \begin_inset Flex CharStyle:Code
19086 \begin_layout Plain Layout
19088 \begin_inset space ~
19096 The name of a required LaTeX package.
19097 The package is included via
19098 \begin_inset Flex CharStyle:Code
19101 \begin_layout Plain Layout
19109 in the LaTeX preamble.
19110 This command may occur zero or more times.
19113 \begin_layout Description
19114 \begin_inset Flex CharStyle:Code
19117 \begin_layout Plain Layout
19119 \begin_inset space ~
19123 \begin_inset space ~
19126 RotationLatexCommand
19131 This command specifies that the built in LaTeX command should be used for
19133 This command may occur once or not at all.
19136 \begin_layout Description
19137 \begin_inset Flex CharStyle:Code
19140 \begin_layout Plain Layout
19142 \begin_inset space ~
19146 \begin_inset space ~
19154 This command specifies that the built in LaTeX command should be used for
19156 This command may occur once or not at all.
19159 \begin_layout Description
19160 \begin_inset Flex CharStyle:Code
19163 \begin_layout Plain Layout
19165 \begin_inset space ~
19169 \begin_inset space ~
19172 RotationLatexOption
19177 This command specifies that rotation is done via an optional argument.
19178 This command may occur once or not at all.
19181 \begin_layout Description
19182 \begin_inset Flex CharStyle:Code
19185 \begin_layout Plain Layout
19187 \begin_inset space ~
19191 \begin_inset space ~
19199 This command specifies that resizing is done via an optional argument.
19200 This command may occur once or not at all.
19203 \begin_layout Description
19204 \begin_inset Flex CharStyle:Code
19207 \begin_layout Plain Layout
19209 \begin_inset space ~
19213 \begin_inset space ~
19221 This command specifies that clipping is done via an optional argument.
19222 This command may occur once or not at all.
19225 \begin_layout Description
19226 \begin_inset Flex CharStyle:Code
19229 \begin_layout Plain Layout
19231 \begin_inset space ~
19235 \begin_inset space ~
19243 This command specifies that an extra optional argument is used.
19244 This command may occur once or not at all.
19247 \begin_layout Description
19248 \begin_inset Flex CharStyle:Code
19251 \begin_layout Plain Layout
19253 \begin_inset space ~
19261 The file format of the converted file.
19262 This must be the name of a format that is known to LyX (see the
19263 \begin_inset Flex CharStyle:MenuItem
19266 \begin_layout Plain Layout
19271 ools\SpecialChar \menuseparator
19276 references:Conversion
19282 This command must occur exactly once.
19285 \begin_layout Description
19286 \begin_inset Flex CharStyle:Code
19289 \begin_layout Plain Layout
19291 \begin_inset space ~
19299 The file name of the converted file.
19300 The file name must be absolute.
19301 This command must occur exactly once.
19304 \begin_layout Subsection
19305 Preamble definitions
19308 \begin_layout Standard
19309 The external template configuration file may contain additional preamble
19310 definitions enclosed by
19311 \begin_inset Flex CharStyle:Code
19314 \begin_layout Plain Layout
19320 \SpecialChar \ldots{}
19322 \begin_inset Flex CharStyle:Code
19325 \begin_layout Plain Layout
19332 They can be used by the templates in the
19333 \begin_inset Flex CharStyle:Code
19336 \begin_layout Plain Layout
19345 \begin_layout Section
19346 The substitution mechanism
19349 \begin_layout Standard
19350 When the external material facility invokes an external program, it is done
19351 on the basis of a command defined in the template configuration file.
19352 These commands can contain various macros that are expanded before execution.
19353 Execution always take place in the directory of the containing document.
19356 \begin_layout Standard
19357 Also, whenever external material is to be displayed, the name will be produced
19358 by the substitution mechanism, and most other commands in the template
19359 definition support substitution as well.
19362 \begin_layout Standard
19363 The available macros are the following:
19366 \begin_layout Description
19367 \begin_inset Flex CharStyle:Code
19370 \begin_layout Plain Layout
19371 $$AbsOrRelPathMaster
19376 The file path, absolute or relative to the master LyX document.
19379 \begin_layout Description
19380 \begin_inset Flex CharStyle:Code
19383 \begin_layout Plain Layout
19384 $$AbsOrRelPathParent
19389 The file path, absolute or relative to the LyX document.
19392 \begin_layout Description
19393 \begin_inset Flex CharStyle:Code
19396 \begin_layout Plain Layout
19402 The absolute file path.
19405 \begin_layout Description
19406 \begin_inset Flex CharStyle:Code
19409 \begin_layout Plain Layout
19415 The filename without path and without the extension.
19418 \begin_layout Description
19419 \begin_inset Flex CharStyle:Code
19422 \begin_layout Plain Layout
19424 \begin_inset Quotes eld
19428 \begin_inset Quotes erd
19436 This macro will expand to the contents of the file with the name
19437 \begin_inset Flex CharStyle:Code
19440 \begin_layout Plain Layout
19449 \begin_layout Description
19450 \begin_inset Flex CharStyle:Code
19453 \begin_layout Plain Layout
19459 The file extension (including the dot).
19462 \begin_layout Description
19463 \begin_inset Flex CharStyle:Code
19466 \begin_layout Plain Layout
19472 The filename of the file specified in the external material dialog.
19473 This is either an absolute name, or it is relative to the LyX document.
19476 \begin_layout Description
19477 \begin_inset Flex CharStyle:Code
19480 \begin_layout Plain Layout
19487 \begin_inset Flex CharStyle:Code
19490 \begin_layout Plain Layout
19496 (absolute name or relative to the LyX document).
19499 \begin_layout Description
19500 \begin_inset Flex CharStyle:Code
19503 \begin_layout Plain Layout
19509 The file path, relative to the master LyX document.
19512 \begin_layout Description
19513 \begin_inset Flex CharStyle:Code
19516 \begin_layout Plain Layout
19522 The file path, relative to the LyX document.
19525 \begin_layout Description
19526 \begin_inset Flex CharStyle:Code
19529 \begin_layout Plain Layout
19535 This macro will expand to the absolute path of the system directory.
19536 This is typically used to point to the various helper scripts that are
19540 \begin_layout Description
19541 \begin_inset Flex CharStyle:Code
19544 \begin_layout Plain Layout
19550 A name and full path to a temporary file which will be automatically deleted
19551 whenever the containing document is closed, or the external material insertion
19555 \begin_layout Standard
19556 All path macros contain a trailing directory separator, so you can construct
19558 \begin_inset space \thinspace{}
19562 \begin_inset space \space{}
19565 the absolute filename with
19566 \begin_inset Flex CharStyle:Code
19569 \begin_layout Plain Layout
19570 $$AbsPath$$Basename$$Extension
19578 \begin_layout Standard
19579 The macros above are substituted in all commands unless otherwise noted.
19581 \begin_inset Flex CharStyle:Code
19584 \begin_layout Plain Layout
19590 supports additionally the following substitutions if they are enabled by
19592 \begin_inset Flex CharStyle:Code
19595 \begin_layout Plain Layout
19602 \begin_inset Flex CharStyle:Code
19605 \begin_layout Plain Layout
19614 \begin_layout Description
19615 \begin_inset Flex CharStyle:Code
19618 \begin_layout Plain Layout
19624 The front part of the resize command.
19627 \begin_layout Description
19628 \begin_inset Flex CharStyle:Code
19631 \begin_layout Plain Layout
19637 The back part of the resize command.
19640 \begin_layout Description
19641 \begin_inset Flex CharStyle:Code
19644 \begin_layout Plain Layout
19650 The front part of the rotation command.
19653 \begin_layout Description
19654 \begin_inset Flex CharStyle:Code
19657 \begin_layout Plain Layout
19663 The back part of the rotation command.
19666 \begin_layout Standard
19667 The value string of the
19668 \begin_inset Flex CharStyle:Code
19671 \begin_layout Plain Layout
19677 command supports additionally the following substitutions if they are enabled
19679 \begin_inset Flex CharStyle:Code
19682 \begin_layout Plain Layout
19689 \begin_inset Flex CharStyle:Code
19692 \begin_layout Plain Layout
19701 \begin_layout Description
19702 \begin_inset Flex CharStyle:Code
19705 \begin_layout Plain Layout
19714 \begin_layout Description
19715 \begin_inset Flex CharStyle:Code
19718 \begin_layout Plain Layout
19727 \begin_layout Description
19728 \begin_inset Flex CharStyle:Code
19731 \begin_layout Plain Layout
19740 \begin_layout Description
19741 \begin_inset Flex CharStyle:Code
19744 \begin_layout Plain Layout
19750 The rotation option.
19753 \begin_layout Standard
19754 You may ask why there are so many path macros.
19755 There are mainly two reasons:
19758 \begin_layout Enumerate
19759 Relative and absolute file names should remain relative or absolute, respectivel
19761 Users may have reasons to prefer either form.
19762 Relative names are useful for portable documents that should work on different
19763 machines, for example.
19764 Absolute names may be required by some programs.
19767 \begin_layout Enumerate
19768 LaTeX treats relative file names differently than LyX and other programs
19769 in nested included files.
19770 For LyX, a relative file name is always relative to the document that contains
19772 For LaTeX, it is always relative to the master document.
19773 These two definitions are identical if you have only one document, but
19774 differ if you have a master document that includes part documents.
19775 That means that relative filenames must be transformed when presented to
19777 Fortunately LyX does this automatically for you if you choose the right
19781 \begin_layout Standard
19782 So which path macro should be used in new template definitions? The rule
19786 \begin_layout Itemize
19788 \begin_inset Flex CharStyle:Code
19791 \begin_layout Plain Layout
19797 if an absolute path is required.
19800 \begin_layout Itemize
19802 \begin_inset Flex CharStyle:Code
19805 \begin_layout Plain Layout
19806 $$AbsOrRelPathMaster
19811 if the substituted string is some kind of LaTeX input.
19814 \begin_layout Itemize
19816 \begin_inset Flex CharStyle:Code
19819 \begin_layout Plain Layout
19820 $$AbsOrRelPathParent
19825 in order to preserve the user's choice.
19828 \begin_layout Standard
19829 There are special cases where this rule does not work and e.
19830 \begin_inset space \thinspace{}
19834 \begin_inset space \space{}
19837 relative names are needed, but normally it will work just fine.
19838 One example for such a case is the command
19839 \begin_inset Flex CharStyle:Code
19842 \begin_layout Plain Layout
19843 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
19848 in the XFig template above: We can't use the absolute name because the
19850 \begin_inset Flex CharStyle:Code
19853 \begin_layout Plain Layout
19859 files needs the relative name in order to rewrite the file content.
19862 \begin_layout Section
19863 Security discussion
19864 \begin_inset CommandInset label
19866 name "sec:Security-discussion"
19873 \begin_layout Standard
19874 The external material feature interfaces with a lot of external programs
19875 and does so automatically, so we have to consider the security implications
19877 In particular, since you have the option of including your own filenames
19878 and/or parameter strings and those are expanded into a command, it seems
19879 that it would be possible to create a malicious document which executes
19880 arbitrary commands when a user views or prints the document.
19881 This is something we definitely want to avoid.
19884 \begin_layout Standard
19885 However, since the external program commands are specified in the template
19886 configuration file only, there are no security issues if LyX is properly
19887 configured with safe templates only.
19888 This is so because the external programs are invoked with the
19889 \begin_inset Flex CharStyle:Code
19892 \begin_layout Plain Layout
19898 -system call rather than the
19899 \begin_inset Flex CharStyle:Code
19902 \begin_layout Plain Layout
19908 system-call, so it's not possible to execute arbitrary commands from the
19909 filename or parameter section via the shell.
19912 \begin_layout Standard
19913 This also implies that you are restricted in what command strings you can
19914 use in the external material templates.
19915 In particular, pipes and redirection are not readily available.
19916 This has to be so if LyX should remain safe.
19917 If you want to use some of the shell features, you should write a safe
19918 script to do this in a controlled manner, and then invoke the script from
19919 the command string.
19923 \begin_layout Standard
19924 It is possible to design a template that interacts directly with the shell,
19925 but since this would allow a malicious user to execute arbitrary commands
19926 by writing clever filenames and/or parameters, we generally recommend that
19927 you only use safe scripts that work with the
19928 \begin_inset Flex CharStyle:Code
19931 \begin_layout Plain Layout
19937 system call in a controlled manner.
19938 Of course, for use in a controlled environment, it can be tempting to just
19939 fall back to use ordinary shell scripts.
19940 If you do so, be aware that you
19944 provide an easily exploitable security hole in your system.
19945 Of course it stands to reason that such unsafe templates will never be
19946 included in the standard LyX distribution, although we do encourage people
19947 to submit new templates in the open source tradition.
19948 But LyX as shipped from the official distribution channels will never have
19952 \begin_layout Standard
19953 Including external material provides a lot of power, and you have to be
19954 careful not to introduce security hazards with this power.
19955 A subtle error in a single line in an innocent looking script can open
19956 the door to huge security problems.
19957 So if you do not fully understand the issues, we recommend that you consult
19958 a knowledgeable security professional or the LyX development team if you
19959 have any questions about whether a given template is safe or not.
19960 And do this before you use it in an uncontrolled environment.