1 #LyX 2.0.0svn created this file. For more info see http://www.lyx.org/
7 % DO NOT ALTER THIS PREAMBLE!!!
9 % This preamble is designed to ensure that this document prints
10 % out as advertised. If you mess with this preamble,
11 % parts of this document may not print out as expected. If you
12 % have problems LaTeXing this file, please contact
13 % the documentation team
14 % email: lyx-docs@lists.lyx.org
16 \usepackage{ifpdf} % part of the hyperref bundle
17 \ifpdf % if pdflatex is used
19 % set fonts for nicer pdf view
20 \IfFileExists{lmodern.sty}
21 {\usepackage{lmodern}}{}
23 \fi % end if pdflatex is used
25 % the pages of the TOC is numbered roman
26 % and a pdf-bookmark for the TOC is added
27 \let\myTOC\tableofcontents
28 \renewcommand\tableofcontents{%
30 \pdfbookmark[1]{\contentsname}{}
34 % redefine the \LyX macro for PDF bookmarks
35 \def\LyX{\texorpdfstring{%
36 L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
39 % used for multi-column text
43 \options fleqn,liststotoc,bibtotoc,idxtotoc,BCOR7.5mm,titlepage,tablecaptionabove
44 \use_default_options false
48 \maintain_unincluded_children false
51 InsetLayout CharStyle:MenuItem
60 \newcommand*{\menuitem}[1]{{\sffamily #1}}
69 \font_typewriter default
70 \font_default_family default
78 \default_output_format default
80 \bibtex_command default
81 \index_command default
85 \pdf_title "LyX Configuration Manual"
86 \pdf_author "LyX Team"
87 \pdf_subject "LyX-documentation Customization"
88 \pdf_keywords "LyX, documentation, customization"
90 \pdf_bookmarksnumbered true
91 \pdf_bookmarksopen true
92 \pdf_bookmarksopenlevel 1
97 \pdf_pdfusetitle false
98 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true,pdfstartview=XYZ, plainpages=false, pdfpagelabels"
108 \paperorientation portrait
121 \paragraph_separation indent
122 \paragraph_indentation default
123 \quotes_language english
126 \paperpagestyle headings
127 \tracking_changes false
128 \output_changes false
136 Customizing LyX: Features for the Advanced User
144 \begin_layout Plain Layout
146 If you have comments or error corrections, please send them to the LyX Documenta
148 \begin_inset CommandInset href
150 target "lyx-docs@lists.lyx.org"
157 \begin_inset Quotes eld
161 \begin_inset Quotes erd
164 in the subject header, and please cc the current maintainer of this file,
165 Richard Heck <rgheck@comcast.net>.
171 \begin_inset Newline newline
175 \begin_inset Newline newline
181 \begin_layout Standard
182 \begin_inset CommandInset toc
183 LatexCommand tableofcontents
190 \begin_layout Standard
191 \begin_inset Note Note
194 \begin_layout Plain Layout
195 Please use change tracking when modifying this document.
196 This makes it easier for our translators to recognize things that have
197 been changed, and it helps the maintainer keep up-to-date with what's been
206 \begin_layout Chapter
210 \begin_layout Standard
211 This manual covers the customization features present in LyX.
212 In it, we discuss issues like keyboard shortcuts, screen previewing options,
213 printer options, sending commands to LyX via the LyX Server, internationalizati
214 on, installing new LaTeX classes and LyX layouts, etc.
215 We can't possibly hope to touch on everything you can change—our developers
216 add new features faster than we can document them—but we will explain the
217 most common customizations and hopefully point you in the right direction
218 for some of the more obscure ones.
221 \begin_layout Standard
222 \begin_inset Branch OutDated
225 \begin_layout Standard
226 Information from previous versions of this document that now seems to be
227 outdated is contained in the OutDated branch of this document.
228 By default, this information will not appear in the LaTeX output.
236 \begin_layout Chapter
237 LyX configuration files
240 \begin_layout Standard
241 This chapter aims to help you to find your way through the LyX configuration
243 Before continuing to read this chapter, you should find out where your
244 LyX library and user directories are by using
245 \begin_inset Flex CharStyle:MenuItem
248 \begin_layout Plain Layout
249 Help\SpecialChar \menuseparator
260 The library directory is the place where LyX places its system-wide configurati
261 on files; the user directory is where you can place your modified versions.
262 We will call the former
263 \begin_inset Flex CharStyle:Code
266 \begin_layout Plain Layout
273 \begin_inset Flex CharStyle:MenuItem
276 \begin_layout Plain Layout
282 in the remainder of this document.
286 \begin_layout Section
288 \begin_inset Flex CharStyle:Code
291 \begin_layout Plain Layout
300 \begin_layout Standard
301 \begin_inset Flex CharStyle:Code
304 \begin_layout Plain Layout
310 and its sub-directories contain a number of files and that can be used
311 to customize LyX's behavior.
312 You can change many of these files from within LyX itself through the
313 \begin_inset Flex CharStyle:MenuItem
316 \begin_layout Plain Layout
317 Tools\SpecialChar \menuseparator
324 Most customization that you will want to do in LyX is possible through
326 However, many other inner aspects of LyX can be customized by modifying
328 \begin_inset Flex CharStyle:Code
331 \begin_layout Plain Layout
338 These files fall in different categories, described in the following subsection
342 \begin_layout Subsection
343 Automatically generated files
346 \begin_layout Standard
347 The files, which are to be found in
348 \begin_inset Flex CharStyle:MenuItem
351 \begin_layout Plain Layout
357 , are generated when you configure LyX.
358 They contain various default values that are guessed by inspection.
359 In general, it is not a good idea to modify them, since they might be overwritt
363 \begin_layout Labeling
364 \labelwidthstring 00.00.0000
365 \begin_inset Flex CharStyle:Code
368 \begin_layout Plain Layout
374 contains defaults for various commands.
377 \begin_layout Labeling
378 \labelwidthstring 00.00.0000
379 \begin_inset Flex CharStyle:Code
382 \begin_layout Plain Layout
388 contains the list of packages that have been recognized by LyX.
389 It is currently unused by the LyX program itself, but the information extracted
390 , and more, is made available with
391 \begin_inset Flex CharStyle:MenuItem
394 \begin_layout Plain Layout
395 Help\SpecialChar \menuseparator
408 \begin_layout Labeling
409 \labelwidthstring 00.00.0000
410 \begin_inset Flex CharStyle:Code
413 \begin_layout Plain Layout
419 the list of text classes that have been found in your
420 \begin_inset Flex CharStyle:Code
423 \begin_layout Plain Layout
429 directories, along with the associated LaTeX document class and their descripti
433 \begin_layout Labeling
434 \labelwidthstring 00.00.0000
435 \begin_inset Flex CharStyle:Code
438 \begin_layout Plain Layout
444 the list of layout modules found in your
445 \begin_inset Flex CharStyle:Code
448 \begin_layout Plain Layout
457 \begin_layout Labeling
458 \labelwidthstring 00.00.0000
459 \begin_inset Flex CharStyle:Code
462 \begin_layout Plain Layout
468 lists of various sorts of LaTeX-related files found on your system
471 \begin_layout Labeling
472 \labelwidthstring 00.00.0000
473 \begin_inset Flex CharStyle:Code
476 \begin_layout Plain Layout
482 is automatically generated during configuration from the file
483 \begin_inset Flex CharStyle:Code
486 \begin_layout Plain Layout
493 It contains information on your LaTeX configuration.
496 \begin_layout Subsection
500 \begin_layout Standard
501 These directories are duplicated between
502 \begin_inset Flex CharStyle:Code
505 \begin_layout Plain Layout
512 \begin_inset Flex CharStyle:Code
515 \begin_layout Plain Layout
522 If a particular files exists in both places, the one in
523 \begin_inset Flex CharStyle:Code
526 \begin_layout Plain Layout
535 \begin_layout Labeling
536 \labelwidthstring 00.00.0000
537 \begin_inset Flex CharStyle:Code
540 \begin_layout Plain Layout
546 this directory contains files with the extension
547 \begin_inset Flex CharStyle:Code
550 \begin_layout Plain Layout
556 that define the keybindings used in LyX.
557 If there exists an internationalized version of the bind file named
558 \begin_inset Flex CharStyle:Code
561 \begin_layout Plain Layout
567 , that will be used first.
570 \begin_layout Labeling
571 \labelwidthstring 00.00.0000
572 \begin_inset Flex CharStyle:Code
575 \begin_layout Plain Layout
581 contains graphics files that can be included in documents.
585 \begin_layout Labeling
586 \labelwidthstring 00.00.0000
587 \begin_inset Flex CharStyle:Code
590 \begin_layout Plain Layout
596 contains LyX documentation files (including the one you are currently reading).
598 \begin_inset Flex CharStyle:Code
601 \begin_layout Plain Layout
607 deserves special attention, as noted above.
608 The internationalized help docs are in subdirectories
609 \begin_inset Flex CharStyle:Code
612 \begin_layout Plain Layout
619 \begin_inset Quotes eld
623 \begin_inset Quotes erd
626 is the ISO language code.
632 \begin_inset CommandInset ref
634 reference "cha:Internationalizing-LyX"
641 \begin_layout Labeling
642 \labelwidthstring 00.00.0000
643 \begin_inset Flex CharStyle:Code
646 \begin_layout Plain Layout
652 contains example files that explain how to use some features.
653 In the file browser, press the
654 \begin_inset Flex CharStyle:MenuItem
657 \begin_layout Plain Layout
666 \begin_layout Labeling
667 \labelwidthstring 00.00.0000
668 \begin_inset Flex CharStyle:Code
671 \begin_layout Plain Layout
677 contains image files that are used by the
678 \begin_inset Flex CharStyle:MenuItem
681 \begin_layout Plain Layout
688 In addition, it also contains the individual icons used in the toolbar
689 and the banners that can be shown when LyX is launched.
692 \begin_layout Labeling
693 \labelwidthstring 00.00.0000
694 \begin_inset Flex CharStyle:Code
697 \begin_layout Plain Layout
703 contains keyboard keymapping files.
709 \begin_inset CommandInset ref
711 reference "sec:International-Keymap-Stuff"
718 \begin_layout Labeling
719 \labelwidthstring 00.00.0000
720 \begin_inset Flex CharStyle:Code
723 \begin_layout Plain Layout
729 contains the text class and module files described in Chapter
734 \begin_inset CommandInset ref
736 reference "cha:Installing-New-Document"
743 \begin_layout Labeling
744 \labelwidthstring 00.00.0000
745 \begin_inset Flex CharStyle:Code
748 \begin_layout Plain Layout
755 \begin_inset Flex CharStyle:Code
758 \begin_layout Plain Layout
764 Python scripts used to convert between LyX versions.
765 These can be run from the command line if, say, you want to batch-convert
769 \begin_layout Labeling
770 \labelwidthstring 00.00.0000
771 \begin_inset Flex CharStyle:Code
774 \begin_layout Plain Layout
780 contains some files that demonstrate the capabilities of the
781 \begin_inset Flex CharStyle:MenuItem
784 \begin_layout Plain Layout
795 Also contains some scripts used by LyX itself.
798 \begin_layout Labeling
799 \labelwidthstring 00.00.0000
800 \begin_inset Flex CharStyle:Code
803 \begin_layout Plain Layout
809 contains the standard LyX template files described in Chapter
814 \begin_inset CommandInset ref
816 reference "sub:Creating-Templates"
823 \begin_layout Labeling
824 \labelwidthstring 00.00.0000
825 \begin_inset Flex CharStyle:Code
828 \begin_layout Plain Layout
834 contains files with the extension
835 \begin_inset Flex CharStyle:Code
838 \begin_layout Plain Layout
844 that define the user interface to LyX.
845 That is, the files define which items appear in which menus and the items
846 appearing on the toolbar.
849 \begin_layout Subsection
850 Files you don't want to modify
853 \begin_layout Standard
854 These files are used internally by LyX and you generally do not need to
855 modify them unless you are a developer.
858 \begin_layout Labeling
859 \labelwidthstring 00.00.0000
860 \begin_inset Flex CharStyle:Code
863 \begin_layout Plain Layout
869 this file contains the list of LyX developers.
870 The contents are displayed with the menu entry
871 \begin_inset Flex CharStyle:MenuItem
874 \begin_layout Plain Layout
875 Help\SpecialChar \menuseparator
888 \begin_layout Labeling
889 \labelwidthstring 00.00.0000
890 \begin_inset Flex CharStyle:Code
893 \begin_layout Plain Layout
899 this is a LaTeX script used during the configuration process.
903 \begin_layout Labeling
904 \labelwidthstring 00.00.0000
905 \begin_inset Flex CharStyle:Code
908 \begin_layout Plain Layout
914 this is the script that is used to re-configure LyX.
915 It creates configuration files in the directory it was run from.
918 \begin_layout Subsection
919 Other files needing a line or two...
922 \begin_layout Labeling
923 \labelwidthstring 00.00.0000
924 \begin_inset Flex CharStyle:Code
927 \begin_layout Plain Layout
933 this contains tables describing how different character encodings can be
937 \begin_layout Labeling
938 \labelwidthstring 00.00.0000
939 \begin_inset Flex CharStyle:Code
942 \begin_layout Plain Layout
948 this file contains the templates available to the new
949 \begin_inset Flex CharStyle:MenuItem
952 \begin_layout Plain Layout
965 \begin_layout Labeling
966 \labelwidthstring 00.00.0000
967 \begin_inset Flex CharStyle:Code
970 \begin_layout Plain Layout
976 this file contains a list of all the languages currently supported by LyX.
979 \begin_layout Section
980 Your local configuration directory
983 \begin_layout Standard
984 Even if you are using LyX as an unprivileged user, you might want to change
985 LyX configuration for your own use.
987 \begin_inset Flex CharStyle:Code
990 \begin_layout Plain Layout
996 directory contains all your personal configuration files.
997 This is the directory described as
998 \begin_inset Quotes eld
1002 \begin_inset Quotes erd
1006 \begin_inset Flex CharStyle:MenuItem
1009 \begin_layout Plain Layout
1010 Help\SpecialChar \menuseparator
1012 \begin_inset space ~
1021 This directory is used as a mirror of
1022 \begin_inset Flex CharStyle:Code
1025 \begin_layout Plain Layout
1031 , which means that every file in
1032 \begin_inset Flex CharStyle:Code
1035 \begin_layout Plain Layout
1041 is a replacement for the corresponding file in
1042 \begin_inset Flex CharStyle:Code
1045 \begin_layout Plain Layout
1052 Any configuration file described in the above sections can be placed either
1053 in the system-wide directory, in which case it will affect all users, or
1054 in your local directory for your own use.
1057 \begin_layout Standard
1058 To make things clearer, let's provide a few examples:
1061 \begin_layout Itemize
1062 The preferences set in the
1063 \begin_inset Flex CharStyle:MenuItem
1066 \begin_layout Plain Layout
1067 Tools\SpecialChar \menuseparator
1073 dialog are saved to a file
1074 \begin_inset Flex CharStyle:Code
1077 \begin_layout Plain Layout
1084 \begin_inset Flex CharStyle:Code
1087 \begin_layout Plain Layout
1096 \begin_layout Itemize
1097 When you reconfigure using
1098 \begin_inset Flex CharStyle:MenuItem
1101 \begin_layout Plain Layout
1102 Tools\SpecialChar \menuseparator
1109 \begin_inset Flex CharStyle:Code
1112 \begin_layout Plain Layout
1118 script, and the resulting files are written in your local configuration
1120 This means that any additional text class file that you might have added
1122 \begin_inset Flex CharStyle:Code
1125 \begin_layout Plain Layout
1131 will be added to the list of classes in the
1132 \begin_inset Flex CharStyle:MenuItem
1135 \begin_layout Plain Layout
1136 Document\SpecialChar \menuseparator
1145 \begin_layout Itemize
1146 If you get some updated documentation from LyX ftp site and cannot install
1147 it because you do not have sysadmin rights on your system, you can just
1149 \begin_inset Flex CharStyle:Code
1152 \begin_layout Plain Layout
1158 and the items in the
1159 \begin_inset Flex CharStyle:MenuItem
1162 \begin_layout Plain Layout
1168 menu will open them!
1171 \begin_layout Section
1172 Running LyX with multiple configurations
1175 \begin_layout Standard
1176 The configuration freedom of the local configuration directory may not suffice
1177 if you want to have more than one configuration at your disposal.
1178 For example, you may want to be use different key bindings or printer settings
1180 You can achieve this by having several such directories.
1181 You then specify which directory to use at run-time.
1184 \begin_layout Standard
1185 Invoking LyX with the command line switch
1186 \begin_inset Flex CharStyle:Code
1189 \begin_layout Plain Layout
1199 instructs the program to read the configuration from that directory, and
1200 not from the default directory.
1201 (You can determine the default directory by running LyX without the
1202 \begin_inset Flex CharStyle:Code
1205 \begin_layout Plain Layout
1211 switch.) If the specified directory does not exist, LyX offers to create
1212 it for you, just like it does for the default directory on the first time
1213 you run the program.
1214 You can modify the configuration options in this additional user directory
1215 exactly as you would for the default directory.
1216 These directories are completely independent (but read on).
1217 Note that setting the environment variable
1218 \begin_inset Flex CharStyle:Code
1221 \begin_layout Plain Layout
1227 to some value has exactly the same effect.
1230 \begin_layout Standard
1231 Having several configurations also requires more maintenance: if you want
1232 to add a new layout to
1233 \begin_inset Flex CharStyle:Code
1236 \begin_layout Plain Layout
1242 which you want available from all your configurations, you must add it
1243 to each directory separately.
1244 You can avoid this with the following trick: after LyX creates the additional
1245 directory, most of the subdirectories (see above) are empty.
1246 If you want the new configuration to mirror an existing one, replace the
1247 empty subdirectory with a symbolic link to the matching subdirectory in
1248 the existing configuration.
1250 \begin_inset Flex CharStyle:Code
1253 \begin_layout Plain Layout
1259 subdirectory, however, since it contains a file written by the configuration
1260 script (also accessible through
1261 \begin_inset Flex CharStyle:MenuItem
1264 \begin_layout Plain Layout
1265 Tools\SpecialChar \menuseparator
1271 ) which is configuration-specific.
1274 \begin_layout Chapter
1275 The Preferences dialog
1278 \begin_layout Standard
1279 All options of the preferences dialog are described in the Appendix
1281 The Preferences Dialog
1288 For some options you might find here more details.
1291 \begin_layout Section
1293 \begin_inset CommandInset label
1302 \begin_layout Standard
1303 The first step is to define your file formats if they are not already defined.
1305 \begin_inset Flex CharStyle:MenuItem
1308 \begin_layout Plain Layout
1309 Tools\SpecialChar \menuseparator
1317 \begin_inset Flex CharStyle:MenuItem
1320 \begin_layout Plain Layout
1321 File Handling\SpecialChar \menuseparator
1328 \begin_inset Flex CharStyle:MenuItem
1331 \begin_layout Plain Layout
1332 New\SpecialChar \ldots{}
1338 button to define your new format.
1340 \begin_inset Flex CharStyle:MenuItem
1343 \begin_layout Plain Layout
1349 field contains the name used to identify the format in the GUI.
1351 \begin_inset Flex CharStyle:MenuItem
1354 \begin_layout Plain Layout
1360 is used to identify the format internally.
1361 You will also need to enter a file extension.
1362 These are all required.
1364 \begin_inset Flex CharStyle:MenuItem
1367 \begin_layout Plain Layout
1373 field is used to provide a keyboard shortcut on the menus.
1374 (For example, pressing
1375 \begin_inset Flex CharStyle:MenuItem
1378 \begin_layout Plain Layout
1385 \begin_inset Flex CharStyle:MenuItem
1388 \begin_layout Plain Layout
1389 View\SpecialChar \menuseparator
1398 \begin_layout Standard
1400 \begin_inset Flex CharStyle:MenuItem
1403 \begin_layout Plain Layout
1410 \begin_inset Flex CharStyle:MenuItem
1413 \begin_layout Plain Layout
1420 For example, you might want to use
1421 \begin_inset Flex CharStyle:MenuItem
1424 \begin_layout Plain Layout
1430 to view PostScript files.
1431 You can enter the command needed to start the program in the corresponding
1433 In defining this command, you can use the four variables listed in the
1435 The viewer is launched when you view an image in LyX or use the
1436 \begin_inset Flex CharStyle:MenuItem
1439 \begin_layout Plain Layout
1446 The editor is for example launched when you right-click on an image and
1448 \begin_inset Flex CharStyle:MenuItem
1451 \begin_layout Plain Layout
1457 in the appearing context menu.
1460 \begin_layout Standard
1462 \begin_inset Flex CharStyle:MenuItem
1465 \begin_layout Plain Layout
1471 option tells LyX that a format is suitable for document export.
1472 If this is set and if a suitable conversion route exists (see sec.
1473 \begin_inset space \thinspace{}
1477 \begin_inset CommandInset ref
1479 reference "sec:Converters"
1483 ), the format will appear in the
1484 \begin_inset Flex CharStyle:MenuItem
1487 \begin_layout Plain Layout
1488 File\SpecialChar \menuseparator
1495 The format will also appear in the
1496 \begin_inset Flex CharStyle:MenuItem
1499 \begin_layout Plain Layout
1505 menu if a viewer is specified for the format.
1506 Pure image formats, such as
1507 \begin_inset Flex CharStyle:Code
1510 \begin_layout Plain Layout
1516 , should not use this option.
1517 Formats that can both represent vector graphics and documents like
1518 \begin_inset Flex CharStyle:Code
1521 \begin_layout Plain Layout
1530 \begin_layout Standard
1532 \begin_inset Flex CharStyle:MenuItem
1535 \begin_layout Plain Layout
1536 Vector graphics format
1541 tells LyX that a format can contain vector graphics.
1542 This information is used to determine the target format of included graphics
1544 \begin_inset Flex CharStyle:MenuItem
1547 \begin_layout Plain Layout
1554 Included graphics may need to be converted to either
1555 \begin_inset Flex CharStyle:MenuItem
1558 \begin_layout Plain Layout
1565 \begin_inset Flex CharStyle:MenuItem
1568 \begin_layout Plain Layout
1575 \begin_inset Flex CharStyle:MenuItem
1578 \begin_layout Plain Layout
1585 \begin_inset Flex CharStyle:MenuItem
1588 \begin_layout Plain Layout
1594 cannot handle other image formats.
1595 If an included graphic is not already in
1596 \begin_inset Flex CharStyle:MenuItem
1599 \begin_layout Plain Layout
1606 \begin_inset Flex CharStyle:MenuItem
1609 \begin_layout Plain Layout
1616 \begin_inset Flex CharStyle:MenuItem
1619 \begin_layout Plain Layout
1625 format, it is converted to
1626 \begin_inset Flex CharStyle:MenuItem
1629 \begin_layout Plain Layout
1635 if the vector format option is set, and otherwise to
1636 \begin_inset Flex CharStyle:MenuItem
1639 \begin_layout Plain Layout
1648 \begin_layout Section
1652 \begin_layout Standard
1653 Since all conversions from one format to another take place in LyX's temporary
1654 directory, it is sometimes necessary to modify a file before copying it
1655 to the temporary directory in order that the conversion may be performed.
1659 \begin_layout Plain Layout
1660 For example, the file may refer to other files—images, for example—using
1661 relative file names, and these may become invalid when the file is copied
1662 to the temporary directory.
1667 This is done by a Copier: It copies a file to (or from) the temporary directory
1668 and may modify it in the process.
1671 \begin_layout Standard
1672 The definitions of the copiers may use four variables:
1675 \begin_layout Labeling
1676 \labelwidthstring 00.00.0000
1677 \begin_inset Flex CharStyle:Code
1680 \begin_layout Plain Layout
1686 The LyX system directory (e.
1687 \begin_inset space \thinspace{}
1691 \begin_inset space \space{}
1695 \begin_inset Flex CharStyle:MenuItem
1698 \begin_layout Plain Layout
1707 \begin_layout Labeling
1708 \labelwidthstring 00.00.0000
1709 \begin_inset Flex CharStyle:Code
1712 \begin_layout Plain Layout
1721 \begin_layout Labeling
1722 \labelwidthstring 00.00.0000
1723 \begin_inset Flex CharStyle:Code
1726 \begin_layout Plain Layout
1735 \begin_layout Labeling
1736 \labelwidthstring 00.00.0000
1737 \begin_inset Flex CharStyle:Code
1740 \begin_layout Plain Layout
1749 \begin_layout Standard
1750 The latter should be the filename as it would be used in a LaTeX's
1757 It is relevant only when exporting files suitable for such inclusion.
1760 \begin_layout Standard
1761 Copiers can be used to do almost anything with output files.
1762 For example, suppose you want generated pdf files to be copied to a special
1764 \begin_inset Flex CharStyle:Code
1767 \begin_layout Plain Layout
1774 Then you could write a shell script such as this one:
1777 \begin_layout Standard
1778 \begin_inset listings
1782 \begin_layout Plain Layout
1787 \begin_layout Plain Layout
1792 \begin_layout Plain Layout
1794 TOFILE=`basename $2`
1797 \begin_layout Plain Layout
1799 cp $FROMFILE /home/you/pdf/$TOFILE
1804 Save it in your local LyX directory—say,
1805 \begin_inset Flex CharStyle:Code
1808 \begin_layout Plain Layout
1809 /home/you/.lyx/scripts/pdfcopier.sh
1814 —and make it executable, if you need to do so on your platform.
1816 \begin_inset Flex CharStyle:MenuItem
1819 \begin_layout Plain Layout
1820 Tools\SpecialChar \menuseparator
1826 dialog, select under
1827 \begin_inset Flex CharStyle:MenuItem
1830 \begin_layout Plain Layout
1831 File Handling\SpecialChar \menuseparator
1838 \begin_inset Flex CharStyle:MenuItem
1841 \begin_layout Plain Layout
1847 format—or one of the other pdf formats—and enter
1848 \begin_inset Flex CharStyle:Code
1851 \begin_layout Plain Layout
1852 pdfcopier.sh $$i $$o
1858 \begin_inset Flex CharStyle:MenuItem
1861 \begin_layout Plain Layout
1871 \begin_layout Standard
1872 Copiers are used by LyX in various of its own conversions.
1873 For example, if appropriate programs are found, LyX will automatically
1874 install copiers for the
1875 \begin_inset Flex CharStyle:MenuItem
1878 \begin_layout Plain Layout
1885 \begin_inset Flex CharStyle:MenuItem
1888 \begin_layout Plain Layout
1890 \begin_inset space ~
1899 When these formats are exported, the copier sees that not just the main
1900 HTML file but various associated files (style files, images, etc.) are also
1902 All these files are written to a subdirectory of the directory in which
1903 the original LyX file was found.
1907 \begin_layout Plain Layout
1908 This copier can be customized.
1910 \begin_inset Quotes eld
1914 \begin_inset Quotes erd
1917 argument takes a comma-separated list of extensions to be copied; if it
1918 is omitted, all files will be copied.
1920 \begin_inset Quotes eld
1924 \begin_inset Quotes erd
1927 argument determines the extension added to the generated directory.
1929 \begin_inset Quotes eld
1933 \begin_inset Flex CharStyle:MenuItem
1936 \begin_layout Plain Layout
1943 \begin_inset Quotes erd
1946 , so HTML generated from
1947 \begin_inset Flex CharStyle:MenuItem
1950 \begin_layout Plain Layout
1951 /path/to/filename.lyx
1957 \begin_inset Flex CharStyle:MenuItem
1960 \begin_layout Plain Layout
1961 /path/to/filename.html.LyXconv
1975 \begin_layout Section
1977 \begin_inset CommandInset label
1979 name "sec:Converters"
1986 \begin_layout Standard
1987 You can define your own Converters to convert files between different formats.
1989 \begin_inset Flex CharStyle:MenuItem
1992 \begin_layout Plain Layout
1993 Tools\SpecialChar \menuseparator
1994 Preferences\SpecialChar \menuseparator
1995 File Handling\SpecialChar \menuseparator
2004 \begin_layout Standard
2005 To define a new converter, select the
2006 \begin_inset Flex CharStyle:MenuItem
2009 \begin_layout Plain Layout
2011 \begin_inset space ~
2020 \begin_inset Flex CharStyle:MenuItem
2023 \begin_layout Plain Layout
2025 \begin_inset space ~
2033 from the drop-down lists, enter the command needed for the conversion,
2035 \begin_inset Flex CharStyle:MenuItem
2038 \begin_layout Plain Layout
2045 Several variables can be used in the definition of converters:
2048 \begin_layout Labeling
2049 \labelwidthstring 00.00.0000
2050 \begin_inset Flex CharStyle:Code
2053 \begin_layout Plain Layout
2059 The LyX system directory
2062 \begin_layout Labeling
2063 \labelwidthstring 00.00.0000
2064 \begin_inset Flex CharStyle:Code
2067 \begin_layout Plain Layout
2076 \begin_layout Labeling
2077 \labelwidthstring 00.00.0000
2078 \begin_inset Flex CharStyle:Code
2081 \begin_layout Plain Layout
2090 \begin_layout Labeling
2091 \labelwidthstring 00.00.0000
2092 \begin_inset Flex CharStyle:Code
2095 \begin_layout Plain Layout
2101 The base filename of the input file (i.
2102 \begin_inset space \thinspace{}
2105 g., without the extension)
2108 \begin_layout Labeling
2109 \labelwidthstring 00.00.0000
2110 \begin_inset Flex CharStyle:Code
2113 \begin_layout Plain Layout
2119 The path to the input file
2122 \begin_layout Labeling
2123 \labelwidthstring 00.00.0000
2124 \begin_inset Flex CharStyle:Code
2127 \begin_layout Plain Layout
2133 The path to the original input file (this is different from $$p when a
2134 chain of converters is called).
2137 \begin_layout Standard
2139 \begin_inset Flex CharStyle:MenuItem
2142 \begin_layout Plain Layout
2144 \begin_inset space ~
2152 field you can enter the following flags, separated by commas:
2155 \begin_layout Labeling
2156 \labelwidthstring 00.00.0000
2157 \begin_inset Flex CharStyle:Code
2160 \begin_layout Plain Layout
2166 This converter runs some form of LaTeX.
2167 This will make LyX's LaTeX error logs available.
2170 \begin_layout Labeling
2171 \labelwidthstring 00.00.0000
2172 \begin_inset Flex CharStyle:Code
2175 \begin_layout Plain Layout
2182 \begin_inset Flex CharStyle:MenuItem
2185 \begin_layout Plain Layout
2191 file for the conversion.
2194 \begin_layout Labeling
2195 \labelwidthstring 00.00.0000
2196 \begin_inset Flex CharStyle:Code
2199 \begin_layout Plain Layout
2208 \begin_layout Standard
2209 The following three flags are not really flags at all because they take
2211 \begin_inset Flex CharStyle:MenuItem
2214 \begin_layout Plain Layout
2216 \begin_inset space ~
2220 \begin_inset space ~
2231 \begin_layout Labeling
2232 \labelwidthstring 00.00.0000
2233 \begin_inset Flex CharStyle:Code
2236 \begin_layout Plain Layout
2242 If set, the converter's standard error will be redirected to a file
2243 \begin_inset Flex CharStyle:Code
2246 \begin_layout Plain Layout
2252 , and the script given as argument will be run as:
2253 \begin_inset Flex CharStyle:Code
2256 \begin_layout Plain Layout
2257 script < infile.out > infile.log
2263 The argument may contain
2264 \begin_inset Flex CharStyle:Code
2267 \begin_layout Plain Layout
2276 \begin_layout Labeling
2277 \labelwidthstring 00.00.0000
2278 \begin_inset Flex CharStyle:Code
2281 \begin_layout Plain Layout
2287 The name of the directory in which the converter will dump the generated
2289 LyX will not create this directory, and it does not copy anything into
2290 it, though it will copy this directory to the destination.
2291 The argument may contain
2292 \begin_inset Flex CharStyle:Code
2295 \begin_layout Plain Layout
2301 , which will be replaced by the base name of the input and output files,
2302 respectively, when the directory is copied.
2303 \begin_inset Newline newline
2306 Note that resultdir and usetempdir make no sense together.
2307 The latter will be ignored if the former is given.
2310 \begin_layout Labeling
2311 \labelwidthstring 00.00.0000
2312 \begin_inset Flex CharStyle:Code
2315 \begin_layout Plain Layout
2321 Determines the output file name and may, contain
2322 \begin_inset Flex CharStyle:Code
2325 \begin_layout Plain Layout
2332 Sensible only with resultdir and optional even then; if not given, it defaults
2336 \begin_layout Standard
2337 None of these last three are presently used in any of the converters that
2338 are installed with LyX.
2342 \begin_layout Standard
2343 You do not have to define converters for all formats between which you want
2345 For example, you will note that there is no `LyX to PostScript' converter,
2346 but LyX will export PostScript.
2347 It does so by first creating a LaTeX file (no converter needs to be defined
2348 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2349 and finally converting the resulting DVI file to PostScript.
2350 LyX finds such `chains' of converters automatically, and it will always
2351 choose the shortest possible chain.
2352 You can, though, still define multiple conversion methods between file
2354 For example, the standard LyX configuration provides three ways to convert
2355 LaTeX to PDF: Directly, using
2356 \begin_inset Flex CharStyle:MenuItem
2359 \begin_layout Plain Layout
2365 ; via (DVI and) PostScript, using
2366 \begin_inset Flex CharStyle:MenuItem
2369 \begin_layout Plain Layout
2376 \begin_inset Flex CharStyle:MenuItem
2379 \begin_layout Plain Layout
2386 To define such alternate chains, you must define multiple target `file
2387 formats', as described in section
2388 \begin_inset CommandInset ref
2390 reference "sec:Formats"
2395 For example, in the standard configuration, the formats named
2396 \begin_inset Flex CharStyle:MenuItem
2399 \begin_layout Plain Layout
2406 \begin_inset Flex CharStyle:MenuItem
2409 \begin_layout Plain Layout
2416 \begin_inset Flex CharStyle:MenuItem
2419 \begin_layout Plain Layout
2425 are defined, all of which share the extension
2426 \begin_inset Flex CharStyle:MenuItem
2429 \begin_layout Plain Layout
2435 , and which correspond to the conversion methods just mentioned.
2438 \begin_layout Chapter
2439 Internationalizing LyX
2440 \begin_inset CommandInset label
2442 name "cha:Internationalizing-LyX"
2449 \begin_layout Standard
2450 LyX supports using a translated interface.
2451 Last time we checked, LyX provided text in thirty languages.
2452 The language of choice is called your
2457 (For further reading on locale settings, see also the documentation for
2458 locale that comes with your operating system.
2459 For Linux, the manual page for
2460 \begin_inset Flex CharStyle:Code
2463 \begin_layout Plain Layout
2469 could be a good place to start).
2472 \begin_layout Standard
2473 Notice that these translations will work, but do contain a few flaws.
2474 In particular, all dialogs have been designed with the English text in
2475 mind, which means that some of the translated text will be too large to
2476 fit within the space allocated.
2477 This is only a display problem and will not cause any harm.
2478 Also, you will find that some of the translations do not define shortcut
2479 keys for everything.
2480 Sometimes, there are simply not enough free letters to do it.
2481 Other times, the translator just hasn't got around to doing it yet.
2482 Our localization team, which you may wish to join,
2486 \begin_layout Plain Layout
2487 If you are a fluent speaker of a language other than English, joining these
2488 teams is a great way to give back to the LyX community!
2493 will of course try to fix these shortcomings in future versions of LyX.
2496 \begin_layout Section
2500 \begin_layout Subsection
2501 Translating the graphical user interface (text messages).
2504 \begin_layout Standard
2506 \begin_inset Flex CharStyle:Code
2509 \begin_layout Plain Layout
2515 library to handle the internationalization of the interface.
2516 To have LyX speak your favorite language in all menus and dialogs, you
2518 \begin_inset Flex CharStyle:Code
2521 \begin_layout Plain Layout
2527 -file for that language.
2528 When this is available, you'll have to generate a
2529 \begin_inset Flex CharStyle:Code
2532 \begin_layout Plain Layout
2538 -file from it and install the
2539 \begin_inset Flex CharStyle:Code
2542 \begin_layout Plain Layout
2549 The process of doing all of this is explained in the documentation for
2551 \begin_inset Flex CharStyle:Code
2554 \begin_layout Plain Layout
2561 It is possible to do this just for yourself, but if you're going to do
2562 it, you might as well share the results of your labors with the rest of
2564 Send a message to the LyX developers' list for more information about how
2568 \begin_layout Standard
2569 In short, this is what you should do (xx denotes the language code):
2572 \begin_layout Itemize
2573 Check out the LyX source code.
2575 \begin_inset CommandInset href
2577 name "information on the web"
2578 target "http://www.lyx.org/devel/cvs.php"
2585 \begin_layout Itemize
2587 \begin_inset Flex CharStyle:Code
2590 \begin_layout Plain Layout
2596 to the folder of the
2597 \begin_inset Flex CharStyle:Code
2600 \begin_layout Plain Layout
2608 \begin_inset Flex CharStyle:Code
2611 \begin_layout Plain Layout
2619 \begin_inset Flex CharStyle:Code
2622 \begin_layout Plain Layout
2628 doesn't exist anywhere, it can be remade with the console command
2629 \begin_inset Flex CharStyle:Code
2632 \begin_layout Plain Layout
2638 in that directory, or you can use an existing po-file for some other language
2642 \begin_layout Itemize
2644 \begin_inset Flex CharStyle:Code
2647 \begin_layout Plain Layout
2657 \begin_layout Plain Layout
2658 This is just a text file, so it can be edited in any text editor.
2659 But there are also specialized programs that support such editing, such
2664 (for all platforms) or
2673 contains a `mode' for editing
2674 \begin_inset Flex CharStyle:Code
2677 \begin_layout Plain Layout
2688 For some menu- and widget-labels, there are also shortcut keys that should
2690 Those keys are marked after a `|', and should be translated according to
2691 the words and phrases of the language.
2692 You should also fill also out the information at the beginning of the new
2694 \begin_inset Flex CharStyle:Code
2697 \begin_layout Plain Layout
2703 -file with your email-address, etc., so people know where to reach you with
2704 suggestions and entertaining flames.
2707 \begin_layout Standard
2708 If you are just doing this on your own, then:
2711 \begin_layout Itemize
2713 \begin_inset Flex CharStyle:Code
2716 \begin_layout Plain Layout
2723 This can be done with
2724 \begin_inset Flex CharStyle:Code
2727 \begin_layout Plain Layout
2728 msgfmt -o xx.mo < xx.po
2736 \begin_layout Itemize
2738 \begin_inset Flex CharStyle:Code
2741 \begin_layout Plain Layout
2747 -file to your locale-tree, at the correct directory for application messages
2752 xx, and under the name
2753 \begin_inset Flex CharStyle:Code
2756 \begin_layout Plain Layout
2763 \begin_inset space \thinspace{}
2767 \begin_inset space \space{}
2771 \begin_inset Flex CharStyle:Code
2774 \begin_layout Plain Layout
2775 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2785 \begin_layout Standard
2786 As said, however, it would be best if the new
2787 \begin_inset Flex CharStyle:Code
2790 \begin_layout Plain Layout
2796 -file could be added to the LyX distribution, so others can use it.
2797 Adding it involves making additional changes to LyX.
2798 So send an email to the developers' mailing list if you're interested in
2802 \begin_layout Subsubsection
2806 \begin_layout Standard
2807 Sometimes it turns out that one English message needs to be translated into
2808 different messages in the target language.
2809 One example is the message
2810 \begin_inset Flex CharStyle:Code
2813 \begin_layout Plain Layout
2819 which has the German translation
2827 , depending upon exactly what the English
2828 \begin_inset Quotes eld
2832 \begin_inset Quotes erd
2837 \begin_inset Flex CharStyle:Code
2840 \begin_layout Plain Layout
2846 does not handle such ambiguous translations.
2847 Therefore you have to add some context information to the message: Instead
2849 \begin_inset Flex CharStyle:Code
2852 \begin_layout Plain Layout
2859 \begin_inset Flex CharStyle:Code
2862 \begin_layout Plain Layout
2863 To[[as in 'From format x to format y']]
2869 \begin_inset Flex CharStyle:Code
2872 \begin_layout Plain Layout
2873 To[[as in 'From page x to page y']].
2878 Now the two occurrences of
2879 \begin_inset Flex CharStyle:Code
2882 \begin_layout Plain Layout
2889 \begin_inset Flex CharStyle:Code
2892 \begin_layout Plain Layout
2898 and can be translated correctly to
2909 \begin_layout Standard
2910 Of course the context information needs to be stripped off the original
2911 message when no translation is used.
2912 Therefore you have to put it in double square brackets at the end of the
2913 message (see the example above).
2914 The translation mechanism of LyX ensures that everything in double square
2915 brackets at the end of messages is removed before displaying the message.
2918 \begin_layout Subsection
2919 Translating the documentation.
2922 \begin_layout Standard
2923 The online documentation (in the
2924 \begin_inset Flex CharStyle:MenuItem
2927 \begin_layout Plain Layout
2933 -menu) can (and should!) be translated.
2934 If there are translated versions of the documentation available
2938 \begin_layout Plain Layout
2939 As of March 2008, at least some of the documents have been translated into
2940 fourteen languages, with the Tutorial available in a few more.
2945 and the locale is set accordingly, these will be used automagically by
2947 LyX looks for translated versions as
2948 \begin_inset Flex CharStyle:Code
2951 \begin_layout Plain Layout
2952 LyXDir/doc/xx/DocName.lyx
2958 \begin_inset Flex CharStyle:Code
2961 \begin_layout Plain Layout
2967 is the code for the language currently in use.
2968 If there are no translated documents, the default English versions will
2970 Note that the translated versions must have the same filenames (
2971 \begin_inset Flex CharStyle:Code
2974 \begin_layout Plain Layout
2980 above) as the original.
2981 If you feel up to translating the documentation (an excellent way to proof-read
2982 the original documentation by the way!), there are a few things you should
2986 \begin_layout Itemize
2987 Check out the documentation translation web page at
2988 \begin_inset CommandInset href
2990 name "http://www.lyx.org/Translation"
2991 target "http://www.lyx.org/Translation"
2996 That way, you can find out which (if any) documents have already been translate
2997 d into your language.
2998 You can also find out who (if anyone) is organizing the effort to translate
2999 the documentation into your language.
3000 If no one is organizing the effort, please let us know that you're interested.
3003 \begin_layout Standard
3004 Once you get to actually translating, here's a few hints for you that may
3008 \begin_layout Itemize
3009 Join the documentation team! There is information on how to do that in
3010 \begin_inset Flex CharStyle:Code
3013 \begin_layout Plain Layout
3020 \begin_inset Flex CharStyle:MenuItem
3023 \begin_layout Plain Layout
3024 Help\SpecialChar \menuseparator
3030 ), which by the way is the first document you should translate.
3033 \begin_layout Itemize
3034 Learn the typographic conventions for the language you are translating to.
3035 Typography is an ancient art and over the centuries, a great variety of
3036 conventions have developed throughout different parts of the world.
3037 Also study the professional terminology amongst typographers in your country.
3038 Inventing your own terminology will only confuse the users.
3041 (Warning! Typography is addictive!)
3044 \begin_layout Itemize
3045 Make a copy of the document.
3046 This will be your working copy.
3047 You can use this as your personal translated help-file by placing it in
3049 \begin_inset Flex CharStyle:Code
3052 \begin_layout Plain Layout
3061 \begin_layout Itemize
3062 Sometimes the original document (from the LyX-team) will be updated.
3063 Use the source viewer at
3064 \begin_inset CommandInset href
3066 name "http://www.lyx.org/trac/timeline"
3067 target "http://www.lyx.org/trac/timeline"
3071 to see what has been changed.
3072 That way you can easily see which parts of the translated document need
3076 \begin_layout Standard
3077 If you ever find an error in the original document, fix it and notify the
3078 rest of the documentation team of the changes! (You didn't forget to join
3079 the documentation team, did you?)
3082 \begin_layout Standard
3083 \begin_inset Branch OutDated
3086 \begin_layout Section
3087 International Keyboard Support
3090 \begin_layout Standard
3093 [Editor's Note: The following section is by
3101 It needs to be fixed to conform to the new Documentation Style sheet and
3102 to make use of the new v1.0 features.
3103 The whole thing also needs to be merged with the section following it.-jw
3104 It may also be badly out of date.-rh (2008)]
3107 \begin_layout Subsection
3108 Defining Own Keymaps: Keymap File Format
3111 \begin_layout Standard
3112 Let's look at a keyboard definition file a little closer.
3113 It is a plain text file defining
3116 \begin_layout Itemize
3117 key-to-key or key-to-string translations
3120 \begin_layout Itemize
3124 \begin_layout Itemize
3125 dead keys exceptions
3128 \begin_layout Standard
3129 To define key-to-key or key-to-string translation, use this command:
3132 \begin_layout Quotation
3133 \begin_inset Flex CharStyle:Code
3136 \begin_layout Plain Layout
3145 \begin_inset Flex CharStyle:Code
3148 \begin_layout Plain Layout
3157 \begin_layout Standard
3159 \begin_inset Flex CharStyle:Code
3162 \begin_layout Plain Layout
3168 is the key to be translated and
3169 \begin_inset Flex CharStyle:Code
3172 \begin_layout Plain Layout
3178 is the string to be inserted into the document.
3179 To define dead keys, use:
3182 \begin_layout Quotation
3183 \begin_inset Flex CharStyle:Code
3186 \begin_layout Plain Layout
3195 \begin_inset Flex CharStyle:Code
3198 \begin_layout Plain Layout
3207 \begin_layout Standard
3209 \begin_inset Flex CharStyle:Code
3212 \begin_layout Plain Layout
3218 is a keyboard key and
3219 \begin_inset Flex CharStyle:Code
3222 \begin_layout Plain Layout
3229 The following dead keys are supported (shortcut name is in parentheses):
3232 \begin_layout Quotation
3236 \begin_inset space \hfill{}
3242 \begin_layout Quotation
3244 \begin_inset space \hfill{}
3250 \begin_layout Quotation
3252 \begin_inset space \hfill{}
3258 \begin_layout Quotation
3260 \begin_inset space \hfill{}
3266 \begin_layout Quotation
3268 \begin_inset space \hfill{}
3274 \begin_layout Quotation
3276 \begin_inset space \hfill{}
3283 \begin_layout Plain Layout
3295 \begin_layout Quotation
3297 \begin_inset space \hfill{}
3303 \begin_layout Quotation
3305 \begin_inset space \hfill{}
3312 \begin_layout Plain Layout
3324 \begin_layout Quotation
3326 \begin_inset space \hfill{}
3332 \begin_layout Quotation
3334 \begin_inset space \hfill{}
3340 \begin_layout Quotation
3342 \begin_inset space \hfill{}
3349 \begin_layout Plain Layout
3361 \begin_layout Quotation
3363 \begin_inset space \hfill{}
3370 \begin_layout Plain Layout
3382 \begin_layout Quotation
3384 \begin_inset space \hfill{}
3390 \begin_layout Quotation
3391 hungarian umlaut (hug)
3392 \begin_inset space \hfill{}
3398 \begin_layout Quotation
3400 \begin_inset space \hfill{}
3406 \begin_layout Quotation
3408 \begin_inset space \hfill{}
3415 \begin_layout Plain Layout
3427 \begin_layout Standard
3428 Since in many international keyboards there are exceptions to what some
3429 dead keys should do, you can define them using
3432 \begin_layout Quotation
3433 \begin_inset Flex CharStyle:Code
3436 \begin_layout Plain Layout
3444 deadkey key outstring
3447 \begin_layout Standard
3448 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3452 \begin_layout Quotation
3453 \begin_inset Flex CharStyle:Code
3456 \begin_layout Plain Layout
3469 \begin_layout Standard
3470 to make it work correctly.
3471 Also, you have to define as exceptions dead keys over i and j, to remove
3472 the dot from them before inserting an accent mark.
3473 I will change this when the time comes, but so far I haven't had time.
3476 \begin_layout Standard
3477 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3480 \begin_inset Flex CharStyle:Code
3483 \begin_layout Plain Layout
3489 have different meaning.
3491 \begin_inset Flex CharStyle:Code
3494 \begin_layout Plain Layout
3500 marks comments, quotes start and end LaTeX-style commands.
3501 To enter quote, you'll need to use
3502 \begin_inset Flex CharStyle:Code
3505 \begin_layout Plain Layout
3514 \begin_inset Flex CharStyle:Code
3517 \begin_layout Plain Layout
3524 \begin_inset Flex CharStyle:Code
3527 \begin_layout Plain Layout
3538 \begin_layout Standard
3539 If you make a keyboard description file that works for your language, please
3540 mail it to me, so I can include it in the next keymap distribution.
3543 \begin_layout Standard
3544 More keywords will be supported in keymap configuration file in future,
3548 \begin_layout Itemize
3549 \begin_inset Flex CharStyle:Code
3552 \begin_layout Plain Layout
3563 \begin_inset space \hfill{}
3567 \begin_inset Flex CharStyle:Code
3570 \begin_layout Plain Layout
3579 \begin_layout Itemize
3580 \begin_inset Flex CharStyle:Code
3583 \begin_layout Plain Layout
3594 \begin_inset space \hfill{}
3598 \begin_inset Flex CharStyle:Code
3601 \begin_layout Plain Layout
3607 an external keymap translation program
3610 \begin_layout Standard
3611 Also, it should look into
3612 \begin_inset Flex CharStyle:Code
3615 \begin_layout Plain Layout
3621 file for defaults, too (for example, a
3622 \begin_inset Flex CharStyle:Code
3625 \begin_layout Plain Layout
3633 option to include default keyboard).
3641 \begin_layout Section
3642 International Keymap Stuff
3643 \begin_inset CommandInset label
3645 name "sec:International-Keymap-Stuff"
3652 \begin_layout Standard
3653 \begin_inset Note Note
3656 \begin_layout Plain Layout
3657 In doing the revisions on this document in March 2008, I did not look over
3658 this stuff, as I do not understand it.
3659 It would be good if someone else could do so.
3668 \begin_layout Standard
3669 The next two sections describe the
3670 \begin_inset Flex CharStyle:Code
3673 \begin_layout Plain Layout
3682 \begin_inset Flex CharStyle:Code
3685 \begin_layout Plain Layout
3693 file syntax in detail.
3694 These sections should help you design your own key map if the ones provided
3695 do not meet your needs.
3698 \begin_layout Subsection
3702 \begin_layout Standard
3706 \begin_inset Flex CharStyle:Code
3709 \begin_layout Plain Layout
3715 file maps keystrokes to characters or strings.
3716 As the name suggests, it sets a keyboard mapping.
3718 \begin_inset Flex CharStyle:Code
3721 \begin_layout Plain Layout
3732 \begin_inset Flex CharStyle:Code
3735 \begin_layout Plain Layout
3750 \begin_inset Flex CharStyle:Code
3753 \begin_layout Plain Layout
3766 \begin_inset Flex CharStyle:Code
3769 \begin_layout Plain Layout
3778 \begin_inset Flex CharStyle:Code
3781 \begin_layout Plain Layout
3789 are described in this section.
3792 \begin_layout Labeling
3793 \labelwidthstring 00.00.0000
3794 \begin_inset Flex CharStyle:Code
3797 \begin_layout Plain Layout
3805 Map a character to a string
3808 \begin_layout LyX-Code
3823 \begin_layout Standard
3856 the double-quote (")
3873 must be escaped with a preceding backslash (
3884 \begin_layout Standard
3886 \begin_inset Flex CharStyle:MenuItem
3889 \begin_layout Plain Layout
3897 statement to cause the symbol
3898 \begin_inset Flex CharStyle:MenuItem
3901 \begin_layout Plain Layout
3909 to be output for the keystroke
3910 \begin_inset Flex CharStyle:MenuItem
3913 \begin_layout Plain Layout
3924 \begin_layout LyX-Code
3930 \begin_layout Labeling
3931 \labelwidthstring 00.00.0000
3932 \begin_inset Flex CharStyle:Code
3935 \begin_layout Plain Layout
3943 Specify an accent character
3946 \begin_layout LyX-Code
3955 \begin_layout Standard
3956 This will make the cha
3994 This is the dead key
3998 \begin_layout Plain Layout
4005 refers to a key that does not produce a character by itself, but when followed
4006 with another key, produces the desired accent character.
4007 For example, a German characte
4009 r with an umlaut like
4019 can be produced in this manner.
4028 \begin_layout Standard
4041 and then another key not in
4058 followed by the other, not allowed key, as output.
4062 \begin_inset Flex CharStyle:MenuItem
4065 \begin_layout Plain Layout
4073 cancels a dead key, so if
4084 \begin_inset Flex CharStyle:MenuItem
4087 \begin_layout Plain Layout
4096 , the cursor will not go one position backwards but will instead cancel
4112 might have had on the next keystroke.
4116 \begin_layout Standard
4117 The following example specifies that the character ' is to be an acute accent,
4118 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4121 \begin_layout LyX-Code
4124 kmod ' acute aeiouAEIOU
4127 \begin_layout Labeling
4128 \labelwidthstring 00.00.0000
4129 \begin_inset Flex CharStyle:Code
4132 \begin_layout Plain Layout
4138 Specify an exception to the accent character
4141 \begin_layout LyX-Code
4150 \begin_layout Standard
4151 This defines an exce
4192 have been assigned a keystroke with a previous
4195 \begin_inset Flex CharStyle:Code
4198 \begin_layout Plain Layout
4222 must not belong in the
4269 If such a declaration does not exist in
4277 \begin_inset Flex CharStyle:Code
4280 \begin_layout Plain Layout
4314 \begin_inset Flex CharStyle:Code
4317 \begin_layout Plain Layout
4331 \begin_layout Standard
4332 The following command produces causes äi to be produced when you enter acute-i
4336 \begin_layout LyX-Code
4350 \begin_layout Labeling
4351 \labelwidthstring 00.00.0000
4352 \begin_inset Flex CharStyle:Code
4355 \begin_layout Plain Layout
4361 Combine two accent characters
4364 \begin_layout LyX-Code
4370 accent1 accent2 allowed
4373 \begin_layout Standard
4374 This one is getting pretty esoteric.
4375 It allows you to combine the effect
4431 \begin_inset Flex CharStyle:Code
4434 \begin_layout Plain Layout
4462 \begin_layout Standard
4463 Consider this example from the
4464 \begin_inset Flex CharStyle:Code
4467 \begin_layout Plain Layout
4478 \begin_layout LyX-Code
4481 kmod ; acute aeioyvhAEIOYVH
4485 kcomb acute umlaut iyIY
4488 \begin_layout Standard
4489 This allows you to press
4490 \begin_inset Flex CharStyle:MenuItem
4493 \begin_layout Plain Layout
4501 and get the effect of
4502 \begin_inset Flex CharStyle:Code
4505 \begin_layout Plain Layout
4524 in this case cancels the last dead key, so if you press
4525 \begin_inset Flex CharStyle:MenuItem
4528 \begin_layout Plain Layout
4537 \begin_inset Flex CharStyle:Code
4540 \begin_layout Plain Layout
4553 \begin_layout Subsection
4557 \begin_layout Standard
4559 \begin_inset Flex CharStyle:Code
4562 \begin_layout Plain Layout
4570 mapping is performed, a
4571 \begin_inset Flex CharStyle:Code
4574 \begin_layout Plain Layout
4584 file maps the strings that the symbols generate to characters in the current
4586 The LyX distribution currently includes at least the
4587 \begin_inset Flex CharStyle:Code
4590 \begin_layout Plain Layout
4599 \begin_inset Flex CharStyle:Code
4602 \begin_layout Plain Layout
4613 \begin_layout Standard
4615 \begin_inset Flex CharStyle:Code
4618 \begin_layout Plain Layout
4626 file is a sequence of declarations of the form
4629 \begin_layout LyX-Code
4642 \begin_layout Standard
4643 For example, in order to map
4644 \begin_inset Flex CharStyle:MenuItem
4647 \begin_layout Plain Layout
4657 to the corresponding character in the iso-8859-1 set (233), the following
4661 \begin_layout LyX-Code
4669 \begin_layout Standard
4671 \begin_inset Flex CharStyle:Code
4674 \begin_layout Plain Layout
4683 \begin_inset Flex CharStyle:Code
4686 \begin_layout Plain Layout
4704 the same character can apply to more than one string.
4706 \begin_inset Flex CharStyle:Code
4709 \begin_layout Plain Layout
4720 \begin_layout LyX-Code
4732 \begin_inset Newline newline
4748 \begin_layout Standard
4749 If LyX cannot find a mapping for the string produced by the keystroke or
4750 a deadkey sequence, it will check if it looks like an accented char and
4751 try to draw an accent over the character on screen.
4754 \begin_layout Subsection
4758 \begin_layout Standard
4759 There is a second way to add support for international characters through
4760 so-called dead-keys.
4761 A dead-key works in combination with a letter to produce an accented character.
4762 Here, we'll explain how to create a really simple dead-key to illustrate
4766 \begin_layout Standard
4767 Suppose you happen to need the circumflex character,
4768 \begin_inset Quotes eld
4772 \begin_inset Quotes erd
4777 \begin_inset Flex CharStyle:MenuItem
4780 \begin_layout Plain Layout
4787 \begin_inset space ~
4791 \begin_inset Flex CharStyle:MenuItem
4794 \begin_layout Plain Layout
4800 ] to the LyX command
4801 \begin_inset Flex CharStyle:Code
4804 \begin_layout Plain Layout
4811 \begin_inset Flex CharStyle:Code
4814 \begin_layout Plain Layout
4821 Now, whenever you type the
4822 \begin_inset Flex CharStyle:MenuItem
4825 \begin_layout Plain Layout
4831 -key followed by a letter, that letter will have a circumflex accent on
4833 For example, the sequence
4834 \begin_inset Quotes eld
4838 \begin_inset Flex CharStyle:MenuItem
4841 \begin_layout Plain Layout
4848 \begin_inset Quotes erd
4851 produces the letter:
4852 \begin_inset Quotes eld
4856 \begin_inset Quotes erd
4860 If you tried to type
4861 \begin_inset Quotes eld
4865 \begin_inset Flex CharStyle:MenuItem
4868 \begin_layout Plain Layout
4875 \begin_inset Quotes erd
4878 , however, LyX will complain with a beep, since a
4879 \begin_inset Quotes eld
4883 \begin_inset Flex CharStyle:MenuItem
4886 \begin_layout Plain Layout
4893 \begin_inset Quotes erd
4896 never takes a circumflex accent.
4898 \begin_inset Flex CharStyle:MenuItem
4901 \begin_layout Plain Layout
4907 after a dead-key produces the bare-accent.
4908 Please note this last point! If you bind a key to a dead-key, you'll need
4909 to rebind the character on that key to yet another key.
4911 \begin_inset Flex CharStyle:MenuItem
4914 \begin_layout Plain Layout
4920 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
4923 \begin_layout Standard
4924 One common way to bind dead-keys is to use
4925 \begin_inset Flex CharStyle:MenuItem
4928 \begin_layout Plain Layout
4935 \begin_inset Flex CharStyle:MenuItem
4938 \begin_layout Plain Layout
4945 \begin_inset Flex CharStyle:MenuItem
4948 \begin_layout Plain Layout
4954 in combination with an accent, like
4955 \begin_inset Quotes eld
4959 \begin_inset Flex CharStyle:MenuItem
4962 \begin_layout Plain Layout
4969 \begin_inset Quotes erd
4973 \begin_inset Quotes eld
4977 \begin_inset Flex CharStyle:MenuItem
4980 \begin_layout Plain Layout
4987 \begin_inset Quotes erd
4991 \begin_inset Quotes eld
4995 \begin_inset Flex CharStyle:MenuItem
4998 \begin_layout Plain Layout
5005 \begin_inset Quotes erd
5009 Another way involves using
5010 \begin_inset Flex CharStyle:Code
5013 \begin_layout Plain Layout
5020 \begin_inset Flex CharStyle:Code
5023 \begin_layout Plain Layout
5029 to set up the special
5030 \begin_inset Flex CharStyle:Code
5033 \begin_layout Plain Layout
5041 \begin_inset Flex CharStyle:Code
5044 \begin_layout Plain Layout
5050 acts in some ways just like
5051 \begin_inset Flex CharStyle:MenuItem
5054 \begin_layout Plain Layout
5060 and permits you to bind keys to accented characters.
5061 You can also turn keys into dead-keys by binding them to something like
5063 \begin_inset Flex CharStyle:Code
5066 \begin_layout Plain Layout
5072 and then binding this symbolic key to the corresponding LyX command.
5076 \begin_layout Plain Layout
5081 : This is exactly what I do in my
5082 \begin_inset Flex CharStyle:Code
5085 \begin_layout Plain Layout
5092 \begin_inset Flex CharStyle:Code
5095 \begin_layout Plain Layout
5103 \begin_inset Flex CharStyle:MenuItem
5106 \begin_layout Plain Layout
5108 \begin_inset space ~
5117 \begin_inset Flex CharStyle:Code
5120 \begin_layout Plain Layout
5126 and a bunch of these
5127 \begin_inset Quotes eld
5131 \begin_inset Flex CharStyle:Code
5134 \begin_layout Plain Layout
5141 \begin_inset Quotes erd
5144 symbolic keys bound such things as
5145 \begin_inset Flex CharStyle:MenuItem
5148 \begin_layout Plain Layout
5150 \begin_inset space ~
5159 \begin_inset Flex CharStyle:MenuItem
5162 \begin_layout Plain Layout
5164 \begin_inset space ~
5173 This is how I produce my accented characters.
5178 You can make just about anything into the
5179 \begin_inset Flex CharStyle:Code
5182 \begin_layout Plain Layout
5189 \begin_inset Flex CharStyle:MenuItem
5192 \begin_layout Plain Layout
5198 keys, a spare function key, etc.
5199 As for the LyX commands that produce accents, check the entry for
5200 \begin_inset Flex CharStyle:Code
5203 \begin_layout Plain Layout
5214 You'll find the complete list there.
5217 \begin_layout Subsection
5218 Saving your Language Configuration
5221 \begin_layout Standard
5222 You can edit your preferences so that your desired language environment
5223 is automatically configured when LyX starts up, via the
5224 \begin_inset Flex CharStyle:MenuItem
5227 \begin_layout Plain Layout
5228 Edit\SpecialChar \menuseparator
5237 \begin_layout Chapter
5238 Installing New Document Classes, Layouts, and Templates
5239 \begin_inset CommandInset label
5241 name "cha:Installing-New-Document"
5246 \begin_inset Argument
5249 \begin_layout Plain Layout
5250 Installing New Document Classes
5258 \begin_layout Standard
5259 In this chapter, we describe the procedures for creating and installing
5260 new LyX layout and template files, as well as offer a refresher on correctly
5261 installing new LaTeX document classes.
5265 \begin_layout Standard
5266 First, let us a say a few words about how one ought to think about the relation
5267 between LyX and LaTeX.
5268 The thing to understand is that, in a certain sense, LyX doesn't know anything
5270 Indeed, from LyX's point of view, LaTeX is just one of several
5271 \begin_inset Quotes eld
5275 \begin_inset Quotes erd
5278 in which it is capable of producing output.
5279 Other such formats are DocBook, plaintext, and XHTML.
5280 LaTeX is, of course, a particularly important format, but very little of
5281 the information LyX has about LaTeX is actually contained in the program
5286 \begin_layout Plain Layout
5287 Some commands are sufficiently complex that they are
5288 \begin_inset Quotes eld
5292 \begin_inset Quotes erd
5296 But the developers generally regard this as a Bad Thing.
5301 Rather, that information, even for the standard classes like
5302 \begin_inset Flex CharStyle:Code
5305 \begin_layout Plain Layout
5311 , is contained in `layout files'.
5312 Similarly, LyX itself does not know much about DocBook or XHTML.
5313 What it knows is contained in layout files.
5316 \begin_layout Standard
5317 You can think of the layout file for a given document class as a translation
5318 manual between LyX constructs---paragraphs with their corresponding styles,
5319 certain sorts of insets, etc---and the corresponding LaTeX, DocBook, or
5321 Almost everything LyX knows about
5322 \begin_inset Flex CharStyle:Code
5325 \begin_layout Plain Layout
5331 , for example, is contained in the file
5332 \begin_inset Flex CharStyle:Code
5335 \begin_layout Plain Layout
5341 and in various other files it includes.
5342 For this reason, anyone intending to write layout files should plan to
5343 study the existing files.
5344 A good place to start is with
5345 \begin_inset Flex CharStyle:Code
5348 \begin_layout Plain Layout
5354 , which is included in
5355 \begin_inset Flex CharStyle:Code
5358 \begin_layout Plain Layout
5365 \begin_inset Flex CharStyle:Code
5368 \begin_layout Plain Layout
5374 , and many of the other layout files for document classes.
5375 This file is where sections and the like are defined:
5376 \begin_inset Flex CharStyle:Code
5379 \begin_layout Plain Layout
5385 tells LyX how paragraphs that are marked with the Section, Subsection,
5386 etc, styles can be translated into corresponding LaTeX, DocBook, and XHTML
5389 \begin_inset Flex CharStyle:Code
5392 \begin_layout Plain Layout
5398 file basically just includes several of these
5399 \begin_inset Flex CharStyle:Code
5402 \begin_layout Plain Layout
5411 \begin_layout Standard
5412 Defining the LyX--LaTeX correspondence is not the only thing layout files
5414 Their other job is to define how the LyX constructs themselves will appear
5416 The fact that layout files have these two jobs is often a source of confusion,
5417 because they are completely separate.
5418 Telling LyX how to translate a certain paragraph style into LaTeX does
5419 not tell LyX how to display it; conversely, telling LyX how to display
5420 a certain paragraph style does not tell LyX how to translate it into LaTeX
5421 (let alone tell LaTeX how to display it).
5422 So, in general, when you define a new LyX construct, you must always do
5423 two quite separate things: (i)
5424 \begin_inset space ~
5427 tell LyX how to translate it into LaTeX and (ii)
5428 \begin_inset space ~
5431 tell LyX how to display it.
5434 \begin_layout Standard
5435 Much the same is true, of course, as regards LyX's other backend formats,
5436 though XHTML is in some ways different, because in that case LyX
5440 able, to some extent, to use information about how it should display a
5441 paragraph on the screen to output information (in the form of CSS) about
5442 how the paragraph should be displayed in a browser.
5443 Even in this case, however, the distinction between what LyX does internally
5444 and how things are rendered externally remains in force, and the two can
5445 be controlled separately.
5447 \begin_inset CommandInset ref
5449 reference "sec:Tags-for-XHTML"
5456 \begin_layout Section
5457 Installing new LaTeX files
5460 \begin_layout Standard
5461 Some installations may not include a LaTeX package or class file that you
5462 would like to use within LyX.
5463 For example, you might need FoilTeX, a package for preparing slides for
5464 overhead projectors.
5465 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5466 a user interface for installing such packages.
5467 For example, with MiKTeX, you start the program
5468 \begin_inset Quotes eld
5472 \begin_inset space ~
5476 \begin_inset Quotes erd
5479 to get a list of available packages.
5480 To install one of them, right click on it or use the corresponding toolbar
5484 \begin_layout Standard
5485 If your LaTeX distribution does not provide such a `package manager', or
5486 if the package is not available from your distribution, then follow these
5487 steps to install it manually:
5490 \begin_layout Enumerate
5491 Get the package from
5492 \begin_inset CommandInset href
5495 target "http://www.ctan.org/"
5502 \begin_layout Enumerate
5503 If the package contains a file with the ending
5504 \begin_inset Quotes eld
5508 \begin_inset Quotes erd
5511 (is the case for FoilTeX) then open a console, change to the folder of
5512 this file and execute the command
5513 \begin_inset Newline newline
5519 \begin_inset Newline newline
5524 You have now unpacked the package and have all files to install it.
5525 Most of the LaTeX-packages are not packed and you can directly start with
5529 \begin_layout Enumerate
5530 Change to the folder where LaTeX is installed and change there to the folder
5536 (For MiKTeX, this would be by default the folder
5537 \begin_inset Quotes gld
5549 \begin_inset Quotes grd
5552 , under Linux it would be
5553 \begin_inset Quotes gld
5557 \begin_inset Quotes grd
5560 .) Create there a new folder with the Name
5561 \begin_inset Quotes gld
5565 \begin_inset Quotes grd
5568 and copy all files of the package into it.
5571 \begin_layout Enumerate
5572 Now one only need to tell LaTeX that there are new files.
5573 This depends on the used LaTeX-Distribution:
5577 \begin_layout Enumerate
5578 For MiKTeX start the program
5579 \begin_inset Quotes gld
5583 \begin_inset space ~
5587 \begin_inset Quotes grd
5590 and press the button
5591 \begin_inset Quotes eld
5595 \begin_inset Quotes erd
5601 \begin_layout Enumerate
5602 For TeXLive execute the command
5603 \begin_inset Newline newline
5611 \begin_inset Newline newline
5614 from a console with root permissions.
5618 \begin_layout Enumerate
5619 Use now in LyX the menu
5621 Tools\SpecialChar \menuseparator
5624 and restart LyX afterwards.
5627 \begin_layout Standard
5628 \begin_inset Note Note
5631 \begin_layout Enumerate
5632 Get the package from
5633 \begin_inset CommandInset href
5636 target "http://www.ctan.org/"
5643 \begin_layout Enumerate
5644 You can install the package in several different places.
5645 If you want it to be available for all users on your system, then you should
5646 install it in your `local' TeX tree; if you want (or need) it to be available
5647 just for you, then you can install it in your own `user' TeX tree.
5648 Where these trees should be created, if they do not already exist, depends
5649 upon the details of your system.
5650 To find out where they are, look in the file
5651 \begin_inset Flex CharStyle:Code
5654 \begin_layout Plain Layout
5664 \begin_layout Plain Layout
5665 This usually lives in the directory
5666 \begin_inset Flex CharStyle:Code
5669 \begin_layout Plain Layout
5675 , though you can run
5676 \begin_inset Flex CharStyle:Code
5679 \begin_layout Plain Layout
5690 The location of the `local' TeX tree is defined by the
5691 \begin_inset Flex CharStyle:Code
5694 \begin_layout Plain Layout
5700 variable; this is usually somewhere like
5701 \begin_inset Flex URL
5704 \begin_layout Plain Layout
5706 /usr/local/share/texmf/
5712 The location of the `user' TeX tree is defined by
5713 \begin_inset Flex CharStyle:Code
5716 \begin_layout Plain Layout
5723 \begin_inset Flex CharStyle:Code
5726 \begin_layout Plain Layout
5733 (If these variables are not predefined, you can define them.) You'll probably
5734 need root permissions to create or modify the `local' tree, but your `user'
5735 tree shouldn't have such limitations.
5738 \begin_layout Enumerate
5740 \begin_inset Flex CharStyle:Code
5743 \begin_layout Plain Layout
5750 \begin_inset Flex CharStyle:Code
5753 \begin_layout Plain Layout
5760 \begin_inset Flex CharStyle:Code
5763 \begin_layout Plain Layout
5770 \begin_inset space \thinspace{}
5774 \begin_inset Newline newline
5778 \begin_inset Flex CharStyle:Code
5781 \begin_layout Plain Layout
5782 TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
5788 \begin_inset Newline newline
5794 \begin_layout Enumerate
5795 Your local and user trees
5799 have the same sort of directory structure as your main existing
5800 \begin_inset Flex CharStyle:Code
5803 \begin_layout Plain Layout
5809 directory, which will be found at
5810 \begin_inset Flex CharStyle:Code
5813 \begin_layout Plain Layout
5820 \begin_inset Flex CharStyle:Code
5823 \begin_layout Plain Layout
5829 .) For example, latex packages should go under
5830 \begin_inset Flex CharStyle:Code
5833 \begin_layout Plain Layout
5834 $TEXMFLOCAL/tex/latex/
5840 \begin_inset Flex CharStyle:Code
5843 \begin_layout Plain Layout
5844 $TEXMFHOME/tex/latex/
5850 If you do not put them here, they probably will not work.
5853 \begin_layout Enumerate
5854 Once your tree is properly set up, you can install the package into an appropria
5856 If you are lucky, your package will have been provided as a so-called `TDS'
5857 (TeX Directory Structure) zip file.
5858 To install it, you want to unzip it from the top of your tree.
5859 So, for example, you can copy the file
5860 \begin_inset Flex CharStyle:Code
5863 \begin_layout Plain Layout
5870 \begin_inset Flex CharStyle:Code
5873 \begin_layout Plain Layout
5874 /home/yourname/texmf/
5879 and then, from inside that directory, just run:
5880 \begin_inset Flex CharStyle:Code
5883 \begin_layout Plain Layout
5890 This will extract the needed files and copy them where they need to be.
5891 \begin_inset Newline newline
5894 If you do not have a TDS file, then you have to do this manually.
5895 For example, you might install the FoilTeX files into
5896 \begin_inset Flex URL
5899 \begin_layout Plain Layout
5901 $TEXMFLOCAL/tex/latex/contrib/foiltex
5907 Why there? The CTAN download directories are themselves organized much
5908 like a TeX tree, and it isn't a bad idea to follow its structure when you
5909 install your own files.
5910 FoilTeX, as it happens, is found at
5911 \begin_inset Flex URL
5914 \begin_layout Plain Layout
5916 http://ctan.org/texarchive/macros/latex/contrib/foiltex/
5925 \begin_layout Enumerate
5926 Finally, you must update the database TeX uses to find files.
5927 On MiKTeX, this is done by pressing the button
5930 \begin_inset space ~
5935 that you find in MiKTeX's
5936 \begin_inset Quotes eld
5940 \begin_inset space ~
5944 \begin_inset Quotes erd
5949 \begin_inset Flex CharStyle:Code
5952 \begin_layout Plain Layout
5953 $TEXMFLOCAL/tex/latex/
5959 Under TeXLive and the like, you should run
5960 \begin_inset Flex CharStyle:Code
5963 \begin_layout Plain Layout
5969 from a terminal, with root permissions if necessary.
5978 \begin_layout Standard
5979 Now the package is installed and it should for example as
5987 \begin_layout Plain Layout
6003 \begin_inset Flex CharStyle:MenuItem
6006 \begin_layout Plain Layout
6007 Document\SpecialChar \menuseparator
6008 Settings\SpecialChar \menuseparator
6015 If not, you need to create a layout file by yourself (or ask someone else
6017 That is the topic of the next section.
6020 \begin_layout Section
6021 Types of layout files
6024 \begin_layout Standard
6025 This section describes the various sorts of LyX files that contain layout
6027 These files describe various paragraph and character styles, determining
6028 how LyX should display them and how they should be translated into LaTeX,
6029 DocBook, XHTML, or whatever output format is being used.
6033 \begin_layout Standard
6034 We shall try to provide a thorough description of the process of writing
6036 However, there are so many different types of documents supported even
6037 by just LaTeX that we can't hope to cover every different possibility or
6038 problem you might encounter.
6039 The LyX users' list is frequented by people with lots of experience with
6040 layout design who are willing to share what they've learned, so please
6041 feel free to ask questions there.
6044 \begin_layout Standard
6045 As you prepare to write a new layout, it is extremely helpful to look at
6046 the layouts distributed with LyX.
6047 If you write a LyX layout for a LaTeX document class that might also be
6048 used by others, or write a module that might be useful to others, then
6049 you should consider posting your layout to the
6050 \begin_inset CommandInset href
6052 name "layout section on the LyX wiki"
6053 target "http://wiki.lyx.org/Layouts/Layouts"
6057 or even to the LyX developers' list, so that it might be included in LyX
6062 \begin_layout Plain Layout
6063 Note that LyX is licensed under the General Public License, so any material
6064 that is contribued to LyX must be similarly licensed.
6072 \begin_layout Subsection
6074 \begin_inset CommandInset label
6076 name "sub:Layout-modules"
6083 \begin_layout Standard
6084 We have spoken to this point about `layout files'.
6085 But there are different sorts of files that contain layout information.
6086 Layout files, strictly so called, have the
6087 \begin_inset Flex CharStyle:Code
6090 \begin_layout Plain Layout
6096 extension and provide LyX with information about document classes.
6097 As of LyX 1.6, however, layout information can also be contained in layout
6103 \begin_inset Flex CharStyle:Code
6106 \begin_layout Plain Layout
6113 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
6114 some modules—such as the
6115 \begin_inset Flex CharStyle:Code
6118 \begin_layout Plain Layout
6124 module—specifcally provide support for one package.
6125 In a sense, layout modules are similar to included
6129 \begin_layout Plain Layout
6130 These can have any extension, but by convention have the
6131 \begin_inset Flex CharStyle:Code
6134 \begin_layout Plain Layout
6146 \begin_inset Flex CharStyle:Code
6149 \begin_layout Plain Layout
6155 —in that modules are not specific to a given document class but may be used
6156 with many different classes.
6157 The difference is that using an included file with
6158 \begin_inset Flex CharStyle:Code
6161 \begin_layout Plain Layout
6167 requires editing that file.
6168 Modules, by contrast, are selected in the
6169 \begin_inset Flex CharStyle:MenuItem
6172 \begin_layout Plain Layout
6173 Document\SpecialChar \menuseparator
6182 \begin_layout Standard
6183 Building modules is the easiest way to get started with layout editing,
6184 since it can be as simple as adding a single new paragraph style or flex
6186 But modules may, in principle, contain anything a layout file can contain.
6189 \begin_layout Standard
6190 After creating a new module and copying it to the
6191 \begin_inset Flex CharStyle:Code
6194 \begin_layout Plain Layout
6200 folder, you will need to reconfigure and then restart LyX for the module
6201 to appear in the menu.
6202 However, changes you make to the module will be seen immediately, if you
6204 \begin_inset Flex CharStyle:MenuItem
6207 \begin_layout Plain Layout
6208 Document\SpecialChar \menuseparator
6214 , highlight something, and then hit
6215 \begin_inset Quotes eld
6219 \begin_inset Quotes erd
6225 It is strongly recommended that you save your work before doing this
6230 it is strongly recommended that you not attempt to edit modules while simultaneo
6231 usly working on actual documents
6234 Though of course the developers strive to keep LyX stable in such situations,
6235 syntax errors and the like in your module file could cause strange behavior.
6238 \begin_layout Subsection
6240 \begin_inset Flex CharStyle:MenuItem
6243 \begin_layout Plain Layout
6252 \begin_layout Standard
6253 There are two situations you are likely to encounter when wanting to support
6254 a new LaTeX document class, involving LaTeX2e class (
6255 \begin_inset Flex CharStyle:Code
6258 \begin_layout Plain Layout
6265 \begin_inset Flex CharStyle:Code
6268 \begin_layout Plain Layout
6275 Supporting a style file is usually fairly easy.
6276 Supporting a new class file is a bit harder.
6277 We'll discuss the former in this section and the latter in the next.
6278 Similar remarks apply, of course, if you want to support a new DocBook
6282 \begin_layout Standard
6283 The easier case is the one in which your new document class is provided
6284 as a style file that is to be used in conjunction with an already supported
6286 For the sake of the example, we'll assume that the style file is called
6288 \begin_inset Flex CharStyle:MenuItem
6291 \begin_layout Plain Layout
6297 and that it is meant to be used with
6298 \begin_inset Flex CharStyle:MenuItem
6301 \begin_layout Plain Layout
6307 , which is a standard class.
6311 \begin_layout Standard
6312 Start by copying the existing class's layout file into your local directory:
6316 \begin_layout Plain Layout
6317 Of course, which directory is your local directory will vary by platform,
6318 and LyX allows you to specify your local directory on startup, too, using
6320 \begin_inset Flex CharStyle:Code
6323 \begin_layout Plain Layout
6337 \begin_layout LyX-Code
6338 cp report.layout ~/.lyx/layouts/myclass.layout
6341 \begin_layout Standard
6343 \begin_inset Flex CharStyle:Code
6346 \begin_layout Plain Layout
6352 and change the line:
6355 \begin_layout LyX-Code
6358 DeclareLaTeXClass{report}
6361 \begin_layout Standard
6365 \begin_layout LyX-Code
6368 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6371 \begin_layout Standard
6375 \begin_layout LyX-Code
6377 \begin_inset Newline newline
6383 \begin_inset Newline newline
6389 \begin_layout Standard
6390 near the top of the file.
6393 \begin_layout Standard
6394 Start LyX and select
6395 \begin_inset Flex CharStyle:MenuItem
6398 \begin_layout Plain Layout
6399 Tools\SpecialChar \menuseparator
6406 Then restart LyX and try creating a new document.
6408 \begin_inset Flex CharStyle:MenuItem
6411 \begin_layout Plain Layout
6417 " as a document class option in the
6418 \begin_inset Flex CharStyle:MenuItem
6421 \begin_layout Plain Layout
6422 Document\SpecialChar \menuseparator
6429 It is likely that some of the sectioning commands and such in your new
6430 class will work differently from how they worked in the base class—
6431 \begin_inset Flex CharStyle:Code
6434 \begin_layout Plain Layout
6440 in this example—so you can fiddle around with the settings for the different
6441 sections if you wish.
6442 The layout information for sections is contained in
6443 \begin_inset Flex CharStyle:Code
6446 \begin_layout Plain Layout
6452 , but you do not need to copy and change this file.
6453 Instead, you can simply add your changes to your layout file, after the
6455 \begin_inset Flex CharStyle:Code
6458 \begin_layout Plain Layout
6464 , which itself includes
6465 \begin_inset Flex CharStyle:Code
6468 \begin_layout Plain Layout
6475 For example, you might add these lines:
6478 \begin_layout LyX-Code
6482 \begin_layout LyX-Code
6486 \begin_layout LyX-Code
6490 \begin_layout LyX-Code
6494 \begin_layout LyX-Code
6498 \begin_layout Standard
6499 to change the font for chapter headings to sans-serif.
6500 This will override (or, in this case, add to) the existing declaration
6501 for the Chapter style.
6505 \begin_layout Standard
6506 Your new package may also provide commands or environments not present in
6508 In this case, you will want to add these to the layout file.
6510 \begin_inset CommandInset ref
6512 reference "sec:TextClass"
6516 for information on how to do so.
6519 \begin_layout Standard
6521 \begin_inset Flex CharStyle:MenuItem
6524 \begin_layout Plain Layout
6530 can be used with several different document classes, and even if it cannot,
6531 you might find it easiest just to write a module that you can load with
6533 The simplest possible such module would be:
6536 \begin_layout LyX-Code
6539 DeclareLyXModule{My Package}
6542 \begin_layout LyX-Code
6546 \begin_layout LyX-Code
6547 #Support for mypkg.sty.
6550 \begin_layout LyX-Code
6552 \begin_inset Newline newline
6558 \begin_layout LyX-Code
6560 \begin_inset Newline newline
6566 \begin_layout LyX-Code
6568 \begin_inset Newline newline
6574 \begin_inset Newline newline
6580 \begin_layout Standard
6581 A more complex module might modify the behavior of some existing constructs
6582 or define some new ones.
6584 \begin_inset CommandInset ref
6586 reference "sec:TextClass"
6593 \begin_layout Subsection
6595 \begin_inset Flex CharStyle:MenuItem
6598 \begin_layout Plain Layout
6607 \begin_layout Standard
6608 There are two possibilities here.
6609 One is that the class file is itself based upon an existing document class.
6610 For example, many thesis classes are based upon
6611 \begin_inset Flex CharStyle:MenuItem
6614 \begin_layout Plain Layout
6621 To see whether yours is, look for a line like
6624 \begin_layout LyX-Code
6630 \begin_layout Standard
6632 If so, then you may proceed largely as in the previous section, though
6634 \begin_inset Flex CharStyle:Code
6637 \begin_layout Plain Layout
6643 line will be different.
6644 If your new class is
6645 \begin_inset Flex CharStyle:Code
6648 \begin_layout Plain Layout
6654 and it is based upon
6655 \begin_inset Flex CharStyle:Code
6658 \begin_layout Plain Layout
6664 , then the line should read:
6668 \begin_layout Plain Layout
6669 And it will be easiest if you save the file to
6670 \begin_inset Flex CharStyle:Code
6673 \begin_layout Plain Layout
6679 : LyX assumes that the document class has the same name as the layout file.
6688 \begin_layout LyX-Code
6691 DeclareLaTeXClass[thesis,book]{thesis}
6694 \begin_layout Standard
6695 If, on the other hand, the new class is not based upon an existing class,
6696 you will probably have to
6697 \begin_inset Quotes eld
6701 \begin_inset Quotes erd
6705 We strongly suggest copying an existing layout file which uses a similar
6706 LaTeX class and then modifying it, if you can do so.
6707 At least use an existing file as a starting point so you can find out what
6708 items you need to worry about.
6709 Again, the specifics are covered below.
6712 \begin_layout Subsection
6714 \begin_inset CommandInset label
6716 name "sub:Creating-Templates"
6723 \begin_layout Standard
6724 Once you have written a layout file for a new document class, you might
6725 want to consider writing a
6730 A template acts as a kind of tutorial for your layout, showing how it might
6731 be used, though containing dummy content.
6732 You can of course look at the various templates included with LyX for ideas.
6735 \begin_layout Standard
6736 Templates are created just like usual documents: using LyX.
6737 The only difference is that usual documents contain all possible settings,
6738 including the font scheme and the paper size.
6739 Usually a user doesn't want a template to overwrite his preferred settings
6740 for such parameters.
6741 For that reason, the designer of a template should remove the corresponding
6743 \begin_inset Flex CharStyle:Code
6746 \begin_layout Plain Layout
6755 \begin_inset Flex CharStyle:Code
6758 \begin_layout Plain Layout
6766 from the template LyX file.
6767 This can be done with any simple text-editor, for example
6768 \begin_inset Flex CharStyle:Code
6771 \begin_layout Plain Layout
6778 \begin_inset Flex CharStyle:Code
6781 \begin_layout Plain Layout
6791 \begin_layout Standard
6792 Put the edited template files you create in
6793 \begin_inset Flex CharStyle:Code
6796 \begin_layout Plain Layout
6802 , copy the ones you use from the global template directory in
6803 \begin_inset Flex CharStyle:Code
6806 \begin_layout Plain Layout
6812 to the same place, and redefine the template path in the
6813 \begin_inset Flex CharStyle:MenuItem
6816 \begin_layout Plain Layout
6817 Tools\SpecialChar \menuseparator
6818 Preferences\SpecialChar \menuseparator
6827 \begin_layout Standard
6828 Note, by the way, that there is a template which has a particular meaning:
6830 \begin_inset Flex CharStyle:Code
6833 \begin_layout Plain Layout
6840 This template is loaded every time you create a new document with
6841 \begin_inset Flex CharStyle:MenuItem
6844 \begin_layout Plain Layout
6845 File\SpecialChar \menuseparator
6851 in order to provide useful defaults.
6852 To create this template from inside LyX, all you have to do is to open
6853 a document with the correct settings, and use the
6854 \begin_inset Flex CharStyle:MenuItem
6857 \begin_layout Plain Layout
6858 Save as Document Defaults
6866 \begin_layout Subsection
6867 Upgrading old layout files
6870 \begin_layout Standard
6871 The format of layout files changes with each LyX release, so old layout
6872 files need to be converted to the new format.
6873 This process has been automated since LyX 1.4: If LyX reads a layout file
6874 in an older format, it automatically calls the script
6875 \begin_inset Flex CharStyle:Code
6878 \begin_layout Plain Layout
6884 to convert it to a temporary file in current format.
6885 The original file is left untouched.
6886 If you use the layout file often, then, you may want to convert it permanently,
6887 so that LyX does not have to do so itself every time.
6888 To do this, you can call the converter manually:
6891 \begin_layout LyX-Code
6892 mv myclass.layout myclass.old
6895 \begin_layout LyX-Code
6896 python LyXDir/scripts/layout2layout.py myclass.old myclass.layout
6899 \begin_layout Standard
6901 \begin_inset Flex CharStyle:Code
6904 \begin_layout Plain Layout
6910 with the name of your LyX system directory, of course.
6913 \begin_layout Standard
6914 Note that manual conversion does not affect included files, so these will
6915 have to be converted separately.
6918 \begin_layout Section
6919 \begin_inset CommandInset label
6921 name "sec:TextClass"
6925 The layout file format
6928 \begin_layout Standard
6929 When it's finally time to get your hands dirty and create or edit your own
6930 layout file, the following sections describe what you're up against.
6931 Our advice is to go slowly, save and test often, listen to soothing music,
6932 and enjoy one or two of your favorite adult beverages; more if you are
6933 getting particularly stuck.
6934 It's really not that hard, except that the multitude of options can become
6935 overwhelming if you try to do too much in one sitting.
6936 Go have another adult beverage, just for good measure.
6939 \begin_layout Standard
6940 Note that all the tags used in layout files are case-insensitive.
6942 \begin_inset Flex CharStyle:Code
6945 \begin_layout Plain Layout
6952 \begin_inset Flex CharStyle:Code
6955 \begin_layout Plain Layout
6962 \begin_inset Flex CharStyle:Code
6965 \begin_layout Plain Layout
6971 are really the same tag.
6972 The possible values are printed in brackets after the feature's name.
6973 The default value if a feature isn't specified inside a text class-description
6975 \begin_inset Flex CharStyle:Code
6978 \begin_layout Plain Layout
6987 If the argument has a data type like
6988 \begin_inset Quotes eld
6992 \begin_inset Quotes erd
6996 \begin_inset Quotes eld
7000 \begin_inset Quotes erd
7003 , the default is shown like this:
7004 \begin_inset Flex CharStyle:Code
7007 \begin_layout Plain Layout
7018 \begin_layout Subsection
7019 The document class declaration
7022 \begin_layout Standard
7023 Lines in a layout file which begin with
7024 \begin_inset Flex CharStyle:Code
7027 \begin_layout Plain Layout
7034 There is one exception to this rule.
7036 \begin_inset Flex CharStyle:Code
7039 \begin_layout Plain Layout
7045 files should begin with a line like:
7048 \begin_layout LyX-Code
7051 #% Do not delete the line below; configure depends on this
7054 \begin_layout LyX-Code
7059 DeclareLaTeXClass{article}
7062 \begin_layout Standard
7063 The second line is used when you (re)configure LyX.
7064 The layout file is read by the LaTeX script
7065 \begin_inset Flex CharStyle:Code
7068 \begin_layout Plain Layout
7074 , in a special mode where
7075 \begin_inset Flex CharStyle:Code
7078 \begin_layout Plain Layout
7085 The first line is just a LaTeX comment, and the second one contains the
7086 declaration of the text class.
7087 If these lines appear in a file named
7088 \begin_inset Flex CharStyle:Code
7091 \begin_layout Plain Layout
7097 , then they define a text class of name
7098 \begin_inset Flex CharStyle:Code
7101 \begin_layout Plain Layout
7107 (the name of the layout file) which uses the LaTeX document class
7108 \begin_inset Flex CharStyle:Code
7111 \begin_layout Plain Layout
7117 (the default is to use the same name as the layout).
7119 \begin_inset Quotes eld
7123 \begin_inset Quotes erd
7126 that appears above is used as a description of the text class in the
7127 \begin_inset Flex CharStyle:MenuItem
7130 \begin_layout Plain Layout
7131 Document\SpecialChar \menuseparator
7140 \begin_layout Standard
7141 Let's assume that you wrote your own text class that uses the
7142 \begin_inset Flex CharStyle:Code
7145 \begin_layout Plain Layout
7151 document class, but where you changed the appearance of the section headings.
7152 If you put it in a file
7153 \begin_inset Flex CharStyle:Code
7156 \begin_layout Plain Layout
7162 , the header of this file should be:
7165 \begin_layout LyX-Code
7168 #% Do not delete the line below; configure depends on this
7171 \begin_layout LyX-Code
7176 DeclareLaTeXClass[article]{article (with my own headings)}
7179 \begin_layout Standard
7180 This declares a text class
7181 \begin_inset Flex CharStyle:Code
7184 \begin_layout Plain Layout
7190 , associated with the LaTeX document class
7191 \begin_inset Flex CharStyle:Code
7194 \begin_layout Plain Layout
7201 \begin_inset Quotes eld
7204 article (with my own headings)
7205 \begin_inset Quotes erd
7209 If your text class depends on several packages, you can declare it as:
7212 \begin_layout LyX-Code
7215 #% Do not delete the line below; configure depends on this
7218 \begin_layout LyX-Code
7223 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
7226 \begin_layout Standard
7227 This indicates that your text class uses the
7228 \begin_inset Flex CharStyle:Code
7231 \begin_layout Plain Layout
7238 Finally, it is also possible to declare classes for DocBook code.
7239 Typical declarations will look like:
7242 \begin_layout LyX-Code
7245 #% Do not delete the line below; configure depends on this
7248 \begin_layout LyX-Code
7253 DeclareDocBookClass[article]{SGML (DocBook article)}
7256 \begin_layout Standard
7257 Note that these declarations can also be given an optional parameter declaring
7258 the name of the document class (but not a list).
7261 \begin_layout Standard
7262 So, to be as explicit as possible, the form of the layout declaration is:
7265 \begin_layout LyX-Code
7270 DeclareLaTeXClass[class,package.sty]{layout description}
7273 \begin_layout Standard
7274 The class need only be specified if the name of the LaTeX class file and
7275 the name of the layout file are different or if there are packages to load.
7276 If the name of the class file is not specified, then LyX will simply assume
7277 that it is the same as the name of the layout file.
7280 \begin_layout Standard
7281 When the text class has been modified to your taste, all you have to do
7282 is to copy it either to
7283 \begin_inset Flex CharStyle:Code
7286 \begin_layout Plain Layout
7293 \begin_inset Flex CharStyle:Code
7296 \begin_layout Plain Layout
7303 \begin_inset Flex CharStyle:MenuItem
7306 \begin_layout Plain Layout
7307 Tools\SpecialChar \menuseparator
7313 , exit LyX and restart.
7314 Then your new text class should be available along with the others.
7317 \begin_layout Standard
7318 Once the layout file is installed, you can edit it and see your changes
7319 without having to reconfigure or to restart LyX.
7324 \begin_layout Plain Layout
7325 In versions of LyX prior to 1.6, this was not true.
7326 As a result, editing layout files was very time consuming, since you had
7327 constantly to restart LyX to see changes.
7332 You can force a reload of the current layout by using the LyX function
7334 \begin_inset Flex CharStyle:MenuItem
7337 \begin_layout Plain Layout
7344 There is no default binding for this function—though, of course, you can
7345 bind it to a key yourself.
7346 But you will normally use this function simply by entering it in the mini-buffe
7351 \begin_layout Standard
7357 \begin_inset Flex CharStyle:MenuItem
7360 \begin_layout Plain Layout
7366 is very much an `advanced feature'.
7371 recommended that you save your work before using this function.
7376 recommended that you not attempt to edit layout information while simultaneousl
7377 y working on a document that you care about.
7378 Use a test document.
7379 Syntax errors and the like in your layout file could cause peculiar behavior.
7380 In particular, such errors could cause LyX to regard the current layout
7381 as invalid and to attempt to switch to some other layout.
7385 \begin_layout Plain Layout
7386 Really bad syntax errors may even caused LyX to exit.
7387 This is because certain sorts of errors may make LyX unable to read
7397 The LyX team strives to keep LyX stable in such situations, but safe is
7402 \begin_layout Plain Layout
7403 While we're giving advice: make regular backups.
7404 And be nice to your mother.
7412 \begin_layout Subsection
7413 The Module declaration
7416 \begin_layout Standard
7417 A module must begin with a line like the following:
7420 \begin_layout LyX-Code
7423 DeclareLyXModule[endnotes.sty]{Endnotes}
7426 \begin_layout Standard
7427 The mandatory argument, in curly brackets, is the name of the module, as
7429 \begin_inset Flex CharStyle:MenuItem
7432 \begin_layout Plain Layout
7433 Document\SpecialChar \menuseparator
7440 The argument in square brackets is optional: It declares any LaTeX packages
7441 on which the module depends.
7442 Please note that only packages about which LyX knows should be listed in
7443 the square brackets.
7447 \begin_layout Plain Layout
7448 The list of such packages is documented only in the source code.
7453 LyX will not check for arbitrary packages.
7454 It is also possible to use the form
7455 \begin_inset Flex CharStyle:MenuItem
7458 \begin_layout Plain Layout
7464 as an optional argument, which declares that the module can only be used
7465 when there exists a conversion chain between the formats `
7466 \begin_inset Flex CharStyle:Code
7469 \begin_layout Plain Layout
7476 \begin_inset Flex CharStyle:Code
7479 \begin_layout Plain Layout
7488 \begin_layout Standard
7489 The module declaration should then be followed by lines like the following:
7492 \begin_layout LyX-Code
7496 \begin_layout LyX-Code
7497 #Adds an endnote command, in addition to footnotes.
7501 \begin_layout LyX-Code
7502 #You will need to add
7504 theendnotes in TeX code where you
7507 \begin_layout LyX-Code
7508 #want the endnotes to appear.
7512 \begin_layout LyX-Code
7516 \begin_layout LyX-Code
7517 #Requires: somemodule | othermodule
7520 \begin_layout LyX-Code
7521 #Excludes: badmodule
7524 \begin_layout Standard
7525 The description is used in
7526 \begin_inset Flex CharStyle:MenuItem
7529 \begin_layout Plain Layout
7530 Document\SpecialChar \menuseparator
7536 to provide the user with information about what the module does.
7538 \begin_inset Flex CharStyle:Code
7541 \begin_layout Plain Layout
7547 line is used to identify other modules with which this one must be used;
7549 \begin_inset Flex CharStyle:Code
7552 \begin_layout Plain Layout
7558 line is used to identify modules with which this one may not be used.
7559 Both are optional, and, as shown, multiple modules should be separated
7560 with the pipe symbol: |.
7561 Note that the required modules are treated disjunctively:
7565 of the required modules must be used.
7570 excluded module may be used.
7571 Note that modules are identified here by their
7576 \begin_inset Flex CharStyle:Code
7579 \begin_layout Plain Layout
7587 \begin_inset Flex CharStyle:Code
7590 \begin_layout Plain Layout
7597 \begin_inset Flex CharStyle:Code
7600 \begin_layout Plain Layout
7609 \begin_layout Subsection
7613 \begin_layout Standard
7614 The first non-comment line of any layout file, included file, or module
7619 contain the file format number:
7622 \begin_layout Description
7623 \begin_inset Flex CharStyle:Code
7626 \begin_layout Plain Layout
7633 \begin_inset Flex CharStyle:Code
7636 \begin_layout Plain Layout
7642 ] The format of the layout file.
7645 \begin_layout Standard
7646 This tag was introduced with LyX 1.4.0.
7647 Layout files from LyX 1.3.x and earlier don't have an explicit file format
7648 and are considered to be of format 1.
7649 The format for the present version of LyX is format 21.
7650 But each version of LyX is capable of reading earlier versions' layout
7651 files, just as they are capable of reading files produced by earlier versions
7653 There is, however, no provision for converting to earlier formats.
7654 So LyX 1.6.x will not read layout files in format 21 but only files in format
7658 \begin_layout Subsection
7659 \begin_inset CommandInset label
7661 name "sub:General-text-class"
7665 General text class parameters
7668 \begin_layout Standard
7669 These are general parameters that govern the behavior of an entire document
7675 mean that they must appear in
7676 \begin_inset Flex CharStyle:Code
7679 \begin_layout Plain Layout
7685 files rather than in modules.
7686 A module can contain any layout tag.)
7689 \begin_layout Description
7690 \begin_inset Flex CharStyle:Code
7693 \begin_layout Plain Layout
7699 Adds information that will be output in the
7700 \begin_inset Flex CharStyle:Code
7703 \begin_layout Plain Layout
7709 block when this document class is output to XHTML.
7710 Typically, this would be used to output CSS style information, but it can
7711 be used for anything that can appear in
7712 \begin_inset Flex CharStyle:Code
7715 \begin_layout Plain Layout
7723 \begin_inset Quotes eld
7727 \begin_inset Flex CharStyle:Code
7730 \begin_layout Plain Layout
7737 \begin_inset Quotes erd
7743 \begin_layout Description
7744 \begin_inset Flex CharStyle:Code
7747 \begin_layout Plain Layout
7753 Adds information to the document preamble.
7755 \begin_inset Quotes eld
7759 \begin_inset Flex CharStyle:Code
7762 \begin_layout Plain Layout
7769 \begin_inset Quotes erd
7775 \begin_layout Description
7776 \begin_inset Flex CharStyle:Code
7779 \begin_layout Plain Layout
7785 Defines formats for use in the display of bibliographic information.
7787 \begin_inset CommandInset ref
7789 reference "sub:Citation-format-description"
7795 \begin_inset Quotes eld
7799 \begin_inset Flex CharStyle:Code
7802 \begin_layout Plain Layout
7809 \begin_inset Quotes erd
7815 \begin_layout Description
7816 \begin_inset Flex CharStyle:Code
7819 \begin_layout Plain Layout
7825 Describes various global options supported by the document class.
7827 \begin_inset space ~
7831 \begin_inset CommandInset ref
7833 reference "sub:ClassOptions"
7839 \begin_inset Quotes eld
7843 \begin_inset Flex CharStyle:Code
7846 \begin_layout Plain Layout
7853 \begin_inset Quotes erd
7859 \begin_layout Description
7860 \begin_inset Flex CharStyle:Code
7863 \begin_layout Plain Layout
7870 \begin_inset Flex CharStyle:Code
7873 \begin_layout Plain Layout
7882 \begin_inset Flex CharStyle:Code
7885 \begin_layout Plain Layout
7891 ] Whether the class should
7895 to having one or two columns.
7896 Can be changed in the
7897 \begin_inset Flex CharStyle:MenuItem
7900 \begin_layout Plain Layout
7901 Document\SpecialChar \menuseparator
7910 \begin_layout Description
7911 \begin_inset Flex CharStyle:Code
7914 \begin_layout Plain Layout
7921 \begin_inset Flex CharStyle:Code
7924 \begin_layout Plain Layout
7930 ] This sequence defines the properties for a counter.
7931 If the counter does not yet exist, it is created; if it does exist, it
7934 \begin_inset Quotes eld
7938 \begin_inset Flex CharStyle:Code
7941 \begin_layout Plain Layout
7948 \begin_inset Quotes erd
7952 \begin_inset Newline newline
7956 \begin_inset space ~
7960 \begin_inset CommandInset ref
7962 reference "sub:Counters"
7966 for details on counters.
7969 \begin_layout Description
7970 \begin_inset Flex CharStyle:Code
7973 \begin_layout Plain Layout
7979 Sets the default font used to display the document.
7981 \begin_inset space ~
7985 \begin_inset CommandInset ref
7987 reference "sub:Font-description"
7991 for how to declare fonts.
7993 \begin_inset Quotes eld
7997 \begin_inset Flex CharStyle:Code
8000 \begin_layout Plain Layout
8007 \begin_inset Quotes erd
8013 \begin_layout Description
8014 \begin_inset Flex CharStyle:Code
8017 \begin_layout Plain Layout
8024 \begin_inset Flex CharStyle:Code
8027 \begin_layout Plain Layout
8033 Specifies a module to be included by default with this document class.
8034 The module should be specified by filename without the
8035 \begin_inset Flex CharStyle:Code
8038 \begin_layout Plain Layout
8045 The user can still remove the module, but it will be active at the outset.
8046 (This applies only when new files are created, or when this class is chosen
8047 for an existing document.)
8050 \begin_layout Description
8051 \begin_inset Flex CharStyle:Code
8054 \begin_layout Plain Layout
8061 \begin_inset Flex CharStyle:Code
8064 \begin_layout Plain Layout
8070 ] This is the style that will be assigned to new paragraphs, usually
8071 \begin_inset Flex CharStyle:MenuItem
8074 \begin_layout Plain Layout
8081 This will default to the first defined style if not given, but you are
8082 encouraged to use this directive.
8085 \begin_layout Description
8086 \begin_inset Flex CharStyle:Code
8089 \begin_layout Plain Layout
8096 \begin_inset Flex CharStyle:Code
8099 \begin_layout Plain Layout
8105 ] This tag indicates that the module in question—which should be specified
8106 by filename without the
8107 \begin_inset Flex CharStyle:Code
8110 \begin_layout Plain Layout
8116 extension—cannot be used with this document class.
8117 This might be used in a journal-specific layout file to prevent, say, the
8119 \begin_inset Flex CharStyle:Code
8122 \begin_layout Plain Layout
8128 module that numbers theorems by section.
8133 be used in a module.
8134 Modules have their own way of excluding other modules (see
8135 \begin_inset CommandInset ref
8137 reference "sub:Layout-modules"
8144 \begin_layout Description
8145 \begin_inset Flex CharStyle:Code
8148 \begin_layout Plain Layout
8154 Defines a new float.
8156 \begin_inset space ~
8160 \begin_inset CommandInset ref
8162 reference "sub:Floats"
8168 \begin_inset Quotes eld
8172 \begin_inset Flex CharStyle:Code
8175 \begin_layout Plain Layout
8182 \begin_inset Quotes erd
8188 \begin_layout Description
8189 \begin_inset Flex CharStyle:Code
8192 \begin_layout Plain Layout
8198 Sets the information that will be output in the
8199 \begin_inset Flex CharStyle:Code
8202 \begin_layout Plain Layout
8208 block when this document class is output to XHTML.
8209 Note that this will completely override any prior
8210 \begin_inset Flex CharStyle:Code
8213 \begin_layout Plain Layout
8220 \begin_inset Flex CharStyle:Code
8223 \begin_layout Plain Layout
8231 \begin_inset Flex CharStyle:Code
8234 \begin_layout Plain Layout
8240 if you just want to add material to the preamble.) Must end with
8241 \begin_inset Quotes eld
8245 \begin_inset Flex CharStyle:Code
8248 \begin_layout Plain Layout
8255 \begin_inset Quotes erd
8261 \begin_layout Description
8262 \begin_inset Flex CharStyle:Code
8265 \begin_layout Plain Layout
8272 \begin_inset Flex CharStyle:Code
8275 \begin_layout Plain Layout
8281 ] The layout to use for the table of contents, bibliography, and so forth,
8282 when the document is output to HTML.
8283 For articles, this should normally be Section; for books, Chapter.
8284 If it is not given, then LyX will attempt to figure out which layout to
8288 \begin_layout Description
8289 \begin_inset Flex CharStyle:Code
8292 \begin_layout Plain Layout
8299 \begin_inset Flex CharStyle:Code
8302 \begin_layout Plain Layout
8308 ] Modifies the properties of the given counter.
8309 If the counter does not exist, the section is ignored.
8311 \begin_inset Quotes eld
8315 \begin_inset Flex CharStyle:Code
8318 \begin_layout Plain Layout
8325 \begin_inset Quotes erd
8329 \begin_inset Newline newline
8333 \begin_inset space ~
8337 \begin_inset CommandInset ref
8339 reference "sub:Counters"
8343 for details on counters.
8346 \begin_layout Description
8347 \begin_inset Flex CharStyle:Code
8350 \begin_layout Plain Layout
8357 \begin_inset Flex CharStyle:Code
8360 \begin_layout Plain Layout
8366 ] Modifies the properties of the given paragraph style.
8367 If the style does not exist, the section is ignored.
8369 \begin_inset Quotes eld
8373 \begin_inset Flex CharStyle:Code
8376 \begin_layout Plain Layout
8383 \begin_inset Quotes erd
8389 \begin_layout Description
8390 \begin_inset Flex CharStyle:Code
8393 \begin_layout Plain Layout
8399 As its name implies, this command allows you to include another layout
8400 definition file within yours to avoid duplicating commands.
8401 Common examples are the standard layout files, for example,
8402 \begin_inset Flex CharStyle:Code
8405 \begin_layout Plain Layout
8411 , which contains most of the basic layouts.
8414 \begin_layout Description
8415 \begin_inset Flex CharStyle:Code
8418 \begin_layout Plain Layout
8424 This section (re-)defines the layout of an inset.
8425 It can be applied to an existing inset or to a new, user-defined inset,
8426 e.g., a new character style.
8428 \begin_inset Quotes eld
8432 \begin_inset Flex CharStyle:Code
8435 \begin_layout Plain Layout
8442 \begin_inset Quotes erd
8446 \begin_inset Newline newline
8450 \begin_inset space ~
8454 \begin_inset CommandInset ref
8456 reference "sub:Flex-insets-and"
8460 for more information.
8464 \begin_layout Description
8465 \begin_inset Flex CharStyle:Code
8468 \begin_layout Plain Layout
8475 \begin_inset Flex CharStyle:Code
8478 \begin_layout Plain Layout
8484 ] A string that indicates the width of the left margin on the screen, for
8486 \begin_inset Quotes eld
8490 \begin_inset Quotes erd
8494 (Note that this is not a `length', like
8495 \begin_inset Quotes eld
8499 \begin_inset Quotes erd
8505 \begin_layout Description
8506 \begin_inset Flex CharStyle:Code
8509 \begin_layout Plain Layout
8515 This command deletes an existing float.
8516 This is particularly useful when you want to suppress a float that has
8517 been defined in an input file.
8520 \begin_layout Description
8521 \begin_inset Flex CharStyle:Code
8524 \begin_layout Plain Layout
8530 This command deletes an existing style.
8531 This is particularly useful when you want to suppress a style that has
8532 be defined in an input file.
8535 \begin_layout Description
8536 \begin_inset Flex CharStyle:Code
8539 \begin_layout Plain Layout
8545 A string indicating the file format (as defined in the Preferences dialog)
8546 produced by this class.
8547 It is mainly useful when
8548 \begin_inset Flex CharStyle:Code
8551 \begin_layout Plain Layout
8557 is `literate' and one wants to define a new type of literate document.
8558 This string is reset to `docbook', `latex', or `literate' when the correspondin
8560 \begin_inset Flex CharStyle:Code
8563 \begin_layout Plain Layout
8569 parameter is encountered.
8572 \begin_layout Description
8573 \begin_inset Flex CharStyle:Code
8576 \begin_layout Plain Layout
8582 A string indicating what sort of output documents using this class will
8584 At present, the options are: `docbook', `latex', and `literate'.
8587 \begin_layout Description
8588 \begin_inset Flex CharStyle:Code
8591 \begin_layout Plain Layout
8598 \begin_inset Flex CharStyle:Code
8601 \begin_layout Plain Layout
8610 \begin_inset Flex CharStyle:Code
8613 \begin_layout Plain Layout
8620 \begin_inset Flex CharStyle:Code
8623 \begin_layout Plain Layout
8629 ] The default pagestyle.
8630 Can be changed in the
8631 \begin_inset Flex CharStyle:MenuItem
8634 \begin_layout Plain Layout
8635 Document\SpecialChar \menuseparator
8644 \begin_layout Description
8645 \begin_inset Flex CharStyle:Code
8648 \begin_layout Plain Layout
8654 Sets the preamble for the LaTeX document.
8655 Note that this will completely override any prior
8656 \begin_inset Flex CharStyle:Code
8659 \begin_layout Plain Layout
8666 \begin_inset Flex CharStyle:Code
8669 \begin_layout Plain Layout
8677 \begin_inset Flex CharStyle:Code
8680 \begin_layout Plain Layout
8686 if you just want to add material to the preamble.) Must end with
8687 \begin_inset Quotes eld
8691 \begin_inset Flex CharStyle:Code
8694 \begin_layout Plain Layout
8701 \begin_inset Quotes erd
8707 \begin_layout Description
8708 \begin_inset Flex CharStyle:Code
8711 \begin_layout Plain Layout
8718 \begin_inset Flex CharStyle:Code
8721 \begin_layout Plain Layout
8728 \begin_inset Flex CharStyle:Code
8731 \begin_layout Plain Layout
8740 \begin_inset Flex CharStyle:Code
8743 \begin_layout Plain Layout
8749 ] Whether the class already provides the feature
8750 \begin_inset Flex CharStyle:Code
8753 \begin_layout Plain Layout
8760 A feature is in general the name of a package (
8761 \begin_inset Flex CharStyle:Code
8764 \begin_layout Plain Layout
8771 \begin_inset Flex CharStyle:Code
8774 \begin_layout Plain Layout
8780 , \SpecialChar \ldots{}
8782 \begin_inset Flex CharStyle:Code
8785 \begin_layout Plain Layout
8792 \begin_inset Flex CharStyle:Code
8795 \begin_layout Plain Layout
8801 ,\SpecialChar \ldots{}
8802 ); the complete list of supported features is unfortunately not documented
8803 outside the LyX source code—but see
8804 \begin_inset Flex CharStyle:Code
8807 \begin_layout Plain Layout
8813 if you're interested.
8815 \begin_inset Flex CharStyle:MenuItem
8818 \begin_layout Plain Layout
8819 Help\SpecialChar \menuseparator
8825 also gives an overview of the supported packages.
8828 \begin_layout Description
8829 \begin_inset Flex CharStyle:Code
8832 \begin_layout Plain Layout
8839 \begin_inset Flex CharStyle:Code
8842 \begin_layout Plain Layout
8848 ] Indicates that this layout provides the functionality of the module mentioned,
8849 which should be specified by the filename without the
8850 \begin_inset Flex CharStyle:Code
8853 \begin_layout Plain Layout
8860 This will typically be used if the layout includes the module directly,
8861 rather than using the
8862 \begin_inset Flex CharStyle:Code
8865 \begin_layout Plain Layout
8871 tag to indicate that it ought to be used.
8872 It could also be used in a module that provided an alternate implementation
8873 of the same functionality.
8876 \begin_layout Description
8877 \begin_inset Flex CharStyle:Code
8880 \begin_layout Plain Layout
8887 \begin_inset Flex CharStyle:Code
8890 \begin_layout Plain Layout
8896 ] Whether the class requires the feature
8897 \begin_inset Flex CharStyle:Code
8900 \begin_layout Plain Layout
8907 Multiple features must be separated by commas.
8908 Note that you can only request supported features.
8910 \begin_inset Flex CharStyle:Code
8913 \begin_layout Plain Layout
8919 for a list of these.)
8922 \begin_layout Description
8923 \begin_inset Flex CharStyle:Code
8926 \begin_layout Plain Layout
8932 A string that indicates the width of the right margin on the screen, for
8934 \begin_inset Quotes eld
8938 \begin_inset Quotes erd
8944 \begin_layout Description
8945 \begin_inset Flex CharStyle:Code
8948 \begin_layout Plain Layout
8954 Sets which divisions get numbered.
8956 \begin_inset Flex CharStyle:Code
8959 \begin_layout Plain Layout
8968 \begin_layout Description
8969 \begin_inset Flex CharStyle:Code
8972 \begin_layout Plain Layout
8979 \begin_inset Flex CharStyle:Code
8982 \begin_layout Plain Layout
8991 \begin_inset Flex CharStyle:Code
8994 \begin_layout Plain Layout
9000 ] Whether the class-default should be printing on one or both sides of the
9002 Can be changed in the
9003 \begin_inset Flex CharStyle:MenuItem
9006 \begin_layout Plain Layout
9007 Document\SpecialChar \menuseparator
9016 \begin_layout Description
9017 \begin_inset Flex CharStyle:Code
9020 \begin_layout Plain Layout
9026 This sequence defines a paragraph style.
9027 If the style does not yet exist, it is created; if it does exist, its parameter
9030 \begin_inset Quotes eld
9034 \begin_inset Flex CharStyle:Code
9037 \begin_layout Plain Layout
9044 \begin_inset Quotes erd
9048 \begin_inset Newline newline
9052 \begin_inset space ~
9056 \begin_inset CommandInset ref
9058 reference "sub:Paragraph-Styles"
9062 for details on paragraph styles.
9065 \begin_layout Description
9066 \begin_inset Flex CharStyle:Code
9069 \begin_layout Plain Layout
9076 \begin_inset Flex CharStyle:Code
9079 \begin_layout Plain Layout
9085 ] The name of the command or environment to be used with
9086 \begin_inset Flex CharStyle:Code
9089 \begin_layout Plain Layout
9098 \begin_layout Description
9099 \begin_inset Flex CharStyle:Code
9102 \begin_layout Plain Layout
9109 \begin_inset Flex CharStyle:Code
9112 \begin_layout Plain Layout
9121 \begin_inset Flex CharStyle:Code
9124 \begin_layout Plain Layout
9130 ] Indicates what kind of markup is used to define the title of a document.
9132 \begin_inset Flex CharStyle:Code
9135 \begin_layout Plain Layout
9141 means that the macro with name
9142 \begin_inset Flex CharStyle:Code
9145 \begin_layout Plain Layout
9151 will be inserted after the last layout which has
9152 \begin_inset Quotes eld
9156 \begin_inset Flex CharStyle:Code
9159 \begin_layout Plain Layout
9166 \begin_inset Quotes erd
9171 \begin_inset Flex CharStyle:Code
9174 \begin_layout Plain Layout
9180 corresponds to the case where the block of paragraphs which have
9181 \begin_inset Quotes eld
9185 \begin_inset Flex CharStyle:Code
9188 \begin_layout Plain Layout
9195 \begin_inset Quotes erd
9198 should be enclosed into the
9199 \begin_inset Flex CharStyle:Code
9202 \begin_layout Plain Layout
9211 \begin_layout Description
9212 \begin_inset Flex CharStyle:Code
9215 \begin_layout Plain Layout
9221 Sets which divisions are included in the table of contents.
9223 \begin_inset Flex CharStyle:Code
9226 \begin_layout Plain Layout
9235 \begin_layout Subsection
9236 \begin_inset Flex CharStyle:Code
9239 \begin_layout Plain Layout
9246 \begin_inset CommandInset label
9248 name "sub:ClassOptions"
9255 \begin_layout Standard
9257 \begin_inset Flex CharStyle:Code
9260 \begin_layout Plain Layout
9266 section can contain the following entries:
9269 \begin_layout Description
9270 \begin_inset Flex CharStyle:Code
9273 \begin_layout Plain Layout
9280 \begin_inset Flex CharStyle:Code
9283 \begin_layout Plain Layout
9289 ] The list of available font sizes for the document's main font, separated
9291 \begin_inset Quotes eld
9295 \begin_inset Flex CharStyle:Code
9298 \begin_layout Plain Layout
9305 \begin_inset Quotes erd
9311 \begin_layout Description
9312 \begin_inset Flex CharStyle:Code
9315 \begin_layout Plain Layout
9321 Used to set the DTD line with XML-based output classes.
9323 \begin_inset space \thinspace{}
9327 \begin_inset Quotes eld
9330 -//OASIS//DTD DocBook V4.2//EN
9331 \begin_inset Quotes erd
9337 \begin_layout Description
9338 \begin_inset Flex CharStyle:Code
9341 \begin_layout Plain Layout
9348 \begin_inset Flex CharStyle:Code
9351 \begin_layout Plain Layout
9352 string="empty|plain|headings|fancy"
9357 ] The list of available page styles, separated by
9358 \begin_inset Quotes eld
9362 \begin_inset Flex CharStyle:Code
9365 \begin_layout Plain Layout
9372 \begin_inset Quotes erd
9378 \begin_layout Description
9379 \begin_inset Flex CharStyle:Code
9382 \begin_layout Plain Layout
9389 \begin_inset Flex CharStyle:Code
9392 \begin_layout Plain Layout
9398 ] Some document class options, separated by a comma, that will be added
9399 to the optional part of the
9400 \begin_inset Flex CharStyle:Code
9403 \begin_layout Plain Layout
9414 \begin_layout Standard
9416 \begin_inset Flex CharStyle:Code
9419 \begin_layout Plain Layout
9425 section must end with
9426 \begin_inset Quotes eld
9430 \begin_inset Flex CharStyle:Code
9433 \begin_layout Plain Layout
9440 \begin_inset Quotes erd
9446 \begin_layout Subsection
9448 \begin_inset CommandInset label
9450 name "sub:Paragraph-Styles"
9457 \begin_layout Standard
9458 A paragraph style description looks like this:
9462 \begin_layout Plain Layout
9463 Note that this will either define a new layout or modify an existing one.
9471 \begin_layout LyX-Code
9478 \begin_layout LyX-Code
9482 \begin_layout LyX-Code
9486 \begin_layout Standard
9487 where the following commands are allowed:
9490 \begin_layout Description
9491 \begin_inset Flex CharStyle:Code
9494 \begin_layout Plain Layout
9501 \begin_inset Flex CharStyle:Code
9504 \begin_layout Plain Layout
9509 , left, right, center
9514 ] Paragraph alignment.
9517 \begin_layout Description
9518 \begin_inset Flex CharStyle:Code
9521 \begin_layout Plain Layout
9528 \begin_inset Flex CharStyle:Code
9531 \begin_layout Plain Layout
9536 , left, right, center
9541 ] A comma separated list of permitted alignments.
9542 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
9544 For example a right-aligned or centered enumeration isn't possible.)
9547 \begin_layout Description
9548 \begin_inset Flex CharStyle:Code
9551 \begin_layout Plain Layout
9557 Note that this will completely override any prior
9558 \begin_inset Flex CharStyle:Code
9561 \begin_layout Plain Layout
9567 declaration for this style.
9569 \begin_inset Quotes eld
9573 \begin_inset Flex CharStyle:Code
9576 \begin_layout Plain Layout
9583 \begin_inset Quotes erd
9588 \begin_inset CommandInset ref
9590 reference "sub:I18n"
9594 for details on its use.
9597 \begin_layout Description
9598 \begin_inset Flex CharStyle:Code
9601 \begin_layout Plain Layout
9608 \begin_inset Flex CharStyle:Code
9611 \begin_layout Plain Layout
9621 \begin_layout Plain Layout
9622 Note that a `float' here is a real number, such as: 1.5.
9627 The vertical space with which the last of a chain of paragraphs with this
9628 layout is separated from the following paragraph.
9629 If the next paragraph has another layout, the separations are not simply
9630 added, but the maximum is taken.
9633 \begin_layout Description
9634 \begin_inset Flex CharStyle:Code
9637 \begin_layout Plain Layout
9644 \begin_inset Flex CharStyle:Code
9647 \begin_layout Plain Layout
9653 The category for this style.
9654 This is used to group related styles in the Layout combobox on the toolbar.
9655 Any string can be used, but you may want to use existing categories with
9660 \begin_layout Description
9661 \begin_inset Flex CharStyle:Code
9664 \begin_layout Plain Layout
9670 Depth of XML command.
9671 Used only with XML-type formats.
9674 \begin_layout Description
9675 \begin_inset Flex CharStyle:Code
9678 \begin_layout Plain Layout
9685 \begin_inset CommandInset label
9687 name "des:CopyStyle"
9692 \begin_inset Flex CharStyle:Code
9695 \begin_layout Plain Layout
9701 Copies all the features of an existing style into the current one.
9705 \begin_layout Description
9706 \begin_inset Flex CharStyle:Code
9709 \begin_layout Plain Layout
9715 The name of a style whose preamble should be output
9720 This allows to ensure some ordering of the preamble snippets when macros
9721 definitions depend on one another.
9725 \begin_layout Plain Layout
9726 Note that, besides that functionality, there is no way to ensure any ordering
9728 The ordering that you see in a given version of LyX may change without
9729 warning in later versions.
9737 \begin_layout Description
9738 \begin_inset Flex CharStyle:Code
9741 \begin_layout Plain Layout
9748 \begin_inset Flex CharStyle:Code
9751 \begin_layout Plain Layout
9756 , Box, Filled_Box, Static
9761 ] The type of label that stands at the end of the paragraph (or sequence
9763 \begin_inset Flex CharStyle:Code
9766 \begin_layout Plain Layout
9773 \begin_inset Flex CharStyle:Code
9776 \begin_layout Plain Layout
9783 \begin_inset Flex CharStyle:Code
9786 \begin_layout Plain Layout
9793 \begin_inset Flex CharStyle:Code
9796 \begin_layout Plain Layout
9804 \begin_inset Flex CharStyle:Code
9807 \begin_layout Plain Layout
9814 \begin_inset Quotes eld
9818 \begin_inset Quotes erd
9822 \begin_inset Flex CharStyle:Code
9825 \begin_layout Plain Layout
9832 \begin_inset Flex CharStyle:Code
9835 \begin_layout Plain Layout
9836 \begin_inset space ~
9845 \begin_inset space ~
9848 black) square suitable for end of proof markers,
9849 \begin_inset Flex CharStyle:Code
9852 \begin_layout Plain Layout
9858 is an explicit text string.
9861 \begin_layout Description
9862 \begin_inset Flex CharStyle:Code
9865 \begin_layout Plain Layout
9872 \begin_inset Flex CharStyle:Code
9875 \begin_layout Plain Layout
9881 ] The string used for a label with a
9882 \begin_inset Flex CharStyle:Code
9885 \begin_layout Plain Layout
9892 \begin_inset Flex CharStyle:Code
9895 \begin_layout Plain Layout
9905 \begin_layout Description
9906 \begin_inset Flex CharStyle:Code
9909 \begin_layout Plain Layout
9916 \begin_inset Flex CharStyle:Code
9919 \begin_layout Plain Layout
9930 \begin_inset Flex CharStyle:Code
9933 \begin_layout Plain Layout
9942 \begin_layout Description
9943 \begin_inset Flex CharStyle:Code
9946 \begin_layout Plain Layout
9953 \begin_inset Flex CharStyle:Code
9956 \begin_layout Plain Layout
9966 ] With this parameter the
9967 \begin_inset Flex CharStyle:MenuItem
9970 \begin_layout Plain Layout
9977 \begin_inset Quotes eld
9980 Vertical space above
9981 \begin_inset Quotes erd
9985 \begin_inset Flex CharStyle:MenuItem
9988 \begin_layout Plain Layout
9989 Edit\SpecialChar \menuseparator
9991 \begin_inset space ~
9999 dialog can be set when initializing a paragraph with this style.
10003 \begin_layout Plain Layout
10006 Note from Jean-Marc:
10008 I'm not sure that this setting has much use, and it should probably be
10009 removed in later versions.
10017 \begin_layout Description
10018 \begin_inset Flex CharStyle:Code
10021 \begin_layout Plain Layout
10027 The font used for both the text body
10033 \begin_inset space ~
10037 \begin_inset CommandInset ref
10039 reference "sub:Font-description"
10044 Note that defining this font automatically defines the
10045 \begin_inset Flex CharStyle:Code
10048 \begin_layout Plain Layout
10055 So you should define this one first if you also want to define
10056 \begin_inset Flex CharStyle:Code
10059 \begin_layout Plain Layout
10068 \begin_layout Description
10069 \begin_inset Flex CharStyle:Code
10072 \begin_layout Plain Layout
10079 \begin_inset CommandInset label
10081 name "des:FreeSpacing"
10086 \begin_inset Flex CharStyle:Code
10089 \begin_layout Plain Layout
10098 \begin_inset Flex CharStyle:Code
10101 \begin_layout Plain Layout
10107 ] Usually LyX doesn't allow you to insert more than one space between words,
10108 since a space is considered as the separation between two words, not a
10109 character or symbol of its own.
10110 This is a very fine thing but sometimes annoying, for example, when typing
10111 program code or plain LaTeX code.
10113 \begin_inset Flex CharStyle:Code
10116 \begin_layout Plain Layout
10123 Note that LyX will create protected blanks for the additional blanks when
10124 in another mode than LaTeX-mode.
10127 \begin_layout Description
10128 \begin_inset Flex CharStyle:Code
10131 \begin_layout Plain Layout
10137 These tags are used with XHTML output.
10139 \begin_inset CommandInset ref
10141 reference "sub:Paragraph-Style-XHTML"
10148 \begin_layout Description
10149 \begin_inset Flex CharStyle:Code
10152 \begin_layout Plain Layout
10158 [[FIXME]] (Used only with XML-type formats.)
10161 \begin_layout Description
10162 \begin_inset Flex CharStyle:Code
10165 \begin_layout Plain Layout
10172 \begin_inset Flex CharStyle:Code
10175 \begin_layout Plain Layout
10181 If 1, marks the layout as to be included in the document preamble rather
10182 than in the document body.
10183 This is useful for document classes that want such information as the title
10184 and author to appear in the preamble.
10185 Note that this works only for layouts for which the
10186 \begin_inset Flex CharStyle:Code
10189 \begin_layout Plain Layout
10196 \begin_inset Flex CharStyle:Code
10199 \begin_layout Plain Layout
10208 \begin_layout Description
10209 \begin_inset Flex CharStyle:Code
10212 \begin_layout Plain Layout
10219 \begin_inset Flex CharStyle:Code
10222 \begin_layout Plain Layout
10228 If 1, marks the layout as being part of a title block (see also the
10229 \begin_inset Flex CharStyle:Code
10232 \begin_layout Plain Layout
10239 \begin_inset Flex CharStyle:Code
10242 \begin_layout Plain Layout
10251 \begin_layout Description
10252 \begin_inset Flex CharStyle:Code
10255 \begin_layout Plain Layout
10262 \begin_inset Flex CharStyle:Code
10265 \begin_layout Plain Layout
10271 ] This provides extra space between paragraphs that have the same layout.
10272 If you put other layouts into an environment, each is separated with the
10274 \begin_inset Flex CharStyle:Code
10277 \begin_layout Plain Layout
10284 But the whole items of the environment are additionally separated with
10286 \begin_inset Flex CharStyle:Code
10289 \begin_layout Plain Layout
10296 Note that this is a
10301 \begin_layout Description
10302 \begin_inset Flex CharStyle:Code
10305 \begin_layout Plain Layout
10311 [[FIXME]] (Used only with XML-type formats.)
10314 \begin_layout Description
10315 \begin_inset Flex CharStyle:Code
10318 \begin_layout Plain Layout
10325 \begin_inset CommandInset label
10327 name "des:KeepEmpty"
10332 \begin_inset Flex CharStyle:Code
10335 \begin_layout Plain Layout
10344 \begin_inset Flex CharStyle:Code
10347 \begin_layout Plain Layout
10353 ] Usually LyX does not allow you to leave a paragraph empty, since it would
10354 lead to empty LaTeX output.
10355 There are some cases where this could be desirable however: in a letter
10356 template, the required fields can be provided as empty fields, so that
10357 people do not forget them; in some special classes, a layout can be used
10358 as some kind of break, which does not contain actual text.
10361 \begin_layout Description
10362 \begin_inset Flex CharStyle:Code
10365 \begin_layout Plain Layout
10371 [float=0] The vertical space between the label and the text body.
10372 Only used for labels that are above the text body (
10373 \begin_inset Flex CharStyle:Code
10376 \begin_layout Plain Layout
10383 \begin_inset Flex CharStyle:Code
10386 \begin_layout Plain Layout
10387 Centered_Top_Environment
10395 \begin_layout Description
10396 \begin_inset Flex CharStyle:Code
10399 \begin_layout Plain Layout
10406 \begin_inset Flex CharStyle:Code
10409 \begin_layout Plain Layout
10416 \begin_inset Newline newline
10419 The name of the counter for automatic numbering.
10421 \begin_inset Newline newline
10429 \begin_inset Flex CharStyle:Code
10432 \begin_layout Plain Layout
10439 \begin_inset Flex CharStyle:Code
10442 \begin_layout Plain Layout
10449 In that case, the counter will be stepped each time the layout appears.
10451 \begin_inset Newline newline
10459 \begin_inset Flex CharStyle:Code
10462 \begin_layout Plain Layout
10469 \begin_inset Flex CharStyle:Code
10472 \begin_layout Plain Layout
10478 , though this case is a bit complicated.
10479 Suppose you declare
10480 \begin_inset Quotes eld
10484 \begin_inset Flex CharStyle:Code
10487 \begin_layout Plain Layout
10488 LabelCounter myenum
10494 \begin_inset Quotes erd
10498 Then the actual counters used are
10499 \begin_inset Flex CharStyle:Code
10502 \begin_layout Plain Layout
10509 \begin_inset Flex CharStyle:Code
10512 \begin_layout Plain Layout
10519 \begin_inset Flex CharStyle:Code
10522 \begin_layout Plain Layout
10529 \begin_inset Flex CharStyle:Code
10532 \begin_layout Plain Layout
10538 , much as in LaTeX.
10539 These counters must all be declared separately.
10540 \begin_inset Newline newline
10544 \begin_inset CommandInset ref
10546 reference "sub:Counters"
10550 for details on counters.
10553 \begin_layout Description
10554 \begin_inset Flex CharStyle:Code
10557 \begin_layout Plain Layout
10563 The font used for the label.
10565 \begin_inset space ~
10569 \begin_inset CommandInset ref
10571 reference "sub:Font-description"
10578 \begin_layout Description
10579 \begin_inset Flex CharStyle:Code
10582 \begin_layout Plain Layout
10588 Text that indicates how far a label should be indented.
10591 \begin_layout Description
10592 \begin_inset Flex CharStyle:Code
10595 \begin_layout Plain Layout
10602 \begin_inset Flex CharStyle:Code
10605 \begin_layout Plain Layout
10611 ] The horizontal space between the label and the text body.
10612 Only used for labels that are not above the text body.
10615 \begin_layout Description
10616 \begin_inset Flex CharStyle:Code
10619 \begin_layout Plain Layout
10626 \begin_inset Flex CharStyle:Code
10629 \begin_layout Plain Layout
10635 ] The string used for a label with a
10636 \begin_inset Flex CharStyle:Code
10639 \begin_layout Plain Layout
10647 \begin_inset Flex CharStyle:Code
10650 \begin_layout Plain Layout
10656 is set, this string can be contain the special formatting commands described
10658 \begin_inset CommandInset ref
10660 reference "sub:Counters"
10668 \begin_layout Plain Layout
10669 For the sake of backwards compatibility, the string
10670 \begin_inset Flex CharStyle:Code
10673 \begin_layout Plain Layout
10683 will be replaced by the expanded
10684 \begin_inset Flex CharStyle:Code
10687 \begin_layout Plain Layout
10694 \begin_inset Flex CharStyle:Code
10697 \begin_layout Plain Layout
10706 This feature is now obsolete and should be replaced by the mechanisms of
10708 \begin_inset CommandInset ref
10710 reference "sub:Counters"
10722 \begin_layout Description
10723 \begin_inset Flex CharStyle:Code
10726 \begin_layout Plain Layout
10727 LabelStringAppendix
10733 \begin_inset Flex CharStyle:Code
10736 \begin_layout Plain Layout
10742 ] This is used inside the appendix instead of
10743 \begin_inset Flex CharStyle:Code
10746 \begin_layout Plain Layout
10754 \begin_inset Flex CharStyle:Code
10757 \begin_layout Plain Layout
10764 \begin_inset Flex CharStyle:Code
10767 \begin_layout Plain Layout
10768 LabelStringAppendix
10776 \begin_layout Description
10777 \begin_inset Flex CharStyle:Code
10780 \begin_layout Plain Layout
10786 [FIXME] (Used only with XML-type formats.)
10789 \begin_layout Description
10790 \begin_inset Flex CharStyle:Code
10793 \begin_layout Plain Layout
10800 \begin_inset Flex CharStyle:Code
10803 \begin_layout Plain Layout
10808 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
10809 Enumerate, Itemize, Bibliography
10818 \begin_layout Itemize
10819 \begin_inset Flex CharStyle:Code
10822 \begin_layout Plain Layout
10828 means the label is the very first word (up to the first real blank).
10829 Use protected spaces (like
10830 \begin_inset space ~
10833 that one) if you want more than one word as the label.
10837 \begin_layout Itemize
10838 \begin_inset Flex CharStyle:Code
10841 \begin_layout Plain Layout
10847 means the label is simply whatever
10848 \begin_inset Flex CharStyle:Code
10851 \begin_layout Plain Layout
10858 Note that this really is `static'.
10861 \begin_layout Itemize
10862 \begin_inset Flex CharStyle:Code
10865 \begin_layout Plain Layout
10872 \begin_inset Flex CharStyle:Code
10875 \begin_layout Plain Layout
10876 Centered_Top_Environment
10881 are special cases of
10882 \begin_inset Flex CharStyle:Code
10885 \begin_layout Plain Layout
10892 The label will be printed above the paragraph, but only at the top of an
10893 environment or the top of a chain of paragraphs with this layout.
10894 This might be used with the
10895 \begin_inset Flex CharStyle:MenuItem
10898 \begin_layout Plain Layout
10904 layout, for example.
10907 \begin_layout Itemize
10908 \begin_inset Flex CharStyle:Code
10911 \begin_layout Plain Layout
10917 is a special case for the caption-labels
10918 \begin_inset Quotes eld
10922 \begin_inset Quotes erd
10926 \begin_inset Quotes eld
10930 \begin_inset Quotes erd
10935 \begin_inset Flex CharStyle:Code
10938 \begin_layout Plain Layout
10944 means the (hardcoded) label string depends on the kind of float: It is
10945 hardcoded to be `FloatType N', where N is the value of the counter associated
10949 \begin_layout Itemize
10951 \begin_inset Flex CharStyle:Code
10954 \begin_layout Plain Layout
10960 label type defines automatically numbered labels.
10962 \begin_inset Flex CharStyle:Code
10965 \begin_layout Plain Layout
10971 will be expanded to resolve any counter references it contains: For example,
10973 \begin_inset Quotes eld
10977 \begin_inset Flex CharStyle:Code
10980 \begin_layout Plain Layout
10991 \begin_inset Quotes erd
10996 \begin_inset CommandInset ref
10998 reference "sub:Counters"
11002 for more information on counters.
11005 \begin_layout Itemize
11006 \begin_inset Flex CharStyle:Code
11009 \begin_layout Plain Layout
11015 produces the usual sort of enumeration labels.
11016 At present, it is hardcoded to use Arabic numerals, lowercase letters,
11017 small Roman numerals, and uppercase letters for the four possible depths.
11020 \begin_layout Itemize
11021 \begin_inset Flex CharStyle:Code
11024 \begin_layout Plain Layout
11030 produces various bullets at the different levels.
11031 It is also hardcoded.
11034 \begin_layout Itemize
11035 \begin_inset Flex CharStyle:Code
11038 \begin_layout Plain Layout
11044 is used internally by LyX and should be used only with
11045 \begin_inset Flex CharStyle:Code
11048 \begin_layout Plain Layout
11049 LatexType BibEnvironment
11058 \begin_layout Description
11059 \begin_inset Flex CharStyle:Code
11062 \begin_layout Plain Layout
11068 Note that this will completely override any prior
11069 \begin_inset Flex CharStyle:Code
11072 \begin_layout Plain Layout
11078 declaration for this style.
11080 \begin_inset Quotes eld
11084 \begin_inset Flex CharStyle:Code
11087 \begin_layout Plain Layout
11094 \begin_inset Quotes erd
11099 \begin_inset CommandInset ref
11101 reference "sub:I18n"
11105 for details on its use.
11108 \begin_layout Description
11109 \begin_inset Flex CharStyle:Code
11112 \begin_layout Plain Layout
11118 The name of the corresponding LaTeX stuff.
11119 Either the environment or command name.
11122 \begin_layout Description
11123 \begin_inset Flex CharStyle:Code
11126 \begin_layout Plain Layout
11132 An optional parameter for the corresponding
11133 \begin_inset Flex CharStyle:Code
11136 \begin_layout Plain Layout
11143 This parameter cannot be changed from within LyX.
11146 \begin_layout Description
11147 \begin_inset Flex CharStyle:Code
11150 \begin_layout Plain Layout
11157 \begin_inset CommandInset label
11159 name "des:LatexType"
11164 \begin_inset Flex CharStyle:Code
11167 \begin_layout Plain Layout
11172 , Command, Environment, Item_Environment,
11178 \begin_inset Flex CharStyle:Code
11181 \begin_layout Plain Layout
11182 List_Environment, Bib_Environment
11187 ] How the layout should be translated into LaTeX.
11191 \begin_layout Plain Layout
11192 \begin_inset Flex CharStyle:Code
11195 \begin_layout Plain Layout
11201 is perhaps a bit misleading, since these rules apply to SGML classes, too.
11202 Visit the SGML class files for specific examples.
11211 \begin_layout Itemize
11212 \begin_inset Flex CharStyle:Code
11215 \begin_layout Plain Layout
11221 means nothing special.
11225 \begin_layout Itemize
11226 \begin_inset Flex CharStyle:Code
11229 \begin_layout Plain Layout
11236 \begin_inset Flex CharStyle:Code
11239 \begin_layout Plain Layout
11246 {\SpecialChar \ldots{}
11255 \begin_layout Itemize
11256 \begin_inset Flex CharStyle:Code
11259 \begin_layout Plain Layout
11266 \begin_inset Flex CharStyle:Code
11269 \begin_layout Plain Layout
11276 }\SpecialChar \ldots{}
11292 \begin_layout Itemize
11293 \begin_inset Flex CharStyle:Code
11296 \begin_layout Plain Layout
11303 \begin_inset Flex CharStyle:Code
11306 \begin_layout Plain Layout
11313 \begin_inset Flex CharStyle:Code
11316 \begin_layout Plain Layout
11324 is generated for each paragraph of this environment.
11328 \begin_layout Itemize
11329 \begin_inset Flex CharStyle:Code
11332 \begin_layout Plain Layout
11339 \begin_inset Flex CharStyle:Code
11342 \begin_layout Plain Layout
11349 \begin_inset Flex CharStyle:Code
11352 \begin_layout Plain Layout
11358 is passed as an argument to the environment.
11360 \begin_inset Flex CharStyle:Code
11363 \begin_layout Plain Layout
11369 can be defined in the
11370 \begin_inset Flex CharStyle:MenuItem
11373 \begin_layout Plain Layout
11378 ayout\SpecialChar \menuseparator
11392 \begin_layout Standard
11393 Putting the last few things together, the LaTeX output will be either:
11396 \begin_layout LyX-Code
11399 latexname[latexparam]{\SpecialChar \ldots{}
11403 \begin_layout Standard
11407 \begin_layout LyX-Code
11410 begin{latexname}[latexparam] \SpecialChar \ldots{}
11416 \begin_layout Standard
11417 depending upon the LaTeX type.
11421 \begin_layout Description
11422 \begin_inset Flex CharStyle:Code
11425 \begin_layout Plain Layout
11432 \begin_inset Flex CharStyle:Code
11435 \begin_layout Plain Layout
11441 ] If you put layouts into environments, the leftmargins are not simply added,
11442 but added with a factor
11443 \begin_inset Formula $\frac{4}{depth+4}$
11447 Note that this parameter is also used when the margin is defined as
11448 \begin_inset Flex CharStyle:Code
11451 \begin_layout Plain Layout
11458 \begin_inset Flex CharStyle:Code
11461 \begin_layout Plain Layout
11468 Then it is added to the manual or dynamic margin.
11470 \begin_inset Newline newline
11473 The argument is passed as a string.
11475 \begin_inset Quotes eld
11479 \begin_inset Flex CharStyle:Code
11482 \begin_layout Plain Layout
11489 \begin_inset Quotes erd
11492 means that the paragraph is indented with the width of
11493 \begin_inset Quotes eld
11497 \begin_inset Flex CharStyle:Code
11500 \begin_layout Plain Layout
11507 \begin_inset Quotes erd
11510 in the normal font.
11511 You can get a negative width by prefixing the string with
11512 \begin_inset Quotes eld
11516 \begin_inset Flex CharStyle:Code
11519 \begin_layout Plain Layout
11526 \begin_inset Quotes erd
11530 This way was chosen so that the look is the same with each used screen
11535 \begin_layout Description
11536 \begin_inset Flex CharStyle:Code
11539 \begin_layout Plain Layout
11546 \begin_inset Flex CharStyle:Code
11549 \begin_layout Plain Layout
11554 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11560 \begin_inset Newline newline
11563 The kind of margin that the layout has on the left side.
11565 \begin_inset Flex CharStyle:Code
11568 \begin_layout Plain Layout
11574 just means a fixed margin.
11576 \begin_inset Flex CharStyle:Code
11579 \begin_layout Plain Layout
11585 means that the left margin depends on the string entered in the
11586 \begin_inset Flex CharStyle:MenuItem
11589 \begin_layout Plain Layout
11590 Edit\SpecialChar \menuseparator
11592 \begin_inset space ~
11601 This is used to typeset nice lists without tabulators.
11603 \begin_inset Flex CharStyle:Code
11606 \begin_layout Plain Layout
11612 means that the margin depends on the size of the label.
11613 This is used for automatic enumerated headlines.
11614 It is obvious that the headline
11615 \begin_inset Quotes eld
11618 5.4.3.2.1 Very long headline
11619 \begin_inset Quotes erd
11622 must have a wider left margin (as wide as
11623 \begin_inset Quotes eld
11627 \begin_inset Quotes erd
11630 plus the space) than
11631 \begin_inset Quotes eld
11634 3.2 Very long headline
11635 \begin_inset Quotes erd
11639 \begin_inset Quotes eld
11643 \begin_inset Quotes erd
11646 are not able to do this.
11648 \begin_inset Flex CharStyle:Code
11651 \begin_layout Plain Layout
11657 is similar, but only the very first row of the paragraph is dynamic, while
11658 the others are static; this is used, for example, for descriptions.
11660 \begin_inset Flex CharStyle:Code
11663 \begin_layout Plain Layout
11669 means the margin is chosen in a way that the longest row of this paragraph
11670 fits to the right margin.
11671 This is used to typeset an address on the right edge of the page.
11674 \begin_layout Description
11675 \begin_inset Flex CharStyle:Code
11678 \begin_layout Plain Layout
11685 \begin_inset Flex CharStyle:Code
11688 \begin_layout Plain Layout
11697 \begin_inset Flex CharStyle:Code
11700 \begin_layout Plain Layout
11706 ] Whether fragile commands in this layout should be
11707 \begin_inset Flex CharStyle:Code
11710 \begin_layout Plain Layout
11723 whether this command should itself be protected.)
11726 \begin_layout Description
11727 \begin_inset Flex CharStyle:Code
11730 \begin_layout Plain Layout
11737 \begin_inset Flex CharStyle:Code
11740 \begin_layout Plain Layout
11747 \begin_inset Flex CharStyle:Code
11750 \begin_layout Plain Layout
11758 ] Whether newlines are translated into LaTeX newlines (
11759 \begin_inset Flex CharStyle:Code
11762 \begin_layout Plain Layout
11773 The translation can be switched off to allow more comfortable LaTeX editing
11777 \begin_layout Description
11778 \begin_inset Flex CharStyle:Code
11781 \begin_layout Plain Layout
11788 \begin_inset Flex CharStyle:Code
11791 \begin_layout Plain Layout
11798 \begin_inset Flex CharStyle:Code
11801 \begin_layout Plain Layout
11809 ] Whether the following Paragraph is allowed to indent its very first row.
11811 \begin_inset Flex CharStyle:Code
11814 \begin_layout Plain Layout
11820 means that it is not allowed to do so;
11821 \begin_inset Flex CharStyle:Code
11824 \begin_layout Plain Layout
11830 means it could do so if it wants to.
11833 \begin_layout Description
11834 \begin_inset Flex CharStyle:Code
11837 \begin_layout Plain Layout
11843 Name of a layout that has replaced this layout.
11844 This is used to rename a layout, while keeping backward compatibility.
11847 \begin_layout Description
11848 \begin_inset Flex CharStyle:Code
11851 \begin_layout Plain Layout
11858 \begin_inset Flex CharStyle:Code
11861 \begin_layout Plain Layout
11867 ] The number of optional arguments that can be used with this layout.
11868 This is useful for things like section headings, and only makes sense with
11870 Note that, on output, the optional arguments will all precede any required
11871 arguments (see below).
11872 So one can have constructs like:
11876 \begin_layout LyX-Code
11879 mycmd[opt1]{req1}{contents of paragraph}
11882 \begin_layout Standard
11883 but one cannot have things like:
11886 \begin_layout LyX-Code
11889 mycmd[opt1]{req1}[opt2]{contents of paragraph}
11892 \begin_layout Standard
11893 at least, not without ERT (with which you can have anything).
11898 \begin_layout Description
11899 \begin_inset Flex CharStyle:Code
11902 \begin_layout Plain Layout
11909 \begin_inset CommandInset label
11911 name "des:ParbreakIsNewline"
11916 \begin_inset Flex CharStyle:Code
11919 \begin_layout Plain Layout
11928 \begin_inset Flex CharStyle:Code
11931 \begin_layout Plain Layout
11937 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
11938 output, but only by a line break; together with
11939 \begin_inset Flex CharStyle:Code
11942 \begin_layout Plain Layout
11948 , this allows to emulate a plain text editor (like the ERT inset).
11951 \begin_layout Description
11952 \begin_inset Flex CharStyle:Code
11955 \begin_layout Plain Layout
11962 \begin_inset Flex CharStyle:Code
11965 \begin_layout Plain Layout
11971 ] The indent of the very first line of a paragraph.
11973 \begin_inset Flex CharStyle:Code
11976 \begin_layout Plain Layout
11982 will be fixed for a certain layout.
11983 The exception is Standard layout, since the indentation of a Standard layout
11984 paragraph can be prohibited with
11985 \begin_inset Flex CharStyle:Code
11988 \begin_layout Plain Layout
11995 Also, Standard layout paragraphs inside environments use the
11996 \begin_inset Flex CharStyle:Code
11999 \begin_layout Plain Layout
12005 of the environment, not their native one.
12006 For example, Standard paragraphs inside an enumeration are not indented.
12009 \begin_layout Description
12010 \begin_inset Flex CharStyle:Code
12013 \begin_layout Plain Layout
12020 \begin_inset Flex CharStyle:Code
12023 \begin_layout Plain Layout
12029 ] The vertical space between two paragraphs of this layout.
12032 \begin_layout Description
12033 \begin_inset Flex CharStyle:Code
12036 \begin_layout Plain Layout
12043 \begin_inset Flex CharStyle:Code
12046 \begin_layout Plain Layout
12052 ] LyX allows the user to choose either
12053 \begin_inset Quotes eld
12057 \begin_inset Quotes erd
12061 \begin_inset Quotes eld
12065 \begin_inset Quotes erd
12068 to typeset a document.
12070 \begin_inset Quotes eld
12074 \begin_inset Quotes erd
12077 is chosen, this value is completely ignored.
12079 \begin_inset Quotes eld
12083 \begin_inset Quotes erd
12086 is chosen, the parindent of a LaTeXtype
12087 \begin_inset Quotes eld
12091 \begin_inset Quotes erd
12094 layout is ignored and all paragraphs are separated by this parskip argument.
12095 The vertical space is calculated with
12096 \begin_inset Flex CharStyle:Code
12099 \begin_layout Plain Layout
12101 \begin_inset space ~
12110 \begin_inset Flex CharStyle:Code
12113 \begin_layout Plain Layout
12119 is the height of a row with the normal font.
12120 This way, the look stays the same with different screen fonts.
12123 \begin_layout Description
12124 \begin_inset Flex CharStyle:Code
12127 \begin_layout Plain Layout
12134 \begin_inset CommandInset label
12136 name "des:PassThru"
12141 \begin_inset Flex CharStyle:Code
12144 \begin_layout Plain Layout
12153 \begin_inset Flex CharStyle:Code
12156 \begin_layout Plain Layout
12162 ] Whether the contents of this paragraph should be output in raw form, meaning
12163 without special translations that LaTeX would require.
12166 \begin_layout Description
12167 \begin_inset Flex CharStyle:Code
12170 \begin_layout Plain Layout
12177 \begin_inset CommandInset label
12179 name "des:Preamble"
12183 Information to be included in the LaTeX preamble when this style is used.
12184 Used to define macros, load packages, etc., required by this particular
12187 \begin_inset Quotes eld
12191 \begin_inset Flex CharStyle:Code
12194 \begin_layout Plain Layout
12201 \begin_inset Quotes erd
12207 \begin_layout Description
12208 \begin_inset Flex CharStyle:Code
12211 \begin_layout Plain Layout
12218 \begin_inset Flex CharStyle:Code
12221 \begin_layout Plain Layout
12227 ] The prefix to use when creating labels referring to paragraphs of this
12229 This allows the use of formatted references.
12232 \begin_layout Description
12233 \begin_inset Flex CharStyle:Code
12236 \begin_layout Plain Layout
12243 \begin_inset Flex CharStyle:Code
12246 \begin_layout Plain Layout
12252 ] The number of required arguments that the LaTeX command or environment
12253 corresponding to this layout expects.
12254 In the case of a command, these are required arguments
12258 that associated with the content of the paragraph itself.
12259 These do not actually have to be provided: LyX will output empty arguments
12261 Note that optional arguments will be output before required arguments.
12262 See the discussion of the
12263 \begin_inset Flex CharStyle:Code
12266 \begin_layout Plain Layout
12272 tag above for more information.
12275 \begin_layout Description
12276 \begin_inset Flex CharStyle:Code
12279 \begin_layout Plain Layout
12286 \begin_inset Flex CharStyle:Code
12289 \begin_layout Plain Layout
12296 \begin_inset CommandInset label
12298 name "des:Requires"
12302 Whether the layout requires the feature
12303 \begin_inset Flex CharStyle:Code
12306 \begin_layout Plain Layout
12313 See the description of
12314 \begin_inset Flex CharStyle:Code
12317 \begin_layout Plain Layout
12324 \begin_inset CommandInset ref
12325 LatexCommand pageref
12326 reference "des:FreeSpacing"
12330 ) for information on `features'.
12334 \begin_layout Description
12335 \begin_inset Flex CharStyle:Code
12338 \begin_layout Plain Layout
12345 \begin_inset Flex CharStyle:Code
12348 \begin_layout Plain Layout
12355 \begin_inset Flex CharStyle:Code
12358 \begin_layout Plain Layout
12367 \begin_layout Description
12368 \begin_inset Flex CharStyle:Code
12371 \begin_layout Plain Layout
12378 \begin_inset Flex CharStyle:Code
12381 \begin_layout Plain Layout
12386 , onehalf, double, other
12395 ] This defines what the default spacing should be in the layout.
12397 \begin_inset Flex CharStyle:Code
12400 \begin_layout Plain Layout
12407 \begin_inset Flex CharStyle:Code
12410 \begin_layout Plain Layout
12417 \begin_inset Flex CharStyle:Code
12420 \begin_layout Plain Layout
12426 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
12427 If you specify the argument
12428 \begin_inset Flex CharStyle:Code
12431 \begin_layout Plain Layout
12437 , then you should also provide a numerical argument which will be the actual
12439 Note that, contrary to other parameters,
12440 \begin_inset Flex CharStyle:Code
12443 \begin_layout Plain Layout
12449 implies the generation of specific LaTeX code, using the package
12452 \begin_inset Flex CharStyle:Code
12455 \begin_layout Plain Layout
12464 \begin_layout Description
12465 \begin_inset Flex CharStyle:Code
12468 \begin_layout Plain Layout
12475 \begin_inset Flex CharStyle:Code
12478 \begin_layout Plain Layout
12485 \begin_inset Flex CharStyle:Code
12488 \begin_layout Plain Layout
12496 ] Spellcheck paragraphs of this style.
12500 \begin_layout Description
12501 \begin_inset Flex CharStyle:Code
12504 \begin_layout Plain Layout
12510 The font used for the text body .
12512 \begin_inset CommandInset ref
12514 reference "sub:Font-description"
12521 \begin_layout Description
12522 \begin_inset Flex CharStyle:Code
12525 \begin_layout Plain Layout
12534 \begin_inset Flex CharStyle:Code
12537 \begin_layout Plain Layout
12547 The level of the style in the table of contents.
12548 This is used for automatic numbering of section headings.
12551 \begin_layout Description
12552 \begin_inset Flex CharStyle:Code
12555 \begin_layout Plain Layout
12562 \begin_inset Flex CharStyle:Code
12565 \begin_layout Plain Layout
12571 ] The vertical space with which the very first of a chain of paragraphs
12572 with this layout is separated from the previous paragraph.
12573 If the previous paragraph has another layout, the separations are not simply
12574 added, but the maximum is taken.
12577 \begin_layout Subsection
12578 \begin_inset CommandInset label
12584 Internationalization of Paragraph Styles
12587 \begin_layout Standard
12588 LyX has long supported internationalization of layout information, but,
12589 until version 2.0, this applied only to the user interface and not to, say,
12591 Thus, French authors were forced to resort to ugly hacks if they wanted
12596 1' instead of `Theorem 1'.
12597 Thanks to Georg Baum, that is no longer the case.
12600 \begin_layout Standard
12602 \begin_inset Flex CharStyle:Code
12605 \begin_layout Plain Layout
12611 defines text that is to appear in the typeset document, it may use
12612 \begin_inset Flex CharStyle:Code
12615 \begin_layout Plain Layout
12622 \begin_inset Flex CharStyle:Code
12625 \begin_layout Plain Layout
12631 to support non-English and even multi-language documents correctly.
12632 The following excerpt (from the
12633 \begin_inset Flex CharStyle:Code
12636 \begin_layout Plain Layout
12642 file) shows how this works:
12645 \begin_layout LyX-Code
12650 \begin_layout LyX-Code
12653 theoremstyle{remark}
12656 \begin_layout LyX-Code
12659 newtheorem{claim}[thm]{
12666 \begin_layout LyX-Code
12670 \begin_layout LyX-Code
12674 \begin_layout LyX-Code
12679 claimname}{_(Claim)}
12682 \begin_layout LyX-Code
12686 \begin_layout LyX-Code
12690 \begin_layout LyX-Code
12699 claimname}{_(Claim)}}
12702 \begin_layout LyX-Code
12707 \begin_layout Standard
12708 In principle, any legal LaTeX may appear in the
12709 \begin_inset Flex CharStyle:Code
12712 \begin_layout Plain Layout
12719 \begin_inset Flex CharStyle:Code
12722 \begin_layout Plain Layout
12728 tags, but in practice they will typically look as they do here.
12729 The key to correct translation of the typeset text is the definition of
12731 \begin_inset Flex CharStyle:Code
12734 \begin_layout Plain Layout
12743 \begin_inset Flex CharStyle:Code
12746 \begin_layout Plain Layout
12758 \begin_layout Standard
12760 \begin_inset Flex CharStyle:Code
12763 \begin_layout Plain Layout
12769 tag provides for internationalization based upon the overall language of
12771 The contents of the tag will be included in the preamble, just as with
12773 \begin_inset Flex CharStyle:Code
12776 \begin_layout Plain Layout
12783 What makes it special is the use of the
12784 \begin_inset Quotes eld
12788 \begin_inset Quotes erd
12792 \begin_inset Flex CharStyle:Code
12795 \begin_layout Plain Layout
12801 , which will be replaced, when LyX produces LaTeX output, with the translation
12802 of its argument into the document language.
12805 \begin_layout Standard
12807 \begin_inset Flex CharStyle:Code
12810 \begin_layout Plain Layout
12816 tag is more complex, since it is meant to provide support for multi-language
12817 documents and so offers an interface to the
12818 \begin_inset Flex CharStyle:Code
12821 \begin_layout Plain Layout
12828 Its contents will be added to the preamble once for each language that
12829 appears in the document.
12830 In this case, the argument to
12831 \begin_inset Flex CharStyle:Code
12834 \begin_layout Plain Layout
12840 will be replaced with its translation into the language in question; the
12842 \begin_inset Flex CharStyle:Code
12845 \begin_layout Plain Layout
12851 is replaced by the language name (as used by the babel package).
12854 \begin_layout Standard
12855 A German document that also included a French section would thus have the
12856 following in the preamble:
12859 \begin_layout LyX-Code
12868 claimname}{Affirmation}}
12876 claimname}{Behauptung}}
12880 claimname}{Behauptung}
12883 \begin_layout Standard
12885 \begin_inset Flex CharStyle:Code
12888 \begin_layout Plain Layout
12894 will then conspire to produce the correct text in the output.
12897 \begin_layout Standard
12898 One important point to note here is that the translations are provided by
12899 LyX itself, through the same mechanism it uses for internationalization
12900 of the user interface.
12901 This means, in effect, that
12902 \begin_inset Flex CharStyle:Code
12905 \begin_layout Plain Layout
12912 \begin_inset Flex CharStyle:Code
12915 \begin_layout Plain Layout
12921 are really only of use in layout files that are provided with LyX, since
12922 text entered in user-created layout files will not be seen by LyX's internation
12923 alization routines.
12924 That said, however, any layout created with the intention that it will
12925 be included with LyX should use these tags where appropriate.
12928 \begin_layout Subsection
12930 \begin_inset CommandInset label
12939 \begin_layout Standard
12940 Since version 1.3.0 of LyX, it is has been both possible and necessary to
12941 define the floats (
12942 \begin_inset Flex CharStyle:MenuItem
12945 \begin_layout Plain Layout
12952 \begin_inset Flex CharStyle:MenuItem
12955 \begin_layout Plain Layout
12961 , \SpecialChar \ldots{}
12962 ) in the text class itself.
12963 Standard floats are included in the file
12964 \begin_inset Flex CharStyle:Code
12967 \begin_layout Plain Layout
12973 , so you may have to do no more than add
12976 \begin_layout LyX-Code
12977 Input stdfloats.inc
12980 \begin_layout Standard
12981 to your layout file.
12982 If you want to implement a text class that proposes some other float types
12983 (like the AGU class bundled with LyX), the information below will hopefully
12987 \begin_layout Description
12988 \begin_inset Flex CharStyle:Code
12991 \begin_layout Plain Layout
12998 \begin_inset Flex CharStyle:Code
13001 \begin_layout Plain Layout
13008 \begin_inset Quotes erd
13012 \begin_inset Quotes erd
13015 ] The file name extension of an auxiliary file for the list of figures (or
13017 LaTeX writes the captions to this file.
13020 \begin_layout Description
13021 \begin_inset Flex CharStyle:Code
13024 \begin_layout Plain Layout
13031 \begin_inset Flex CharStyle:Code
13034 \begin_layout Plain Layout
13041 \begin_inset Quotes erd
13045 \begin_inset Quotes erd
13048 ] The string that will be used in the menus and also for the caption.
13049 This is translated to the current language if babel is used.
13052 \begin_layout Description
13053 \begin_inset Flex CharStyle:Code
13056 \begin_layout Plain Layout
13062 These are used for XHTML output.
13064 \begin_inset CommandInset ref
13066 reference "sec:Tags-for-XHTML"
13073 \begin_layout Description
13074 \begin_inset Flex CharStyle:Code
13077 \begin_layout Plain Layout
13084 \begin_inset Flex CharStyle:Code
13087 \begin_layout Plain Layout
13094 \begin_inset Quotes erd
13098 \begin_inset Quotes erd
13101 ] The command used to generate a list of floats of this type; the leading
13104 ' should be omitted.
13110 \begin_inset Flex CharStyle:Code
13113 \begin_layout Plain Layout
13119 is false, since there is no standard way to generate this command.
13121 \begin_inset Flex CharStyle:Code
13124 \begin_layout Plain Layout
13130 is true, since in that case there is a standard way.
13133 \begin_layout Description
13134 \begin_inset Flex CharStyle:Code
13137 \begin_layout Plain Layout
13144 \begin_inset Flex CharStyle:Code
13147 \begin_layout Plain Layout
13154 \begin_inset Quotes erd
13158 \begin_inset Quotes erd
13161 ] A title for a list of floats of this kind (list of figures, tables, or
13163 It is used for the screen label within LyX; it is passed to LaTeX for use
13164 as the title there; and it is used as the title in XHTML output.
13165 It will be translated to the document language.
13168 \begin_layout Description
13169 \begin_inset Flex CharStyle:Code
13172 \begin_layout Plain Layout
13179 \begin_inset Flex CharStyle:Code
13182 \begin_layout Plain Layout
13189 \begin_inset Flex CharStyle:Code
13192 \begin_layout Plain Layout
13200 ] Indicates whether the float is already defined in the document class or
13201 if we instead need to load
13202 \begin_inset Flex CharStyle:Code
13205 \begin_layout Plain Layout
13211 and use what it provides.
13213 \begin_inset Flex CharStyle:Code
13216 \begin_layout Plain Layout
13223 \begin_inset Flex CharStyle:Code
13226 \begin_layout Plain Layout
13233 It should be set to
13234 \begin_inset Flex CharStyle:Code
13237 \begin_layout Plain Layout
13243 if the float is already defined by the LaTeX document class.
13246 \begin_layout Description
13247 \begin_inset Flex CharStyle:Code
13250 \begin_layout Plain Layout
13257 \begin_inset Flex CharStyle:Code
13260 \begin_layout Plain Layout
13267 \begin_inset Quotes erd
13271 \begin_inset Quotes erd
13274 ] This (optional) argument determines whether floats of this class will
13275 be numbered within some sectional unit of the document.
13276 For example, if within is equal to
13277 \begin_inset Flex CharStyle:Code
13280 \begin_layout Plain Layout
13286 , the floats will be numbered within chapters.
13290 \begin_layout Description
13291 \begin_inset Flex CharStyle:Code
13294 \begin_layout Plain Layout
13301 \begin_inset Flex CharStyle:Code
13304 \begin_layout Plain Layout
13311 \begin_inset Quotes erd
13315 \begin_inset Quotes erd
13318 ] The default placement for the given class of floats.
13319 The string should be as in standard LaTeX:
13320 \begin_inset Flex CharStyle:Code
13323 \begin_layout Plain Layout
13330 \begin_inset Flex CharStyle:Code
13333 \begin_layout Plain Layout
13340 \begin_inset Flex CharStyle:Code
13343 \begin_layout Plain Layout
13350 \begin_inset Flex CharStyle:Code
13353 \begin_layout Plain Layout
13359 for top, bottom, page, and here, respectively.
13363 \begin_layout Plain Layout
13364 Note that the order of these letters in the string is irrelevant, like in
13370 On top of that there is a new type,
13371 \begin_inset Flex CharStyle:Code
13374 \begin_layout Plain Layout
13380 , which does not really correspond to a float, since it means: put it
13381 \begin_inset Quotes eld
13385 \begin_inset Quotes erd
13389 Note however that the
13390 \begin_inset Flex CharStyle:Code
13393 \begin_layout Plain Layout
13399 specifier is special and, because of implementation details, cannot be
13400 used in non-built in float types.
13401 If you do not understand what this means, just use
13402 \begin_inset Quotes eld
13406 \begin_inset Flex CharStyle:Code
13409 \begin_layout Plain Layout
13416 \begin_inset Quotes erd
13422 \begin_layout Description
13423 \begin_inset Flex CharStyle:Code
13426 \begin_layout Plain Layout
13433 \begin_inset Flex CharStyle:Code
13436 \begin_layout Plain Layout
13442 ] The prefix to use when creating labels referring to floats of this type.
13443 This allows the use of formatted references.
13444 Note that you can remove any
13445 \begin_inset Flex CharStyle:Code
13448 \begin_layout Plain Layout
13454 set by a copied style by using the special value
13455 \begin_inset Quotes eld
13459 \begin_inset Quotes erd
13462 , which must be all caps.
13465 \begin_layout Description
13466 \begin_inset Flex CharStyle:Code
13469 \begin_layout Plain Layout
13476 \begin_inset Flex CharStyle:Code
13479 \begin_layout Plain Layout
13486 \begin_inset Quotes erd
13490 \begin_inset Quotes erd
13493 ] The style used when defining the float using
13494 \begin_inset Flex CharStyle:Code
13497 \begin_layout Plain Layout
13508 \begin_layout Description
13509 \begin_inset Flex CharStyle:Code
13512 \begin_layout Plain Layout
13519 \begin_inset Flex CharStyle:Code
13522 \begin_layout Plain Layout
13529 \begin_inset Quotes erd
13533 \begin_inset Quotes erd
13537 \begin_inset Quotes eld
13541 \begin_inset Quotes erd
13544 of the new class of floats, like program or algorithm.
13545 After the appropriate
13546 \begin_inset Flex CharStyle:Code
13549 \begin_layout Plain Layout
13558 \begin_inset Flex CharStyle:Code
13561 \begin_layout Plain Layout
13570 \begin_inset Flex CharStyle:Code
13573 \begin_layout Plain Layout
13584 \begin_layout Standard
13585 Note that defining a float with type
13586 \begin_inset Flex CharStyle:Code
13589 \begin_layout Plain Layout
13597 automatically defines the corresponding counter with name
13598 \begin_inset Flex CharStyle:Code
13601 \begin_layout Plain Layout
13612 \begin_layout Subsection
13613 Flex insets and InsetLayout
13614 \begin_inset CommandInset label
13616 name "sub:Flex-insets-and"
13623 \begin_layout Standard
13624 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
13625 these are called Flex insets.
13629 \begin_layout Standard
13630 Flex insets come in three different kinds:
13633 \begin_layout Itemize
13635 \begin_inset Flex CharStyle:Code
13638 \begin_layout Plain Layout
13644 ): These define semantic markup corresponding to such LaTeX commands as
13646 \begin_inset Flex CharStyle:Code
13649 \begin_layout Plain Layout
13658 \begin_inset Flex CharStyle:Code
13661 \begin_layout Plain Layout
13672 \begin_layout Itemize
13674 \begin_inset Flex CharStyle:Code
13677 \begin_layout Plain Layout
13683 ): These can be used to define custom collapsible insets, similar to TeX
13684 code, footnote, and the like.
13685 An obvious example is an endnote inset, which is defined in the
13686 \begin_inset Flex CharStyle:Code
13689 \begin_layout Plain Layout
13698 \begin_layout Itemize
13700 \begin_inset Flex CharStyle:Code
13703 \begin_layout Plain Layout
13709 ): For use with DocBook classes.
13712 \begin_layout Standard
13713 Flex insets are defined using the
13714 \begin_inset Flex CharStyle:Code
13717 \begin_layout Plain Layout
13723 tag, which shall be explained in a moment.
13726 \begin_layout Standard
13728 \begin_inset Flex CharStyle:Code
13731 \begin_layout Plain Layout
13737 tag also serves another function: It can be used to customize the general
13738 layout of many different types of insets.
13740 \begin_inset Flex CharStyle:Code
13743 \begin_layout Plain Layout
13749 can be used to customize the layout parameters for footnotes, marginal
13750 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
13751 boxes, tables, algorithms, URLs, and optional arguments, as well as to
13752 define Flex insets.
13755 \begin_layout Standard
13757 \begin_inset Flex CharStyle:Code
13760 \begin_layout Plain Layout
13766 definition must begin with a line of the form:
13769 \begin_layout LyX-Code
13773 \begin_layout Standard
13775 \begin_inset Flex CharStyle:Code
13778 \begin_layout Plain Layout
13784 indicates the inset whose layout is being defined, and here there are two
13788 \begin_layout Enumerate
13789 The layout for a pre-existing inset is being modified.
13790 In this case, can be
13791 \begin_inset Flex CharStyle:Code
13794 \begin_layout Plain Layout
13800 any one of the following:
13801 \begin_inset Flex CharStyle:Code
13804 \begin_layout Plain Layout
13811 \begin_inset Flex CharStyle:Code
13814 \begin_layout Plain Layout
13821 \begin_inset Flex CharStyle:Code
13824 \begin_layout Plain Layout
13831 \begin_inset Flex CharStyle:Code
13834 \begin_layout Plain Layout
13841 \begin_inset Flex CharStyle:Code
13844 \begin_layout Plain Layout
13851 \begin_inset Flex CharStyle:Code
13854 \begin_layout Plain Layout
13861 \begin_inset Flex CharStyle:Code
13864 \begin_layout Plain Layout
13871 \begin_inset Flex CharStyle:Code
13874 \begin_layout Plain Layout
13881 \begin_inset Flex CharStyle:Code
13884 \begin_layout Plain Layout
13891 \begin_inset Flex CharStyle:Code
13894 \begin_layout Plain Layout
13901 \begin_inset Flex CharStyle:Code
13904 \begin_layout Plain Layout
13911 \begin_inset Flex CharStyle:Code
13914 \begin_layout Plain Layout
13921 \begin_inset Flex CharStyle:Code
13924 \begin_layout Plain Layout
13931 \begin_inset Flex CharStyle:Code
13934 \begin_layout Plain Layout
13941 \begin_inset Flex CharStyle:Code
13944 \begin_layout Plain Layout
13951 \begin_inset Flex CharStyle:Code
13954 \begin_layout Plain Layout
13961 \begin_inset Flex CharStyle:Code
13964 \begin_layout Plain Layout
13971 \begin_inset Flex CharStyle:Code
13974 \begin_layout Plain Layout
13981 \begin_inset Flex CharStyle:Code
13984 \begin_layout Plain Layout
13991 \begin_inset Flex CharStyle:Code
13994 \begin_layout Plain Layout
14003 \begin_layout Enumerate
14004 The layout for a Flex inset is being defined.
14006 \begin_inset Flex CharStyle:Code
14009 \begin_layout Plain Layout
14015 can be any valid identifier not used by a pre-existing inset.
14016 Note that the definition of a flex inset
14021 \begin_inset Flex CharStyle:Code
14024 \begin_layout Plain Layout
14030 entry, declaring which type of inset this is.
14033 \begin_layout Standard
14035 \begin_inset Flex CharStyle:Code
14038 \begin_layout Plain Layout
14044 definition can contain the following entries:
14047 \begin_layout Description
14048 \begin_inset Flex CharStyle:Code
14051 \begin_layout Plain Layout
14057 The color for the inset's background.
14058 The valid colors are defined in
14059 \begin_inset Flex CharStyle:Code
14062 \begin_layout Plain Layout
14071 \begin_layout Description
14072 \begin_inset Flex CharStyle:Code
14075 \begin_layout Plain Layout
14082 \begin_inset Flex CharStyle:Code
14085 \begin_layout Plain Layout
14094 \begin_inset Flex CharStyle:Code
14097 \begin_layout Plain Layout
14103 ] Whether to use the content of the inset as the label, when the inset is
14108 \begin_layout Description
14109 \begin_inset Flex CharStyle:Code
14112 \begin_layout Plain Layout
14118 As with paragraph styles (see page
14119 \begin_inset CommandInset ref
14121 reference "des:CopyStyle"
14128 \begin_layout Description
14129 \begin_inset Flex CharStyle:Code
14132 \begin_layout Plain Layout
14139 \begin_inset Flex CharStyle:Code
14142 \begin_layout Plain Layout
14151 \begin_inset Flex CharStyle:Code
14154 \begin_layout Plain Layout
14160 ] Indicates whether the user may employ the Paragraph Settings dialog to
14161 customize the paragraph.
14164 \begin_layout Description
14165 \begin_inset Flex CharStyle:Code
14168 \begin_layout Plain Layout
14175 \begin_inset Flex CharStyle:Code
14178 \begin_layout Plain Layout
14185 \begin_inset Flex CharStyle:Code
14188 \begin_layout Plain Layout
14195 \begin_inset Flex CharStyle:Code
14198 \begin_layout Plain Layout
14204 , describing the rendering style used for the inset's frame and buttons.
14205 Footnotes generally use
14206 \begin_inset Flex CharStyle:Code
14209 \begin_layout Plain Layout
14215 , ERT insets generally
14216 \begin_inset Flex CharStyle:Code
14219 \begin_layout Plain Layout
14225 , and character styles
14226 \begin_inset Flex CharStyle:Code
14229 \begin_layout Plain Layout
14238 \begin_layout Description
14239 \begin_inset Flex CharStyle:Code
14242 \begin_layout Plain Layout
14248 Required at the end of the InsetLayout declarations.
14251 \begin_layout Description
14252 \begin_inset Flex CharStyle:Code
14255 \begin_layout Plain Layout
14261 The font used for both the text body
14267 \begin_inset space ~
14271 \begin_inset CommandInset ref
14273 reference "sub:Font-description"
14278 Note that defining this font automatically defines the
14279 \begin_inset Flex CharStyle:Code
14282 \begin_layout Plain Layout
14288 to the same value, so define this first and define
14289 \begin_inset Flex CharStyle:Code
14292 \begin_layout Plain Layout
14298 later if you want them to be different.
14301 \begin_layout Description
14302 \begin_inset Flex CharStyle:Code
14305 \begin_layout Plain Layout
14312 \begin_inset Quotes eld
14316 \begin_inset Quotes erd
14319 language, leading to Left-to-Right (latin) output, e.
14320 \begin_inset space \thinspace{}
14324 \begin_inset space \space{}
14327 in TeX code or URL.
14331 \begin_layout Description
14332 \begin_inset Flex CharStyle:Code
14335 \begin_layout Plain Layout
14342 \begin_inset Flex CharStyle:Code
14345 \begin_layout Plain Layout
14354 \begin_inset Flex CharStyle:Code
14357 \begin_layout Plain Layout
14363 ] Indicates whether the PlainLayout should be used or, instead, the user
14364 can change the paragraph style used in the inset.
14368 \begin_layout Description
14369 \begin_inset Flex CharStyle:Code
14372 \begin_layout Plain Layout
14378 As with paragraph styles (see page
14379 \begin_inset CommandInset ref
14380 LatexCommand pageref
14381 reference "des:FreeSpacing"
14389 \begin_layout Description
14390 \begin_inset Flex CharStyle:Code
14393 \begin_layout Plain Layout
14399 These tags control XHTML output.
14403 \begin_layout Description
14404 \begin_inset Flex CharStyle:Code
14407 \begin_layout Plain Layout
14414 \begin_inset Flex CharStyle:Code
14417 \begin_layout Plain Layout
14426 \begin_inset Flex CharStyle:Code
14429 \begin_layout Plain Layout
14435 ] Whether to include the contents of this inset in the strings generated
14436 for the `Outline' pane.
14437 One would not, for example, want the content of a footnote in a section
14438 header to be included in the TOC displayed in the outline, but one would
14439 normally want the content of a character style displayed.
14440 Default is false: not to include.
14443 \begin_layout Description
14444 \begin_inset Flex CharStyle:Code
14447 \begin_layout Plain Layout
14453 As with paragraph styles (see page
14454 \begin_inset CommandInset ref
14455 LatexCommand pageref
14456 reference "des:KeepEmpty"
14464 \begin_layout Description
14465 \begin_inset Flex CharStyle:Code
14468 \begin_layout Plain Layout
14474 The font used for the label.
14476 \begin_inset space ~
14480 \begin_inset CommandInset ref
14482 reference "sub:Font-description"
14487 Note that this definition can never appear before
14488 \begin_inset Flex CharStyle:Code
14491 \begin_layout Plain Layout
14497 , lest it be ineffective.
14500 \begin_layout Description
14501 \begin_inset Flex CharStyle:Code
14504 \begin_layout Plain Layout
14510 What will be displayed on the button or elsewhere as the inset label.
14511 Some inset types (TeX code and Branch) modify this label on the fly.
14514 \begin_layout Description
14515 \begin_inset Flex CharStyle:Code
14518 \begin_layout Plain Layout
14524 The name of the corresponding LaTeX stuff.
14525 Either the environment or command name.
14528 \begin_layout Description
14529 \begin_inset Flex CharStyle:Code
14532 \begin_layout Plain Layout
14538 The optional parameter for the corresponding
14539 \begin_inset Flex CharStyle:Code
14542 \begin_layout Plain Layout
14548 stuff, including possible bracket pairs like
14549 \begin_inset Flex CharStyle:Code
14552 \begin_layout Plain Layout
14559 This parameter cannot be changed from within LyX.
14562 \begin_layout Description
14563 \begin_inset Flex CharStyle:Code
14566 \begin_layout Plain Layout
14572 As with paragraph styles (see page
14573 \begin_inset CommandInset ref
14574 LatexCommand pageref
14575 reference "des:LatexType"
14582 \begin_layout Description
14583 \begin_inset Flex CharStyle:Code
14586 \begin_layout Plain Layout
14593 \begin_inset Flex CharStyle:Code
14596 \begin_layout Plain Layout
14603 \begin_inset Flex CharStyle:Code
14606 \begin_layout Plain Layout
14613 \begin_inset Flex CharStyle:Code
14616 \begin_layout Plain Layout
14623 \begin_inset Flex CharStyle:Code
14626 \begin_layout Plain Layout
14632 (indicating a dummy definition ending definitions of charstyles, etc).
14633 This entry is required in and is only meaningful for Flex insets.
14634 Among other things, it determines on which menu this inset will appear.
14636 \begin_inset Flex CharStyle:Code
14639 \begin_layout Plain Layout
14646 \begin_inset Flex CharStyle:Code
14649 \begin_layout Plain Layout
14656 \begin_inset Flex CharStyle:Code
14659 \begin_layout Plain Layout
14667 \begin_inset Flex CharStyle:Code
14670 \begin_layout Plain Layout
14676 can be set to true for charstyle insets, if you wish, by setting it
14681 \begin_inset Flex CharStyle:Code
14684 \begin_layout Plain Layout
14693 \begin_layout Description
14694 \begin_inset Flex CharStyle:Code
14697 \begin_layout Plain Layout
14704 \begin_inset Flex CharStyle:Code
14707 \begin_layout Plain Layout
14716 \begin_inset Flex CharStyle:Code
14719 \begin_layout Plain Layout
14725 ] Whether multiple paragraphs are permitted in this inset.
14727 \begin_inset Flex CharStyle:Code
14730 \begin_layout Plain Layout
14736 to the same value and
14737 \begin_inset Flex CharStyle:Code
14740 \begin_layout Plain Layout
14746 to the opposite value.
14747 These can be reset to other values, if they are used
14752 \begin_inset Flex CharStyle:Code
14755 \begin_layout Plain Layout
14765 \begin_layout Description
14766 \begin_inset Flex CharStyle:Code
14769 \begin_layout Plain Layout
14776 \begin_inset Flex CharStyle:Code
14779 \begin_layout Plain Layout
14788 \begin_inset Flex CharStyle:Code
14791 \begin_layout Plain Layout
14797 ] Whether fragile commands in this layout should be
14798 \begin_inset Flex CharStyle:Code
14801 \begin_layout Plain Layout
14814 whether the command should itself be protected.) Default is false.
14817 \begin_layout Description
14818 \begin_inset Flex CharStyle:Code
14821 \begin_layout Plain Layout
14828 \begin_inset Flex CharStyle:Code
14831 \begin_layout Plain Layout
14840 \begin_inset Flex CharStyle:Code
14843 \begin_layout Plain Layout
14849 ] As with paragraph styles (see page
14850 \begin_inset CommandInset ref
14851 LatexCommand pageref
14852 reference "des:ParbreakIsNewline"
14860 \begin_layout Description
14861 \begin_inset Flex CharStyle:Code
14864 \begin_layout Plain Layout
14871 \begin_inset Flex CharStyle:Code
14874 \begin_layout Plain Layout
14883 \begin_inset Flex CharStyle:Code
14886 \begin_layout Plain Layout
14892 ] As with paragraph styles (see page
14893 \begin_inset CommandInset ref
14894 LatexCommand pageref
14895 reference "des:PassThru"
14903 \begin_layout Description
14904 \begin_inset Flex CharStyle:Code
14907 \begin_layout Plain Layout
14913 As with paragraph styles (see page
14914 \begin_inset CommandInset ref
14915 LatexCommand pageref
14916 reference "des:Preamble"
14923 \begin_layout Description
14924 \begin_inset Flex CharStyle:Code
14927 \begin_layout Plain Layout
14934 \begin_inset Flex CharStyle:Code
14937 \begin_layout Plain Layout
14943 ] The prefix to use when creating labels referring to insets of this type.
14944 This allows the use of formatted references.
14947 \begin_layout Description
14948 \begin_inset Flex CharStyle:Code
14951 \begin_layout Plain Layout
14958 \begin_inset Flex CharStyle:Code
14961 \begin_layout Plain Layout
14967 ] As with paragraph styles (see page
14968 \begin_inset CommandInset ref
14969 LatexCommand pageref
14970 reference "des:Requires"
14977 \begin_layout Description
14978 \begin_inset Flex CharStyle:Code
14981 \begin_layout Plain Layout
14988 \begin_inset Flex CharStyle:Code
14991 \begin_layout Plain Layout
14998 \begin_inset Flex CharStyle:Code
15001 \begin_layout Plain Layout
15009 ] Spellcheck the contents of this inset.
15013 \begin_layout Subsection
15015 \begin_inset CommandInset label
15017 name "sub:Counters"
15024 \begin_layout Standard
15025 Since version 1.3.0 of LyX, it is both possible and necessary to define the
15027 \begin_inset Flex CharStyle:MenuItem
15030 \begin_layout Plain Layout
15037 \begin_inset Flex CharStyle:MenuItem
15040 \begin_layout Plain Layout
15046 , \SpecialChar \ldots{}
15047 ) in the text class itself.
15048 The standard counters are defined in the file
15049 \begin_inset Flex CharStyle:Code
15052 \begin_layout Plain Layout
15058 , so you may have to do no more than add
15061 \begin_layout LyX-Code
15062 Input stdcounters.inc
15065 \begin_layout Standard
15066 to your layout file to get them to work.
15067 But if you want to define custom counters, then you can do so.
15068 The counter declaration must begin with:
15071 \begin_layout LyX-Code
15072 Counter CounterName
15075 \begin_layout Standard
15077 \begin_inset Flex CharStyle:Code
15080 \begin_layout Plain Layout
15086 ' is replaced by the name of the counter.
15087 And it must end with
15088 \begin_inset Quotes eld
15092 \begin_inset Flex CharStyle:Code
15095 \begin_layout Plain Layout
15102 \begin_inset Quotes erd
15106 The following parameters can also be used:
15109 \begin_layout Description
15110 \begin_inset Flex CharStyle:Code
15113 \begin_layout Plain Layout
15120 \begin_inset Flex CharStyle:Code
15123 \begin_layout Plain Layout
15130 \begin_inset Quotes erd
15134 \begin_inset Quotes erd
15137 ] When defined, this string defines how the counter is displayed.
15138 Setting this value sets
15139 \begin_inset Flex CharStyle:Code
15142 \begin_layout Plain Layout
15143 LabelStringAppendix
15149 The following special constructs can be used in the string:
15153 \begin_layout Itemize
15154 \begin_inset Flex CharStyle:Code
15157 \begin_layout Plain Layout
15165 will be replaced by the expansion of the
15166 \begin_inset Flex CharStyle:Code
15169 \begin_layout Plain Layout
15176 \begin_inset Flex CharStyle:Code
15179 \begin_layout Plain Layout
15180 LabelStringAppendix
15186 \begin_inset Flex CharStyle:Code
15189 \begin_layout Plain Layout
15199 \begin_layout Itemize
15200 counter values can be expressed using LaTeX-like macros
15201 \begin_inset Flex CharStyle:Code
15204 \begin_layout Plain Layout
15221 \begin_inset Flex CharStyle:Code
15224 \begin_layout Plain Layout
15236 \begin_layout Plain Layout
15246 Actually, the situation is a bit more complicated: any
15265 other than those described below will produce arabic numerals.
15266 It would not be surprising to see this change in the future.
15272 \begin_inset Flex CharStyle:Code
15275 \begin_layout Plain Layout
15281 : 1, 2, 3,\SpecialChar \ldots{}
15283 \begin_inset Flex CharStyle:Code
15286 \begin_layout Plain Layout
15292 for lower-case letters: a, b, c, \SpecialChar \ldots{}
15294 \begin_inset Flex CharStyle:Code
15297 \begin_layout Plain Layout
15303 for upper-case letters: A, B, C, \SpecialChar \ldots{}
15305 \begin_inset Flex CharStyle:Code
15308 \begin_layout Plain Layout
15314 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
15316 \begin_inset Flex CharStyle:Code
15319 \begin_layout Plain Layout
15325 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
15327 \begin_inset Flex CharStyle:Code
15330 \begin_layout Plain Layout
15336 for hebrew numerals.
15340 \begin_layout Standard
15341 If LabelString is not defined, a default value is constructed as follows:
15342 if the counter has a master counter
15343 \begin_inset Flex CharStyle:Code
15346 \begin_layout Plain Layout
15353 \begin_inset Flex CharStyle:Code
15356 \begin_layout Plain Layout
15363 \begin_inset Flex CharStyle:Code
15366 \begin_layout Plain Layout
15376 is used; otherwise the string
15377 \begin_inset Flex CharStyle:Code
15380 \begin_layout Plain Layout
15391 \begin_layout Description
15392 \begin_inset Flex CharStyle:Code
15395 \begin_layout Plain Layout
15396 LabelStringAppendix
15402 \begin_inset Flex CharStyle:Code
15405 \begin_layout Plain Layout
15412 \begin_inset Quotes erd
15416 \begin_inset Quotes erd
15420 \begin_inset Flex CharStyle:Code
15423 \begin_layout Plain Layout
15429 , but for use in the Appendix.
15432 \begin_layout Description
15433 \begin_inset Flex CharStyle:Code
15436 \begin_layout Plain Layout
15443 \begin_inset Flex CharStyle:Code
15446 \begin_layout Plain Layout
15453 \begin_inset Quotes erd
15457 \begin_inset Quotes erd
15460 ] A format for use with formatted references to this counter.
15461 For example, one might want to have references to section numbers appear
15463 \begin_inset Quotes eld
15467 \begin_inset Quotes erd
15471 The string should contain
15472 \begin_inset Quotes eld
15476 \begin_inset Quotes erd
15480 This will be replaced by the counter number itself.
15481 So, for sections, it would be: Section ##.
15484 \begin_layout Description
15485 \begin_inset Flex CharStyle:Code
15488 \begin_layout Plain Layout
15495 \begin_inset Flex CharStyle:Code
15498 \begin_layout Plain Layout
15505 \begin_inset Quotes erd
15509 \begin_inset Quotes erd
15512 ] If this is set to the name of another counter, the present counter will
15513 be reset every time the other one is increased.
15515 \begin_inset Flex CharStyle:Code
15518 \begin_layout Plain Layout
15525 \begin_inset Flex CharStyle:Code
15528 \begin_layout Plain Layout
15537 \begin_layout Subsection
15539 \begin_inset CommandInset label
15541 name "sub:Font-description"
15548 \begin_layout Standard
15549 A font description looks like this:
15552 \begin_layout LyX-Code
15562 \begin_layout LyX-Code
15566 \begin_layout LyX-Code
15570 \begin_layout Standard
15571 The following commands are available:
15574 \begin_layout Description
15575 \begin_inset Flex CharStyle:Code
15578 \begin_layout Plain Layout
15585 \begin_inset Flex CharStyle:Code
15588 \begin_layout Plain Layout
15597 \begin_inset Flex CharStyle:Code
15600 \begin_layout Plain Layout
15607 \begin_inset Flex CharStyle:Code
15610 \begin_layout Plain Layout
15617 \begin_inset Flex CharStyle:Code
15620 \begin_layout Plain Layout
15627 \begin_inset Flex CharStyle:Code
15630 \begin_layout Plain Layout
15637 \begin_inset Flex CharStyle:Code
15640 \begin_layout Plain Layout
15647 \begin_inset Flex CharStyle:Code
15650 \begin_layout Plain Layout
15657 \begin_inset Flex CharStyle:Code
15660 \begin_layout Plain Layout
15667 \begin_inset Flex CharStyle:Code
15670 \begin_layout Plain Layout
15679 \begin_layout Description
15680 \begin_inset Flex CharStyle:Code
15683 \begin_layout Plain Layout
15690 \begin_inset Flex CharStyle:Code
15693 \begin_layout Plain Layout
15702 \begin_inset Flex CharStyle:Code
15705 \begin_layout Plain Layout
15712 \begin_inset Flex CharStyle:Code
15715 \begin_layout Plain Layout
15724 \begin_layout Description
15725 \begin_inset Flex CharStyle:Code
15728 \begin_layout Plain Layout
15735 \begin_inset Flex CharStyle:Code
15738 \begin_layout Plain Layout
15744 ] Valid arguments are:
15745 \begin_inset Flex CharStyle:Code
15748 \begin_layout Plain Layout
15755 \begin_inset Flex CharStyle:Code
15758 \begin_layout Plain Layout
15765 \begin_inset Flex CharStyle:Code
15768 \begin_layout Plain Layout
15775 \begin_inset Flex CharStyle:Code
15778 \begin_layout Plain Layout
15785 \begin_inset Flex CharStyle:Code
15788 \begin_layout Plain Layout
15795 \begin_inset Flex CharStyle:Code
15798 \begin_layout Plain Layout
15805 Each of these turns on or off the corresponding attribute.
15807 \begin_inset Flex CharStyle:Code
15810 \begin_layout Plain Layout
15816 turns on emphasis, and
15817 \begin_inset Flex CharStyle:Code
15820 \begin_layout Plain Layout
15828 \begin_inset Newline newline
15831 If the latter seems puzzling, remember that the font settings for the present
15832 context are generally inherited from the surrounding context.
15834 \begin_inset Flex CharStyle:Code
15837 \begin_layout Plain Layout
15843 would turn off the emphasis that was anyway in effect, say, in a theorem
15847 \begin_layout Description
15848 \begin_inset Flex CharStyle:Code
15851 \begin_layout Plain Layout
15858 \begin_inset Flex CharStyle:Code
15861 \begin_layout Plain Layout
15870 \begin_inset Flex CharStyle:Code
15873 \begin_layout Plain Layout
15882 \begin_layout Description
15883 \begin_inset Flex CharStyle:Code
15886 \begin_layout Plain Layout
15893 \begin_inset Flex CharStyle:Code
15896 \begin_layout Plain Layout
15905 \begin_inset Flex CharStyle:Code
15908 \begin_layout Plain Layout
15915 \begin_inset Flex CharStyle:Code
15918 \begin_layout Plain Layout
15925 \begin_inset Flex CharStyle:Code
15928 \begin_layout Plain Layout
15937 \begin_layout Description
15938 \begin_inset Flex CharStyle:Code
15941 \begin_layout Plain Layout
15948 \begin_inset Flex CharStyle:Code
15951 \begin_layout Plain Layout
15958 \begin_inset Flex CharStyle:Code
15961 \begin_layout Plain Layout
15968 \begin_inset Flex CharStyle:Code
15971 \begin_layout Plain Layout
15980 \begin_inset Flex CharStyle:Code
15983 \begin_layout Plain Layout
15990 \begin_inset Flex CharStyle:Code
15993 \begin_layout Plain Layout
16000 \begin_inset Flex CharStyle:Code
16003 \begin_layout Plain Layout
16010 \begin_inset Flex CharStyle:Code
16013 \begin_layout Plain Layout
16020 \begin_inset Flex CharStyle:Code
16023 \begin_layout Plain Layout
16032 \begin_layout Subsection
16033 \begin_inset CommandInset label
16035 name "sub:Citation-format-description"
16039 Citation format description
16042 \begin_layout Standard
16044 \begin_inset Flex CharStyle:Code
16047 \begin_layout Plain Layout
16053 blocks are used to describe how bibliographic information should be displayed,
16054 both within LyX itself (in the citation dialog and in tooltips, for example)
16055 and in XHTML output.
16056 Such a block might look like this:
16059 \begin_layout LyX-Code
16063 \begin_layout LyX-Code
16067 \begin_layout LyX-Code
16071 \begin_layout LyX-Code
16075 \begin_layout Standard
16076 The individual lines define how the bibliographic information associated
16077 with an article or book, respectively, is to be displayed, and such a definitio
16078 n can be given for any `entry type' that might be present in a BibTeX file.
16079 LyX defines a default format in the source code that will be used if no
16080 specific definition has been given.
16081 LyX predefines several formats in the file
16082 \begin_inset Flex CharStyle:Code
16085 \begin_layout Plain Layout
16091 , which is included in most of LyX's document classes.
16094 \begin_layout Standard
16095 The definitions use a simple language that allows BibTeX keys to be replaced
16097 Keys should be enclosed in
16098 \begin_inset Flex CharStyle:Code
16101 \begin_layout Plain Layout
16108 \begin_inset Flex CharStyle:Code
16111 \begin_layout Plain Layout
16118 So a simple definition might look like this:
16121 \begin_layout LyX-Code
16123 \begin_inset Quotes eld
16127 \begin_inset Quotes erd
16133 \begin_layout Standard
16134 This would print the author, followed by a comma, followed by the title,
16135 in quotes, followed by a period.
16138 \begin_layout Standard
16139 Of course, sometimes you may want to print a key only if it exists.
16140 This can be done by using a conditional construction, such as:
16141 \begin_inset Flex CharStyle:Code
16144 \begin_layout Plain Layout
16146 \begin_inset space ~
16156 \begin_inset Flex CharStyle:Code
16159 \begin_layout Plain Layout
16165 key exists, then print
16166 \begin_inset Quotes eld
16170 \begin_inset space ~
16174 \begin_inset Quotes erd
16177 followed by the volume key.
16178 It is also possible to have an else clause in the conditional, such as:
16180 \begin_inset Flex CharStyle:Code
16183 \begin_layout Plain Layout
16184 {%author%[[%author%]][[%editor%, ed.]]}
16191 \begin_inset Flex CharStyle:Code
16194 \begin_layout Plain Layout
16200 key is printed if it exists; otherwise, the editor key is printed, followed
16202 \begin_inset Quotes eld
16206 \begin_inset space ~
16210 \begin_inset Quotes erd
16213 Note that the key is again enclosed in
16214 \begin_inset Flex CharStyle:Code
16217 \begin_layout Plain Layout
16223 signs; the entire conditional is enclosed in braces; and the if and else
16224 clauses are enclosed in double brackets,
16225 \begin_inset Quotes eld
16229 \begin_inset Flex CharStyle:Code
16232 \begin_layout Plain Layout
16239 \begin_inset Quotes eld
16243 \begin_inset Quotes eld
16247 \begin_inset Flex CharStyle:Code
16250 \begin_layout Plain Layout
16257 \begin_inset Quotes erd
16261 There must be no space between any of these.
16264 \begin_layout Standard
16265 There is one other piece of syntax available in definitions, which looks
16267 \begin_inset Flex CharStyle:Code
16270 \begin_layout Plain Layout
16277 This defines a piece of formatting information that is to be used when
16279 \begin_inset Quotes eld
16283 \begin_inset Quotes erd
16287 Obviously, we do not want to output HTML tags when writing plain text,
16288 so they should be wrapped in
16289 \begin_inset Quotes eld
16293 \begin_inset Quotes erd
16297 \begin_inset Quotes eld
16301 \begin_inset Quotes erd
16307 \begin_layout Standard
16308 Two special sorts of definitions are also possible in a
16309 \begin_inset Flex CharStyle:Code
16312 \begin_layout Plain Layout
16319 An example of the first would be:
16322 \begin_layout LyX-Code
16324 \begin_inset Quotes eld
16328 \begin_inset Quotes erd
16334 \begin_layout Standard
16335 This is an abbreviation, or macro, and it can be used by treating it as
16337 \begin_inset Flex CharStyle:Code
16340 \begin_layout Plain Layout
16348 \begin_inset Flex CharStyle:Code
16351 \begin_layout Plain Layout
16357 exactly as it would treat its definition.
16358 So, let us issue the obvious
16366 \begin_layout LyX-Code
16370 \begin_layout Standard
16371 or anything like it.
16372 LyX shouldn't go into an infinite loop, but it may go into a long one before
16376 \begin_layout Standard
16377 The second sort of special definition might look like this:
16380 \begin_layout LyX-Code
16384 \begin_layout Standard
16385 This defines a translatable piece of text, which allows relevant parts of
16386 the bibliography to be translated.
16387 It can be included in a definition by treating it as a key:
16388 \begin_inset Flex CharStyle:Code
16391 \begin_layout Plain Layout
16398 Several of these are predefined in
16399 \begin_inset Flex CharStyle:Code
16402 \begin_layout Plain Layout
16409 Note that these are not macros, in the sense just defined.
16410 They will not be expanded.
16413 \begin_layout Standard
16414 So here then is an example that use all these features:
16417 \begin_layout LyX-Code
16418 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
16421 \begin_layout Standard
16422 The defines a macro that prints the author, followed by a comma, if the
16424 \begin_inset Flex CharStyle:Code
16427 \begin_layout Plain Layout
16433 key is defined, or else prints the name of the editor, followed by the
16435 \begin_inset Flex CharStyle:Code
16438 \begin_layout Plain Layout
16444 or its translation (it is by default
16445 \begin_inset Quotes eld
16449 \begin_inset Quotes erd
16453 \begin_inset Flex CharStyle:Code
16456 \begin_layout Plain Layout
16463 Note that this is in fact defined in
16464 \begin_inset Flex CharStyle:Code
16467 \begin_layout Plain Layout
16473 , so you can use it in your own definitions, or re-definitions, if you load
16477 \begin_layout Section
16478 \begin_inset CommandInset label
16480 name "sec:Tags-for-XHTML"
16484 Tags for XHTML output
16487 \begin_layout Standard
16488 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
16489 by layout information.
16490 In general, LyX provides sensible defaults and, as mentioned earlier, it
16491 will even construct default CSS style rules from the other layout tags.
16492 For example, LyX will attempt to use the information provided in the
16493 \begin_inset Flex CharStyle:Code
16496 \begin_layout Plain Layout
16502 declaration for the Chapter style to write CSS that will appropriately
16503 format chapter headings.
16506 \begin_layout Standard
16507 In many cases, then, you may not have to do anything at all to get acceptable
16508 XHTML output for your own environments, custom insets, and so forth.
16509 But in some cases you will, and so LyX provides a number of layout tags
16510 that can be used to customize the XHTML and CSS that are generated.
16513 \begin_layout Standard
16514 Note that there are two tags,
16515 \begin_inset Flex CharStyle:Code
16518 \begin_layout Plain Layout
16525 \begin_inset Flex CharStyle:Code
16528 \begin_layout Plain Layout
16534 that may appear outside style and inset declarations.
16536 \begin_inset CommandInset ref
16538 reference "sub:General-text-class"
16542 for details on these.
16545 \begin_layout Subsection
16546 \begin_inset CommandInset label
16548 name "sub:Paragraph-Style-XHTML"
16555 \begin_layout Standard
16556 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
16557 dealing with a normal paragraph, a command, or an environment, where this
16558 is itself determined by the contents of the corresponding
16559 \begin_inset Flex CharStyle:Code
16562 \begin_layout Plain Layout
16572 \begin_layout Standard
16573 For a command or normal paragraph, the output XHTML has the following form:
16576 \begin_layout LyX-Code
16578 \begin_inset Quotes erd
16582 \begin_inset Quotes erd
16588 \begin_layout LyX-Code
16590 \begin_inset Quotes erd
16594 \begin_inset Quotes erd
16600 \begin_layout LyX-Code
16601 Contents of the paragraph.
16604 \begin_layout LyX-Code
16608 \begin_layout Standard
16609 The label tags are of course omitted if the paragraph does not have a label.
16612 \begin_layout Standard
16613 For an environment that is not some sort of list, the XHTML takes this form:
16616 \begin_layout LyX-Code
16618 \begin_inset Quotes erd
16622 \begin_inset Quotes erd
16628 \begin_layout LyX-Code
16630 \begin_inset Quotes erd
16634 \begin_inset Quotes erd
16638 \begin_inset Quotes erd
16642 \begin_inset Quotes erd
16645 >Environment Label</labeltag>First paragraph.</itemtag>
16648 \begin_layout LyX-Code
16649 <itemtag>Second paragraph.</itemtag>
16652 \begin_layout LyX-Code
16656 \begin_layout Standard
16657 Note that the label is output only for the first paragraph, as it should
16658 be for a theorem, for example.
16662 \begin_layout Standard
16663 For a list, we have one of these forms:
16666 \begin_layout LyX-Code
16668 \begin_inset Quotes erd
16672 \begin_inset Quotes erd
16678 \begin_layout LyX-Code
16680 \begin_inset Quotes erd
16684 \begin_inset Quotes erd
16688 \begin_inset Quotes erd
16692 \begin_inset Quotes erd
16695 >List Label</labeltag>First item.</itemtag>
16698 \begin_layout LyX-Code
16700 \begin_inset Quotes erd
16704 \begin_inset Quotes erd
16708 \begin_inset Quotes erd
16712 \begin_inset Quotes erd
16715 >List Label</labeltag>Second item.</itemtag>
16718 \begin_layout LyX-Code
16722 \begin_layout LyX-Code
16726 \begin_layout LyX-Code
16728 \begin_inset Quotes erd
16732 \begin_inset Quotes erd
16738 \begin_layout LyX-Code
16740 \begin_inset Quotes erd
16744 \begin_inset Quotes erd
16747 >List Label</labeltag><itemtag attr=
16748 \begin_inset Quotes erd
16752 \begin_inset Quotes erd
16755 >First item.</itemtag>
16758 \begin_layout LyX-Code
16760 \begin_inset Quotes erd
16764 \begin_inset Quotes erd
16767 >List Label</labeltag><itemtag attr=
16768 \begin_inset Quotes erd
16772 \begin_inset Quotes erd
16775 >Second item.</itemtag>
16778 \begin_layout LyX-Code
16782 \begin_layout Standard
16783 Note the different orders of
16784 \begin_inset Flex CharStyle:Code
16787 \begin_layout Plain Layout
16794 \begin_inset Flex CharStyle:Code
16797 \begin_layout Plain Layout
16804 Which order we get depends upon the setting of
16805 \begin_inset Flex CharStyle:Code
16808 \begin_layout Plain Layout
16815 \begin_inset Flex CharStyle:Code
16818 \begin_layout Plain Layout
16824 is false (the default), you get the first of these, with the label within
16825 the item; if true, you get the second, with the label outside the item.
16828 \begin_layout Standard
16829 The specific tags and attributes output for each paragraph type can be controlle
16830 d by means of the layout tags we are about to describe.
16831 As mentioned earlier, however, LyX uses sensible defaults for many of these,
16832 so you often may not need to do very much to get good XHTML output.
16833 Think of the available tags as there so you can tweak things to your liking.
16836 \begin_layout Description
16837 \begin_inset Flex CharStyle:Code
16840 \begin_layout Plain Layout
16847 \begin_inset Flex CharStyle:Code
16850 \begin_layout Plain Layout
16856 ] Specifies attribute information to be output with the main tag.
16858 \begin_inset Quotes eld
16862 \begin_inset Flex CharStyle:Code
16865 \begin_layout Plain Layout
16872 \begin_inset Quotes erd
16876 By default, LyX will output
16877 \begin_inset Quotes eld
16881 \begin_inset Flex CharStyle:Code
16884 \begin_layout Plain Layout
16891 \begin_inset Quotes erd
16895 \begin_inset Flex CharStyle:Code
16898 \begin_layout Plain Layout
16904 is the LyX name of the layout, made lowercase, for example: chapter.
16909 contain any style information.
16911 \begin_inset Flex CharStyle:Code
16914 \begin_layout Plain Layout
16923 \begin_layout Description
16924 \begin_inset Flex CharStyle:Code
16927 \begin_layout Plain Layout
16934 \begin_inset Flex CharStyle:Code
16937 \begin_layout Plain Layout
16947 ] Whether to output the default CSS information LyX generates for this layout,
16948 even if additional information is explicitly provided via
16949 \begin_inset Flex CharStyle:Code
16952 \begin_layout Plain Layout
16960 \begin_inset Flex CharStyle:Code
16963 \begin_layout Plain Layout
16969 allows you to alter or augment the generated CSS, rather than to override
16972 \begin_inset Flex CharStyle:Code
16975 \begin_layout Plain Layout
16984 \begin_layout Description
16985 \begin_inset Flex CharStyle:Code
16988 \begin_layout Plain Layout
16995 \begin_inset Flex CharStyle:Code
16998 \begin_layout Plain Layout
17004 ] The tag to be used for individual paragraphs of environments, replacing
17006 \begin_inset Flex CharStyle:Code
17009 \begin_layout Plain Layout
17015 in the examples above.
17017 \begin_inset Flex CharStyle:Code
17020 \begin_layout Plain Layout
17029 \begin_layout Description
17030 \begin_inset Flex CharStyle:Code
17033 \begin_layout Plain Layout
17040 \begin_inset Flex CharStyle:Code
17043 \begin_layout Plain Layout
17049 ] Attributes for the item tag.
17051 \begin_inset Quotes eld
17055 \begin_inset Flex CharStyle:Code
17058 \begin_layout Plain Layout
17059 class=`layoutname_item'
17065 \begin_inset Quotes erd
17073 contain any style information.
17075 \begin_inset Flex CharStyle:Code
17078 \begin_layout Plain Layout
17087 \begin_layout Description
17088 \begin_inset Flex CharStyle:Code
17091 \begin_layout Plain Layout
17098 \begin_inset Flex CharStyle:Code
17101 \begin_layout Plain Layout
17107 ] The tag to be used for paragraph and item labels, replacing
17108 \begin_inset Flex CharStyle:Code
17111 \begin_layout Plain Layout
17117 in the examples above.
17119 \begin_inset Flex CharStyle:Code
17122 \begin_layout Plain Layout
17129 \begin_inset Flex CharStyle:Code
17132 \begin_layout Plain Layout
17139 \begin_inset Flex CharStyle:Code
17142 \begin_layout Plain Layout
17149 \begin_inset Flex CharStyle:Code
17152 \begin_layout Plain Layout
17153 Centered_Top_Environment
17158 , in which case it defaults to
17159 \begin_inset Flex CharStyle:Code
17162 \begin_layout Plain Layout
17171 \begin_layout Description
17172 \begin_inset Flex CharStyle:Code
17175 \begin_layout Plain Layout
17182 \begin_inset Flex CharStyle:Code
17185 \begin_layout Plain Layout
17191 ] Attributes for the label tag.
17193 \begin_inset Quotes eld
17197 \begin_inset Flex CharStyle:Code
17200 \begin_layout Plain Layout
17201 class=`layoutname_label'
17207 \begin_inset Quotes erd
17215 contain any style information.
17217 \begin_inset Flex CharStyle:Code
17220 \begin_layout Plain Layout
17229 \begin_layout Description
17230 \begin_inset Flex CharStyle:Code
17233 \begin_layout Plain Layout
17240 \begin_inset Flex CharStyle:Code
17243 \begin_layout Plain Layout
17253 ] Meaningful only for list-like environments, this tag controls whether
17254 the label tag is output before or inside the item tag.
17255 This is used, for example, in the description environment, where we want
17257 \begin_inset Flex CharStyle:Code
17260 \begin_layout Plain Layout
17261 <dt>\SpecialChar \ldots{}
17262 </dt><dd>\SpecialChar \ldots{}
17270 \begin_inset Flex CharStyle:Code
17273 \begin_layout Plain Layout
17279 : The label tag is output inside the item tag.
17282 \begin_layout Description
17283 \begin_inset Flex CharStyle:Code
17286 \begin_layout Plain Layout
17292 Information to be output in the
17293 \begin_inset Flex CharStyle:Code
17296 \begin_layout Plain Layout
17302 section when this style is used.
17303 This might, for example, be used to include a
17304 \begin_inset Flex CharStyle:Code
17307 \begin_layout Plain Layout
17314 \begin_inset Flex CharStyle:Code
17317 \begin_layout Plain Layout
17326 \begin_layout Description
17327 \begin_inset Flex CharStyle:Code
17330 \begin_layout Plain Layout
17336 CSS style information to be included when this style is used.
17337 Note that this will automatically be wrapped in a layout-generated
17338 \begin_inset Flex CharStyle:Code
17341 \begin_layout Plain Layout
17347 block, so only the CSS itself need be included.
17350 \begin_layout Description
17351 \begin_inset Flex CharStyle:Code
17354 \begin_layout Plain Layout
17361 \begin_inset Flex CharStyle:Code
17364 \begin_layout Plain Layout
17370 ] The tag to be used for the main label, replacing
17371 \begin_inset Flex CharStyle:Code
17374 \begin_layout Plain Layout
17380 in the examples above.
17382 \begin_inset Flex CharStyle:Code
17385 \begin_layout Plain Layout
17394 \begin_layout Description
17395 \begin_inset Flex CharStyle:Code
17398 \begin_layout Plain Layout
17405 \begin_inset Flex CharStyle:Code
17408 \begin_layout Plain Layout
17418 ] Marks this style as the one to be used to generate the
17419 \begin_inset Flex CharStyle:Code
17422 \begin_layout Plain Layout
17428 tag for the XHTML file.
17429 By default, it is false.
17431 \begin_inset Flex CharStyle:Code
17434 \begin_layout Plain Layout
17440 file sets it to true for the
17441 \begin_inset Flex CharStyle:Code
17444 \begin_layout Plain Layout
17454 \begin_layout Subsection
17458 \begin_layout Standard
17459 The XHTML output of insets can also be controlled by information in layout
17464 \begin_layout Plain Layout
17465 At present, this is true only for
17466 \begin_inset Quotes eld
17470 \begin_inset Quotes erd
17473 insets (insets you can type into) and is not true for
17474 \begin_inset Quotes eld
17478 \begin_inset Quotes erd
17481 insets (insets that are associated with dialog boxes).
17486 Here, too, LyX tries to provide sensible defaults, and it constructs default
17488 But everything can be customized.
17491 \begin_layout Standard
17492 The XHTML LyX outputs for an inset has the following form:
17495 \begin_layout LyX-Code
17497 \begin_inset Quotes erd
17501 \begin_inset Quotes erd
17507 \begin_layout LyX-Code
17508 <labeltag>Label</labeltag>
17511 \begin_layout LyX-Code
17513 \begin_inset Quotes erd
17517 \begin_inset Quotes erd
17520 >Contents of the inset.</innertag>
17523 \begin_layout LyX-Code
17527 \begin_layout Standard
17528 If the inset permits multiple paragraphs---that is, if
17529 \begin_inset Flex CharStyle:Code
17532 \begin_layout Plain Layout
17538 is true---then the contents of the inset will itself be output as paragraphs
17539 formatted according to the styles used for those paragraphs (standard,
17540 quote, and the like).
17541 The label tag is of course omitted if the paragraph does not have a label
17542 and, at present, is always
17543 \begin_inset Flex CharStyle:Code
17546 \begin_layout Plain Layout
17553 The inner tag is optional and, by default, does not appear.
17556 \begin_layout Standard
17557 The specific tags and attributes output for each inset can be controlled
17558 by means of the following layout tags.
17561 \begin_layout Description
17562 \begin_inset Flex CharStyle:Code
17565 \begin_layout Plain Layout
17572 \begin_inset Flex CharStyle:Code
17575 \begin_layout Plain Layout
17581 ] Specifies attribute information to be output with the main tag.
17583 \begin_inset Quotes eld
17587 \begin_inset Flex CharStyle:Code
17590 \begin_layout Plain Layout
17591 class=`myinset' onclick=`\SpecialChar \ldots{}
17598 \begin_inset Quotes erd
17602 By default, LyX will output
17603 \begin_inset Quotes eld
17607 \begin_inset Flex CharStyle:Code
17610 \begin_layout Plain Layout
17617 \begin_inset Quotes erd
17621 \begin_inset Flex CharStyle:Code
17624 \begin_layout Plain Layout
17630 is the LyX name of the inset, made lowercase and with non-alphanumeric
17631 characters converted to underscores, for example: footnote.
17634 \begin_layout Description
17635 \begin_inset Flex CharStyle:Code
17638 \begin_layout Plain Layout
17645 \begin_inset Flex CharStyle:Code
17648 \begin_layout Plain Layout
17658 ] Whether to output the default CSS information LyX generates for this layout,
17659 even if additional information is explicitly provided via
17660 \begin_inset Flex CharStyle:Code
17663 \begin_layout Plain Layout
17671 \begin_inset Flex CharStyle:Code
17674 \begin_layout Plain Layout
17680 allows you to alter or augment the generated CSS, rather than to override
17685 \begin_layout Description
17686 \begin_inset Flex CharStyle:Code
17689 \begin_layout Plain Layout
17696 \begin_inset Flex CharStyle:Code
17699 \begin_layout Plain Layout
17705 ] Attributes for the inner tag.
17707 \begin_inset Quotes eld
17711 \begin_inset Flex CharStyle:Code
17714 \begin_layout Plain Layout
17715 class=`insetname_inner'
17721 \begin_inset Quotes erd
17727 \begin_layout Description
17728 \begin_inset Flex CharStyle:Code
17731 \begin_layout Plain Layout
17738 \begin_inset Flex CharStyle:Code
17741 \begin_layout Plain Layout
17747 ] The inner tag, replacing
17748 \begin_inset Flex CharStyle:Code
17751 \begin_layout Plain Layout
17757 in the examples above.
17758 By default, there is none.
17761 \begin_layout Description
17762 \begin_inset Flex CharStyle:Code
17765 \begin_layout Plain Layout
17772 \begin_inset Flex CharStyle:Code
17775 \begin_layout Plain Layout
17783 ] Whether this inset represents a standalone block of text (such as a footnote)
17784 or instead represents material that is included in the surrounding text
17785 (such as a branch).
17789 \begin_layout Description
17790 \begin_inset Flex CharStyle:Code
17793 \begin_layout Plain Layout
17800 \begin_inset Flex CharStyle:Code
17803 \begin_layout Plain Layout
17809 ] A label for this inset, possibly including a reference to a counter.
17810 For example, for footnote, it might be:
17811 \begin_inset Flex CharStyle:Code
17814 \begin_layout Plain Layout
17823 This is optional, and there is no default.
17826 \begin_layout Description
17827 \begin_inset Flex CharStyle:Code
17830 \begin_layout Plain Layout
17836 Information to be output in the
17837 \begin_inset Flex CharStyle:Code
17840 \begin_layout Plain Layout
17846 section when this style is used.
17847 This might, for example, be used to include a
17848 \begin_inset Flex CharStyle:Code
17851 \begin_layout Plain Layout
17858 \begin_inset Flex CharStyle:Code
17861 \begin_layout Plain Layout
17870 \begin_layout Description
17871 \begin_inset Flex CharStyle:Code
17874 \begin_layout Plain Layout
17880 CSS style information to be included when this style is used.
17881 Note that this will automatically be wrapped in a layout-generated
17882 \begin_inset Flex CharStyle:Code
17885 \begin_layout Plain Layout
17891 block, so only the CSS itself need be included.
17894 \begin_layout Description
17895 \begin_inset Flex CharStyle:Code
17898 \begin_layout Plain Layout
17905 \begin_inset Flex CharStyle:Code
17908 \begin_layout Plain Layout
17914 ] The tag to be used for the main label, replacing
17915 \begin_inset Flex CharStyle:Code
17918 \begin_layout Plain Layout
17924 in the examples above.
17925 The default depends upon the setting of
17926 \begin_inset Flex CharStyle:Code
17929 \begin_layout Plain Layout
17936 \begin_inset Flex CharStyle:Code
17939 \begin_layout Plain Layout
17945 is true, the default is
17946 \begin_inset Flex CharStyle:Code
17949 \begin_layout Plain Layout
17955 ; if it is false, the default is
17956 \begin_inset Flex CharStyle:Code
17959 \begin_layout Plain Layout
17968 \begin_layout Subsection
17972 \begin_layout Standard
17973 The XHTML output for floats too can be controlled by layout information.
17974 The output has the following form:
17977 \begin_layout LyX-Code
17979 \begin_inset Quotes erd
17983 \begin_inset Quotes erd
17989 \begin_layout LyX-Code
17990 Contents of the float.
17993 \begin_layout LyX-Code
17997 \begin_layout Standard
17998 The caption, if there is one, is a separate inset and will be output as
18000 Its appearance can be controlled via the InsetLayout for caption insets.
18004 \begin_layout Description
18005 \begin_inset Flex CharStyle:Code
18008 \begin_layout Plain Layout
18015 \begin_inset Flex CharStyle:Code
18018 \begin_layout Plain Layout
18024 ] Specifies attribute information to be output with the main tag.
18026 \begin_inset Quotes eld
18030 \begin_inset Flex CharStyle:Code
18033 \begin_layout Plain Layout
18034 class=`myfloat' onclick=`\SpecialChar \ldots{}
18041 \begin_inset Quotes erd
18045 By default, LyX will output
18046 \begin_inset Quotes eld
18050 \begin_inset Flex CharStyle:Code
18053 \begin_layout Plain Layout
18054 class=`float float-floattype'
18060 \begin_inset Quotes erd
18064 \begin_inset Flex CharStyle:Code
18067 \begin_layout Plain Layout
18073 is LyX's name for this type of float, as determined by the float delcaration
18075 \begin_inset CommandInset ref
18077 reference "sub:Floats"
18081 ), though made lowercase and with non-alphanumeric characters converted
18082 to underscores, for example: float-table.
18085 \begin_layout Description
18086 \begin_inset Flex CharStyle:Code
18089 \begin_layout Plain Layout
18095 CSS style information to be included when this float is used.
18096 Note that this will automatically be wrapped in a layout-generated
18097 \begin_inset Flex CharStyle:Code
18100 \begin_layout Plain Layout
18106 block, so only the CSS itself need be included.
18109 \begin_layout Description
18110 \begin_inset Flex CharStyle:Code
18113 \begin_layout Plain Layout
18120 \begin_inset Flex CharStyle:Code
18123 \begin_layout Plain Layout
18129 ] The tag to be used for this float, replacing
18130 \begin_inset Quotes eld
18134 \begin_inset Flex CharStyle:Code
18137 \begin_layout Plain Layout
18144 \begin_inset Quotes erd
18147 in the example above.
18149 \begin_inset Flex CharStyle:Code
18152 \begin_layout Plain Layout
18158 and will rarely need changing.
18161 \begin_layout Subsection
18162 Bibliography formatting
18165 \begin_layout Standard
18166 The bibliography can be formatted using
18167 \begin_inset Flex CharStyle:Code
18170 \begin_layout Plain Layout
18178 \begin_inset CommandInset ref
18180 reference "sub:Citation-format-description"
18187 \begin_layout Subsection
18191 \begin_layout Standard
18192 We have several times mentioned that LyX will generate default CSS style
18193 rules for both insets and paragraph styles, based upon the other layout
18194 information that is provided.
18195 In this section, we shall say a word about which layout information LyX
18199 \begin_layout Standard
18200 At present, LyX auto-generates CSS only for font information, making use
18202 \begin_inset Flex CharStyle:Code
18205 \begin_layout Plain Layout
18212 \begin_inset Flex CharStyle:Code
18215 \begin_layout Plain Layout
18222 \begin_inset Flex CharStyle:Code
18225 \begin_layout Plain Layout
18232 \begin_inset Flex CharStyle:Code
18235 \begin_layout Plain Layout
18242 \begin_inset Flex CharStyle:Code
18245 \begin_layout Plain Layout
18253 \begin_inset CommandInset ref
18255 reference "sub:Font-description"
18259 .) The translation is mostly straightforward and obvious.
18261 \begin_inset Quotes eld
18265 \begin_inset Flex CharStyle:Code
18268 \begin_layout Plain Layout
18275 \begin_inset Quotes erd
18279 \begin_inset Quotes eld
18283 \begin_inset Flex CharStyle:Code
18286 \begin_layout Plain Layout
18287 font-family: sans-serif;
18293 \begin_inset Quotes erd
18297 The correspondence of LyX sizes and CSS sizes is a little less obvious
18298 but nonetheless intuitive.
18300 \begin_inset Flex CharStyle:Code
18303 \begin_layout Plain Layout
18310 \begin_inset Flex URL
18313 \begin_layout Plain Layout
18324 \begin_layout Chapter
18325 Including External Material
18328 \begin_layout Standard
18329 \begin_inset Box Shadowbox
18339 height_special "totalheight"
18342 \begin_layout Plain Layout
18343 WARNING: This portion of the documentation has not been updated for some
18345 We certainly hope that it is still accurate, but there are no guarantees.
18353 \begin_layout Standard
18354 The use of material from sources external to LyX is covered in detail in
18360 This part of the manual covers what needs to happen behind the scenes for
18361 new sorts of material to be included.
18364 \begin_layout Section
18368 \begin_layout Standard
18369 The external material feature is based on the concept of a
18374 A template is a specification of how LyX should interface with a certain
18376 As bundled, LyX comes with predefined templates for Xfig figures, various
18377 raster format images, chess diagrams, and LilyPond music notation.
18378 You can check the actual list by using the menu
18379 \begin_inset Flex CharStyle:MenuItem
18382 \begin_layout Plain Layout
18383 Insert\SpecialChar \menuseparator
18384 File\SpecialChar \menuseparator
18391 Furthermore, it is possible to roll your own template to support a specific
18393 Later we'll describe in more detail what is involved, and hopefully you
18394 will submit all the templates you create so we can include them in a later
18398 \begin_layout Standard
18399 Another basic idea of the external material feature is to distinguish between
18400 the original file that serves as a base for final material and the produced
18401 file that is included in your exported or printed document.
18402 For example, consider the case of a figure produced with
18403 \begin_inset Flex CharStyle:Code
18406 \begin_layout Plain Layout
18413 The Xfig application itself works on an original file with the
18414 \begin_inset Flex CharStyle:Code
18417 \begin_layout Plain Layout
18424 Within Xfig, you create and change your figure, and when you are done,
18426 \begin_inset Flex CharStyle:Code
18429 \begin_layout Plain Layout
18436 When you want to include the figure in your document, you invoke
18437 \begin_inset Flex CharStyle:Code
18440 \begin_layout Plain Layout
18446 in order to create a PostScript file that can readily be included in your
18449 \begin_inset Flex CharStyle:Code
18452 \begin_layout Plain Layout
18458 file is the original file, and the PostScript file is the produced file.
18461 \begin_layout Standard
18462 This distinction is important in order to allow updating of the material
18463 while you are in the process of writing the document.
18464 Furthermore, it provides us with the flexibility that is needed to support
18465 multiple export formats.
18466 For instance, in the case of a plain text file, it is not exactly an award-winn
18467 ing idea to include the figure as raw PostScript.
18468 Instead, you'd either prefer to just include a reference to the figure
18469 or try to invoke some graphics to ASCII converter to make the final result
18470 look similar to the real graphics.
18471 The external material management allows you to do this, because it is parametri
18472 zed on the different export formats that LyX supports.
18475 \begin_layout Standard
18476 Besides supporting the production of different products according to the
18477 exported format, it supports tight integration with editing and viewing
18479 In the case of an Xfig figure, you are able to invoke Xfig on the original
18480 file with a single click from within the external material dialog in LyX,
18481 and also preview the produced PostScript file with Ghostview with another
18483 No more fiddling around with the command line and/or file browsers to locate
18484 and manipulate the original or produced files.
18485 In this way, you are finally able to take full advantage of the many different
18486 applications that are relevant to use when you write your documents, and
18487 ultimately be more productive.
18490 \begin_layout Section
18491 The external template configuration file
18494 \begin_layout Standard
18495 It is relatively easy to add custom external template definitions to LyX.
18496 However, be aware that doing this in an careless manner most probably
18500 introduce an easily exploitable security hole.
18501 So before you do this, please read the discussion about security in section
18503 \begin_inset CommandInset ref
18505 reference "sec:Security-discussion"
18512 \begin_layout Standard
18513 Having said that, we encourage you to submit any interesting templates that
18518 \begin_layout Standard
18519 The external templates are defined in the
18520 \begin_inset Flex CharStyle:Code
18523 \begin_layout Plain Layout
18524 LyXDir/lib/external_templates
18530 You can place your own version in
18531 \begin_inset Flex CharStyle:Code
18534 \begin_layout Plain Layout
18535 UserDir/external_templates
18543 \begin_layout Standard
18544 A typical template looks like this:
18547 \begin_layout LyX-Code
18551 \begin_layout LyX-Code
18552 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
18555 \begin_layout LyX-Code
18559 \begin_layout LyX-Code
18563 \begin_layout LyX-Code
18567 \begin_layout LyX-Code
18571 \begin_layout LyX-Code
18575 \begin_layout LyX-Code
18576 AutomaticProduction true
18579 \begin_layout LyX-Code
18583 \begin_layout LyX-Code
18587 \begin_layout LyX-Code
18591 \begin_layout LyX-Code
18592 TransformCommand Rotate RotationLatexCommand
18595 \begin_layout LyX-Code
18596 TransformCommand Resize ResizeLatexCommand
18599 \begin_layout LyX-Code
18600 Product "$$RotateFront$$ResizeFront
18603 \begin_layout LyX-Code
18608 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
18611 \begin_layout LyX-Code
18612 $$ResizeBack$$RotateBack"
18615 \begin_layout LyX-Code
18619 \begin_layout LyX-Code
18620 UpdateResult "$$AbsPath$$Basename.pstex_t"
18623 \begin_layout LyX-Code
18624 Requirement "graphicx"
18627 \begin_layout LyX-Code
18628 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
18631 \begin_layout LyX-Code
18632 ReferencedFile latex "$$AbsPath$$Basename.eps"
18635 \begin_layout LyX-Code
18636 ReferencedFile dvi "$$AbsPath$$Basename.eps"
18639 \begin_layout LyX-Code
18643 \begin_layout LyX-Code
18647 \begin_layout LyX-Code
18648 TransformCommand Rotate RotationLatexCommand
18651 \begin_layout LyX-Code
18652 TransformCommand Resize ResizeLatexCommand
18655 \begin_layout LyX-Code
18656 Product "$$RotateFront$$ResizeFront
18659 \begin_layout LyX-Code
18664 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
18667 \begin_layout LyX-Code
18668 $$ResizeBack$$RotateBack"
18671 \begin_layout LyX-Code
18672 UpdateFormat pdftex
18675 \begin_layout LyX-Code
18676 UpdateResult "$$AbsPath$$Basename.pdftex_t"
18679 \begin_layout LyX-Code
18680 Requirement "graphicx"
18683 \begin_layout LyX-Code
18684 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
18687 \begin_layout LyX-Code
18688 ReferencedFile latex "$$AbsPath$$Basename.pdf"
18691 \begin_layout LyX-Code
18695 \begin_layout LyX-Code
18699 \begin_layout LyX-Code
18700 Product "$$Contents(
18702 "$$AbsPath$$Basename.asc
18707 \begin_layout LyX-Code
18708 UpdateFormat asciixfig
18711 \begin_layout LyX-Code
18712 UpdateResult "$$AbsPath$$Basename.asc"
18715 \begin_layout LyX-Code
18719 \begin_layout LyX-Code
18723 \begin_layout LyX-Code
18724 Product "<graphic fileref=
18726 "$$AbsOrRelPathMaster$$Basename.eps
18731 \begin_layout LyX-Code
18735 \begin_layout LyX-Code
18739 \begin_layout LyX-Code
18740 UpdateResult "$$AbsPath$$Basename.eps"
18743 \begin_layout LyX-Code
18744 ReferencedFile docbook "$$AbsPath$$Basename.eps"
18747 \begin_layout LyX-Code
18748 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
18751 \begin_layout LyX-Code
18755 \begin_layout LyX-Code
18756 Product "[XFig: $$FName]"
18759 \begin_layout LyX-Code
18763 \begin_layout LyX-Code
18767 \begin_layout Standard
18768 As you can see, the template is enclosed in
18769 \begin_inset Flex CharStyle:Code
18772 \begin_layout Plain Layout
18778 \SpecialChar \ldots{}
18780 \begin_inset Flex CharStyle:Code
18783 \begin_layout Plain Layout
18790 It contains a header specifying some general settings and, for each supported
18791 primary document file format, a section
18792 \begin_inset Flex CharStyle:Code
18795 \begin_layout Plain Layout
18801 \SpecialChar \ldots{}
18803 \begin_inset Flex CharStyle:Code
18806 \begin_layout Plain Layout
18815 \begin_layout Subsection
18816 The template header
18819 \begin_layout Description
18820 \begin_inset Flex CharStyle:Code
18823 \begin_layout Plain Layout
18824 AutomaticProduction
18825 \begin_inset space ~
18833 Whether the file represented by the template must be generated by LyX.
18834 This command must occur exactly once.
18837 \begin_layout Description
18838 \begin_inset Flex CharStyle:Code
18841 \begin_layout Plain Layout
18843 \begin_inset space ~
18851 A glob pattern that is used in the file dialog to filter out the desired
18853 If there is more than one possible file extension (e.
18854 \begin_inset space \thinspace{}
18858 \begin_inset space \space{}
18862 \begin_inset Flex CharStyle:Code
18865 \begin_layout Plain Layout
18872 \begin_inset Flex CharStyle:Code
18875 \begin_layout Plain Layout
18881 ), use something like
18882 \begin_inset Flex CharStyle:Code
18885 \begin_layout Plain Layout
18892 This command must occur exactly once.
18895 \begin_layout Description
18896 \begin_inset Flex CharStyle:Code
18899 \begin_layout Plain Layout
18901 \begin_inset space ~
18909 The text that is displayed on the button.
18910 This command must occur exactly once.
18913 \begin_layout Description
18914 \begin_inset Flex CharStyle:Code
18917 \begin_layout Plain Layout
18919 \begin_inset space ~
18923 \begin_inset space ~
18931 The help text that is used in the External dialog.
18932 Provide enough information to explain to the user just what the template
18933 can provide him with.
18934 This command must occur exactly once.
18937 \begin_layout Description
18938 \begin_inset Flex CharStyle:Code
18941 \begin_layout Plain Layout
18943 \begin_inset space ~
18951 The file format of the original file.
18952 This must be the name of a format that is known to LyX (see section
18953 \begin_inset CommandInset ref
18955 reference "sec:Formats"
18961 \begin_inset Quotes eld
18965 \begin_inset Flex CharStyle:Code
18968 \begin_layout Plain Layout
18975 \begin_inset Quotes erd
18978 if the template can handle original files of more than one format.
18979 LyX will attempt to interrogate the file itself in order to deduce its
18980 format in this case.
18981 This command must occur exactly once.
18984 \begin_layout Description
18985 \begin_inset Flex CharStyle:Code
18988 \begin_layout Plain Layout
18990 \begin_inset space ~
18998 A unique name for the template.
18999 It must not contain substitution macros (see below).
19002 \begin_layout Description
19003 \begin_inset Flex CharStyle:Code
19006 \begin_layout Plain Layout
19008 \begin_inset space ~
19011 Rotate|Resize|Clip|Extra
19016 This command specifies which transformations are supported by this template.
19017 It may occur zero or more times.
19018 This command enables the corresponding tabs in the external dialog.
19020 \begin_inset Flex CharStyle:Code
19023 \begin_layout Plain Layout
19029 command must have either a corresponding
19030 \begin_inset Flex CharStyle:Code
19033 \begin_layout Plain Layout
19040 \begin_inset Flex CharStyle:Code
19043 \begin_layout Plain Layout
19050 \begin_inset Flex CharStyle:Code
19053 \begin_layout Plain Layout
19060 Otherwise the transformation will not be supported by that format.
19063 \begin_layout Subsection
19067 \begin_layout Description
19068 \begin_inset Flex CharStyle:Code
19071 \begin_layout Plain Layout
19073 \begin_inset space ~
19076 LaTeX|PDFLaTeX|PlainText|DocBook
19081 The primary document file format that this format definition is for.
19082 Not every template has a sensible representation in all document file formats.
19083 Please define nevertheless a
19084 \begin_inset Flex CharStyle:Code
19087 \begin_layout Plain Layout
19093 section for all formats.
19094 Use a dummy text when no representation is available.
19095 Then you can at least see a reference to the external material in the exported
19099 \begin_layout Description
19100 \begin_inset Flex CharStyle:Code
19103 \begin_layout Plain Layout
19105 \begin_inset space ~
19109 \begin_inset space ~
19117 This command defines an additional macro
19118 \begin_inset Flex CharStyle:Code
19121 \begin_layout Plain Layout
19127 for substitution in
19128 \begin_inset Flex CharStyle:Code
19131 \begin_layout Plain Layout
19139 \begin_inset Flex CharStyle:Code
19142 \begin_layout Plain Layout
19148 itself may contain substitution macros.
19149 The advantage over using
19150 \begin_inset Flex CharStyle:Code
19153 \begin_layout Plain Layout
19160 \begin_inset Flex CharStyle:Code
19163 \begin_layout Plain Layout
19169 is that the substituted value of
19170 \begin_inset Flex CharStyle:Code
19173 \begin_layout Plain Layout
19179 is sanitized so that it is a valid optional argument in the document format.
19180 This command may occur zero or more times.
19183 \begin_layout Description
19184 \begin_inset Flex CharStyle:Code
19187 \begin_layout Plain Layout
19189 \begin_inset space ~
19197 The text that is inserted in the exported document.
19198 This is actually the most important command and can be quite complex.
19199 This command must occur exactly once.
19202 \begin_layout Description
19203 \begin_inset Flex CharStyle:Code
19206 \begin_layout Plain Layout
19208 \begin_inset space ~
19216 This command specifies a preamble snippet that will be included in the
19218 It has to be defined using
19219 \begin_inset Flex CharStyle:Code
19222 \begin_layout Plain Layout
19228 \SpecialChar \ldots{}
19230 \begin_inset Flex CharStyle:Code
19233 \begin_layout Plain Layout
19240 This command may occur zero or more times.
19243 \begin_layout Description
19244 \begin_inset Flex CharStyle:Code
19247 \begin_layout Plain Layout
19249 \begin_inset space ~
19253 \begin_inset space ~
19261 This command denotes files that are created by the conversion process and
19262 are needed for a particular export format.
19263 If the filename is relative, it is interpreted relative to the master document.
19264 This command may be given zero or more times.
19267 \begin_layout Description
19268 \begin_inset Flex CharStyle:Code
19271 \begin_layout Plain Layout
19273 \begin_inset space ~
19281 The name of a required LaTeX package.
19282 The package is included via
19283 \begin_inset Flex CharStyle:Code
19286 \begin_layout Plain Layout
19294 in the LaTeX preamble.
19295 This command may occur zero or more times.
19298 \begin_layout Description
19299 \begin_inset Flex CharStyle:Code
19302 \begin_layout Plain Layout
19304 \begin_inset space ~
19308 \begin_inset space ~
19311 RotationLatexCommand
19316 This command specifies that the built in LaTeX command should be used for
19318 This command may occur once or not at all.
19321 \begin_layout Description
19322 \begin_inset Flex CharStyle:Code
19325 \begin_layout Plain Layout
19327 \begin_inset space ~
19331 \begin_inset space ~
19339 This command specifies that the built in LaTeX command should be used for
19341 This command may occur once or not at all.
19344 \begin_layout Description
19345 \begin_inset Flex CharStyle:Code
19348 \begin_layout Plain Layout
19350 \begin_inset space ~
19354 \begin_inset space ~
19357 RotationLatexOption
19362 This command specifies that rotation is done via an optional argument.
19363 This command may occur once or not at all.
19366 \begin_layout Description
19367 \begin_inset Flex CharStyle:Code
19370 \begin_layout Plain Layout
19372 \begin_inset space ~
19376 \begin_inset space ~
19384 This command specifies that resizing is done via an optional argument.
19385 This command may occur once or not at all.
19388 \begin_layout Description
19389 \begin_inset Flex CharStyle:Code
19392 \begin_layout Plain Layout
19394 \begin_inset space ~
19398 \begin_inset space ~
19406 This command specifies that clipping is done via an optional argument.
19407 This command may occur once or not at all.
19410 \begin_layout Description
19411 \begin_inset Flex CharStyle:Code
19414 \begin_layout Plain Layout
19416 \begin_inset space ~
19420 \begin_inset space ~
19428 This command specifies that an extra optional argument is used.
19429 This command may occur once or not at all.
19432 \begin_layout Description
19433 \begin_inset Flex CharStyle:Code
19436 \begin_layout Plain Layout
19438 \begin_inset space ~
19446 The file format of the converted file.
19447 This must be the name of a format that is known to LyX (see the
19448 \begin_inset Flex CharStyle:MenuItem
19451 \begin_layout Plain Layout
19456 ools\SpecialChar \menuseparator
19461 references:Conversion
19467 This command must occur exactly once.
19470 \begin_layout Description
19471 \begin_inset Flex CharStyle:Code
19474 \begin_layout Plain Layout
19476 \begin_inset space ~
19484 The file name of the converted file.
19485 The file name must be absolute.
19486 This command must occur exactly once.
19489 \begin_layout Subsection
19490 Preamble definitions
19493 \begin_layout Standard
19494 The external template configuration file may contain additional preamble
19495 definitions enclosed by
19496 \begin_inset Flex CharStyle:Code
19499 \begin_layout Plain Layout
19505 \SpecialChar \ldots{}
19507 \begin_inset Flex CharStyle:Code
19510 \begin_layout Plain Layout
19517 They can be used by the templates in the
19518 \begin_inset Flex CharStyle:Code
19521 \begin_layout Plain Layout
19530 \begin_layout Section
19531 The substitution mechanism
19534 \begin_layout Standard
19535 When the external material facility invokes an external program, it is done
19536 on the basis of a command defined in the template configuration file.
19537 These commands can contain various macros that are expanded before execution.
19538 Execution always take place in the directory of the containing document.
19541 \begin_layout Standard
19542 Also, whenever external material is to be displayed, the name will be produced
19543 by the substitution mechanism, and most other commands in the template
19544 definition support substitution as well.
19547 \begin_layout Standard
19548 The available macros are the following:
19551 \begin_layout Description
19552 \begin_inset Flex CharStyle:Code
19555 \begin_layout Plain Layout
19556 $$AbsOrRelPathMaster
19561 The file path, absolute or relative to the master LyX document.
19564 \begin_layout Description
19565 \begin_inset Flex CharStyle:Code
19568 \begin_layout Plain Layout
19569 $$AbsOrRelPathParent
19574 The file path, absolute or relative to the LyX document.
19577 \begin_layout Description
19578 \begin_inset Flex CharStyle:Code
19581 \begin_layout Plain Layout
19587 The absolute file path.
19590 \begin_layout Description
19591 \begin_inset Flex CharStyle:Code
19594 \begin_layout Plain Layout
19600 The filename without path and without the extension.
19603 \begin_layout Description
19604 \begin_inset Flex CharStyle:Code
19607 \begin_layout Plain Layout
19609 \begin_inset Quotes eld
19613 \begin_inset Quotes erd
19621 This macro will expand to the contents of the file with the name
19622 \begin_inset Flex CharStyle:Code
19625 \begin_layout Plain Layout
19634 \begin_layout Description
19635 \begin_inset Flex CharStyle:Code
19638 \begin_layout Plain Layout
19644 The file extension (including the dot).
19647 \begin_layout Description
19648 \begin_inset Flex CharStyle:Code
19651 \begin_layout Plain Layout
19657 The filename of the file specified in the external material dialog.
19658 This is either an absolute name, or it is relative to the LyX document.
19661 \begin_layout Description
19662 \begin_inset Flex CharStyle:Code
19665 \begin_layout Plain Layout
19672 \begin_inset Flex CharStyle:Code
19675 \begin_layout Plain Layout
19681 (absolute name or relative to the LyX document).
19684 \begin_layout Description
19685 \begin_inset Flex CharStyle:Code
19688 \begin_layout Plain Layout
19694 The file path, relative to the master LyX document.
19697 \begin_layout Description
19698 \begin_inset Flex CharStyle:Code
19701 \begin_layout Plain Layout
19707 The file path, relative to the LyX document.
19710 \begin_layout Description
19711 \begin_inset Flex CharStyle:Code
19714 \begin_layout Plain Layout
19720 This macro will expand to the absolute path of the system directory.
19721 This is typically used to point to the various helper scripts that are
19725 \begin_layout Description
19726 \begin_inset Flex CharStyle:Code
19729 \begin_layout Plain Layout
19735 A name and full path to a temporary file which will be automatically deleted
19736 whenever the containing document is closed, or the external material insertion
19740 \begin_layout Standard
19741 All path macros contain a trailing directory separator, so you can construct
19743 \begin_inset space \thinspace{}
19747 \begin_inset space \space{}
19750 the absolute filename with
19751 \begin_inset Flex CharStyle:Code
19754 \begin_layout Plain Layout
19755 $$AbsPath$$Basename$$Extension
19763 \begin_layout Standard
19764 The macros above are substituted in all commands unless otherwise noted.
19766 \begin_inset Flex CharStyle:Code
19769 \begin_layout Plain Layout
19775 supports additionally the following substitutions if they are enabled by
19777 \begin_inset Flex CharStyle:Code
19780 \begin_layout Plain Layout
19787 \begin_inset Flex CharStyle:Code
19790 \begin_layout Plain Layout
19799 \begin_layout Description
19800 \begin_inset Flex CharStyle:Code
19803 \begin_layout Plain Layout
19809 The front part of the resize command.
19812 \begin_layout Description
19813 \begin_inset Flex CharStyle:Code
19816 \begin_layout Plain Layout
19822 The back part of the resize command.
19825 \begin_layout Description
19826 \begin_inset Flex CharStyle:Code
19829 \begin_layout Plain Layout
19835 The front part of the rotation command.
19838 \begin_layout Description
19839 \begin_inset Flex CharStyle:Code
19842 \begin_layout Plain Layout
19848 The back part of the rotation command.
19851 \begin_layout Standard
19852 The value string of the
19853 \begin_inset Flex CharStyle:Code
19856 \begin_layout Plain Layout
19862 command supports additionally the following substitutions if they are enabled
19864 \begin_inset Flex CharStyle:Code
19867 \begin_layout Plain Layout
19874 \begin_inset Flex CharStyle:Code
19877 \begin_layout Plain Layout
19886 \begin_layout Description
19887 \begin_inset Flex CharStyle:Code
19890 \begin_layout Plain Layout
19899 \begin_layout Description
19900 \begin_inset Flex CharStyle:Code
19903 \begin_layout Plain Layout
19912 \begin_layout Description
19913 \begin_inset Flex CharStyle:Code
19916 \begin_layout Plain Layout
19925 \begin_layout Description
19926 \begin_inset Flex CharStyle:Code
19929 \begin_layout Plain Layout
19935 The rotation option.
19938 \begin_layout Standard
19939 You may ask why there are so many path macros.
19940 There are mainly two reasons:
19943 \begin_layout Enumerate
19944 Relative and absolute file names should remain relative or absolute, respectivel
19946 Users may have reasons to prefer either form.
19947 Relative names are useful for portable documents that should work on different
19948 machines, for example.
19949 Absolute names may be required by some programs.
19952 \begin_layout Enumerate
19953 LaTeX treats relative file names differently than LyX and other programs
19954 in nested included files.
19955 For LyX, a relative file name is always relative to the document that contains
19957 For LaTeX, it is always relative to the master document.
19958 These two definitions are identical if you have only one document, but
19959 differ if you have a master document that includes part documents.
19960 That means that relative filenames must be transformed when presented to
19962 Fortunately LyX does this automatically for you if you choose the right
19966 \begin_layout Standard
19967 So which path macro should be used in new template definitions? The rule
19971 \begin_layout Itemize
19973 \begin_inset Flex CharStyle:Code
19976 \begin_layout Plain Layout
19982 if an absolute path is required.
19985 \begin_layout Itemize
19987 \begin_inset Flex CharStyle:Code
19990 \begin_layout Plain Layout
19991 $$AbsOrRelPathMaster
19996 if the substituted string is some kind of LaTeX input.
19999 \begin_layout Itemize
20001 \begin_inset Flex CharStyle:Code
20004 \begin_layout Plain Layout
20005 $$AbsOrRelPathParent
20010 in order to preserve the user's choice.
20013 \begin_layout Standard
20014 There are special cases where this rule does not work and e.
20015 \begin_inset space \thinspace{}
20019 \begin_inset space \space{}
20022 relative names are needed, but normally it will work just fine.
20023 One example for such a case is the command
20024 \begin_inset Flex CharStyle:Code
20027 \begin_layout Plain Layout
20028 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
20033 in the XFig template above: We can't use the absolute name because the
20035 \begin_inset Flex CharStyle:Code
20038 \begin_layout Plain Layout
20044 files needs the relative name in order to rewrite the file content.
20047 \begin_layout Section
20048 Security discussion
20049 \begin_inset CommandInset label
20051 name "sec:Security-discussion"
20058 \begin_layout Standard
20059 The external material feature interfaces with a lot of external programs
20060 and does so automatically, so we have to consider the security implications
20062 In particular, since you have the option of including your own filenames
20063 and/or parameter strings and those are expanded into a command, it seems
20064 that it would be possible to create a malicious document which executes
20065 arbitrary commands when a user views or prints the document.
20066 This is something we definitely want to avoid.
20069 \begin_layout Standard
20070 However, since the external program commands are specified in the template
20071 configuration file only, there are no security issues if LyX is properly
20072 configured with safe templates only.
20073 This is so because the external programs are invoked with the
20074 \begin_inset Flex CharStyle:Code
20077 \begin_layout Plain Layout
20083 -system call rather than the
20084 \begin_inset Flex CharStyle:Code
20087 \begin_layout Plain Layout
20093 system-call, so it's not possible to execute arbitrary commands from the
20094 filename or parameter section via the shell.
20097 \begin_layout Standard
20098 This also implies that you are restricted in what command strings you can
20099 use in the external material templates.
20100 In particular, pipes and redirection are not readily available.
20101 This has to be so if LyX should remain safe.
20102 If you want to use some of the shell features, you should write a safe
20103 script to do this in a controlled manner, and then invoke the script from
20104 the command string.
20108 \begin_layout Standard
20109 It is possible to design a template that interacts directly with the shell,
20110 but since this would allow a malicious user to execute arbitrary commands
20111 by writing clever filenames and/or parameters, we generally recommend that
20112 you only use safe scripts that work with the
20113 \begin_inset Flex CharStyle:Code
20116 \begin_layout Plain Layout
20122 system call in a controlled manner.
20123 Of course, for use in a controlled environment, it can be tempting to just
20124 fall back to use ordinary shell scripts.
20125 If you do so, be aware that you
20129 provide an easily exploitable security hole in your system.
20130 Of course it stands to reason that such unsafe templates will never be
20131 included in the standard LyX distribution, although we do encourage people
20132 to submit new templates in the open source tradition.
20133 But LyX as shipped from the official distribution channels will never have
20137 \begin_layout Standard
20138 Including external material provides a lot of power, and you have to be
20139 careful not to introduce security hazards with this power.
20140 A subtle error in a single line in an innocent looking script can open
20141 the door to huge security problems.
20142 So if you do not fully understand the issues, we recommend that you consult
20143 a knowledgeable security professional or the LyX development team if you
20144 have any questions about whether a given template is safe or not.
20145 And do this before you use it in an uncontrolled environment.