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
50 InsetLayout CharStyle:MenuItem
59 \newcommand*{\menuitem}[1]{{\sffamily #1}}
68 \font_typewriter default
69 \font_default_family default
77 \default_output_format default
78 \bibtex_command default
79 \index_command default
83 \pdf_title "LyX Configuration Manual"
84 \pdf_author "LyX Team"
85 \pdf_subject "LyX-documentation Customization"
86 \pdf_keywords "LyX, documentation, customization"
88 \pdf_bookmarksnumbered true
89 \pdf_bookmarksopen true
90 \pdf_bookmarksopenlevel 1
95 \pdf_pdfusetitle false
96 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true,pdfstartview=XYZ, plainpages=false, pdfpagelabels"
105 \paperorientation portrait
118 \paragraph_separation indent
119 \paragraph_indentation default
120 \quotes_language english
123 \paperpagestyle headings
124 \tracking_changes false
125 \output_changes false
126 \html_use_mathml true
133 Customizing LyX: Features for the Advanced User
141 \begin_layout Plain Layout
143 If you have comments or error corrections, please send them to the LyX Documenta
145 \begin_inset CommandInset href
147 target "lyx-docs@lists.lyx.org"
154 \begin_inset Quotes eld
158 \begin_inset Quotes erd
161 in the subject header, and please cc the current maintainer of this file,
162 Richard Heck <rgheck@comcast.net>.
168 \begin_inset Newline newline
172 \begin_inset Newline newline
178 \begin_layout Standard
179 \begin_inset CommandInset toc
180 LatexCommand tableofcontents
187 \begin_layout Standard
188 \begin_inset Note Note
191 \begin_layout Plain Layout
192 Please use change tracking when modifying this document.
193 This makes it easier for our translators to recognize things that have
194 been changed, and it helps the maintainer keep up-to-date with what's been
203 \begin_layout Chapter
207 \begin_layout Standard
208 This manual covers the customization features present in LyX.
209 In it, we discuss issues like keyboard shortcuts, screen previewing options,
210 printer options, sending commands to LyX via the LyX Server, internationalizati
211 on, installing new LaTeX classes and LyX layouts, etc.
212 We can't possibly hope to touch on everything you can change—our developers
213 add new features faster than we can document them—but we will explain the
214 most common customizations and hopefully point you in the right direction
215 for some of the more obscure ones.
218 \begin_layout Standard
219 \begin_inset Branch OutDated
222 \begin_layout Standard
223 Information from previous versions of this document that now seems to be
224 outdated is contained in the OutDated branch of this document.
225 By default, this information will not appear in the LaTeX output.
233 \begin_layout Chapter
234 LyX configuration files
237 \begin_layout Standard
238 This chapter aims to help you to find your way through the LyX configuration
240 Before continuing to read this chapter, you should find out where your
241 LyX library and user directories are by using
242 \begin_inset Flex CharStyle:MenuItem
245 \begin_layout Plain Layout
246 Help\SpecialChar \menuseparator
257 The library directory is the place where LyX places its system-wide configurati
258 on files; the user directory is where you can place your modified versions.
259 We will call the former
260 \begin_inset Flex CharStyle:Code
263 \begin_layout Plain Layout
270 \begin_inset Flex CharStyle:MenuItem
273 \begin_layout Plain Layout
279 in the remainder of this document.
283 \begin_layout Section
285 \begin_inset Flex CharStyle:Code
288 \begin_layout Plain Layout
297 \begin_layout Standard
298 \begin_inset Flex CharStyle:Code
301 \begin_layout Plain Layout
307 and its sub-directories contain a number of files and that can be used
308 to customize LyX's behavior.
309 You can change many of these files from within LyX itself through the
310 \begin_inset Flex CharStyle:MenuItem
313 \begin_layout Plain Layout
314 Tools\SpecialChar \menuseparator
321 Most customization that you will want to do in LyX is possible through
323 However, many other inner aspects of LyX can be customized by modifying
325 \begin_inset Flex CharStyle:Code
328 \begin_layout Plain Layout
335 These files fall in different categories, described in the following subsection
339 \begin_layout Subsection
340 Automatically generated files
343 \begin_layout Standard
344 The files, which are to be found in
345 \begin_inset Flex CharStyle:MenuItem
348 \begin_layout Plain Layout
354 , are generated when you configure LyX.
355 They contain various default values that are guessed by inspection.
356 In general, it is not a good idea to modify them, since they might be overwritt
360 \begin_layout Labeling
361 \labelwidthstring 00.00.0000
362 \begin_inset Flex CharStyle:Code
365 \begin_layout Plain Layout
371 contains defaults for various commands.
374 \begin_layout Labeling
375 \labelwidthstring 00.00.0000
376 \begin_inset Flex CharStyle:Code
379 \begin_layout Plain Layout
385 contains the list of packages that have been recognized by LyX.
386 It is currently unused by the LyX program itself, but the information extracted
387 , and more, is made available with
388 \begin_inset Flex CharStyle:MenuItem
391 \begin_layout Plain Layout
392 Help\SpecialChar \menuseparator
405 \begin_layout Labeling
406 \labelwidthstring 00.00.0000
407 \begin_inset Flex CharStyle:Code
410 \begin_layout Plain Layout
416 the list of text classes that have been found in your
417 \begin_inset Flex CharStyle:Code
420 \begin_layout Plain Layout
426 directories, along with the associated LaTeX document class and their descripti
430 \begin_layout Labeling
431 \labelwidthstring 00.00.0000
432 \begin_inset Flex CharStyle:Code
435 \begin_layout Plain Layout
441 the list of layout modules found in your
442 \begin_inset Flex CharStyle:Code
445 \begin_layout Plain Layout
454 \begin_layout Labeling
455 \labelwidthstring 00.00.0000
456 \begin_inset Flex CharStyle:Code
459 \begin_layout Plain Layout
465 lists of various sorts of LaTeX-related files found on your system
468 \begin_layout Labeling
469 \labelwidthstring 00.00.0000
470 \begin_inset Flex CharStyle:Code
473 \begin_layout Plain Layout
479 is automatically generated during configuration from the file
480 \begin_inset Flex CharStyle:Code
483 \begin_layout Plain Layout
490 It contains information on your LaTeX configuration.
493 \begin_layout Subsection
497 \begin_layout Standard
498 These directories are duplicated between
499 \begin_inset Flex CharStyle:Code
502 \begin_layout Plain Layout
509 \begin_inset Flex CharStyle:Code
512 \begin_layout Plain Layout
519 If a particular files exists in both places, the one in
520 \begin_inset Flex CharStyle:Code
523 \begin_layout Plain Layout
532 \begin_layout Labeling
533 \labelwidthstring 00.00.0000
534 \begin_inset Flex CharStyle:Code
537 \begin_layout Plain Layout
543 this directory contains files with the extension
544 \begin_inset Flex CharStyle:Code
547 \begin_layout Plain Layout
553 that define the keybindings used in LyX.
554 If there exists an internationalized version of the bind file named
555 \begin_inset Flex CharStyle:Code
558 \begin_layout Plain Layout
564 , that will be used first.
567 \begin_layout Labeling
568 \labelwidthstring 00.00.0000
569 \begin_inset Flex CharStyle:Code
572 \begin_layout Plain Layout
578 contains graphics files that can be included in documents.
582 \begin_layout Labeling
583 \labelwidthstring 00.00.0000
584 \begin_inset Flex CharStyle:Code
587 \begin_layout Plain Layout
593 contains LyX documentation files (including the one you are currently reading).
595 \begin_inset Flex CharStyle:Code
598 \begin_layout Plain Layout
604 deserves special attention, as noted above.
605 The internationalized help docs are in subdirectories
606 \begin_inset Flex CharStyle:Code
609 \begin_layout Plain Layout
616 \begin_inset Quotes eld
620 \begin_inset Quotes erd
623 is the ISO language code.
629 \begin_inset CommandInset ref
631 reference "cha:Internationalizing-LyX"
638 \begin_layout Labeling
639 \labelwidthstring 00.00.0000
640 \begin_inset Flex CharStyle:Code
643 \begin_layout Plain Layout
649 contains example files that explain how to use some features.
650 In the file browser, press the
651 \begin_inset Flex CharStyle:MenuItem
654 \begin_layout Plain Layout
663 \begin_layout Labeling
664 \labelwidthstring 00.00.0000
665 \begin_inset Flex CharStyle:Code
668 \begin_layout Plain Layout
674 contains image files that are used by the
675 \begin_inset Flex CharStyle:MenuItem
678 \begin_layout Plain Layout
685 In addition, it also contains the individual icons used in the toolbar
686 and the banners that can be shown when LyX is launched.
689 \begin_layout Labeling
690 \labelwidthstring 00.00.0000
691 \begin_inset Flex CharStyle:Code
694 \begin_layout Plain Layout
700 contains keyboard keymapping files.
706 \begin_inset CommandInset ref
708 reference "sec:International-Keymap-Stuff"
715 \begin_layout Labeling
716 \labelwidthstring 00.00.0000
717 \begin_inset Flex CharStyle:Code
720 \begin_layout Plain Layout
726 contains the text class and module files described in Chapter
731 \begin_inset CommandInset ref
733 reference "cha:Installing-New-Document"
740 \begin_layout Labeling
741 \labelwidthstring 00.00.0000
742 \begin_inset Flex CharStyle:Code
745 \begin_layout Plain Layout
752 \begin_inset Flex CharStyle:Code
755 \begin_layout Plain Layout
761 Python scripts used to convert between LyX versions.
762 These can be run from the command line if, say, you want to batch-convert
766 \begin_layout Labeling
767 \labelwidthstring 00.00.0000
768 \begin_inset Flex CharStyle:Code
771 \begin_layout Plain Layout
777 contains some files that demonstrate the capabilities of the
778 \begin_inset Flex CharStyle:MenuItem
781 \begin_layout Plain Layout
792 Also contains some scripts used by LyX itself.
795 \begin_layout Labeling
796 \labelwidthstring 00.00.0000
797 \begin_inset Flex CharStyle:Code
800 \begin_layout Plain Layout
806 contains the standard LyX template files described in Chapter
811 \begin_inset CommandInset ref
813 reference "sub:Creating-Templates"
820 \begin_layout Labeling
821 \labelwidthstring 00.00.0000
822 \begin_inset Flex CharStyle:Code
825 \begin_layout Plain Layout
831 contains files with the extension
832 \begin_inset Flex CharStyle:Code
835 \begin_layout Plain Layout
841 that define the user interface to LyX.
842 That is, the files define which items appear in which menus and the items
843 appearing on the toolbar.
846 \begin_layout Subsection
847 Files you don't want to modify
850 \begin_layout Standard
851 These files are used internally by LyX and you generally do not need to
852 modify them unless you are a developer.
855 \begin_layout Labeling
856 \labelwidthstring 00.00.0000
857 \begin_inset Flex CharStyle:Code
860 \begin_layout Plain Layout
866 this file contains the list of LyX developers.
867 The contents are displayed with the menu entry
868 \begin_inset Flex CharStyle:MenuItem
871 \begin_layout Plain Layout
872 Help\SpecialChar \menuseparator
885 \begin_layout Labeling
886 \labelwidthstring 00.00.0000
887 \begin_inset Flex CharStyle:Code
890 \begin_layout Plain Layout
896 this is a LaTeX script used during the configuration process.
900 \begin_layout Labeling
901 \labelwidthstring 00.00.0000
902 \begin_inset Flex CharStyle:Code
905 \begin_layout Plain Layout
911 this is the script that is used to re-configure LyX.
912 It creates configuration files in the directory it was run from.
915 \begin_layout Subsection
916 Other files needing a line or two...
919 \begin_layout Labeling
920 \labelwidthstring 00.00.0000
921 \begin_inset Flex CharStyle:Code
924 \begin_layout Plain Layout
930 this contains tables describing how different character encodings can be
934 \begin_layout Labeling
935 \labelwidthstring 00.00.0000
936 \begin_inset Flex CharStyle:Code
939 \begin_layout Plain Layout
945 this file contains the templates available to the new
946 \begin_inset Flex CharStyle:MenuItem
949 \begin_layout Plain Layout
962 \begin_layout Labeling
963 \labelwidthstring 00.00.0000
964 \begin_inset Flex CharStyle:Code
967 \begin_layout Plain Layout
973 this file contains a list of all the languages currently supported by LyX.
976 \begin_layout Section
977 Your local configuration directory
980 \begin_layout Standard
981 Even if you are using LyX as an unprivileged user, you might want to change
982 LyX configuration for your own use.
984 \begin_inset Flex CharStyle:Code
987 \begin_layout Plain Layout
993 directory contains all your personal configuration files.
994 This is the directory described as
995 \begin_inset Quotes eld
999 \begin_inset Quotes erd
1003 \begin_inset Flex CharStyle:MenuItem
1006 \begin_layout Plain Layout
1007 Help\SpecialChar \menuseparator
1009 \begin_inset space ~
1018 This directory is used as a mirror of
1019 \begin_inset Flex CharStyle:Code
1022 \begin_layout Plain Layout
1028 , which means that every file in
1029 \begin_inset Flex CharStyle:Code
1032 \begin_layout Plain Layout
1038 is a replacement for the corresponding file in
1039 \begin_inset Flex CharStyle:Code
1042 \begin_layout Plain Layout
1049 Any configuration file described in the above sections can be placed either
1050 in the system-wide directory, in which case it will affect all users, or
1051 in your local directory for your own use.
1054 \begin_layout Standard
1055 To make things clearer, let's provide a few examples:
1058 \begin_layout Itemize
1059 The preferences set in the
1060 \begin_inset Flex CharStyle:MenuItem
1063 \begin_layout Plain Layout
1064 Tools\SpecialChar \menuseparator
1070 dialog are saved to a file
1071 \begin_inset Flex CharStyle:Code
1074 \begin_layout Plain Layout
1081 \begin_inset Flex CharStyle:Code
1084 \begin_layout Plain Layout
1093 \begin_layout Itemize
1094 When you reconfigure using
1095 \begin_inset Flex CharStyle:MenuItem
1098 \begin_layout Plain Layout
1099 Tools\SpecialChar \menuseparator
1106 \begin_inset Flex CharStyle:Code
1109 \begin_layout Plain Layout
1115 script, and the resulting files are written in your local configuration
1117 This means that any additional text class file that you might have added
1119 \begin_inset Flex CharStyle:Code
1122 \begin_layout Plain Layout
1128 will be added to the list of classes in the
1129 \begin_inset Flex CharStyle:MenuItem
1132 \begin_layout Plain Layout
1133 Document\SpecialChar \menuseparator
1142 \begin_layout Itemize
1143 If you get some updated documentation from LyX ftp site and cannot install
1144 it because you do not have sysadmin rights on your system, you can just
1146 \begin_inset Flex CharStyle:Code
1149 \begin_layout Plain Layout
1155 and the items in the
1156 \begin_inset Flex CharStyle:MenuItem
1159 \begin_layout Plain Layout
1165 menu will open them!
1168 \begin_layout Section
1169 Running LyX with multiple configurations
1172 \begin_layout Standard
1173 The configuration freedom of the local configuration directory may not suffice
1174 if you want to have more than one configuration at your disposal.
1175 For example, you may want to be use different key bindings or printer settings
1177 You can achieve this by having several such directories.
1178 You then specify which directory to use at run-time.
1181 \begin_layout Standard
1182 Invoking LyX with the command line switch
1183 \begin_inset Flex CharStyle:Code
1186 \begin_layout Plain Layout
1196 instructs the program to read the configuration from that directory, and
1197 not from the default directory.
1198 (You can determine the default directory by running LyX without the
1199 \begin_inset Flex CharStyle:Code
1202 \begin_layout Plain Layout
1208 switch.) If the specified directory does not exist, LyX offers to create
1209 it for you, just like it does for the default directory on the first time
1210 you run the program.
1211 You can modify the configuration options in this additional user directory
1212 exactly as you would for the default directory.
1213 These directories are completely independent (but read on).
1214 Note that setting the environment variable
1215 \begin_inset Flex CharStyle:Code
1218 \begin_layout Plain Layout
1224 to some value has exactly the same effect.
1227 \begin_layout Standard
1228 Having several configurations also requires more maintenance: if you want
1229 to add a new layout to
1230 \begin_inset Flex CharStyle:Code
1233 \begin_layout Plain Layout
1239 which you want available from all your configurations, you must add it
1240 to each directory separately.
1241 You can avoid this with the following trick: after LyX creates the additional
1242 directory, most of the subdirectories (see above) are empty.
1243 If you want the new configuration to mirror an existing one, replace the
1244 empty subdirectory with a symbolic link to the matching subdirectory in
1245 the existing configuration.
1247 \begin_inset Flex CharStyle:Code
1250 \begin_layout Plain Layout
1256 subdirectory, however, since it contains a file written by the configuration
1257 script (also accessible through
1258 \begin_inset Flex CharStyle:MenuItem
1261 \begin_layout Plain Layout
1262 Tools\SpecialChar \menuseparator
1268 ) which is configuration-specific.
1271 \begin_layout Chapter
1272 The Preferences dialog
1275 \begin_layout Standard
1276 All options of the preferences dialog are described in the Appendix
1278 The Preferences Dialog
1285 For some options you might find here more details.
1288 \begin_layout Section
1290 \begin_inset CommandInset label
1299 \begin_layout Standard
1300 The first step is to define your file formats if they are not already defined.
1302 \begin_inset Flex CharStyle:MenuItem
1305 \begin_layout Plain Layout
1306 Tools\SpecialChar \menuseparator
1314 \begin_inset Flex CharStyle:MenuItem
1317 \begin_layout Plain Layout
1318 File Handling\SpecialChar \menuseparator
1325 \begin_inset Flex CharStyle:MenuItem
1328 \begin_layout Plain Layout
1329 New\SpecialChar \ldots{}
1335 button to define your new format.
1337 \begin_inset Flex CharStyle:MenuItem
1340 \begin_layout Plain Layout
1346 field contains the name used to identify the format in the GUI.
1348 \begin_inset Flex CharStyle:MenuItem
1351 \begin_layout Plain Layout
1357 is used to identify the format internally.
1358 You will also need to enter a file extension.
1359 These are all required.
1361 \begin_inset Flex CharStyle:MenuItem
1364 \begin_layout Plain Layout
1370 field is used to provide a keyboard shortcut on the menus.
1371 (For example, pressing
1372 \begin_inset Flex CharStyle:MenuItem
1375 \begin_layout Plain Layout
1382 \begin_inset Flex CharStyle:MenuItem
1385 \begin_layout Plain Layout
1386 View\SpecialChar \menuseparator
1395 \begin_layout Standard
1397 \begin_inset Flex CharStyle:MenuItem
1400 \begin_layout Plain Layout
1407 \begin_inset Flex CharStyle:MenuItem
1410 \begin_layout Plain Layout
1417 For example, you might want to use
1418 \begin_inset Flex CharStyle:MenuItem
1421 \begin_layout Plain Layout
1427 to view PostScript files.
1428 You can enter the command needed to start the program in the corresponding
1430 In defining this command, you can use the four variables listed in the
1432 The viewer is launched when you view an image in LyX or use the
1433 \begin_inset Flex CharStyle:MenuItem
1436 \begin_layout Plain Layout
1443 The editor is for example launched when you right-click on an image and
1445 \begin_inset Flex CharStyle:MenuItem
1448 \begin_layout Plain Layout
1454 in the appearing context menu.
1457 \begin_layout Standard
1459 \begin_inset Flex CharStyle:MenuItem
1462 \begin_layout Plain Layout
1468 option tells LyX that a format is suitable for document export.
1469 If this is set and if a suitable conversion route exists (see sec.
1470 \begin_inset space \thinspace{}
1474 \begin_inset CommandInset ref
1476 reference "sec:Converters"
1480 ), the format will appear in the
1481 \begin_inset Flex CharStyle:MenuItem
1484 \begin_layout Plain Layout
1485 File\SpecialChar \menuseparator
1492 The format will also appear in the
1493 \begin_inset Flex CharStyle:MenuItem
1496 \begin_layout Plain Layout
1502 menu if a viewer is specified for the format.
1503 Pure image formats, such as
1504 \begin_inset Flex CharStyle:Code
1507 \begin_layout Plain Layout
1513 , should not use this option.
1514 Formats that can both represent vector graphics and documents like
1515 \begin_inset Flex CharStyle:Code
1518 \begin_layout Plain Layout
1527 \begin_layout Standard
1529 \begin_inset Flex CharStyle:MenuItem
1532 \begin_layout Plain Layout
1533 Vector graphics format
1538 tells LyX that a format can contain vector graphics.
1539 This information is used to determine the target format of included graphics
1541 \begin_inset Flex CharStyle:MenuItem
1544 \begin_layout Plain Layout
1551 Included graphics may need to be converted to either
1552 \begin_inset Flex CharStyle:MenuItem
1555 \begin_layout Plain Layout
1562 \begin_inset Flex CharStyle:MenuItem
1565 \begin_layout Plain Layout
1572 \begin_inset Flex CharStyle:MenuItem
1575 \begin_layout Plain Layout
1582 \begin_inset Flex CharStyle:MenuItem
1585 \begin_layout Plain Layout
1591 cannot handle other image formats.
1592 If an included graphic is not already in
1593 \begin_inset Flex CharStyle:MenuItem
1596 \begin_layout Plain Layout
1603 \begin_inset Flex CharStyle:MenuItem
1606 \begin_layout Plain Layout
1613 \begin_inset Flex CharStyle:MenuItem
1616 \begin_layout Plain Layout
1622 format, it is converted to
1623 \begin_inset Flex CharStyle:MenuItem
1626 \begin_layout Plain Layout
1632 if the vector format option is set, and otherwise to
1633 \begin_inset Flex CharStyle:MenuItem
1636 \begin_layout Plain Layout
1645 \begin_layout Section
1649 \begin_layout Standard
1650 Since all conversions from one format to another take place in LyX's temporary
1651 directory, it is sometimes necessary to modify a file before copying it
1652 to the temporary directory in order that the conversion may be performed.
1656 \begin_layout Plain Layout
1657 For example, the file may refer to other files—images, for example—using
1658 relative file names, and these may become invalid when the file is copied
1659 to the temporary directory.
1664 This is done by a Copier: It copies a file to (or from) the temporary directory
1665 and may modify it in the process.
1668 \begin_layout Standard
1669 The definitions of the copiers may use four variables:
1672 \begin_layout Labeling
1673 \labelwidthstring 00.00.0000
1674 \begin_inset Flex CharStyle:Code
1677 \begin_layout Plain Layout
1683 The LyX system directory (e.
1684 \begin_inset space \thinspace{}
1688 \begin_inset space \space{}
1692 \begin_inset Flex CharStyle:MenuItem
1695 \begin_layout Plain Layout
1704 \begin_layout Labeling
1705 \labelwidthstring 00.00.0000
1706 \begin_inset Flex CharStyle:Code
1709 \begin_layout Plain Layout
1718 \begin_layout Labeling
1719 \labelwidthstring 00.00.0000
1720 \begin_inset Flex CharStyle:Code
1723 \begin_layout Plain Layout
1732 \begin_layout Labeling
1733 \labelwidthstring 00.00.0000
1734 \begin_inset Flex CharStyle:Code
1737 \begin_layout Plain Layout
1746 \begin_layout Standard
1747 The latter should be the filename as it would be used in a LaTeX's
1754 It is relevant only when exporting files suitable for such inclusion.
1757 \begin_layout Standard
1758 Copiers can be used to do almost anything with output files.
1759 For example, suppose you want generated pdf files to be copied to a special
1761 \begin_inset Flex CharStyle:Code
1764 \begin_layout Plain Layout
1771 Then you could write a shell script such as this one:
1774 \begin_layout Standard
1775 \begin_inset listings
1779 \begin_layout Plain Layout
1784 \begin_layout Plain Layout
1789 \begin_layout Plain Layout
1791 TOFILE=`basename $2`
1794 \begin_layout Plain Layout
1796 cp $FROMFILE /home/you/pdf/$TOFILE
1801 Save it in your local LyX directory—say,
1802 \begin_inset Flex CharStyle:Code
1805 \begin_layout Plain Layout
1806 /home/you/.lyx/scripts/pdfcopier.sh
1811 —and make it executable, if you need to do so on your platform.
1813 \begin_inset Flex CharStyle:MenuItem
1816 \begin_layout Plain Layout
1817 Tools\SpecialChar \menuseparator
1823 dialog, select under
1824 \begin_inset Flex CharStyle:MenuItem
1827 \begin_layout Plain Layout
1828 File Handling\SpecialChar \menuseparator
1835 \begin_inset Flex CharStyle:MenuItem
1838 \begin_layout Plain Layout
1844 format—or one of the other pdf formats—and enter
1845 \begin_inset Flex CharStyle:Code
1848 \begin_layout Plain Layout
1849 pdfcopier.sh $$i $$o
1855 \begin_inset Flex CharStyle:MenuItem
1858 \begin_layout Plain Layout
1868 \begin_layout Standard
1869 Copiers are used by LyX in various of its own conversions.
1870 For example, if appropriate programs are found, LyX will automatically
1871 install copiers for the
1872 \begin_inset Flex CharStyle:MenuItem
1875 \begin_layout Plain Layout
1882 \begin_inset Flex CharStyle:MenuItem
1885 \begin_layout Plain Layout
1887 \begin_inset space ~
1896 When these formats are exported, the copier sees that not just the main
1897 HTML file but various associated files (style files, images, etc.) are also
1899 All these files are written to a subdirectory of the directory in which
1900 the original LyX file was found.
1904 \begin_layout Plain Layout
1905 This copier can be customized.
1907 \begin_inset Quotes eld
1911 \begin_inset Quotes erd
1914 argument takes a comma-separated list of extensions to be copied; if it
1915 is omitted, all files will be copied.
1917 \begin_inset Quotes eld
1921 \begin_inset Quotes erd
1924 argument determines the extension added to the generated directory.
1926 \begin_inset Quotes eld
1930 \begin_inset Flex CharStyle:MenuItem
1933 \begin_layout Plain Layout
1940 \begin_inset Quotes erd
1943 , so HTML generated from
1944 \begin_inset Flex CharStyle:MenuItem
1947 \begin_layout Plain Layout
1948 /path/to/filename.lyx
1954 \begin_inset Flex CharStyle:MenuItem
1957 \begin_layout Plain Layout
1958 /path/to/filename.html.LyXconv
1972 \begin_layout Section
1974 \begin_inset CommandInset label
1976 name "sec:Converters"
1983 \begin_layout Standard
1984 You can define your own Converters to convert files between different formats.
1986 \begin_inset Flex CharStyle:MenuItem
1989 \begin_layout Plain Layout
1990 Tools\SpecialChar \menuseparator
1991 Preferences\SpecialChar \menuseparator
1992 File Handling\SpecialChar \menuseparator
2001 \begin_layout Standard
2002 To define a new converter, select the
2003 \begin_inset Flex CharStyle:MenuItem
2006 \begin_layout Plain Layout
2008 \begin_inset space ~
2017 \begin_inset Flex CharStyle:MenuItem
2020 \begin_layout Plain Layout
2022 \begin_inset space ~
2030 from the drop-down lists, enter the command needed for the conversion,
2032 \begin_inset Flex CharStyle:MenuItem
2035 \begin_layout Plain Layout
2042 Several variables can be used in the definition of converters:
2045 \begin_layout Labeling
2046 \labelwidthstring 00.00.0000
2047 \begin_inset Flex CharStyle:Code
2050 \begin_layout Plain Layout
2056 The LyX system directory
2059 \begin_layout Labeling
2060 \labelwidthstring 00.00.0000
2061 \begin_inset Flex CharStyle:Code
2064 \begin_layout Plain Layout
2073 \begin_layout Labeling
2074 \labelwidthstring 00.00.0000
2075 \begin_inset Flex CharStyle:Code
2078 \begin_layout Plain Layout
2087 \begin_layout Labeling
2088 \labelwidthstring 00.00.0000
2089 \begin_inset Flex CharStyle:Code
2092 \begin_layout Plain Layout
2098 The base filename of the input file (i.
2099 \begin_inset space \thinspace{}
2102 g., without the extension)
2105 \begin_layout Labeling
2106 \labelwidthstring 00.00.0000
2107 \begin_inset Flex CharStyle:Code
2110 \begin_layout Plain Layout
2116 The path to the input file
2119 \begin_layout Labeling
2120 \labelwidthstring 00.00.0000
2121 \begin_inset Flex CharStyle:Code
2124 \begin_layout Plain Layout
2130 The path to the original input file (this is different from $$p when a
2131 chain of converters is called).
2134 \begin_layout Standard
2136 \begin_inset Flex CharStyle:MenuItem
2139 \begin_layout Plain Layout
2141 \begin_inset space ~
2149 field you can enter the following flags, separated by commas:
2152 \begin_layout Labeling
2153 \labelwidthstring 00.00.0000
2154 \begin_inset Flex CharStyle:Code
2157 \begin_layout Plain Layout
2163 This converter runs some form of LaTeX.
2164 This will make LyX's LaTeX error logs available.
2167 \begin_layout Labeling
2168 \labelwidthstring 00.00.0000
2169 \begin_inset Flex CharStyle:Code
2172 \begin_layout Plain Layout
2179 \begin_inset Flex CharStyle:MenuItem
2182 \begin_layout Plain Layout
2188 file for the conversion.
2191 \begin_layout Labeling
2192 \labelwidthstring 00.00.0000
2193 \begin_inset Flex CharStyle:Code
2196 \begin_layout Plain Layout
2205 \begin_layout Standard
2206 The following three flags are not really flags at all because they take
2208 \begin_inset Flex CharStyle:MenuItem
2211 \begin_layout Plain Layout
2213 \begin_inset space ~
2217 \begin_inset space ~
2228 \begin_layout Labeling
2229 \labelwidthstring 00.00.0000
2230 \begin_inset Flex CharStyle:Code
2233 \begin_layout Plain Layout
2239 If set, the converter's standard error will be redirected to a file
2240 \begin_inset Flex CharStyle:Code
2243 \begin_layout Plain Layout
2249 , and the script given as argument will be run as:
2250 \begin_inset Flex CharStyle:Code
2253 \begin_layout Plain Layout
2254 script < infile.out > infile.log
2260 The argument may contain
2261 \begin_inset Flex CharStyle:Code
2264 \begin_layout Plain Layout
2273 \begin_layout Labeling
2274 \labelwidthstring 00.00.0000
2275 \begin_inset Flex CharStyle:Code
2278 \begin_layout Plain Layout
2284 The name of the directory in which the converter will dump the generated
2286 LyX will not create this directory, and it does not copy anything into
2287 it, though it will copy this directory to the destination.
2288 The argument may contain
2289 \begin_inset Flex CharStyle:Code
2292 \begin_layout Plain Layout
2298 , which will be replaced by the base name of the input and output files,
2299 respectively, when the directory is copied.
2300 \begin_inset Newline newline
2303 Note that resultdir and usetempdir make no sense together.
2304 The latter will be ignored if the former is given.
2307 \begin_layout Labeling
2308 \labelwidthstring 00.00.0000
2309 \begin_inset Flex CharStyle:Code
2312 \begin_layout Plain Layout
2318 Determines the output file name and may, contain
2319 \begin_inset Flex CharStyle:Code
2322 \begin_layout Plain Layout
2329 Sensible only with resultdir and optional even then; if not given, it defaults
2333 \begin_layout Standard
2334 None of these last three are presently used in any of the converters that
2335 are installed with LyX.
2339 \begin_layout Standard
2340 You do not have to define converters for all formats between which you want
2342 For example, you will note that there is no `LyX to PostScript' converter,
2343 but LyX will export PostScript.
2344 It does so by first creating a LaTeX file (no converter needs to be defined
2345 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2346 and finally converting the resulting DVI file to PostScript.
2347 LyX finds such `chains' of converters automatically, and it will always
2348 choose the shortest possible chain.
2349 You can, though, still define multiple conversion methods between file
2351 For example, the standard LyX configuration provides three ways to convert
2352 LaTeX to PDF: Directly, using
2353 \begin_inset Flex CharStyle:MenuItem
2356 \begin_layout Plain Layout
2362 ; via (DVI and) PostScript, using
2363 \begin_inset Flex CharStyle:MenuItem
2366 \begin_layout Plain Layout
2373 \begin_inset Flex CharStyle:MenuItem
2376 \begin_layout Plain Layout
2383 To define such alternate chains, you must define multiple target `file
2384 formats', as described in section
2385 \begin_inset CommandInset ref
2387 reference "sec:Formats"
2392 For example, in the standard configuration, the formats named
2393 \begin_inset Flex CharStyle:MenuItem
2396 \begin_layout Plain Layout
2403 \begin_inset Flex CharStyle:MenuItem
2406 \begin_layout Plain Layout
2413 \begin_inset Flex CharStyle:MenuItem
2416 \begin_layout Plain Layout
2422 are defined, all of which share the extension
2423 \begin_inset Flex CharStyle:MenuItem
2426 \begin_layout Plain Layout
2432 , and which correspond to the conversion methods just mentioned.
2435 \begin_layout Chapter
2436 Internationalizing LyX
2437 \begin_inset CommandInset label
2439 name "cha:Internationalizing-LyX"
2446 \begin_layout Standard
2447 LyX supports using a translated interface.
2448 Last time we checked, LyX provided text in thirty languages.
2449 The language of choice is called your
2454 (For further reading on locale settings, see also the documentation for
2455 locale that comes with your operating system.
2456 For Linux, the manual page for
2457 \begin_inset Flex CharStyle:Code
2460 \begin_layout Plain Layout
2466 could be a good place to start).
2469 \begin_layout Standard
2470 Notice that these translations will work, but do contain a few flaws.
2471 In particular, all dialogs have been designed with the English text in
2472 mind, which means that some of the translated text will be too large to
2473 fit within the space allocated.
2474 This is only a display problem and will not cause any harm.
2475 Also, you will find that some of the translations do not define shortcut
2476 keys for everything.
2477 Sometimes, there are simply not enough free letters to do it.
2478 Other times, the translator just hasn't got around to doing it yet.
2479 Our localization team, which you may wish to join,
2483 \begin_layout Plain Layout
2484 If you are a fluent speaker of a language other than English, joining these
2485 teams is a great way to give back to the LyX community!
2490 will of course try to fix these shortcomings in future versions of LyX.
2493 \begin_layout Section
2497 \begin_layout Subsection
2498 Translating the graphical user interface (text messages).
2501 \begin_layout Standard
2503 \begin_inset Flex CharStyle:Code
2506 \begin_layout Plain Layout
2512 library to handle the internationalization of the interface.
2513 To have LyX speak your favorite language in all menus and dialogs, you
2515 \begin_inset Flex CharStyle:Code
2518 \begin_layout Plain Layout
2524 -file for that language.
2525 When this is available, you'll have to generate a
2526 \begin_inset Flex CharStyle:Code
2529 \begin_layout Plain Layout
2535 -file from it and install the
2536 \begin_inset Flex CharStyle:Code
2539 \begin_layout Plain Layout
2546 The process of doing all of this is explained in the documentation for
2548 \begin_inset Flex CharStyle:Code
2551 \begin_layout Plain Layout
2558 It is possible to do this just for yourself, but if you're going to do
2559 it, you might as well share the results of your labors with the rest of
2561 Send a message to the LyX developers' list for more information about how
2565 \begin_layout Standard
2566 In short, this is what you should do (xx denotes the language code):
2569 \begin_layout Itemize
2570 Check out the LyX source code.
2572 \begin_inset CommandInset href
2574 name "information on the web"
2575 target "http://www.lyx.org/devel/cvs.php"
2582 \begin_layout Itemize
2584 \begin_inset Flex CharStyle:Code
2587 \begin_layout Plain Layout
2593 to the folder of the
2594 \begin_inset Flex CharStyle:Code
2597 \begin_layout Plain Layout
2605 \begin_inset Flex CharStyle:Code
2608 \begin_layout Plain Layout
2616 \begin_inset Flex CharStyle:Code
2619 \begin_layout Plain Layout
2625 doesn't exist anywhere, it can be remade with the console command
2626 \begin_inset Flex CharStyle:Code
2629 \begin_layout Plain Layout
2635 in that directory, or you can use an existing po-file for some other language
2639 \begin_layout Itemize
2641 \begin_inset Flex CharStyle:Code
2644 \begin_layout Plain Layout
2654 \begin_layout Plain Layout
2655 This is just a text file, so it can be edited in any text editor.
2656 But there are also specialized programs that support such editing, such
2661 (for all platforms) or
2670 contains a `mode' for editing
2671 \begin_inset Flex CharStyle:Code
2674 \begin_layout Plain Layout
2685 For some menu- and widget-labels, there are also shortcut keys that should
2687 Those keys are marked after a `|', and should be translated according to
2688 the words and phrases of the language.
2689 You should also fill also out the information at the beginning of the new
2691 \begin_inset Flex CharStyle:Code
2694 \begin_layout Plain Layout
2700 -file with your email-address, etc., so people know where to reach you with
2701 suggestions and entertaining flames.
2704 \begin_layout Standard
2705 If you are just doing this on your own, then:
2708 \begin_layout Itemize
2710 \begin_inset Flex CharStyle:Code
2713 \begin_layout Plain Layout
2720 This can be done with
2721 \begin_inset Flex CharStyle:Code
2724 \begin_layout Plain Layout
2725 msgfmt -o xx.mo < xx.po
2733 \begin_layout Itemize
2735 \begin_inset Flex CharStyle:Code
2738 \begin_layout Plain Layout
2744 -file to your locale-tree, at the correct directory for application messages
2749 xx, and under the name
2750 \begin_inset Flex CharStyle:Code
2753 \begin_layout Plain Layout
2760 \begin_inset space \thinspace{}
2764 \begin_inset space \space{}
2768 \begin_inset Flex CharStyle:Code
2771 \begin_layout Plain Layout
2772 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2782 \begin_layout Standard
2783 As said, however, it would be best if the new
2784 \begin_inset Flex CharStyle:Code
2787 \begin_layout Plain Layout
2793 -file could be added to the LyX distribution, so others can use it.
2794 Adding it involves making additional changes to LyX.
2795 So send an email to the developers' mailing list if you're interested in
2799 \begin_layout Subsubsection
2803 \begin_layout Standard
2804 Sometimes it turns out that one English message needs to be translated into
2805 different messages in the target language.
2806 One example is the message
2807 \begin_inset Flex CharStyle:Code
2810 \begin_layout Plain Layout
2816 which has the German translation
2824 , depending upon exactly what the English
2825 \begin_inset Quotes eld
2829 \begin_inset Quotes erd
2834 \begin_inset Flex CharStyle:Code
2837 \begin_layout Plain Layout
2843 does not handle such ambiguous translations.
2844 Therefore you have to add some context information to the message: Instead
2846 \begin_inset Flex CharStyle:Code
2849 \begin_layout Plain Layout
2856 \begin_inset Flex CharStyle:Code
2859 \begin_layout Plain Layout
2860 To[[as in 'From format x to format y']]
2866 \begin_inset Flex CharStyle:Code
2869 \begin_layout Plain Layout
2870 To[[as in 'From page x to page y']].
2875 Now the two occurrences of
2876 \begin_inset Flex CharStyle:Code
2879 \begin_layout Plain Layout
2886 \begin_inset Flex CharStyle:Code
2889 \begin_layout Plain Layout
2895 and can be translated correctly to
2906 \begin_layout Standard
2907 Of course the context information needs to be stripped off the original
2908 message when no translation is used.
2909 Therefore you have to put it in double square brackets at the end of the
2910 message (see the example above).
2911 The translation mechanism of LyX ensures that everything in double square
2912 brackets at the end of messages is removed before displaying the message.
2915 \begin_layout Subsection
2916 Translating the documentation.
2919 \begin_layout Standard
2920 The online documentation (in the
2921 \begin_inset Flex CharStyle:MenuItem
2924 \begin_layout Plain Layout
2930 -menu) can (and should!) be translated.
2931 If there are translated versions of the documentation available
2935 \begin_layout Plain Layout
2936 As of March 2008, at least some of the documents have been translated into
2937 fourteen languages, with the Tutorial available in a few more.
2942 and the locale is set accordingly, these will be used automagically by
2944 LyX looks for translated versions as
2945 \begin_inset Flex CharStyle:Code
2948 \begin_layout Plain Layout
2949 LyXDir/doc/xx/DocName.lyx
2955 \begin_inset Flex CharStyle:Code
2958 \begin_layout Plain Layout
2964 is the code for the language currently in use.
2965 If there are no translated documents, the default English versions will
2967 Note that the translated versions must have the same filenames (
2968 \begin_inset Flex CharStyle:Code
2971 \begin_layout Plain Layout
2977 above) as the original.
2978 If you feel up to translating the documentation (an excellent way to proof-read
2979 the original documentation by the way!), there are a few things you should
2983 \begin_layout Itemize
2984 Check out the documentation translation web page at
2985 \begin_inset CommandInset href
2987 name "http://www.lyx.org/Translation"
2988 target "http://www.lyx.org/Translation"
2993 That way, you can find out which (if any) documents have already been translate
2994 d into your language.
2995 You can also find out who (if anyone) is organizing the effort to translate
2996 the documentation into your language.
2997 If no one is organizing the effort, please let us know that you're interested.
3000 \begin_layout Standard
3001 Once you get to actually translating, here's a few hints for you that may
3005 \begin_layout Itemize
3006 Join the documentation team! There is information on how to do that in
3007 \begin_inset Flex CharStyle:Code
3010 \begin_layout Plain Layout
3017 \begin_inset Flex CharStyle:MenuItem
3020 \begin_layout Plain Layout
3021 Help\SpecialChar \menuseparator
3027 ), which by the way is the first document you should translate.
3030 \begin_layout Itemize
3031 Learn the typographic conventions for the language you are translating to.
3032 Typography is an ancient art and over the centuries, a great variety of
3033 conventions have developed throughout different parts of the world.
3034 Also study the professional terminology amongst typographers in your country.
3035 Inventing your own terminology will only confuse the users.
3038 (Warning! Typography is addictive!)
3041 \begin_layout Itemize
3042 Make a copy of the document.
3043 This will be your working copy.
3044 You can use this as your personal translated help-file by placing it in
3046 \begin_inset Flex CharStyle:Code
3049 \begin_layout Plain Layout
3058 \begin_layout Itemize
3059 Sometimes the original document (from the LyX-team) will be updated.
3060 Use the source viewer at
3061 \begin_inset CommandInset href
3063 name "http://www.lyx.org/trac/timeline"
3064 target "http://www.lyx.org/trac/timeline"
3068 to see what has been changed.
3069 That way you can easily see which parts of the translated document need
3073 \begin_layout Standard
3074 If you ever find an error in the original document, fix it and notify the
3075 rest of the documentation team of the changes! (You didn't forget to join
3076 the documentation team, did you?)
3079 \begin_layout Standard
3080 \begin_inset Branch OutDated
3083 \begin_layout Section
3084 International Keyboard Support
3087 \begin_layout Standard
3090 [Editor's Note: The following section is by
3098 It needs to be fixed to conform to the new Documentation Style sheet and
3099 to make use of the new v1.0 features.
3100 The whole thing also needs to be merged with the section following it.-jw
3101 It may also be badly out of date.-rh (2008)]
3104 \begin_layout Subsection
3105 Defining Own Keymaps: Keymap File Format
3108 \begin_layout Standard
3109 Let's look at a keyboard definition file a little closer.
3110 It is a plain text file defining
3113 \begin_layout Itemize
3114 key-to-key or key-to-string translations
3117 \begin_layout Itemize
3121 \begin_layout Itemize
3122 dead keys exceptions
3125 \begin_layout Standard
3126 To define key-to-key or key-to-string translation, use this command:
3129 \begin_layout Quotation
3130 \begin_inset Flex CharStyle:Code
3133 \begin_layout Plain Layout
3142 \begin_inset Flex CharStyle:Code
3145 \begin_layout Plain Layout
3154 \begin_layout Standard
3156 \begin_inset Flex CharStyle:Code
3159 \begin_layout Plain Layout
3165 is the key to be translated and
3166 \begin_inset Flex CharStyle:Code
3169 \begin_layout Plain Layout
3175 is the string to be inserted into the document.
3176 To define dead keys, use:
3179 \begin_layout Quotation
3180 \begin_inset Flex CharStyle:Code
3183 \begin_layout Plain Layout
3192 \begin_inset Flex CharStyle:Code
3195 \begin_layout Plain Layout
3204 \begin_layout Standard
3206 \begin_inset Flex CharStyle:Code
3209 \begin_layout Plain Layout
3215 is a keyboard key and
3216 \begin_inset Flex CharStyle:Code
3219 \begin_layout Plain Layout
3226 The following dead keys are supported (shortcut name is in parentheses):
3229 \begin_layout Quotation
3233 \begin_inset space \hfill{}
3239 \begin_layout Quotation
3241 \begin_inset space \hfill{}
3247 \begin_layout Quotation
3249 \begin_inset space \hfill{}
3255 \begin_layout Quotation
3257 \begin_inset space \hfill{}
3263 \begin_layout Quotation
3265 \begin_inset space \hfill{}
3271 \begin_layout Quotation
3273 \begin_inset space \hfill{}
3280 \begin_layout Plain Layout
3292 \begin_layout Quotation
3294 \begin_inset space \hfill{}
3300 \begin_layout Quotation
3302 \begin_inset space \hfill{}
3309 \begin_layout Plain Layout
3321 \begin_layout Quotation
3323 \begin_inset space \hfill{}
3329 \begin_layout Quotation
3331 \begin_inset space \hfill{}
3337 \begin_layout Quotation
3339 \begin_inset space \hfill{}
3346 \begin_layout Plain Layout
3358 \begin_layout Quotation
3360 \begin_inset space \hfill{}
3367 \begin_layout Plain Layout
3379 \begin_layout Quotation
3381 \begin_inset space \hfill{}
3387 \begin_layout Quotation
3388 hungarian umlaut (hug)
3389 \begin_inset space \hfill{}
3395 \begin_layout Quotation
3397 \begin_inset space \hfill{}
3403 \begin_layout Quotation
3405 \begin_inset space \hfill{}
3412 \begin_layout Plain Layout
3424 \begin_layout Standard
3425 Since in many international keyboards there are exceptions to what some
3426 dead keys should do, you can define them using
3429 \begin_layout Quotation
3430 \begin_inset Flex CharStyle:Code
3433 \begin_layout Plain Layout
3441 deadkey key outstring
3444 \begin_layout Standard
3445 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3449 \begin_layout Quotation
3450 \begin_inset Flex CharStyle:Code
3453 \begin_layout Plain Layout
3466 \begin_layout Standard
3467 to make it work correctly.
3468 Also, you have to define as exceptions dead keys over i and j, to remove
3469 the dot from them before inserting an accent mark.
3470 I will change this when the time comes, but so far I haven't had time.
3473 \begin_layout Standard
3474 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3477 \begin_inset Flex CharStyle:Code
3480 \begin_layout Plain Layout
3486 have different meaning.
3488 \begin_inset Flex CharStyle:Code
3491 \begin_layout Plain Layout
3497 marks comments, quotes start and end LaTeX-style commands.
3498 To enter quote, you'll need to use
3499 \begin_inset Flex CharStyle:Code
3502 \begin_layout Plain Layout
3511 \begin_inset Flex CharStyle:Code
3514 \begin_layout Plain Layout
3521 \begin_inset Flex CharStyle:Code
3524 \begin_layout Plain Layout
3535 \begin_layout Standard
3536 If you make a keyboard description file that works for your language, please
3537 mail it to me, so I can include it in the next keymap distribution.
3540 \begin_layout Standard
3541 More keywords will be supported in keymap configuration file in future,
3545 \begin_layout Itemize
3546 \begin_inset Flex CharStyle:Code
3549 \begin_layout Plain Layout
3560 \begin_inset space \hfill{}
3564 \begin_inset Flex CharStyle:Code
3567 \begin_layout Plain Layout
3576 \begin_layout Itemize
3577 \begin_inset Flex CharStyle:Code
3580 \begin_layout Plain Layout
3591 \begin_inset space \hfill{}
3595 \begin_inset Flex CharStyle:Code
3598 \begin_layout Plain Layout
3604 an external keymap translation program
3607 \begin_layout Standard
3608 Also, it should look into
3609 \begin_inset Flex CharStyle:Code
3612 \begin_layout Plain Layout
3618 file for defaults, too (for example, a
3619 \begin_inset Flex CharStyle:Code
3622 \begin_layout Plain Layout
3630 option to include default keyboard).
3638 \begin_layout Section
3639 International Keymap Stuff
3640 \begin_inset CommandInset label
3642 name "sec:International-Keymap-Stuff"
3649 \begin_layout Standard
3650 \begin_inset Note Note
3653 \begin_layout Plain Layout
3654 In doing the revisions on this document in March 2008, I did not look over
3655 this stuff, as I do not understand it.
3656 It would be good if someone else could do so.
3665 \begin_layout Standard
3666 The next two sections describe the
3667 \begin_inset Flex CharStyle:Code
3670 \begin_layout Plain Layout
3679 \begin_inset Flex CharStyle:Code
3682 \begin_layout Plain Layout
3690 file syntax in detail.
3691 These sections should help you design your own key map if the ones provided
3692 do not meet your needs.
3695 \begin_layout Subsection
3699 \begin_layout Standard
3703 \begin_inset Flex CharStyle:Code
3706 \begin_layout Plain Layout
3712 file maps keystrokes to characters or strings.
3713 As the name suggests, it sets a keyboard mapping.
3715 \begin_inset Flex CharStyle:Code
3718 \begin_layout Plain Layout
3729 \begin_inset Flex CharStyle:Code
3732 \begin_layout Plain Layout
3747 \begin_inset Flex CharStyle:Code
3750 \begin_layout Plain Layout
3763 \begin_inset Flex CharStyle:Code
3766 \begin_layout Plain Layout
3775 \begin_inset Flex CharStyle:Code
3778 \begin_layout Plain Layout
3786 are described in this section.
3789 \begin_layout Labeling
3790 \labelwidthstring 00.00.0000
3791 \begin_inset Flex CharStyle:Code
3794 \begin_layout Plain Layout
3802 Map a character to a string
3805 \begin_layout LyX-Code
3820 \begin_layout Standard
3853 the double-quote (")
3870 must be escaped with a preceding backslash (
3881 \begin_layout Standard
3883 \begin_inset Flex CharStyle:MenuItem
3886 \begin_layout Plain Layout
3894 statement to cause the symbol
3895 \begin_inset Flex CharStyle:MenuItem
3898 \begin_layout Plain Layout
3906 to be output for the keystroke
3907 \begin_inset Flex CharStyle:MenuItem
3910 \begin_layout Plain Layout
3921 \begin_layout LyX-Code
3927 \begin_layout Labeling
3928 \labelwidthstring 00.00.0000
3929 \begin_inset Flex CharStyle:Code
3932 \begin_layout Plain Layout
3940 Specify an accent character
3943 \begin_layout LyX-Code
3952 \begin_layout Standard
3953 This will make the cha
3991 This is the dead key
3995 \begin_layout Plain Layout
4002 refers to a key that does not produce a character by itself, but when followed
4003 with another key, produces the desired accent character.
4004 For example, a German characte
4006 r with an umlaut like
4016 can be produced in this manner.
4025 \begin_layout Standard
4038 and then another key not in
4055 followed by the other, not allowed key, as output.
4059 \begin_inset Flex CharStyle:MenuItem
4062 \begin_layout Plain Layout
4070 cancels a dead key, so if
4081 \begin_inset Flex CharStyle:MenuItem
4084 \begin_layout Plain Layout
4093 , the cursor will not go one position backwards but will instead cancel
4109 might have had on the next keystroke.
4113 \begin_layout Standard
4114 The following example specifies that the character ' is to be an acute accent,
4115 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4118 \begin_layout LyX-Code
4121 kmod ' acute aeiouAEIOU
4124 \begin_layout Labeling
4125 \labelwidthstring 00.00.0000
4126 \begin_inset Flex CharStyle:Code
4129 \begin_layout Plain Layout
4135 Specify an exception to the accent character
4138 \begin_layout LyX-Code
4147 \begin_layout Standard
4148 This defines an exce
4189 have been assigned a keystroke with a previous
4192 \begin_inset Flex CharStyle:Code
4195 \begin_layout Plain Layout
4219 must not belong in the
4266 If such a declaration does not exist in
4274 \begin_inset Flex CharStyle:Code
4277 \begin_layout Plain Layout
4311 \begin_inset Flex CharStyle:Code
4314 \begin_layout Plain Layout
4328 \begin_layout Standard
4329 The following command produces causes äi to be produced when you enter acute-i
4333 \begin_layout LyX-Code
4347 \begin_layout Labeling
4348 \labelwidthstring 00.00.0000
4349 \begin_inset Flex CharStyle:Code
4352 \begin_layout Plain Layout
4358 Combine two accent characters
4361 \begin_layout LyX-Code
4367 accent1 accent2 allowed
4370 \begin_layout Standard
4371 This one is getting pretty esoteric.
4372 It allows you to combine the effect
4428 \begin_inset Flex CharStyle:Code
4431 \begin_layout Plain Layout
4459 \begin_layout Standard
4460 Consider this example from the
4461 \begin_inset Flex CharStyle:Code
4464 \begin_layout Plain Layout
4475 \begin_layout LyX-Code
4478 kmod ; acute aeioyvhAEIOYVH
4482 kcomb acute umlaut iyIY
4485 \begin_layout Standard
4486 This allows you to press
4487 \begin_inset Flex CharStyle:MenuItem
4490 \begin_layout Plain Layout
4498 and get the effect of
4499 \begin_inset Flex CharStyle:Code
4502 \begin_layout Plain Layout
4521 in this case cancels the last dead key, so if you press
4522 \begin_inset Flex CharStyle:MenuItem
4525 \begin_layout Plain Layout
4534 \begin_inset Flex CharStyle:Code
4537 \begin_layout Plain Layout
4550 \begin_layout Subsection
4554 \begin_layout Standard
4556 \begin_inset Flex CharStyle:Code
4559 \begin_layout Plain Layout
4567 mapping is performed, a
4568 \begin_inset Flex CharStyle:Code
4571 \begin_layout Plain Layout
4581 file maps the strings that the symbols generate to characters in the current
4583 The LyX distribution currently includes at least the
4584 \begin_inset Flex CharStyle:Code
4587 \begin_layout Plain Layout
4596 \begin_inset Flex CharStyle:Code
4599 \begin_layout Plain Layout
4610 \begin_layout Standard
4612 \begin_inset Flex CharStyle:Code
4615 \begin_layout Plain Layout
4623 file is a sequence of declarations of the form
4626 \begin_layout LyX-Code
4639 \begin_layout Standard
4640 For example, in order to map
4641 \begin_inset Flex CharStyle:MenuItem
4644 \begin_layout Plain Layout
4654 to the corresponding character in the iso-8859-1 set (233), the following
4658 \begin_layout LyX-Code
4666 \begin_layout Standard
4668 \begin_inset Flex CharStyle:Code
4671 \begin_layout Plain Layout
4680 \begin_inset Flex CharStyle:Code
4683 \begin_layout Plain Layout
4701 the same character can apply to more than one string.
4703 \begin_inset Flex CharStyle:Code
4706 \begin_layout Plain Layout
4717 \begin_layout LyX-Code
4729 \begin_inset Newline newline
4745 \begin_layout Standard
4746 If LyX cannot find a mapping for the string produced by the keystroke or
4747 a deadkey sequence, it will check if it looks like an accented char and
4748 try to draw an accent over the character on screen.
4751 \begin_layout Subsection
4755 \begin_layout Standard
4756 There is a second way to add support for international characters through
4757 so-called dead-keys.
4758 A dead-key works in combination with a letter to produce an accented character.
4759 Here, we'll explain how to create a really simple dead-key to illustrate
4763 \begin_layout Standard
4764 Suppose you happen to need the circumflex character,
4765 \begin_inset Quotes eld
4769 \begin_inset Quotes erd
4774 \begin_inset Flex CharStyle:MenuItem
4777 \begin_layout Plain Layout
4784 \begin_inset space ~
4788 \begin_inset Flex CharStyle:MenuItem
4791 \begin_layout Plain Layout
4797 ] to the LyX command
4798 \begin_inset Flex CharStyle:Code
4801 \begin_layout Plain Layout
4808 \begin_inset Flex CharStyle:Code
4811 \begin_layout Plain Layout
4818 Now, whenever you type the
4819 \begin_inset Flex CharStyle:MenuItem
4822 \begin_layout Plain Layout
4828 -key followed by a letter, that letter will have a circumflex accent on
4830 For example, the sequence
4831 \begin_inset Quotes eld
4835 \begin_inset Flex CharStyle:MenuItem
4838 \begin_layout Plain Layout
4845 \begin_inset Quotes erd
4848 produces the letter:
4849 \begin_inset Quotes eld
4853 \begin_inset Quotes erd
4857 If you tried to type
4858 \begin_inset Quotes eld
4862 \begin_inset Flex CharStyle:MenuItem
4865 \begin_layout Plain Layout
4872 \begin_inset Quotes erd
4875 , however, LyX will complain with a beep, since a
4876 \begin_inset Quotes eld
4880 \begin_inset Flex CharStyle:MenuItem
4883 \begin_layout Plain Layout
4890 \begin_inset Quotes erd
4893 never takes a circumflex accent.
4895 \begin_inset Flex CharStyle:MenuItem
4898 \begin_layout Plain Layout
4904 after a dead-key produces the bare-accent.
4905 Please note this last point! If you bind a key to a dead-key, you'll need
4906 to rebind the character on that key to yet another key.
4908 \begin_inset Flex CharStyle:MenuItem
4911 \begin_layout Plain Layout
4917 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
4920 \begin_layout Standard
4921 One common way to bind dead-keys is to use
4922 \begin_inset Flex CharStyle:MenuItem
4925 \begin_layout Plain Layout
4932 \begin_inset Flex CharStyle:MenuItem
4935 \begin_layout Plain Layout
4942 \begin_inset Flex CharStyle:MenuItem
4945 \begin_layout Plain Layout
4951 in combination with an accent, like
4952 \begin_inset Quotes eld
4956 \begin_inset Flex CharStyle:MenuItem
4959 \begin_layout Plain Layout
4966 \begin_inset Quotes erd
4970 \begin_inset Quotes eld
4974 \begin_inset Flex CharStyle:MenuItem
4977 \begin_layout Plain Layout
4984 \begin_inset Quotes erd
4988 \begin_inset Quotes eld
4992 \begin_inset Flex CharStyle:MenuItem
4995 \begin_layout Plain Layout
5002 \begin_inset Quotes erd
5006 Another way involves using
5007 \begin_inset Flex CharStyle:Code
5010 \begin_layout Plain Layout
5017 \begin_inset Flex CharStyle:Code
5020 \begin_layout Plain Layout
5026 to set up the special
5027 \begin_inset Flex CharStyle:Code
5030 \begin_layout Plain Layout
5038 \begin_inset Flex CharStyle:Code
5041 \begin_layout Plain Layout
5047 acts in some ways just like
5048 \begin_inset Flex CharStyle:MenuItem
5051 \begin_layout Plain Layout
5057 and permits you to bind keys to accented characters.
5058 You can also turn keys into dead-keys by binding them to something like
5060 \begin_inset Flex CharStyle:Code
5063 \begin_layout Plain Layout
5069 and then binding this symbolic key to the corresponding LyX command.
5073 \begin_layout Plain Layout
5078 : This is exactly what I do in my
5079 \begin_inset Flex CharStyle:Code
5082 \begin_layout Plain Layout
5089 \begin_inset Flex CharStyle:Code
5092 \begin_layout Plain Layout
5100 \begin_inset Flex CharStyle:MenuItem
5103 \begin_layout Plain Layout
5105 \begin_inset space ~
5114 \begin_inset Flex CharStyle:Code
5117 \begin_layout Plain Layout
5123 and a bunch of these
5124 \begin_inset Quotes eld
5128 \begin_inset Flex CharStyle:Code
5131 \begin_layout Plain Layout
5138 \begin_inset Quotes erd
5141 symbolic keys bound such things as
5142 \begin_inset Flex CharStyle:MenuItem
5145 \begin_layout Plain Layout
5147 \begin_inset space ~
5156 \begin_inset Flex CharStyle:MenuItem
5159 \begin_layout Plain Layout
5161 \begin_inset space ~
5170 This is how I produce my accented characters.
5175 You can make just about anything into the
5176 \begin_inset Flex CharStyle:Code
5179 \begin_layout Plain Layout
5186 \begin_inset Flex CharStyle:MenuItem
5189 \begin_layout Plain Layout
5195 keys, a spare function key, etc.
5196 As for the LyX commands that produce accents, check the entry for
5197 \begin_inset Flex CharStyle:Code
5200 \begin_layout Plain Layout
5211 You'll find the complete list there.
5214 \begin_layout Subsection
5215 Saving your Language Configuration
5218 \begin_layout Standard
5219 You can edit your preferences so that your desired language environment
5220 is automatically configured when LyX starts up, via the
5221 \begin_inset Flex CharStyle:MenuItem
5224 \begin_layout Plain Layout
5225 Edit\SpecialChar \menuseparator
5234 \begin_layout Chapter
5235 Installing New Document Classes, Layouts, and Templates
5236 \begin_inset CommandInset label
5238 name "cha:Installing-New-Document"
5246 \begin_layout Plain Layout
5247 Installing New Document Classes
5255 \begin_layout Standard
5256 In this chapter, we describe the procedures for creating and installing
5257 new LyX layout and template files, as well as offer a refresher on correctly
5258 installing new LaTeX document classes.
5262 \begin_layout Standard
5263 First, let us a say a few words about how one ought to think about the relation
5264 between LyX and LaTeX.
5265 The thing to understand is that, in a certain sense, LyX doesn't know anything
5267 Indeed, from LyX's point of view, LaTeX is just one of several
5268 \begin_inset Quotes eld
5272 \begin_inset Quotes erd
5275 in which it is capable of producing output.
5276 Other such formats are DocBook, plaintext, and XHTML.
5277 LaTeX is, of course, a particularly important format, but very little of
5278 the information LyX has about LaTeX is actually contained in the program
5283 \begin_layout Plain Layout
5284 Some commands are sufficiently complex that they are
5285 \begin_inset Quotes eld
5289 \begin_inset Quotes erd
5293 But the developers generally regard this as a Bad Thing.
5298 Rather, that information, even for the standard classes like
5299 \begin_inset Flex CharStyle:Code
5302 \begin_layout Plain Layout
5308 , is contained in layout files.
5309 Similarly, LyX itself does not know much about DocBook or XHTML.
5312 \begin_layout Standard
5313 You can think of the layout file for a given document class as a translation
5314 manual between LyX constructs---paragraphs with their corresponding styles,
5315 certain sorts of insets, etc---and the corresponding LaTeX, DocBook, or
5317 Almost everything LyX knows about
5318 \begin_inset Flex CharStyle:Code
5321 \begin_layout Plain Layout
5327 , for example, is contained in the file
5328 \begin_inset Flex CharStyle:Code
5331 \begin_layout Plain Layout
5337 and in various other files it includes.
5338 For this reason, anyone intending to write layout files should plan to
5339 study the existing files.
5340 A good place to start is with
5341 \begin_inset Flex CharStyle:Code
5344 \begin_layout Plain Layout
5350 , which is included in
5351 \begin_inset Flex CharStyle:Code
5354 \begin_layout Plain Layout
5361 \begin_inset Flex CharStyle:Code
5364 \begin_layout Plain Layout
5370 , and many of the other layout files for document classes.
5371 This file is where sections and the like are defined:
5372 \begin_inset Flex CharStyle:Code
5375 \begin_layout Plain Layout
5381 tells LyX how paragraphs that are marked with the Section, Subsection,
5382 etc, styles can be translated into corresponding LaTeX, DocBook, and XHTML
5385 \begin_inset Flex CharStyle:Code
5388 \begin_layout Plain Layout
5394 file basically just includes several of these
5395 \begin_inset Flex CharStyle:Code
5398 \begin_layout Plain Layout
5407 \begin_layout Standard
5408 Defining the LyX--LaTeX correspondence is not the only thing layout files
5410 Their other job is to define how the LyX constructs themselves will appear
5412 The fact that layout files have these two jobs is often a source of confusion,
5413 because they are completely separate.
5414 Telling LyX how to translate a certain paragraph style into LaTeX does
5415 not tell LyX how to display it; conversely, telling LyX how to display
5416 a certain paragraph style does not tell LyX how to translate it into LaTeX
5417 (let alone tell LaTeX how to display it).
5418 So, in general, when you define a new LyX construct, you must always do
5419 two quite separate things: (i)
5420 \begin_inset space ~
5423 tell LyX how to translate it into LaTeX and (ii)
5424 \begin_inset space ~
5427 tell LyX how to display it.
5430 \begin_layout Standard
5431 Much the same is true, of course, as regards LyX's other backend formats,
5432 though XHTML is in some ways different, because in that case LyX
5436 able, to some extent, to use information about how it should display a
5437 paragraph on the screen to output information (in the form of CSS) about
5438 how the paragraph should be displayed in a browser.
5439 Even in this case, however, the distinction between what LyX does internally
5440 and how things are rendered externally remains in force, and the two can
5441 be controlled separately.
5443 \begin_inset CommandInset ref
5444 LatexCommand prettyref
5445 reference "sec:Tags-for-XHTML"
5452 \begin_layout Section
5453 Installing new LaTeX files
5456 \begin_layout Standard
5457 Some installations may not include a LaTeX package or class file that you
5458 would like to use within LyX.
5459 For example, you might need FoilTeX, a package for preparing slides for
5460 overhead projectors.
5461 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5462 a user interface for installing such packages.
5463 For example, with MiKTeX, you start the program
5464 \begin_inset Quotes eld
5468 \begin_inset Quotes erd
5471 to get a list of available packages.
5472 To install one, right click on it or use the toolbar button to install
5477 \begin_layout Standard
5478 If your LaTeX distribution doesn't provide such a `package manager', or
5479 if the file is not available from your distribution, then you can follow
5480 these steps to install it manually.
5483 \begin_layout Enumerate
5484 Get the package from
5485 \begin_inset CommandInset href
5488 target "http://www.ctan.org/"
5495 \begin_layout Enumerate
5496 You can install the package in several different places.
5497 If you want it to be available for all users on your system, then you should
5498 install it in your `local' TeX tree; if you want (or need) it to be available
5499 just for you, then you can install it in your own `user' TeX tree.
5500 Where these trees should be created, if they do not already exist, depends
5501 upon the details of your system.
5502 To find out where they are, look in the file
5503 \begin_inset Flex CharStyle:Code
5506 \begin_layout Plain Layout
5516 \begin_layout Plain Layout
5517 This usually lives in the directory
5518 \begin_inset Flex CharStyle:Code
5521 \begin_layout Plain Layout
5527 , though you can run
5528 \begin_inset Flex CharStyle:Code
5531 \begin_layout Plain Layout
5542 The location of the `local' TeX tree is defined by the
5543 \begin_inset Flex CharStyle:Code
5546 \begin_layout Plain Layout
5552 variable; this is usually somewhere like
5553 \begin_inset Flex URL
5556 \begin_layout Plain Layout
5558 /usr/local/share/texmf/
5564 The location of the `user' TeX tree is defined by
5565 \begin_inset Flex CharStyle:Code
5568 \begin_layout Plain Layout
5575 \begin_inset Flex CharStyle:Code
5578 \begin_layout Plain Layout
5585 (If these variables are not predefined, you can define them.) You'll probably
5586 need root permissions to create or modify the `local' tree, but your `user'
5587 tree shouldn't have such limitations.
5590 \begin_layout Enumerate
5592 \begin_inset Flex CharStyle:Code
5595 \begin_layout Plain Layout
5602 \begin_inset Flex CharStyle:Code
5605 \begin_layout Plain Layout
5612 \begin_inset Flex CharStyle:Code
5615 \begin_layout Plain Layout
5622 \begin_inset space \thinspace{}
5626 \begin_inset Newline newline
5630 \begin_inset Flex CharStyle:Code
5633 \begin_layout Plain Layout
5634 TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
5640 \begin_inset Newline newline
5646 \begin_layout Enumerate
5647 Your local and user trees
5651 have the same sort of directory structure as your main existing
5652 \begin_inset Flex CharStyle:Code
5655 \begin_layout Plain Layout
5661 directory, which will be found at
5662 \begin_inset Flex CharStyle:Code
5665 \begin_layout Plain Layout
5672 \begin_inset Flex CharStyle:Code
5675 \begin_layout Plain Layout
5681 .) For example, latex packages should go under
5682 \begin_inset Flex CharStyle:Code
5685 \begin_layout Plain Layout
5686 $TEXMFLOCAL/tex/latex/
5692 \begin_inset Flex CharStyle:Code
5695 \begin_layout Plain Layout
5696 $TEXMFHOME/tex/latex/
5702 If you do not put them here, they probably will not work.
5705 \begin_layout Enumerate
5706 Once your tree is properly set up, you can install the package into an appropria
5708 If you are lucky, your package will have been provided as a so-called `TDS'
5709 (TeX Directory Structure) zip file.
5710 To install it, you want to unzip it from the top of your tree.
5711 So, for example, you can copy the file
5712 \begin_inset Flex CharStyle:Code
5715 \begin_layout Plain Layout
5722 \begin_inset Flex CharStyle:Code
5725 \begin_layout Plain Layout
5726 /home/yourname/texmf/
5731 and then, from inside that directory, just run:
5732 \begin_inset Flex CharStyle:Code
5735 \begin_layout Plain Layout
5742 This will extract the needed files and copy them where they need to be.
5743 \begin_inset Newline newline
5746 If you do not have a TDS file, then you have to do this manually.
5747 For example, you might install the FoilTeX files into
5748 \begin_inset Flex URL
5751 \begin_layout Plain Layout
5753 $TEXMFLOCAL/tex/latex/contrib/foiltex
5759 Why there? The CTAN download directories are themselves organized much
5760 like a TeX tree, and it isn't a bad idea to follow its structure when you
5761 install your own files.
5762 FoilTeX, as it happens, is found at
5763 \begin_inset Flex URL
5766 \begin_layout Plain Layout
5768 http://ctan.org/texarchive/macros/latex/contrib/foiltex/
5777 \begin_layout Enumerate
5778 Finally, you must update the database TeX uses to find files.
5779 On MiKTeX, this is done by pressing the button
5782 \begin_inset space ~
5787 that you find in MiKTeX's
5788 \begin_inset Quotes eld
5792 \begin_inset Quotes erd
5797 \begin_inset Flex CharStyle:Code
5800 \begin_layout Plain Layout
5801 $TEXMFLOCAL/tex/latex/
5807 Under TeXLive and the like, you should run
5808 \begin_inset Flex CharStyle:Code
5811 \begin_layout Plain Layout
5817 from a terminal, with root permissions if necessary.
5821 \begin_layout Standard
5822 Your package is now installed and available to LaTeX.
5823 You can verify this from a terminal by typing `
5824 \begin_inset Flex CharStyle:Code
5827 \begin_layout Plain Layout
5828 kpsewhich yourfile.ext
5834 To make LyX aware of it, however, you will need to reconfigure (
5835 \begin_inset Flex CharStyle:MenuItem
5838 \begin_layout Plain Layout
5839 Tools\SpecialChar \menuseparator
5845 ) and then restart LyX.
5846 If the new package was a document class, such as FoilTeX again, you will
5847 now see it available under
5848 \begin_inset Flex CharStyle:MenuItem
5851 \begin_layout Plain Layout
5852 Document\SpecialChar \menuseparator
5853 Settings\SpecialChar \menuseparator
5860 \begin_inset Flex CharStyle:MenuItem
5863 \begin_layout Plain Layout
5872 \begin_layout Standard
5873 What if there isn't a layout file is available for your new document class?
5874 Then, unfortunately, LyX will know nothing about it until you create a
5875 layout file yourself (or get someone else to do it).
5876 That is the topic of the next section.
5879 \begin_layout Section
5880 Types of layout files
5883 \begin_layout Standard
5884 This section describes the various sorts of LyX files that contain layout
5886 These files describe various paragraph and character styles, determining
5887 how LyX should display them and how they should be translated into LaTeX,
5888 DocBook, XHTML, or whatever output format is being used.
5892 \begin_layout Standard
5893 We shall try to provide a thorough description of the process of writing
5895 However, there are so many different types of documents supported even
5896 by just LaTeX that we can't hope to cover every different possibility or
5897 problem you might encounter.
5898 The LyX users' list is frequented by people with lots of experience with
5899 layout design who are willing to share what they've learned, so please
5900 feel free to ask questions there.
5903 \begin_layout Standard
5904 As you prepare to write a new layout, it is extremely helpful to look at
5905 the layouts distributed with LyX.
5906 If you write a LyX layout for a LaTeX document class that might also be
5907 used by others, or write a module that might be useful to others, then
5908 you should consider posting your layout to the
5909 \begin_inset CommandInset href
5911 name "layout section on the LyX wiki"
5912 target "http://wiki.lyx.org/Layouts/Layouts"
5916 or even to the LyX developers' list, so that it might be included in LyX
5921 \begin_layout Plain Layout
5922 Note that LyX is licensed under the General Public License, so any material
5923 that is contribued to LyX must be similarly licensed.
5931 \begin_layout Subsection
5933 \begin_inset CommandInset label
5935 name "sub:Layout-modules"
5942 \begin_layout Standard
5943 We have spoken to this point about `layout files'.
5944 But there are different sorts of files that contain layout information.
5945 Layout files, strictly so called, have the
5946 \begin_inset Flex CharStyle:Code
5949 \begin_layout Plain Layout
5955 extension and provide LyX with information about document classes.
5956 As of LyX 1.6, however, layout information can also be contained in layout
5962 \begin_inset Flex CharStyle:Code
5965 \begin_layout Plain Layout
5972 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
5973 some modules—such as the
5974 \begin_inset Flex CharStyle:Code
5977 \begin_layout Plain Layout
5983 module—specifcally provide support for one package.
5984 In a sense, layout modules are similar to included
5988 \begin_layout Plain Layout
5989 These can have any extension, but by convention have the
5990 \begin_inset Flex CharStyle:Code
5993 \begin_layout Plain Layout
6005 \begin_inset Flex CharStyle:Code
6008 \begin_layout Plain Layout
6014 —in that modules are not specific to a given document class but may be used
6015 with many different classes.
6016 The difference is that using an included file with
6017 \begin_inset Flex CharStyle:Code
6020 \begin_layout Plain Layout
6026 requires editing that file.
6027 Modules, by contrast, are selected in the
6028 \begin_inset Flex CharStyle:MenuItem
6031 \begin_layout Plain Layout
6032 Document\SpecialChar \menuseparator
6041 \begin_layout Standard
6042 Building modules is the easiest way to get started with layout editing,
6043 since it can be as simple as adding a single new paragraph style or flex
6045 But modules may, in principle, contain anything a layout file can contain.
6048 \begin_layout Standard
6049 After creating a new module and copying it to the
6050 \begin_inset Flex CharStyle:Code
6053 \begin_layout Plain Layout
6059 folder, you will need to reconfigure and then restart LyX for the module
6060 to appear in the menu.
6061 However, changes you make to the module will be seen immediately, if you
6063 \begin_inset Flex CharStyle:MenuItem
6066 \begin_layout Plain Layout
6067 Document\SpecialChar \menuseparator
6073 , highlight something, and then hit
6074 \begin_inset Quotes eld
6078 \begin_inset Quotes erd
6084 It is strongly recommended that you save your work before doing this
6089 it is strongly recommended that you not attempt to edit modules while simultaneo
6090 usly working on actual documents
6093 Though of course the developers strive to keep LyX stable in such situations,
6094 syntax errors and the like in your module file could cause strange behavior.
6097 \begin_layout Subsection
6099 \begin_inset Flex CharStyle:MenuItem
6102 \begin_layout Plain Layout
6111 \begin_layout Standard
6112 There are two situations you are likely to encounter when wanting to support
6113 a new LaTeX document class, involving LaTeX2e class (
6114 \begin_inset Flex CharStyle:Code
6117 \begin_layout Plain Layout
6124 \begin_inset Flex CharStyle:Code
6127 \begin_layout Plain Layout
6134 Supporting a style file is usually fairly easy.
6135 Supporting a new class file is a bit harder.
6136 We'll discuss the former in this section and the latter in the next.
6137 Similar remarks apply, of course, if you want to support a new DocBook
6141 \begin_layout Standard
6142 The easier case is the one in which your new document class is provided
6143 as a style file that is to be used in conjunction with an already supported
6145 For the sake of the example, we'll assume that the style file is called
6147 \begin_inset Flex CharStyle:MenuItem
6150 \begin_layout Plain Layout
6156 and that it is meant to be used with
6157 \begin_inset Flex CharStyle:MenuItem
6160 \begin_layout Plain Layout
6166 , which is a standard class.
6170 \begin_layout Standard
6171 Start by copying the existing class's layout file into your local directory:
6175 \begin_layout Plain Layout
6176 Of course, which directory is your local directory will vary by platform,
6177 and LyX allows you to specify your local directory on startup, too, using
6179 \begin_inset Flex CharStyle:Code
6182 \begin_layout Plain Layout
6196 \begin_layout LyX-Code
6197 cp report.layout ~/.lyx/layouts/myclass.layout
6200 \begin_layout Standard
6202 \begin_inset Flex CharStyle:Code
6205 \begin_layout Plain Layout
6211 and change the line:
6214 \begin_layout LyX-Code
6217 DeclareLaTeXClass{report}
6220 \begin_layout Standard
6224 \begin_layout LyX-Code
6227 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6230 \begin_layout Standard
6234 \begin_layout LyX-Code
6236 \begin_inset Newline newline
6242 \begin_inset Newline newline
6248 \begin_layout Standard
6249 near the top of the file.
6252 \begin_layout Standard
6253 Start LyX and select
6254 \begin_inset Flex CharStyle:MenuItem
6257 \begin_layout Plain Layout
6258 Tools\SpecialChar \menuseparator
6265 Then restart LyX and try creating a new document.
6267 \begin_inset Flex CharStyle:MenuItem
6270 \begin_layout Plain Layout
6276 " as a document class option in the
6277 \begin_inset Flex CharStyle:MenuItem
6280 \begin_layout Plain Layout
6281 Document\SpecialChar \menuseparator
6288 It is likely that some of the sectioning commands and such in your new
6289 class will work differently from how they worked in the base class—
6290 \begin_inset Flex CharStyle:Code
6293 \begin_layout Plain Layout
6299 in this example—so you can fiddle around with the settings for the different
6300 sections if you wish.
6301 The layout information for sections is contained in
6302 \begin_inset Flex CharStyle:Code
6305 \begin_layout Plain Layout
6311 , but you do not need to copy and change this file.
6312 Instead, you can simply add your changes to your layout file, after the
6314 \begin_inset Flex CharStyle:Code
6317 \begin_layout Plain Layout
6323 , which itself includes
6324 \begin_inset Flex CharStyle:Code
6327 \begin_layout Plain Layout
6334 For example, you might add these lines:
6337 \begin_layout LyX-Code
6341 \begin_layout LyX-Code
6345 \begin_layout LyX-Code
6349 \begin_layout LyX-Code
6353 \begin_layout LyX-Code
6357 \begin_layout Standard
6358 to change the font for chapter headings to sans-serif.
6359 This will override (or, in this case, add to) the existing declaration
6360 for the Chapter style.
6364 \begin_layout Standard
6365 Your new package may also provide commands or environments not present in
6367 In this case, you will want to add these to the layout file.
6369 \begin_inset CommandInset ref
6371 reference "sec:TextClass"
6375 for information on how to do so.
6378 \begin_layout Standard
6380 \begin_inset Flex CharStyle:MenuItem
6383 \begin_layout Plain Layout
6389 can be used with several different document classes, and even if it cannot,
6390 you might find it easiest just to write a module that you can load with
6392 The simplest possible such module would be:
6395 \begin_layout LyX-Code
6398 DeclareLyXModule{My Package}
6401 \begin_layout LyX-Code
6405 \begin_layout LyX-Code
6406 #Support for mypkg.sty.
6409 \begin_layout LyX-Code
6411 \begin_inset Newline newline
6417 \begin_layout LyX-Code
6419 \begin_inset Newline newline
6425 \begin_layout LyX-Code
6427 \begin_inset Newline newline
6433 \begin_inset Newline newline
6439 \begin_layout Standard
6440 A more complex module might modify the behavior of some existing constructs
6441 or define some new ones.
6443 \begin_inset CommandInset ref
6445 reference "sec:TextClass"
6452 \begin_layout Subsection
6454 \begin_inset Flex CharStyle:MenuItem
6457 \begin_layout Plain Layout
6466 \begin_layout Standard
6467 There are two possibilities here.
6468 One is that the class file is itself based upon an existing document class.
6469 For example, many thesis classes are based upon
6470 \begin_inset Flex CharStyle:MenuItem
6473 \begin_layout Plain Layout
6480 To see whether yours is, look for a line like
6483 \begin_layout LyX-Code
6489 \begin_layout Standard
6491 If so, then you may proceed largely as in the previous section, though
6493 \begin_inset Flex CharStyle:Code
6496 \begin_layout Plain Layout
6502 line will be different.
6503 If your new class is
6504 \begin_inset Flex CharStyle:Code
6507 \begin_layout Plain Layout
6513 and it is based upon
6514 \begin_inset Flex CharStyle:Code
6517 \begin_layout Plain Layout
6523 , then the line should read:
6527 \begin_layout Plain Layout
6528 And it will be easiest if you save the file to
6529 \begin_inset Flex CharStyle:Code
6532 \begin_layout Plain Layout
6538 : LyX assumes that the document class has the same name as the layout file.
6547 \begin_layout LyX-Code
6550 DeclareLaTeXClass[thesis,book]{thesis}
6553 \begin_layout Standard
6554 If, on the other hand, the new class is not based upon an existing class,
6555 you will probably have to
6556 \begin_inset Quotes eld
6560 \begin_inset Quotes erd
6564 We strongly suggest copying an existing layout file which uses a similar
6565 LaTeX class and then modifying it, if you can do so.
6566 At least use an existing file as a starting point so you can find out what
6567 items you need to worry about.
6568 Again, the specifics are covered below.
6571 \begin_layout Subsection
6573 \begin_inset CommandInset label
6575 name "sub:Creating-Templates"
6582 \begin_layout Standard
6583 Once you have written a layout file for a new document class, you might
6584 want to consider writing a
6589 A template acts as a kind of tutorial for your layout, showing how it might
6590 be used, though containing dummy content.
6591 You can of course look at the various templates included with LyX for ideas.
6594 \begin_layout Standard
6595 Templates are created just like usual documents: using LyX.
6596 The only difference is that usual documents contain all possible settings,
6597 including the font scheme and the paper size.
6598 Usually a user doesn't want a template to overwrite his preferred settings
6599 for such parameters.
6600 For that reason, the designer of a template should remove the corresponding
6602 \begin_inset Flex CharStyle:Code
6605 \begin_layout Plain Layout
6614 \begin_inset Flex CharStyle:Code
6617 \begin_layout Plain Layout
6625 from the template LyX file.
6626 This can be done with any simple text-editor, for example
6627 \begin_inset Flex CharStyle:Code
6630 \begin_layout Plain Layout
6637 \begin_inset Flex CharStyle:Code
6640 \begin_layout Plain Layout
6650 \begin_layout Standard
6651 Put the edited template files you create in
6652 \begin_inset Flex CharStyle:Code
6655 \begin_layout Plain Layout
6661 , copy the ones you use from the global template directory in
6662 \begin_inset Flex CharStyle:Code
6665 \begin_layout Plain Layout
6671 to the same place, and redefine the template path in the
6672 \begin_inset Flex CharStyle:MenuItem
6675 \begin_layout Plain Layout
6676 Tools\SpecialChar \menuseparator
6677 Preferences\SpecialChar \menuseparator
6686 \begin_layout Standard
6687 Note, by the way, that there is a template which has a particular meaning:
6689 \begin_inset Flex CharStyle:Code
6692 \begin_layout Plain Layout
6699 This template is loaded every time you create a new document with
6700 \begin_inset Flex CharStyle:MenuItem
6703 \begin_layout Plain Layout
6704 File\SpecialChar \menuseparator
6710 in order to provide useful defaults.
6711 To create this template from inside LyX, all you have to do is to open
6712 a document with the correct settings, and use the
6713 \begin_inset Flex CharStyle:MenuItem
6716 \begin_layout Plain Layout
6717 Save as Document Defaults
6725 \begin_layout Subsection
6726 Upgrading old layout files
6729 \begin_layout Standard
6730 The format of layout files changes with each LyX release, so old layout
6731 files need to be converted to the new format.
6732 This process has been automated since LyX 1.4: If LyX reads a layout file
6733 in an older format, it automatically calls the script
6734 \begin_inset Flex CharStyle:Code
6737 \begin_layout Plain Layout
6743 to convert it to a temporary file in current format.
6744 The original file is left untouched.
6745 If you use the layout file often, then, you may want to convert it permanently,
6746 so that LyX does not have to do so itself every time.
6747 To do this, you can call the converter manually:
6750 \begin_layout LyX-Code
6751 mv myclass.layout myclass.old
6754 \begin_layout LyX-Code
6755 python LyXDir/scripts/layout2layout.py myclass.old myclass.layout
6758 \begin_layout Standard
6760 \begin_inset Flex CharStyle:Code
6763 \begin_layout Plain Layout
6769 with the name of your LyX system directory, of course.
6772 \begin_layout Standard
6773 Note that manual conversion does not affect included files, so these will
6774 have to be converted separately.
6777 \begin_layout Section
6778 \begin_inset CommandInset label
6780 name "sec:TextClass"
6784 The layout file format
6787 \begin_layout Standard
6788 When it's finally time to get your hands dirty and create or edit your own
6789 layout file, the following sections describe what you're up against.
6790 Our advice is to go slowly, save and test often, listen to soothing music,
6791 and enjoy one or two of your favorite adult beverages; more if you are
6792 getting particularly stuck.
6793 It's really not that hard, except that the multitude of options can become
6794 overwhelming if you try to do too much in one sitting.
6795 Go have another adult beverage, just for good measure.
6798 \begin_layout Standard
6799 Note that all the tags used in layout files are case-insensitive.
6801 \begin_inset Flex CharStyle:Code
6804 \begin_layout Plain Layout
6811 \begin_inset Flex CharStyle:Code
6814 \begin_layout Plain Layout
6821 \begin_inset Flex CharStyle:Code
6824 \begin_layout Plain Layout
6830 are really the same tag.
6831 The possible values are printed in brackets after the feature's name.
6832 The default value if a feature isn't specified inside a text class-description
6834 \begin_inset Flex CharStyle:Code
6837 \begin_layout Plain Layout
6846 If the argument has a data type like
6847 \begin_inset Quotes eld
6851 \begin_inset Quotes erd
6855 \begin_inset Quotes eld
6859 \begin_inset Quotes erd
6862 , the default is shown like this:
6863 \begin_inset Flex CharStyle:Code
6866 \begin_layout Plain Layout
6877 \begin_layout Subsection
6878 The Document Class Declaration
6881 \begin_layout Standard
6882 Lines in a layout file which begin with
6883 \begin_inset Flex CharStyle:Code
6886 \begin_layout Plain Layout
6893 There is one exception to this rule.
6895 \begin_inset Flex CharStyle:Code
6898 \begin_layout Plain Layout
6904 files should begin with a line like:
6907 \begin_layout LyX-Code
6910 #% Do not delete the line below; configure depends on this
6913 \begin_layout LyX-Code
6918 DeclareLaTeXClass{article}
6921 \begin_layout Standard
6922 The second line is used when you (re)configure LyX.
6923 The layout file is read by the LaTeX script
6924 \begin_inset Flex CharStyle:Code
6927 \begin_layout Plain Layout
6933 , in a special mode where
6934 \begin_inset Flex CharStyle:Code
6937 \begin_layout Plain Layout
6944 The first line is just a LaTeX comment, and the second one contains the
6945 declaration of the text class.
6946 If these lines appear in a file named
6947 \begin_inset Flex CharStyle:Code
6950 \begin_layout Plain Layout
6956 , then they define a text class of name
6957 \begin_inset Flex CharStyle:Code
6960 \begin_layout Plain Layout
6966 (the name of the layout file) which uses the LaTeX document class
6967 \begin_inset Flex CharStyle:Code
6970 \begin_layout Plain Layout
6976 (the default is to use the same name as the layout).
6978 \begin_inset Quotes eld
6982 \begin_inset Quotes erd
6985 that appears above is used as a description of the text class in the
6986 \begin_inset Flex CharStyle:MenuItem
6989 \begin_layout Plain Layout
6990 Document\SpecialChar \menuseparator
6999 \begin_layout Standard
7000 Let's assume that you wrote your own text class that uses the
7001 \begin_inset Flex CharStyle:Code
7004 \begin_layout Plain Layout
7010 document class, but where you changed the appearance of the section headings.
7011 If you put it in a file
7012 \begin_inset Flex CharStyle:Code
7015 \begin_layout Plain Layout
7021 , the header of this file should be:
7024 \begin_layout LyX-Code
7027 #% Do not delete the line below; configure depends on this
7030 \begin_layout LyX-Code
7035 DeclareLaTeXClass[article]{article (with my own headings)}
7038 \begin_layout Standard
7039 This declares a text class
7040 \begin_inset Flex CharStyle:Code
7043 \begin_layout Plain Layout
7049 , associated with the LaTeX document class
7050 \begin_inset Flex CharStyle:Code
7053 \begin_layout Plain Layout
7060 \begin_inset Quotes eld
7063 article (with my own headings)
7064 \begin_inset Quotes erd
7068 If your text class depends on several packages, you can declare it as:
7071 \begin_layout LyX-Code
7074 #% Do not delete the line below; configure depends on this
7077 \begin_layout LyX-Code
7082 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
7085 \begin_layout Standard
7086 This indicates that your text class uses the
7087 \begin_inset Flex CharStyle:Code
7090 \begin_layout Plain Layout
7097 Finally, it is also possible to declare classes for DocBook code.
7098 Typical declarations will look like:
7101 \begin_layout LyX-Code
7104 #% Do not delete the line below; configure depends on this
7107 \begin_layout LyX-Code
7112 DeclareDocBookClass[article]{SGML (DocBook article)}
7115 \begin_layout Standard
7116 Note that these declarations can also be given an optional parameter declaring
7117 the name of the document class (but not a list).
7120 \begin_layout Standard
7121 So, to be as explicit as possible, the form of the layout declaration is:
7124 \begin_layout LyX-Code
7129 DeclareLaTeXClass[class,package.sty]{layout description}
7132 \begin_layout Standard
7133 The class need only be specified if the name of the LaTeX class file and
7134 the name of the layout file are different; if the name of the class file
7135 is not specified, then LyX will simply assume that it is the same as the
7136 name of the layout file.
7139 \begin_layout Standard
7140 When the text class has been modified to your taste, all you have to do
7141 is to copy it either to
7142 \begin_inset Flex CharStyle:Code
7145 \begin_layout Plain Layout
7152 \begin_inset Flex CharStyle:Code
7155 \begin_layout Plain Layout
7162 \begin_inset Flex CharStyle:MenuItem
7165 \begin_layout Plain Layout
7166 Tools\SpecialChar \menuseparator
7172 , exit LyX and restart.
7173 Then your new text class should be available along with the others.
7176 \begin_layout Standard
7177 Once the layout file is installed, you can edit it and see your changes
7178 without having to reconfigure or to restart LyX.
7183 \begin_layout Plain Layout
7184 In versions of LyX prior to 1.6, this was not true.
7185 As a result, editing layout files was very time consuming, since you had
7186 constantly to restart LyX to see changes.
7191 You can force a reload of the current layout by using the LyX function
7193 \begin_inset Flex CharStyle:MenuItem
7196 \begin_layout Plain Layout
7203 There is no default binding for this function—though, of course, you can
7204 bind it to a key yourself.
7205 But you will normally use this function simply by entering it in the mini-buffe
7210 \begin_layout Standard
7216 \begin_inset Flex CharStyle:MenuItem
7219 \begin_layout Plain Layout
7225 is very much an `advanced feature'.
7230 recommended that you save your work before using this function.
7235 recommended that you not attempt to edit layout information while simultaneousl
7236 y working on a document that you care about.
7237 Use a test document.
7238 Syntax errors and the like in your layout file could cause peculiar behavior.
7239 In particular, such errors could cause LyX to regard the current layout
7240 as invalid and to attempt to switch to some other layout.
7244 \begin_layout Plain Layout
7245 Really bad syntax errors may even caused LyX to exit.
7246 This is because certain sorts of errors may make LyX unable to read
7256 The LyX team strives to keep LyX stable in such situations, but safe is
7261 \begin_layout Plain Layout
7262 While we're giving advice: make regular backups.
7263 And be nice to your mother.
7271 \begin_layout Subsection
7272 The Module Declaration
7275 \begin_layout Standard
7276 A module must begin with a line like the following:
7279 \begin_layout LyX-Code
7282 DeclareLyXModule[endnotes.sty]{Endnotes}
7285 \begin_layout Standard
7286 The mandatory argument, in curly brackets, is the name of the module, as
7288 \begin_inset Flex CharStyle:MenuItem
7291 \begin_layout Plain Layout
7292 Document\SpecialChar \menuseparator
7299 The argument in square brackets is optional: It declares any LaTeX packages
7300 on which the module depends.
7301 Please note that only packages about which LyX knows should be listed in
7302 the square brackets.
7306 \begin_layout Plain Layout
7307 The list of such packages is documented only in the source code.
7312 LyX will not check for arbitrary packages.
7313 It is also possible to use the form
7314 \begin_inset Flex CharStyle:MenuItem
7317 \begin_layout Plain Layout
7323 as an optional argument, which declares that the module can only be used
7324 when there exists a conversion chain between the formats `
7325 \begin_inset Flex CharStyle:Code
7328 \begin_layout Plain Layout
7335 \begin_inset Flex CharStyle:Code
7338 \begin_layout Plain Layout
7347 \begin_layout Standard
7348 The module declaration should then be followed by lines like the following:
7351 \begin_layout LyX-Code
7355 \begin_layout LyX-Code
7356 #Adds an endnote command, in addition to footnotes.
7360 \begin_layout LyX-Code
7361 #You will need to add
7363 theendnotes in TeX code where you
7366 \begin_layout LyX-Code
7367 #want the endnotes to appear.
7371 \begin_layout LyX-Code
7375 \begin_layout LyX-Code
7376 #Requires: somemodule | othermodule
7379 \begin_layout LyX-Code
7380 #Excludes: badmodule
7383 \begin_layout Standard
7384 The description is used in
7385 \begin_inset Flex CharStyle:MenuItem
7388 \begin_layout Plain Layout
7389 Document\SpecialChar \menuseparator
7395 to provide the user with information about what the module does.
7397 \begin_inset Flex CharStyle:Code
7400 \begin_layout Plain Layout
7406 line is used to identify other modules with which this one must be used;
7408 \begin_inset Flex CharStyle:Code
7411 \begin_layout Plain Layout
7417 line is used to identify modules with which this one may not be used.
7418 Both are optional, and, as shown, multiple modules should be separated
7419 with the pipe symbol: |.
7420 Note that the required modules are treated disjunctively:
7424 of the required modules must be used.
7429 excluded module may be used.
7430 Note that modules are identified here by their
7435 \begin_inset Flex CharStyle:Code
7438 \begin_layout Plain Layout
7446 \begin_inset Flex CharStyle:Code
7449 \begin_layout Plain Layout
7456 \begin_inset Flex CharStyle:Code
7459 \begin_layout Plain Layout
7468 \begin_layout Subsection
7472 \begin_layout Standard
7473 The first non-comment line of any layout file, included file, or module
7478 contain the file format number:
7481 \begin_layout Description
7482 \begin_inset Flex CharStyle:Code
7485 \begin_layout Plain Layout
7492 \begin_inset Flex CharStyle:Code
7495 \begin_layout Plain Layout
7501 ] The format of the layout file.
7504 \begin_layout Standard
7505 This tag was introduced with LyX 1.4.0.
7506 Layout files from LyX 1.3.x and earlier don't have an explicit file format
7507 and are considered to be of format 1.
7508 The format for the present version of LyX is format 20.
7509 But each version of LyX is capable of reading earlier versions' layout
7510 files, just as they are capable of reading files produced by earlier versions
7512 There is, however, no provision for converting to earlier formats.
7513 So LyX 1.6.x will not read layout files in format 20 but only files in format
7517 \begin_layout Subsection
7518 \begin_inset CommandInset label
7520 name "sub:General-text-class"
7524 General text class parameters
7527 \begin_layout Standard
7528 These are general parameters that govern the behavior of an entire document
7534 mean that they must appear in
7535 \begin_inset Flex CharStyle:Code
7538 \begin_layout Plain Layout
7544 files rather than in modules.
7545 A module can contain any layout tag.)
7548 \begin_layout Description
7549 \begin_inset Flex CharStyle:Code
7552 \begin_layout Plain Layout
7558 Adds information that will be output in the
7559 \begin_inset Flex CharStyle:Code
7562 \begin_layout Plain Layout
7568 block when this document class is output to XHTML.
7569 Typically, this would be used to output CSS style information, but it can
7570 be used for anything that can appear in
7571 \begin_inset Flex CharStyle:Code
7574 \begin_layout Plain Layout
7582 \begin_inset Quotes eld
7586 \begin_inset Flex CharStyle:Code
7589 \begin_layout Plain Layout
7596 \begin_inset Quotes erd
7602 \begin_layout Description
7603 \begin_inset Flex CharStyle:Code
7606 \begin_layout Plain Layout
7612 Adds information to the document preamble.
7614 \begin_inset Quotes eld
7618 \begin_inset Flex CharStyle:Code
7621 \begin_layout Plain Layout
7628 \begin_inset Quotes erd
7634 \begin_layout Description
7635 \begin_inset Flex CharStyle:Code
7638 \begin_layout Plain Layout
7644 Describes various global options supported by the document class.
7646 \begin_inset space ~
7650 \begin_inset CommandInset ref
7652 reference "sub:ClassOptions"
7658 \begin_inset Quotes eld
7662 \begin_inset Flex CharStyle:Code
7665 \begin_layout Plain Layout
7672 \begin_inset Quotes erd
7678 \begin_layout Description
7679 \begin_inset Flex CharStyle:Code
7682 \begin_layout Plain Layout
7689 \begin_inset Flex CharStyle:Code
7692 \begin_layout Plain Layout
7701 \begin_inset Flex CharStyle:Code
7704 \begin_layout Plain Layout
7710 ] Whether the class should
7714 to having one or two columns.
7715 Can be changed in the
7716 \begin_inset Flex CharStyle:MenuItem
7719 \begin_layout Plain Layout
7720 Document\SpecialChar \menuseparator
7729 \begin_layout Description
7730 \begin_inset Flex CharStyle:Code
7733 \begin_layout Plain Layout
7740 \begin_inset Flex CharStyle:Code
7743 \begin_layout Plain Layout
7749 ] This sequence defines the properties for a counter.
7750 If the counter does not yet exist, it is created; if it does exist, it
7753 \begin_inset Quotes eld
7757 \begin_inset Flex CharStyle:Code
7760 \begin_layout Plain Layout
7767 \begin_inset Quotes erd
7771 \begin_inset Newline newline
7775 \begin_inset space ~
7779 \begin_inset CommandInset ref
7781 reference "sub:Counters"
7785 for details on counters.
7788 \begin_layout Description
7789 \begin_inset Flex CharStyle:Code
7792 \begin_layout Plain Layout
7798 Sets the default font used to display the document.
7800 \begin_inset space ~
7804 \begin_inset CommandInset ref
7806 reference "sub:Font-description"
7810 for how to declare fonts.
7812 \begin_inset Quotes eld
7816 \begin_inset Flex CharStyle:Code
7819 \begin_layout Plain Layout
7826 \begin_inset Quotes erd
7832 \begin_layout Description
7833 \begin_inset Flex CharStyle:Code
7836 \begin_layout Plain Layout
7843 \begin_inset Flex CharStyle:Code
7846 \begin_layout Plain Layout
7852 Specifies a module to be included by default with this document class.
7853 The module should be specified by filename without the
7854 \begin_inset Flex CharStyle:Code
7857 \begin_layout Plain Layout
7864 The user can still remove the module, but it will be active at the outset.
7865 (This applies only when new files are created, or when this class is chosen
7866 for an existing document.)
7869 \begin_layout Description
7870 \begin_inset Flex CharStyle:Code
7873 \begin_layout Plain Layout
7880 \begin_inset Flex CharStyle:Code
7883 \begin_layout Plain Layout
7889 ] This is the style that will be assigned to new paragraphs, usually
7890 \begin_inset Flex CharStyle:MenuItem
7893 \begin_layout Plain Layout
7900 This will default to the first defined style if not given, but you are
7901 encouraged to use this directive.
7904 \begin_layout Description
7905 \begin_inset Flex CharStyle:Code
7908 \begin_layout Plain Layout
7915 \begin_inset Flex CharStyle:Code
7918 \begin_layout Plain Layout
7924 ] This tag indicates that the module in question—which should be specified
7925 by filename without the
7926 \begin_inset Flex CharStyle:Code
7929 \begin_layout Plain Layout
7935 extension—cannot be used with this document class.
7936 This might be used in a journal-specific layout file to prevent, say, the
7938 \begin_inset Flex CharStyle:Code
7941 \begin_layout Plain Layout
7947 module that numbers theorems by section.
7952 be used in a module.
7953 Modules have their own way of excluding other modules (see
7954 \begin_inset CommandInset ref
7956 reference "sub:Layout-modules"
7963 \begin_layout Description
7964 \begin_inset Flex CharStyle:Code
7967 \begin_layout Plain Layout
7973 Defines a new float.
7975 \begin_inset space ~
7979 \begin_inset CommandInset ref
7981 reference "sub:Floats"
7987 \begin_inset Quotes eld
7991 \begin_inset Flex CharStyle:Code
7994 \begin_layout Plain Layout
8001 \begin_inset Quotes erd
8007 \begin_layout Description
8008 \begin_inset Flex CharStyle:Code
8011 \begin_layout Plain Layout
8017 Sets the information that will be output in the
8018 \begin_inset Flex CharStyle:Code
8021 \begin_layout Plain Layout
8027 block when this document class is output to XHTML.
8028 Note that this will completely override any prior
8029 \begin_inset Flex CharStyle:Code
8032 \begin_layout Plain Layout
8039 \begin_inset Flex CharStyle:Code
8042 \begin_layout Plain Layout
8050 \begin_inset Flex CharStyle:Code
8053 \begin_layout Plain Layout
8059 if you just want to add material to the preamble.) Must end with
8060 \begin_inset Quotes eld
8064 \begin_inset Flex CharStyle:Code
8067 \begin_layout Plain Layout
8074 \begin_inset Quotes erd
8080 \begin_layout Description
8081 \begin_inset Flex CharStyle:Code
8084 \begin_layout Plain Layout
8091 \begin_inset Flex CharStyle:Code
8094 \begin_layout Plain Layout
8100 ] Modifies the properties of the given counter.
8101 If the counter does not exist, the section is ignored.
8103 \begin_inset Quotes eld
8107 \begin_inset Flex CharStyle:Code
8110 \begin_layout Plain Layout
8117 \begin_inset Quotes erd
8121 \begin_inset Newline newline
8125 \begin_inset space ~
8129 \begin_inset CommandInset ref
8131 reference "sub:Counters"
8135 for details on counters.
8138 \begin_layout Description
8139 \begin_inset Flex CharStyle:Code
8142 \begin_layout Plain Layout
8149 \begin_inset Flex CharStyle:Code
8152 \begin_layout Plain Layout
8158 ] Modifies the properties of the given paragraph style.
8159 If the style does not exist, the section is ignored.
8161 \begin_inset Quotes eld
8165 \begin_inset Flex CharStyle:Code
8168 \begin_layout Plain Layout
8175 \begin_inset Quotes erd
8181 \begin_layout Description
8182 \begin_inset Flex CharStyle:Code
8185 \begin_layout Plain Layout
8191 As its name implies, this command allows you to include another layout
8192 definition file within yours to avoid duplicating commands.
8193 Common examples are the standard layout files, for example,
8194 \begin_inset Flex CharStyle:Code
8197 \begin_layout Plain Layout
8203 , which contains most of the basic layouts.
8206 \begin_layout Description
8207 \begin_inset Flex CharStyle:Code
8210 \begin_layout Plain Layout
8216 This section (re-)defines the layout of an inset.
8217 It can be applied to an existing inset or to a new, user-defined inset,
8218 e.g., a new character style.
8220 \begin_inset Quotes eld
8224 \begin_inset Flex CharStyle:Code
8227 \begin_layout Plain Layout
8234 \begin_inset Quotes erd
8238 \begin_inset Newline newline
8242 \begin_inset space ~
8246 \begin_inset CommandInset ref
8248 reference "sub:Flex-insets-and"
8252 for more information.
8256 \begin_layout Description
8257 \begin_inset Flex CharStyle:Code
8260 \begin_layout Plain Layout
8267 \begin_inset Flex CharStyle:Code
8270 \begin_layout Plain Layout
8276 ] A string that indicates the width of the left margin on the screen, for
8278 \begin_inset Quotes eld
8282 \begin_inset Quotes erd
8286 (Note that this is not a `length', like
8287 \begin_inset Quotes eld
8291 \begin_inset Quotes erd
8297 \begin_layout Description
8298 \begin_inset Flex CharStyle:Code
8301 \begin_layout Plain Layout
8307 This command deletes an existing float.
8308 This is particularly useful when you want to suppress a float that has
8309 been defined in an input file.
8312 \begin_layout Description
8313 \begin_inset Flex CharStyle:Code
8316 \begin_layout Plain Layout
8322 This command deletes an existing style.
8323 This is particularly useful when you want to suppress a style that has
8324 be defined in an input file.
8327 \begin_layout Description
8328 \begin_inset Flex CharStyle:Code
8331 \begin_layout Plain Layout
8337 A string indicating the file format (as defined in the Preferences dialog)
8338 produced by this class.
8339 It is mainly useful when
8340 \begin_inset Flex CharStyle:Code
8343 \begin_layout Plain Layout
8349 is `literate' and one wants to define a new type of literate document.
8350 This string is reset to `docbook', `latex', or `literate' when the correspondin
8352 \begin_inset Flex CharStyle:Code
8355 \begin_layout Plain Layout
8361 parameter is encountered.
8364 \begin_layout Description
8365 \begin_inset Flex CharStyle:Code
8368 \begin_layout Plain Layout
8374 A string indicating what sort of output documents using this class will
8376 At present, the options are: `docbook', `latex', and `literate'.
8379 \begin_layout Description
8380 \begin_inset Flex CharStyle:Code
8383 \begin_layout Plain Layout
8392 \begin_inset Flex CharStyle:Code
8395 \begin_layout Plain Layout
8406 \begin_inset Flex CharStyle:Code
8409 \begin_layout Plain Layout
8416 \begin_inset Flex CharStyle:Code
8419 \begin_layout Plain Layout
8425 ] The default pagestyle.
8426 Can be changed in the
8427 \begin_inset Flex CharStyle:MenuItem
8430 \begin_layout Plain Layout
8431 Document\SpecialChar \menuseparator
8440 \begin_layout Description
8441 \begin_inset Flex CharStyle:Code
8444 \begin_layout Plain Layout
8450 Sets the preamble for the LaTeX document.
8451 Note that this will completely override any prior
8452 \begin_inset Flex CharStyle:Code
8455 \begin_layout Plain Layout
8462 \begin_inset Flex CharStyle:Code
8465 \begin_layout Plain Layout
8473 \begin_inset Flex CharStyle:Code
8476 \begin_layout Plain Layout
8482 if you just want to add material to the preamble.) Must end with
8483 \begin_inset Quotes eld
8487 \begin_inset Flex CharStyle:Code
8490 \begin_layout Plain Layout
8497 \begin_inset Quotes erd
8503 \begin_layout Description
8504 \begin_inset Flex CharStyle:Code
8507 \begin_layout Plain Layout
8514 \begin_inset Flex CharStyle:Code
8517 \begin_layout Plain Layout
8524 \begin_inset Flex CharStyle:Code
8527 \begin_layout Plain Layout
8536 \begin_inset Flex CharStyle:Code
8539 \begin_layout Plain Layout
8545 ] Whether the class already provides the feature
8546 \begin_inset Flex CharStyle:Code
8549 \begin_layout Plain Layout
8556 A feature is in general the name of a package (
8557 \begin_inset Flex CharStyle:Code
8560 \begin_layout Plain Layout
8567 \begin_inset Flex CharStyle:Code
8570 \begin_layout Plain Layout
8576 , \SpecialChar \ldots{}
8578 \begin_inset Flex CharStyle:Code
8581 \begin_layout Plain Layout
8588 \begin_inset Flex CharStyle:Code
8591 \begin_layout Plain Layout
8597 ,\SpecialChar \ldots{}
8598 ); the complete list of supported features is unfortunately not documented
8599 outside the LyX source code—but see
8600 \begin_inset Flex CharStyle:Code
8603 \begin_layout Plain Layout
8609 if you're interested.
8611 \begin_inset Flex CharStyle:MenuItem
8614 \begin_layout Plain Layout
8615 Help\SpecialChar \menuseparator
8621 also gives an overview of the supported packages.
8624 \begin_layout Description
8625 \begin_inset Flex CharStyle:Code
8628 \begin_layout Plain Layout
8635 \begin_inset Flex CharStyle:Code
8638 \begin_layout Plain Layout
8644 ] Indicates that this layout provides the functionality of the module mentioned,
8645 which should be specified by the filename without the
8646 \begin_inset Flex CharStyle:Code
8649 \begin_layout Plain Layout
8656 This will typically be used if the layout includes the module directly,
8657 rather than using the
8658 \begin_inset Flex CharStyle:Code
8661 \begin_layout Plain Layout
8667 tag to indicate that it ought to be used.
8668 It could also be used in a module that provided an alternate implementation
8669 of the same functionality.
8672 \begin_layout Description
8673 \begin_inset Flex CharStyle:Code
8676 \begin_layout Plain Layout
8683 \begin_inset Flex CharStyle:Code
8686 \begin_layout Plain Layout
8692 ] Whether the class requires the feature
8693 \begin_inset Flex CharStyle:Code
8696 \begin_layout Plain Layout
8703 Multiple features must be separated by commas.
8704 Note that you can only request supported features.
8706 \begin_inset Flex CharStyle:Code
8709 \begin_layout Plain Layout
8715 for a list of these.)
8718 \begin_layout Description
8719 \begin_inset Flex CharStyle:Code
8722 \begin_layout Plain Layout
8728 A string that indicates the width of the right margin on the screen, for
8730 \begin_inset Quotes eld
8734 \begin_inset Quotes erd
8740 \begin_layout Description
8741 \begin_inset Flex CharStyle:Code
8744 \begin_layout Plain Layout
8750 Sets which divisions get numbered.
8752 \begin_inset Flex CharStyle:Code
8755 \begin_layout Plain Layout
8764 \begin_layout Description
8765 \begin_inset Flex CharStyle:Code
8768 \begin_layout Plain Layout
8777 \begin_inset Flex CharStyle:Code
8780 \begin_layout Plain Layout
8791 \begin_inset Flex CharStyle:Code
8794 \begin_layout Plain Layout
8800 ] Whether the class-default should be printing on one or both sides of the
8802 Can be changed in the
8803 \begin_inset Flex CharStyle:MenuItem
8806 \begin_layout Plain Layout
8807 Document\SpecialChar \menuseparator
8816 \begin_layout Description
8817 \begin_inset Flex CharStyle:Code
8820 \begin_layout Plain Layout
8826 This sequence defines a paragraph style.
8827 If the style does not yet exist, it is created; if it does exist, its parameter
8830 \begin_inset Quotes eld
8834 \begin_inset Flex CharStyle:Code
8837 \begin_layout Plain Layout
8844 \begin_inset Quotes erd
8848 \begin_inset Newline newline
8852 \begin_inset space ~
8856 \begin_inset CommandInset ref
8858 reference "sub:Paragraph-Styles"
8862 for details on paragraph styles.
8865 \begin_layout Description
8866 \begin_inset Flex CharStyle:Code
8869 \begin_layout Plain Layout
8876 \begin_inset Flex CharStyle:Code
8879 \begin_layout Plain Layout
8885 ] The name of the command or environment to be used with
8886 \begin_inset Flex CharStyle:Code
8889 \begin_layout Plain Layout
8898 \begin_layout Description
8899 \begin_inset Flex CharStyle:Code
8902 \begin_layout Plain Layout
8909 \begin_inset Flex CharStyle:Code
8912 \begin_layout Plain Layout
8921 \begin_inset Flex CharStyle:Code
8924 \begin_layout Plain Layout
8930 ] Indicates what kind of markup is used to define the title of a document.
8932 \begin_inset Flex CharStyle:Code
8935 \begin_layout Plain Layout
8941 means that the macro with name
8942 \begin_inset Flex CharStyle:Code
8945 \begin_layout Plain Layout
8951 will be inserted after the last layout which has
8952 \begin_inset Quotes eld
8956 \begin_inset Flex CharStyle:Code
8959 \begin_layout Plain Layout
8966 \begin_inset Quotes erd
8971 \begin_inset Flex CharStyle:Code
8974 \begin_layout Plain Layout
8980 corresponds to the case where the block of paragraphs which have
8981 \begin_inset Quotes eld
8985 \begin_inset Flex CharStyle:Code
8988 \begin_layout Plain Layout
8995 \begin_inset Quotes erd
8998 should be enclosed into the
8999 \begin_inset Flex CharStyle:Code
9002 \begin_layout Plain Layout
9011 \begin_layout Description
9012 \begin_inset Flex CharStyle:Code
9015 \begin_layout Plain Layout
9021 Sets which divisions are included in the table of contents.
9023 \begin_inset Flex CharStyle:Code
9026 \begin_layout Plain Layout
9035 \begin_layout Subsection
9036 \begin_inset Flex CharStyle:Code
9039 \begin_layout Plain Layout
9046 \begin_inset CommandInset label
9048 name "sub:ClassOptions"
9055 \begin_layout Standard
9057 \begin_inset Flex CharStyle:Code
9060 \begin_layout Plain Layout
9066 section can contain the following entries:
9069 \begin_layout Description
9070 \begin_inset Flex CharStyle:Code
9073 \begin_layout Plain Layout
9080 \begin_inset Flex CharStyle:Code
9083 \begin_layout Plain Layout
9089 ] The list of available font sizes for the document's main font, separated
9091 \begin_inset Quotes eld
9095 \begin_inset Flex CharStyle:Code
9098 \begin_layout Plain Layout
9105 \begin_inset Quotes erd
9111 \begin_layout Description
9112 \begin_inset Flex CharStyle:Code
9115 \begin_layout Plain Layout
9121 Used to set the DTD line with XML-based output classes.
9123 \begin_inset space \thinspace{}
9127 \begin_inset Quotes eld
9130 -//OASIS//DTD DocBook V4.2//EN
9131 \begin_inset Quotes erd
9137 \begin_layout Description
9138 \begin_inset Flex CharStyle:Code
9141 \begin_layout Plain Layout
9148 \begin_inset Flex CharStyle:Code
9151 \begin_layout Plain Layout
9152 string="empty|plain|headings|fancy"
9157 ] The list of available page styles, separated by
9158 \begin_inset Quotes eld
9162 \begin_inset Flex CharStyle:Code
9165 \begin_layout Plain Layout
9172 \begin_inset Quotes erd
9178 \begin_layout Description
9179 \begin_inset Flex CharStyle:Code
9182 \begin_layout Plain Layout
9189 \begin_inset Flex CharStyle:Code
9192 \begin_layout Plain Layout
9198 ] Some document class options, separated by a comma, that will be added
9199 to the optional part of the
9200 \begin_inset Flex CharStyle:Code
9203 \begin_layout Plain Layout
9214 \begin_layout Standard
9216 \begin_inset Flex CharStyle:Code
9219 \begin_layout Plain Layout
9225 section must end with
9226 \begin_inset Quotes eld
9230 \begin_inset Flex CharStyle:Code
9233 \begin_layout Plain Layout
9240 \begin_inset Quotes erd
9246 \begin_layout Subsection
9248 \begin_inset CommandInset label
9250 name "sub:Paragraph-Styles"
9257 \begin_layout Standard
9258 A paragraph style description looks like this:
9262 \begin_layout Plain Layout
9263 Note that this will either define a new layout or modify an existing one.
9271 \begin_layout LyX-Code
9278 \begin_layout LyX-Code
9282 \begin_layout LyX-Code
9286 \begin_layout Standard
9287 where the following commands are allowed:
9290 \begin_layout Description
9291 \begin_inset Flex CharStyle:Code
9294 \begin_layout Plain Layout
9301 \begin_inset Flex CharStyle:Code
9304 \begin_layout Plain Layout
9309 , left, right, center
9314 ] Paragraph alignment.
9317 \begin_layout Description
9318 \begin_inset Flex CharStyle:Code
9321 \begin_layout Plain Layout
9328 \begin_inset Flex CharStyle:Code
9331 \begin_layout Plain Layout
9336 , left, right, center
9341 ] A comma separated list of permitted alignments.
9342 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
9344 For example a right-aligned or centered enumeration isn't possible.)
9347 \begin_layout Description
9348 \begin_inset Flex CharStyle:Code
9351 \begin_layout Plain Layout
9357 Language dependent information to be included in the LaTeX preamble when
9359 Note that this will completely override any prior
9360 \begin_inset Flex CharStyle:Code
9363 \begin_layout Plain Layout
9371 \begin_inset Quotes eld
9375 \begin_inset Flex CharStyle:Code
9378 \begin_layout Plain Layout
9385 \begin_inset Quotes erd
9389 The contents of this tag will occur once in the LaTeX preamble for each
9390 language used by the document.
9391 Each time, the following substitutions are made:
9395 \begin_layout Itemize
9396 \begin_inset Flex CharStyle:Code
9399 \begin_layout Plain Layout
9405 is replaced by the language name (as used by the babel package).
9408 \begin_layout Itemize
9410 \begin_inset Quotes eld
9414 \begin_inset Quotes erd
9418 \begin_inset Flex CharStyle:Code
9421 \begin_layout Plain Layout
9427 replaces its argument by the translation of the argument to the current
9431 \begin_layout Standard
9432 This preamble snippet will only be used if the document contains more than
9433 one language and the babel package is used.
9437 \begin_layout Description
9438 \begin_inset Flex CharStyle:Code
9441 \begin_layout Plain Layout
9448 \begin_inset Flex CharStyle:Code
9451 \begin_layout Plain Layout
9461 \begin_layout Plain Layout
9462 Note that a `float' here is a real number, such as: 1.5.
9467 The vertical space with which the last of a chain of paragraphs with this
9468 layout is separated from the following paragraph.
9469 If the next paragraph has another layout, the separations are not simply
9470 added, but the maximum is taken.
9473 \begin_layout Description
9474 \begin_inset Flex CharStyle:Code
9477 \begin_layout Plain Layout
9484 \begin_inset Flex CharStyle:Code
9487 \begin_layout Plain Layout
9493 The category for this style.
9494 This is used to group related styles in the Layout combobox on the toolbar.
9495 Any string can be used, but you may want to use existing categories with
9500 \begin_layout Description
9501 \begin_inset Flex CharStyle:Code
9504 \begin_layout Plain Layout
9510 Depth of XML command.
9511 Used only with XML-type formats.
9514 \begin_layout Description
9515 \begin_inset Flex CharStyle:Code
9518 \begin_layout Plain Layout
9525 \begin_inset CommandInset label
9527 name "des:CopyStyle"
9532 \begin_inset Flex CharStyle:Code
9535 \begin_layout Plain Layout
9541 Copies all the features of an existing style into the current one.
9545 \begin_layout Description
9546 \begin_inset Flex CharStyle:Code
9549 \begin_layout Plain Layout
9555 The name of a style whose preamble should be output
9560 This allows to ensure some ordering of the preamble snippets when macros
9561 definitions depend on one another.
9565 \begin_layout Plain Layout
9566 Note that, besides that functionality, there is no way to ensure any ordering
9568 The ordering that you see in a given version of LyX may change without
9569 warning in later versions.
9577 \begin_layout Description
9578 \begin_inset Flex CharStyle:Code
9581 \begin_layout Plain Layout
9588 \begin_inset Flex CharStyle:Code
9591 \begin_layout Plain Layout
9596 , Box, Filled_Box, Static
9601 ] The type of label that stands at the end of the paragraph (or sequence
9603 \begin_inset Flex CharStyle:Code
9606 \begin_layout Plain Layout
9613 \begin_inset Flex CharStyle:Code
9616 \begin_layout Plain Layout
9623 \begin_inset Flex CharStyle:Code
9626 \begin_layout Plain Layout
9633 \begin_inset Flex CharStyle:Code
9636 \begin_layout Plain Layout
9644 \begin_inset Flex CharStyle:Code
9647 \begin_layout Plain Layout
9654 \begin_inset Quotes eld
9658 \begin_inset Quotes erd
9662 \begin_inset Flex CharStyle:Code
9665 \begin_layout Plain Layout
9672 \begin_inset Flex CharStyle:Code
9675 \begin_layout Plain Layout
9676 \begin_inset space ~
9685 \begin_inset space ~
9688 black) square suitable for end of proof markers,
9689 \begin_inset Flex CharStyle:Code
9692 \begin_layout Plain Layout
9698 is an explicit text string.
9701 \begin_layout Description
9702 \begin_inset Flex CharStyle:Code
9705 \begin_layout Plain Layout
9712 \begin_inset Flex CharStyle:Code
9715 \begin_layout Plain Layout
9721 ] The string used for a label with a
9722 \begin_inset Flex CharStyle:Code
9725 \begin_layout Plain Layout
9732 \begin_inset Flex CharStyle:Code
9735 \begin_layout Plain Layout
9745 \begin_layout Description
9746 \begin_inset Flex CharStyle:Code
9749 \begin_layout Plain Layout
9756 \begin_inset Flex CharStyle:Code
9759 \begin_layout Plain Layout
9770 \begin_inset Flex CharStyle:Code
9773 \begin_layout Plain Layout
9782 \begin_layout Description
9783 \begin_inset Flex CharStyle:Code
9786 \begin_layout Plain Layout
9793 \begin_inset Flex CharStyle:Code
9796 \begin_layout Plain Layout
9806 ] With this parameter the
9807 \begin_inset Flex CharStyle:MenuItem
9810 \begin_layout Plain Layout
9817 \begin_inset Quotes eld
9820 Vertical space above
9821 \begin_inset Quotes erd
9825 \begin_inset Flex CharStyle:MenuItem
9828 \begin_layout Plain Layout
9829 Edit\SpecialChar \menuseparator
9831 \begin_inset space ~
9839 dialog can be set when initializing a paragraph with this style.
9843 \begin_layout Plain Layout
9846 Note from Jean-Marc:
9848 I'm not sure that this setting has much use, and it should probably be
9849 removed in later versions.
9857 \begin_layout Description
9858 \begin_inset Flex CharStyle:Code
9861 \begin_layout Plain Layout
9867 The font used for both the text body
9873 \begin_inset space ~
9877 \begin_inset CommandInset ref
9879 reference "sub:Font-description"
9884 Note that defining this font automatically defines the
9885 \begin_inset Flex CharStyle:Code
9888 \begin_layout Plain Layout
9895 So you should define this one first if you also want to define
9896 \begin_inset Flex CharStyle:Code
9899 \begin_layout Plain Layout
9908 \begin_layout Description
9909 \begin_inset Flex CharStyle:Code
9912 \begin_layout Plain Layout
9919 \begin_inset CommandInset label
9921 name "des:FreeSpacing"
9928 \begin_inset Flex CharStyle:Code
9931 \begin_layout Plain Layout
9942 \begin_inset Flex CharStyle:Code
9945 \begin_layout Plain Layout
9951 ] Usually LyX doesn't allow you to insert more than one space between words,
9952 since a space is considered as the separation between two words, not a
9953 character or symbol of its own.
9954 This is a very fine thing but sometimes annoying, for example, when typing
9955 program code or plain LaTeX code.
9957 \begin_inset Flex CharStyle:Code
9960 \begin_layout Plain Layout
9967 Note that LyX will create protected blanks for the additional blanks when
9968 in another mode than LaTeX-mode.
9971 \begin_layout Description
9972 \begin_inset Flex CharStyle:Code
9975 \begin_layout Plain Layout
9981 These tags are used with XHTML output.
9983 \begin_inset CommandInset ref
9984 LatexCommand prettyref
9985 reference "sub:Paragraph-Style-XHTML"
9992 \begin_layout Description
9993 \begin_inset Flex CharStyle:Code
9996 \begin_layout Plain Layout
10002 [[FIXME]] (Used only with XML-type formats.)
10005 \begin_layout Description
10006 \begin_inset Flex CharStyle:Code
10009 \begin_layout Plain Layout
10016 \begin_inset Flex CharStyle:Code
10019 \begin_layout Plain Layout
10025 If 1, marks the layout as to be included in the document preamble rather
10026 than in the document body.
10027 This is useful for document classes that want such information as the title
10028 and author to appear in the preamble.
10031 \begin_layout Description
10032 \begin_inset Flex CharStyle:Code
10035 \begin_layout Plain Layout
10042 \begin_inset Flex CharStyle:Code
10045 \begin_layout Plain Layout
10051 If 1, marks the layout as being part of a title block (see also the
10052 \begin_inset Flex CharStyle:Code
10055 \begin_layout Plain Layout
10062 \begin_inset Flex CharStyle:Code
10065 \begin_layout Plain Layout
10074 \begin_layout Description
10075 \begin_inset Flex CharStyle:Code
10078 \begin_layout Plain Layout
10085 \begin_inset Flex CharStyle:Code
10088 \begin_layout Plain Layout
10094 ] This provides extra space between paragraphs that have the same layout.
10095 If you put other layouts into an environment, each is separated with the
10097 \begin_inset Flex CharStyle:Code
10100 \begin_layout Plain Layout
10107 But the whole items of the environment are additionally separated with
10109 \begin_inset Flex CharStyle:Code
10112 \begin_layout Plain Layout
10119 Note that this is a
10124 \begin_layout Description
10125 \begin_inset Flex CharStyle:Code
10128 \begin_layout Plain Layout
10134 [[FIXME]] (Used only with XML-type formats.)
10137 \begin_layout Description
10138 \begin_inset Flex CharStyle:Code
10141 \begin_layout Plain Layout
10148 \begin_inset CommandInset label
10150 name "des:KeepEmpty"
10157 \begin_inset Flex CharStyle:Code
10160 \begin_layout Plain Layout
10171 \begin_inset Flex CharStyle:Code
10174 \begin_layout Plain Layout
10180 ] Usually LyX does not allow you to leave a paragraph empty, since it would
10181 lead to empty LaTeX output.
10182 There are some cases where this could be desirable however: in a letter
10183 template, the required fields can be provided as empty fields, so that
10184 people do not forget them; in some special classes, a layout can be used
10185 as some kind of break, which does not contain actual text.
10188 \begin_layout Description
10189 \begin_inset Flex CharStyle:Code
10192 \begin_layout Plain Layout
10198 [float=0] The vertical space between the label and the text body.
10199 Only used for labels that are above the text body (
10200 \begin_inset Flex CharStyle:Code
10203 \begin_layout Plain Layout
10210 \begin_inset Flex CharStyle:Code
10213 \begin_layout Plain Layout
10214 Centered_Top_Environment
10222 \begin_layout Description
10223 \begin_inset Flex CharStyle:Code
10226 \begin_layout Plain Layout
10233 \begin_inset Flex CharStyle:Code
10236 \begin_layout Plain Layout
10243 \begin_inset Newline newline
10246 The name of the counter for automatic numbering.
10248 \begin_inset Newline newline
10256 \begin_inset Flex CharStyle:Code
10259 \begin_layout Plain Layout
10266 \begin_inset Flex CharStyle:Code
10269 \begin_layout Plain Layout
10276 In that case, the counter will be stepped each time the layout appears.
10278 \begin_inset Newline newline
10286 \begin_inset Flex CharStyle:Code
10289 \begin_layout Plain Layout
10296 \begin_inset Flex CharStyle:Code
10299 \begin_layout Plain Layout
10305 , though this case is a bit complicated.
10306 Suppose you declare
10307 \begin_inset Quotes eld
10311 \begin_inset Flex CharStyle:Code
10314 \begin_layout Plain Layout
10315 LabelCounter myenum
10321 \begin_inset Quotes erd
10325 Then the actual counters used are
10326 \begin_inset Flex CharStyle:Code
10329 \begin_layout Plain Layout
10336 \begin_inset Flex CharStyle:Code
10339 \begin_layout Plain Layout
10346 \begin_inset Flex CharStyle:Code
10349 \begin_layout Plain Layout
10356 \begin_inset Flex CharStyle:Code
10359 \begin_layout Plain Layout
10365 , much as in LaTeX.
10366 These counters must all be declared separately.
10367 \begin_inset Newline newline
10371 \begin_inset CommandInset ref
10373 reference "sub:Counters"
10377 for details on counters.
10380 \begin_layout Description
10381 \begin_inset Flex CharStyle:Code
10384 \begin_layout Plain Layout
10390 The font used for the label.
10392 \begin_inset space ~
10396 \begin_inset CommandInset ref
10398 reference "sub:Font-description"
10405 \begin_layout Description
10406 \begin_inset Flex CharStyle:Code
10409 \begin_layout Plain Layout
10415 Text that indicates how far a label should be indented.
10418 \begin_layout Description
10419 \begin_inset Flex CharStyle:Code
10422 \begin_layout Plain Layout
10429 \begin_inset Flex CharStyle:Code
10432 \begin_layout Plain Layout
10438 ] The horizontal space between the label and the text body.
10439 Only used for labels that are not above the text body.
10442 \begin_layout Description
10443 \begin_inset Flex CharStyle:Code
10446 \begin_layout Plain Layout
10453 \begin_inset Flex CharStyle:Code
10456 \begin_layout Plain Layout
10462 ] The string used for a label with a
10463 \begin_inset Flex CharStyle:Code
10466 \begin_layout Plain Layout
10474 \begin_inset Flex CharStyle:Code
10477 \begin_layout Plain Layout
10483 is set, this string can be contain the special formatting commands described
10485 \begin_inset CommandInset ref
10487 reference "sub:Counters"
10495 \begin_layout Plain Layout
10496 For the sake of backwards compatibility, the string
10497 \begin_inset Flex CharStyle:Code
10500 \begin_layout Plain Layout
10510 will be replaced by the expanded
10511 \begin_inset Flex CharStyle:Code
10514 \begin_layout Plain Layout
10521 \begin_inset Flex CharStyle:Code
10524 \begin_layout Plain Layout
10533 This feature is now obsolete and should be replaced by the mechanisms of
10535 \begin_inset CommandInset ref
10537 reference "sub:Counters"
10549 \begin_layout Description
10550 \begin_inset Flex CharStyle:Code
10553 \begin_layout Plain Layout
10554 LabelStringAppendix
10560 \begin_inset Flex CharStyle:Code
10563 \begin_layout Plain Layout
10569 ] This is used inside the appendix instead of
10570 \begin_inset Flex CharStyle:Code
10573 \begin_layout Plain Layout
10581 \begin_inset Flex CharStyle:Code
10584 \begin_layout Plain Layout
10591 \begin_inset Flex CharStyle:Code
10594 \begin_layout Plain Layout
10595 LabelStringAppendix
10603 \begin_layout Description
10604 \begin_inset Flex CharStyle:Code
10607 \begin_layout Plain Layout
10613 [FIXME] (Used only with XML-type formats.)
10616 \begin_layout Description
10617 \begin_inset Flex CharStyle:Code
10620 \begin_layout Plain Layout
10627 \begin_inset Flex CharStyle:Code
10630 \begin_layout Plain Layout
10635 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
10636 Enumerate, Itemize, Bibliography
10645 \begin_layout Itemize
10646 \begin_inset Flex CharStyle:Code
10649 \begin_layout Plain Layout
10655 means the label is the very first word (up to the first real blank).
10656 Use protected spaces (like
10657 \begin_inset space ~
10660 that one) if you want more than one word as the label.
10664 \begin_layout Itemize
10665 \begin_inset Flex CharStyle:Code
10668 \begin_layout Plain Layout
10674 means the label is simply whatever
10675 \begin_inset Flex CharStyle:Code
10678 \begin_layout Plain Layout
10685 Note that this really is `static'.
10688 \begin_layout Itemize
10689 \begin_inset Flex CharStyle:Code
10692 \begin_layout Plain Layout
10699 \begin_inset Flex CharStyle:Code
10702 \begin_layout Plain Layout
10703 Centered_Top_Environment
10708 are special cases of
10709 \begin_inset Flex CharStyle:Code
10712 \begin_layout Plain Layout
10719 The label will be printed above the paragraph, but only at the top of an
10720 environment or the top of a chain of paragraphs with this layout.
10721 This might be used with the
10722 \begin_inset Flex CharStyle:MenuItem
10725 \begin_layout Plain Layout
10731 layout, for example.
10734 \begin_layout Itemize
10735 \begin_inset Flex CharStyle:Code
10738 \begin_layout Plain Layout
10744 is a special case for the caption-labels
10745 \begin_inset Quotes eld
10749 \begin_inset Quotes erd
10753 \begin_inset Quotes eld
10757 \begin_inset Quotes erd
10762 \begin_inset Flex CharStyle:Code
10765 \begin_layout Plain Layout
10771 means the (hardcoded) label string depends on the kind of float: It is
10772 hardcoded to be `FloatType N', where N is the value of the counter associated
10776 \begin_layout Itemize
10778 \begin_inset Flex CharStyle:Code
10781 \begin_layout Plain Layout
10787 label type defines automatically numbered labels.
10789 \begin_inset Flex CharStyle:Code
10792 \begin_layout Plain Layout
10798 will be expanded to resolve any counter references it contains: For example,
10800 \begin_inset Quotes eld
10804 \begin_inset Flex CharStyle:Code
10807 \begin_layout Plain Layout
10818 \begin_inset Quotes erd
10823 \begin_inset CommandInset ref
10825 reference "sub:Counters"
10829 for more information on counters.
10832 \begin_layout Itemize
10833 \begin_inset Flex CharStyle:Code
10836 \begin_layout Plain Layout
10842 produces the usual sort of enumeration labels.
10843 At present, it is hardcoded to use Arabic numerals, lowercase letters,
10844 small Roman numerals, and uppercase letters for the four possible depths.
10847 \begin_layout Itemize
10848 \begin_inset Flex CharStyle:Code
10851 \begin_layout Plain Layout
10857 produces various bullets at the different levels.
10858 It is also hardcoded.
10861 \begin_layout Itemize
10862 \begin_inset Flex CharStyle:Code
10865 \begin_layout Plain Layout
10871 is used internally by LyX and should be used only with
10872 \begin_inset Flex CharStyle:Code
10875 \begin_layout Plain Layout
10876 LatexType BibEnvironment
10885 \begin_layout Description
10886 \begin_inset Flex CharStyle:Code
10889 \begin_layout Plain Layout
10896 \begin_inset Flex CharStyle:Code
10899 \begin_layout Plain Layout
10905 , but this preamble snippet occurs independently from the babel package,
10906 and only for the document language.
10908 \begin_inset Quotes eld
10912 \begin_inset Flex CharStyle:Code
10915 \begin_layout Plain Layout
10922 \begin_inset Quotes erd
10929 \begin_layout Standard
10930 If the style defines text that appears in the typeset document, it may use
10932 \begin_inset Flex CharStyle:Code
10935 \begin_layout Plain Layout
10942 \begin_inset Flex CharStyle:Code
10945 \begin_layout Plain Layout
10951 to support non-english and even multilanguage documents correctly.
10952 The following excerpt (from the
10953 \begin_inset Flex CharStyle:Code
10956 \begin_layout Plain Layout
10962 file) shows how this works:
10965 \begin_layout LyX-Code
10969 \begin_layout LyX-Code
10972 theoremstyle{remark}
10975 \begin_layout LyX-Code
10978 newtheorem{claim}[thm]{
10985 \begin_layout LyX-Code
10989 \begin_layout LyX-Code
10993 \begin_layout LyX-Code
10998 claimname}{_(Claim)}
11001 \begin_layout LyX-Code
11005 \begin_layout LyX-Code
11009 \begin_layout LyX-Code
11013 \begin_layout LyX-Code
11022 claimname}{_(Claim)}}
11025 \begin_layout LyX-Code
11029 \begin_layout Standard
11030 The key to correct translation of the user visible text is the definition
11032 \begin_inset Flex CharStyle:Code
11035 \begin_layout Plain Layout
11043 in the language preamble.
11044 This command holds the name of the theorem that will appear in the output.
11046 \begin_inset Flex CharStyle:Code
11049 \begin_layout Plain Layout
11055 then uses the commands offered by the babel package to redefine
11056 \begin_inset Flex CharStyle:Code
11059 \begin_layout Plain Layout
11067 for each used language in multilanguage documents.
11071 \begin_layout Description
11072 \begin_inset Flex CharStyle:Code
11075 \begin_layout Plain Layout
11081 The name of the corresponding LaTeX stuff.
11082 Either the environment or command name.
11085 \begin_layout Description
11086 \begin_inset Flex CharStyle:Code
11089 \begin_layout Plain Layout
11095 An optional parameter for the corresponding
11096 \begin_inset Flex CharStyle:Code
11099 \begin_layout Plain Layout
11106 This parameter cannot be changed from within LyX.
11109 \begin_layout Description
11110 \begin_inset Flex CharStyle:Code
11113 \begin_layout Plain Layout
11120 \begin_inset CommandInset label
11122 name "des:LatexType"
11127 \begin_inset Flex CharStyle:Code
11130 \begin_layout Plain Layout
11135 , Command, Environment, Item_Environment,
11141 \begin_inset Flex CharStyle:Code
11144 \begin_layout Plain Layout
11145 List_Environment, Bib_Environment
11150 ] How the layout should be translated into LaTeX.
11154 \begin_layout Plain Layout
11155 \begin_inset Flex CharStyle:Code
11158 \begin_layout Plain Layout
11164 is perhaps a bit misleading, since these rules apply to SGML classes, too.
11165 Visit the SGML class files for specific examples.
11174 \begin_layout Itemize
11175 \begin_inset Flex CharStyle:Code
11178 \begin_layout Plain Layout
11184 means nothing special.
11188 \begin_layout Itemize
11189 \begin_inset Flex CharStyle:Code
11192 \begin_layout Plain Layout
11199 \begin_inset Flex CharStyle:Code
11202 \begin_layout Plain Layout
11209 {\SpecialChar \ldots{}
11218 \begin_layout Itemize
11219 \begin_inset Flex CharStyle:Code
11222 \begin_layout Plain Layout
11229 \begin_inset Flex CharStyle:Code
11232 \begin_layout Plain Layout
11239 }\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 \begin_inset Flex CharStyle:Code
11279 \begin_layout Plain Layout
11287 is generated for each paragraph of this environment.
11291 \begin_layout Itemize
11292 \begin_inset Flex CharStyle:Code
11295 \begin_layout Plain Layout
11302 \begin_inset Flex CharStyle:Code
11305 \begin_layout Plain Layout
11312 \begin_inset Flex CharStyle:Code
11315 \begin_layout Plain Layout
11321 is passed as an argument to the environment.
11323 \begin_inset Flex CharStyle:Code
11326 \begin_layout Plain Layout
11332 can be defined in the
11333 \begin_inset Flex CharStyle:MenuItem
11336 \begin_layout Plain Layout
11341 ayout\SpecialChar \menuseparator
11355 \begin_layout Standard
11356 Putting the last few things together, the LaTeX output will be either:
11359 \begin_layout LyX-Code
11362 latexname[latexparam]{\SpecialChar \ldots{}
11366 \begin_layout Standard
11370 \begin_layout LyX-Code
11373 begin{latexname}[latexparam] \SpecialChar \ldots{}
11379 \begin_layout Standard
11380 depending upon the LaTeX type.
11384 \begin_layout Description
11385 \begin_inset Flex CharStyle:Code
11388 \begin_layout Plain Layout
11395 \begin_inset Flex CharStyle:Code
11398 \begin_layout Plain Layout
11404 ] If you put layouts into environments, the leftmargins are not simply added,
11405 but added with a factor
11406 \begin_inset Formula $\frac{4}{depth+4}$
11410 Note that this parameter is also used when the margin is defined as
11411 \begin_inset Flex CharStyle:Code
11414 \begin_layout Plain Layout
11421 \begin_inset Flex CharStyle:Code
11424 \begin_layout Plain Layout
11431 Then it is added to the manual or dynamic margin.
11433 \begin_inset Newline newline
11436 The argument is passed as a string.
11438 \begin_inset Quotes eld
11442 \begin_inset Flex CharStyle:Code
11445 \begin_layout Plain Layout
11452 \begin_inset Quotes erd
11455 means that the paragraph is indented with the width of
11456 \begin_inset Quotes eld
11460 \begin_inset Flex CharStyle:Code
11463 \begin_layout Plain Layout
11470 \begin_inset Quotes erd
11473 in the normal font.
11474 You can get a negative width by prefixing the string with
11475 \begin_inset Quotes eld
11479 \begin_inset Flex CharStyle:Code
11482 \begin_layout Plain Layout
11489 \begin_inset Quotes erd
11493 This way was chosen so that the look is the same with each used screen
11498 \begin_layout Description
11499 \begin_inset Flex CharStyle:Code
11502 \begin_layout Plain Layout
11509 \begin_inset Flex CharStyle:Code
11512 \begin_layout Plain Layout
11517 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11523 \begin_inset Newline newline
11526 The kind of margin that the layout has on the left side.
11528 \begin_inset Flex CharStyle:Code
11531 \begin_layout Plain Layout
11537 just means a fixed margin.
11539 \begin_inset Flex CharStyle:Code
11542 \begin_layout Plain Layout
11548 means that the left margin depends on the string entered in the
11549 \begin_inset Flex CharStyle:MenuItem
11552 \begin_layout Plain Layout
11553 Edit\SpecialChar \menuseparator
11555 \begin_inset space ~
11564 This is used to typeset nice lists without tabulators.
11566 \begin_inset Flex CharStyle:Code
11569 \begin_layout Plain Layout
11575 means that the margin depends on the size of the label.
11576 This is used for automatic enumerated headlines.
11577 It is obvious that the headline
11578 \begin_inset Quotes eld
11581 5.4.3.2.1 Very long headline
11582 \begin_inset Quotes erd
11585 must have a wider left margin (as wide as
11586 \begin_inset Quotes eld
11590 \begin_inset Quotes erd
11593 plus the space) than
11594 \begin_inset Quotes eld
11597 3.2 Very long headline
11598 \begin_inset Quotes erd
11602 \begin_inset Quotes eld
11606 \begin_inset Quotes erd
11609 are not able to do this.
11611 \begin_inset Flex CharStyle:Code
11614 \begin_layout Plain Layout
11620 is similar, but only the very first row of the paragraph is dynamic, while
11621 the others are static; this is used, for example, for descriptions.
11623 \begin_inset Flex CharStyle:Code
11626 \begin_layout Plain Layout
11632 means the margin is chosen in a way that the longest row of this paragraph
11633 fits to the right margin.
11634 This is used to typeset an address on the right edge of the page.
11637 \begin_layout Description
11638 \begin_inset Flex CharStyle:Code
11641 \begin_layout Plain Layout
11648 \begin_inset Flex CharStyle:Code
11651 \begin_layout Plain Layout
11660 \begin_inset Flex CharStyle:Code
11663 \begin_layout Plain Layout
11669 ] Whether fragile commands in this layout should be
11670 \begin_inset Flex CharStyle:Code
11673 \begin_layout Plain Layout
11686 whether this command should itself be protected.)
11689 \begin_layout Description
11690 \begin_inset Flex CharStyle:Code
11693 \begin_layout Plain Layout
11700 \begin_inset Flex CharStyle:Code
11703 \begin_layout Plain Layout
11710 \begin_inset Flex CharStyle:Code
11713 \begin_layout Plain Layout
11721 ] Whether newlines are translated into LaTeX newlines (
11722 \begin_inset Flex CharStyle:Code
11725 \begin_layout Plain Layout
11736 The translation can be switched off to allow more comfortable LaTeX editing
11740 \begin_layout Description
11741 \begin_inset Flex CharStyle:Code
11744 \begin_layout Plain Layout
11751 \begin_inset Flex CharStyle:Code
11754 \begin_layout Plain Layout
11761 \begin_inset Flex CharStyle:Code
11764 \begin_layout Plain Layout
11772 ] Whether the following Paragraph is allowed to indent its very first row.
11774 \begin_inset Flex CharStyle:Code
11777 \begin_layout Plain Layout
11783 means that it is not allowed to do so;
11784 \begin_inset Flex CharStyle:Code
11787 \begin_layout Plain Layout
11793 means it could do so if it wants to.
11796 \begin_layout Description
11797 \begin_inset Flex CharStyle:Code
11800 \begin_layout Plain Layout
11806 Name of a layout that has replaced this layout.
11807 This is used to rename a layout, while keeping backward compatibility.
11810 \begin_layout Description
11811 \begin_inset Flex CharStyle:Code
11814 \begin_layout Plain Layout
11821 \begin_inset Flex CharStyle:Code
11824 \begin_layout Plain Layout
11830 ] The number of optional arguments that can be used with this layout.
11831 This is useful for things like section headings, and only makes sense with
11835 \begin_layout Description
11836 \begin_inset Flex CharStyle:Code
11839 \begin_layout Plain Layout
11846 \begin_inset Flex CharStyle:Code
11849 \begin_layout Plain Layout
11855 ] The indent of the very first line of a paragraph.
11857 \begin_inset Flex CharStyle:Code
11860 \begin_layout Plain Layout
11866 will be fixed for a certain layout.
11867 The exception is Standard layout, since the indentation of a Standard layout
11868 paragraph can be prohibited with
11869 \begin_inset Flex CharStyle:Code
11872 \begin_layout Plain Layout
11879 Also, Standard layout paragraphs inside environments use the
11880 \begin_inset Flex CharStyle:Code
11883 \begin_layout Plain Layout
11889 of the environment, not their native one.
11890 For example, Standard paragraphs inside an enumeration are not indented.
11893 \begin_layout Description
11894 \begin_inset Flex CharStyle:Code
11897 \begin_layout Plain Layout
11904 \begin_inset Flex CharStyle:Code
11907 \begin_layout Plain Layout
11913 ] The vertical space between two paragraphs of this layout.
11916 \begin_layout Description
11917 \begin_inset Flex CharStyle:Code
11920 \begin_layout Plain Layout
11927 \begin_inset Flex CharStyle:Code
11930 \begin_layout Plain Layout
11936 ] LyX allows the user to choose either
11937 \begin_inset Quotes eld
11941 \begin_inset Quotes erd
11945 \begin_inset Quotes eld
11949 \begin_inset Quotes erd
11952 to typeset a document.
11954 \begin_inset Quotes eld
11958 \begin_inset Quotes erd
11961 is chosen, this value is completely ignored.
11963 \begin_inset Quotes eld
11967 \begin_inset Quotes erd
11970 is chosen, the parindent of a LaTeXtype
11971 \begin_inset Quotes eld
11975 \begin_inset Quotes erd
11978 layout is ignored and all paragraphs are separated by this parskip argument.
11979 The vertical space is calculated with
11980 \begin_inset Flex CharStyle:Code
11983 \begin_layout Plain Layout
11985 \begin_inset space ~
11994 \begin_inset Flex CharStyle:Code
11997 \begin_layout Plain Layout
12003 is the height of a row with the normal font.
12004 This way, the look stays the same with different screen fonts.
12007 \begin_layout Description
12008 \begin_inset Flex CharStyle:Code
12011 \begin_layout Plain Layout
12018 \begin_inset CommandInset label
12020 name "des:PathThru"
12027 \begin_inset Flex CharStyle:Code
12030 \begin_layout Plain Layout
12041 \begin_inset Flex CharStyle:Code
12044 \begin_layout Plain Layout
12050 ] Whether the contents of this paragraph should be output in raw form, meaning
12051 without special translations that LaTeX would require.
12054 \begin_layout Description
12055 \begin_inset Flex CharStyle:Code
12058 \begin_layout Plain Layout
12065 \begin_inset CommandInset label
12067 name "des:Preamble"
12071 Information to be included in the LaTeX preamble when this style is used.
12072 Used to define macros, load packages, etc., required by this particular
12075 \begin_inset Quotes eld
12079 \begin_inset Flex CharStyle:Code
12082 \begin_layout Plain Layout
12089 \begin_inset Quotes erd
12095 \begin_layout Description
12096 \begin_inset Flex CharStyle:Code
12099 \begin_layout Plain Layout
12106 \begin_inset Flex CharStyle:Code
12109 \begin_layout Plain Layout
12116 \begin_inset CommandInset label
12118 name "des:Requires"
12122 Whether the layout requires the feature
12123 \begin_inset Flex CharStyle:Code
12126 \begin_layout Plain Layout
12133 See the description of
12134 \begin_inset Flex CharStyle:Code
12137 \begin_layout Plain Layout
12144 \begin_inset CommandInset ref
12145 LatexCommand pageref
12146 reference "des:FreeSpacing"
12150 ) for information on `features'.
12154 \begin_layout Description
12155 \begin_inset Flex CharStyle:Code
12158 \begin_layout Plain Layout
12165 \begin_inset Flex CharStyle:Code
12168 \begin_layout Plain Layout
12175 \begin_inset Flex CharStyle:Code
12178 \begin_layout Plain Layout
12187 \begin_layout Description
12188 \begin_inset Flex CharStyle:Code
12191 \begin_layout Plain Layout
12198 \begin_inset Flex CharStyle:Code
12201 \begin_layout Plain Layout
12206 , onehalf, double, other
12215 ] This defines what the default spacing should be in the layout.
12217 \begin_inset Flex CharStyle:Code
12220 \begin_layout Plain Layout
12227 \begin_inset Flex CharStyle:Code
12230 \begin_layout Plain Layout
12237 \begin_inset Flex CharStyle:Code
12240 \begin_layout Plain Layout
12246 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
12247 If you specify the argument
12248 \begin_inset Flex CharStyle:Code
12251 \begin_layout Plain Layout
12257 , then you should also provide a numerical argument which will be the actual
12259 Note that, contrary to other parameters,
12260 \begin_inset Flex CharStyle:Code
12263 \begin_layout Plain Layout
12269 implies the generation of specific LaTeX code, using the package
12272 \begin_inset Flex CharStyle:Code
12275 \begin_layout Plain Layout
12284 \begin_layout Description
12285 \begin_inset Flex CharStyle:Code
12288 \begin_layout Plain Layout
12294 The font used for the text body .
12296 \begin_inset CommandInset ref
12298 reference "sub:Font-description"
12305 \begin_layout Description
12306 \begin_inset Flex CharStyle:Code
12309 \begin_layout Plain Layout
12318 \begin_inset Flex CharStyle:Code
12321 \begin_layout Plain Layout
12331 The level of the style in the table of contents.
12332 This is used for automatic numbering of section headings.
12335 \begin_layout Description
12336 \begin_inset Flex CharStyle:Code
12339 \begin_layout Plain Layout
12346 \begin_inset Flex CharStyle:Code
12349 \begin_layout Plain Layout
12355 ] The vertical space with which the very first of a chain of paragraphs
12356 with this layout is separated from the previous paragraph.
12357 If the previous paragraph has another layout, the separations are not simply
12358 added, but the maximum is taken.
12361 \begin_layout Subsection
12363 \begin_inset CommandInset label
12372 \begin_layout Standard
12373 Since version 1.3.0 of LyX, it is has been both possible and necessary to
12374 define the floats (
12375 \begin_inset Flex CharStyle:MenuItem
12378 \begin_layout Plain Layout
12385 \begin_inset Flex CharStyle:MenuItem
12388 \begin_layout Plain Layout
12394 , \SpecialChar \ldots{}
12395 ) in the text class itself.
12396 Standard floats are included in the file
12397 \begin_inset Flex CharStyle:Code
12400 \begin_layout Plain Layout
12406 , so you may have to do no more than add
12409 \begin_layout LyX-Code
12410 Input stdfloats.inc
12413 \begin_layout Standard
12414 to your layout file.
12415 If you want to implement a text class that proposes some other float types
12416 (like the AGU class bundled with LyX), the information below will hopefully
12420 \begin_layout Description
12421 \begin_inset Flex CharStyle:Code
12424 \begin_layout Plain Layout
12431 \begin_inset Flex CharStyle:Code
12434 \begin_layout Plain Layout
12441 \begin_inset Quotes erd
12445 \begin_inset Quotes erd
12448 ] The file name extension of an auxiliary file for the list of figures (or
12450 LaTeX writes the captions to this file.
12453 \begin_layout Description
12454 \begin_inset Flex CharStyle:Code
12457 \begin_layout Plain Layout
12464 \begin_inset Flex CharStyle:Code
12467 \begin_layout Plain Layout
12474 \begin_inset Quotes erd
12478 \begin_inset Quotes erd
12481 ] The string that will be used in the menus and also for the caption.
12482 This is translated to the current language if babel is used.
12485 \begin_layout Description
12486 \begin_inset Flex CharStyle:Code
12489 \begin_layout Plain Layout
12496 \begin_inset Flex CharStyle:Code
12499 \begin_layout Plain Layout
12508 \begin_inset Flex CharStyle:Code
12511 \begin_layout Plain Layout
12518 \begin_inset Flex CharStyle:Code
12521 \begin_layout Plain Layout
12527 if the float is already defined by the LaTeX document class.
12529 \begin_inset Flex CharStyle:Code
12532 \begin_layout Plain Layout
12538 , the float will be defined using the LaTeX package
12539 \begin_inset Flex CharStyle:Code
12542 \begin_layout Plain Layout
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
12572 \begin_inset Quotes erd
12576 \begin_inset Quotes erd
12579 ] The heading used for the list of floats.
12580 This is translated to the document language.
12583 \begin_layout Description
12584 \begin_inset Flex CharStyle:Code
12587 \begin_layout Plain Layout
12594 \begin_inset Flex CharStyle:Code
12597 \begin_layout Plain Layout
12604 \begin_inset Quotes erd
12608 \begin_inset Quotes erd
12611 ] This (optional) argument determines whether floats of this class will
12612 be numbered within some sectional unit of the document.
12613 For example, if within is equal to
12614 \begin_inset Flex CharStyle:Code
12617 \begin_layout Plain Layout
12623 , the floats will be numbered within chapters.
12627 \begin_layout Description
12628 \begin_inset Flex CharStyle:Code
12631 \begin_layout Plain Layout
12638 \begin_inset Flex CharStyle:Code
12641 \begin_layout Plain Layout
12648 \begin_inset Quotes erd
12652 \begin_inset Quotes erd
12655 ] The default placement for the given class of floats.
12656 The string should be as in standard LaTeX:
12657 \begin_inset Flex CharStyle:Code
12660 \begin_layout Plain Layout
12667 \begin_inset Flex CharStyle:Code
12670 \begin_layout Plain Layout
12677 \begin_inset Flex CharStyle:Code
12680 \begin_layout Plain Layout
12687 \begin_inset Flex CharStyle:Code
12690 \begin_layout Plain Layout
12696 for top, bottom, page, and here, respectively.
12700 \begin_layout Plain Layout
12701 Note that the order of these letters in the string is irrelevant, like in
12707 On top of that there is a new type,
12708 \begin_inset Flex CharStyle:Code
12711 \begin_layout Plain Layout
12717 , which does not really correspond to a float, since it means: put it
12718 \begin_inset Quotes eld
12722 \begin_inset Quotes erd
12726 Note however that the
12727 \begin_inset Flex CharStyle:Code
12730 \begin_layout Plain Layout
12736 specifier is special and, because of implementation details, cannot be
12737 used in non-built in float types.
12738 If you do not understand what this means, just use
12739 \begin_inset Quotes eld
12743 \begin_inset Flex CharStyle:Code
12746 \begin_layout Plain Layout
12753 \begin_inset Quotes erd
12759 \begin_layout Description
12760 \begin_inset Flex CharStyle:Code
12763 \begin_layout Plain Layout
12770 \begin_inset Flex CharStyle:Code
12773 \begin_layout Plain Layout
12780 \begin_inset Quotes erd
12784 \begin_inset Quotes erd
12787 ] The style used when defining the float using
12788 \begin_inset Flex CharStyle:Code
12791 \begin_layout Plain Layout
12802 \begin_layout Description
12803 \begin_inset Flex CharStyle:Code
12806 \begin_layout Plain Layout
12813 \begin_inset Flex CharStyle:Code
12816 \begin_layout Plain Layout
12823 \begin_inset Quotes erd
12827 \begin_inset Quotes erd
12831 \begin_inset Quotes eld
12835 \begin_inset Quotes erd
12838 of the new class of floats, like program or algorithm.
12839 After the appropriate
12840 \begin_inset Flex CharStyle:Code
12843 \begin_layout Plain Layout
12852 \begin_inset Flex CharStyle:Code
12855 \begin_layout Plain Layout
12864 \begin_inset Flex CharStyle:Code
12867 \begin_layout Plain Layout
12878 \begin_layout Standard
12879 Note that defining a float with type
12880 \begin_inset Flex CharStyle:Code
12883 \begin_layout Plain Layout
12891 automatically defines the corresponding counter with name
12892 \begin_inset Flex CharStyle:Code
12895 \begin_layout Plain Layout
12906 \begin_layout Subsection
12907 Flex insets and InsetLayout
12908 \begin_inset CommandInset label
12910 name "sub:Flex-insets-and"
12917 \begin_layout Standard
12918 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
12919 these are called Flex insets.
12923 \begin_layout Standard
12924 Flex insets come in three different kinds:
12927 \begin_layout Itemize
12929 \begin_inset Flex CharStyle:Code
12932 \begin_layout Plain Layout
12938 ): These define semantic markup corresponding to such LaTeX commands as
12940 \begin_inset Flex CharStyle:Code
12943 \begin_layout Plain Layout
12952 \begin_inset Flex CharStyle:Code
12955 \begin_layout Plain Layout
12966 \begin_layout Itemize
12968 \begin_inset Flex CharStyle:Code
12971 \begin_layout Plain Layout
12977 ): These can be used to define custom collapsible insets, similar to TeX
12978 code, footnote, and the like.
12979 An obvious example is an endnote inset, which is defined in the
12980 \begin_inset Flex CharStyle:Code
12983 \begin_layout Plain Layout
12992 \begin_layout Itemize
12994 \begin_inset Flex CharStyle:Code
12997 \begin_layout Plain Layout
13003 ): For use with DocBook classes.
13006 \begin_layout Standard
13007 Flex insets are defined using the
13008 \begin_inset Flex CharStyle:Code
13011 \begin_layout Plain Layout
13017 tag, which shall be explained in a moment.
13020 \begin_layout Standard
13022 \begin_inset Flex CharStyle:Code
13025 \begin_layout Plain Layout
13031 tag also serves another function: It can be used to customize the general
13032 layout of many different types of insets.
13034 \begin_inset Flex CharStyle:Code
13037 \begin_layout Plain Layout
13043 can be used to customize the layout parameters for footnotes, marginal
13044 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
13045 boxes, tables, algorithms, URLs, and optional arguments, as well as to
13046 define Flex insets.
13049 \begin_layout Standard
13051 \begin_inset Flex CharStyle:Code
13054 \begin_layout Plain Layout
13060 definition must begin with a line of the form:
13063 \begin_layout LyX-Code
13067 \begin_layout Standard
13069 \begin_inset Flex CharStyle:Code
13072 \begin_layout Plain Layout
13078 indicates the inset whose layout is being defined, and here there are two
13082 \begin_layout Enumerate
13083 The layout for a pre-existing inset is being modified.
13084 In this case, can be
13085 \begin_inset Flex CharStyle:Code
13088 \begin_layout Plain Layout
13094 any one of the following:
13095 \begin_inset Flex CharStyle:Code
13098 \begin_layout Plain Layout
13105 \begin_inset Flex CharStyle:Code
13108 \begin_layout Plain Layout
13115 \begin_inset Flex CharStyle:Code
13118 \begin_layout Plain Layout
13125 \begin_inset Flex CharStyle:Code
13128 \begin_layout Plain Layout
13135 \begin_inset Flex CharStyle:Code
13138 \begin_layout Plain Layout
13145 \begin_inset Flex CharStyle:Code
13148 \begin_layout Plain Layout
13155 \begin_inset Flex CharStyle:Code
13158 \begin_layout Plain Layout
13165 \begin_inset Flex CharStyle:Code
13168 \begin_layout Plain Layout
13175 \begin_inset Flex CharStyle:Code
13178 \begin_layout Plain Layout
13185 \begin_inset Flex CharStyle:Code
13188 \begin_layout Plain Layout
13195 \begin_inset Flex CharStyle:Code
13198 \begin_layout Plain Layout
13205 \begin_inset Flex CharStyle:Code
13208 \begin_layout Plain Layout
13215 \begin_inset Flex CharStyle:Code
13218 \begin_layout Plain Layout
13225 \begin_inset Flex CharStyle:Code
13228 \begin_layout Plain Layout
13235 \begin_inset Flex CharStyle:Code
13238 \begin_layout Plain Layout
13245 \begin_inset Flex CharStyle:Code
13248 \begin_layout Plain Layout
13255 \begin_inset Flex CharStyle:Code
13258 \begin_layout Plain Layout
13265 \begin_inset Flex CharStyle:Code
13268 \begin_layout Plain Layout
13275 \begin_inset Flex CharStyle:Code
13278 \begin_layout Plain Layout
13285 \begin_inset Flex CharStyle:Code
13288 \begin_layout Plain Layout
13297 \begin_layout Enumerate
13298 The layout for a Flex inset is being defined.
13300 \begin_inset Flex CharStyle:Code
13303 \begin_layout Plain Layout
13309 can be any valid identifier not used by a pre-existing inset.
13310 Note that the definition of a flex inset
13315 \begin_inset Flex CharStyle:Code
13318 \begin_layout Plain Layout
13324 entry, declaring which type of inset this is.
13327 \begin_layout Standard
13329 \begin_inset Flex CharStyle:Code
13332 \begin_layout Plain Layout
13338 definition can contain the following entries:
13341 \begin_layout Description
13342 \begin_inset Flex CharStyle:Code
13345 \begin_layout Plain Layout
13351 The color for the inset's background.
13352 The valid colors are defined in
13353 \begin_inset Flex CharStyle:Code
13356 \begin_layout Plain Layout
13365 \begin_layout Description
13366 \begin_inset Flex CharStyle:Code
13369 \begin_layout Plain Layout
13376 \begin_inset Flex CharStyle:Code
13379 \begin_layout Plain Layout
13388 \begin_inset Flex CharStyle:Code
13391 \begin_layout Plain Layout
13397 ] Whether to use the content of the inset as the label, when the inset is
13402 \begin_layout Description
13403 \begin_inset Flex CharStyle:Code
13406 \begin_layout Plain Layout
13412 As with paragraph styles (see page
13413 \begin_inset CommandInset ref
13415 reference "des:CopyStyle"
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
13445 \begin_inset Flex CharStyle:Code
13448 \begin_layout Plain Layout
13454 ] Indicates whether the user may employ the Paragraph Settings dialog to
13455 customize the paragraph.
13458 \begin_layout Description
13459 \begin_inset Flex CharStyle:Code
13462 \begin_layout Plain Layout
13469 \begin_inset Flex CharStyle:Code
13472 \begin_layout Plain Layout
13479 \begin_inset Flex CharStyle:Code
13482 \begin_layout Plain Layout
13489 \begin_inset Flex CharStyle:Code
13492 \begin_layout Plain Layout
13498 , describing the rendering style used for the inset's frame and buttons.
13499 Footnotes generally use
13500 \begin_inset Flex CharStyle:Code
13503 \begin_layout Plain Layout
13509 , ERT insets generally
13510 \begin_inset Flex CharStyle:Code
13513 \begin_layout Plain Layout
13519 , and character styles
13520 \begin_inset Flex CharStyle:Code
13523 \begin_layout Plain Layout
13532 \begin_layout Description
13533 \begin_inset Flex CharStyle:Code
13536 \begin_layout Plain Layout
13542 Required at the end of the InsetLayout declarations.
13545 \begin_layout Description
13546 \begin_inset Flex CharStyle:Code
13549 \begin_layout Plain Layout
13555 The font used for both the text body
13561 \begin_inset space ~
13565 \begin_inset CommandInset ref
13567 reference "sub:Font-description"
13572 Note that defining this font automatically defines the
13573 \begin_inset Flex CharStyle:Code
13576 \begin_layout Plain Layout
13582 to the same value, so define this first and define
13583 \begin_inset Flex CharStyle:Code
13586 \begin_layout Plain Layout
13592 later if you want them to be different.
13595 \begin_layout Description
13596 \begin_inset Flex CharStyle:Code
13599 \begin_layout Plain Layout
13606 \begin_inset Quotes eld
13610 \begin_inset Quotes erd
13613 language, leading to Left-to-Right (latin) output, e.
13614 \begin_inset space \thinspace{}
13618 \begin_inset space \space{}
13621 in TeX code or URL.
13625 \begin_layout Description
13626 \begin_inset Flex CharStyle:Code
13629 \begin_layout Plain Layout
13636 \begin_inset Flex CharStyle:Code
13639 \begin_layout Plain Layout
13648 \begin_inset Flex CharStyle:Code
13651 \begin_layout Plain Layout
13657 ] Indicates whether the PlainLayout should be used or, instead, the user
13658 can change the paragraph style used in the inset.
13662 \begin_layout Description
13663 \begin_inset Flex CharStyle:Code
13666 \begin_layout Plain Layout
13672 As with paragraph styles (see page
13673 \begin_inset CommandInset ref
13674 LatexCommand pageref
13675 reference "des:FreeSpacing"
13683 \begin_layout Description
13684 \begin_inset Flex CharStyle:Code
13687 \begin_layout Plain Layout
13693 These tags control XHTML output.
13697 \begin_layout Description
13698 \begin_inset Flex CharStyle:Code
13701 \begin_layout Plain Layout
13708 \begin_inset Flex CharStyle:Code
13711 \begin_layout Plain Layout
13720 \begin_inset Flex CharStyle:Code
13723 \begin_layout Plain Layout
13729 ] Whether to include the contents of this inset in the strings generated
13730 for the `Outline' pane.
13731 One would not, for example, want the content of a footnote in a section
13732 header to be included in the TOC displayed in the outline, but one would
13733 normally want the content of a character style displayed.
13734 Default is false: not to include.
13737 \begin_layout Description
13738 \begin_inset Flex CharStyle:Code
13741 \begin_layout Plain Layout
13747 As with paragraph styles (see page
13748 \begin_inset CommandInset ref
13749 LatexCommand pageref
13750 reference "des:KeepEmpty"
13758 \begin_layout Description
13759 \begin_inset Flex CharStyle:Code
13762 \begin_layout Plain Layout
13768 The font used for the label.
13770 \begin_inset space ~
13774 \begin_inset CommandInset ref
13776 reference "sub:Font-description"
13781 Note that this definition can never appear before
13782 \begin_inset Flex CharStyle:Code
13785 \begin_layout Plain Layout
13791 , lest it be ineffective.
13794 \begin_layout Description
13795 \begin_inset Flex CharStyle:Code
13798 \begin_layout Plain Layout
13804 What will be displayed on the button or elsewhere as the inset label.
13805 Some inset types (TeX code and Branch) modify this label on the fly.
13808 \begin_layout Description
13809 \begin_inset Flex CharStyle:Code
13812 \begin_layout Plain Layout
13818 The name of the corresponding LaTeX stuff.
13819 Either the environment or command name.
13822 \begin_layout Description
13823 \begin_inset Flex CharStyle:Code
13826 \begin_layout Plain Layout
13832 The optional parameter for the corresponding
13833 \begin_inset Flex CharStyle:Code
13836 \begin_layout Plain Layout
13842 stuff, including possible bracket pairs like
13843 \begin_inset Flex CharStyle:Code
13846 \begin_layout Plain Layout
13853 This parameter cannot be changed from within LyX.
13856 \begin_layout Description
13857 \begin_inset Flex CharStyle:Code
13860 \begin_layout Plain Layout
13866 As with paragraph styles (see page
13867 \begin_inset CommandInset ref
13868 LatexCommand pageref
13869 reference "des:LatexType"
13876 \begin_layout Description
13877 \begin_inset Flex CharStyle:Code
13880 \begin_layout Plain Layout
13887 \begin_inset Flex CharStyle:Code
13890 \begin_layout Plain Layout
13897 \begin_inset Flex CharStyle:Code
13900 \begin_layout Plain Layout
13907 \begin_inset Flex CharStyle:Code
13910 \begin_layout Plain Layout
13917 \begin_inset Flex CharStyle:Code
13920 \begin_layout Plain Layout
13926 (indicating a dummy definition ending definitions of charstyles, etc).
13927 This entry is required in and is only meaningful for Flex insets.
13928 Among other things, it determines on which menu this inset will appear.
13931 \begin_layout Description
13932 \begin_inset Flex CharStyle:Code
13935 \begin_layout Plain Layout
13942 \begin_inset Flex CharStyle:Code
13945 \begin_layout Plain Layout
13954 \begin_inset Flex CharStyle:Code
13957 \begin_layout Plain Layout
13963 ] Whether multiple paragraphs are permitted in this inset.
13965 \begin_inset Flex CharStyle:Code
13968 \begin_layout Plain Layout
13974 to the same value and
13975 \begin_inset Flex CharStyle:Code
13978 \begin_layout Plain Layout
13984 to the opposite value.
13985 These can be reset to other values, if they are used
13990 \begin_inset Flex CharStyle:Code
13993 \begin_layout Plain Layout
14003 \begin_layout Description
14004 \begin_inset Flex CharStyle:Code
14007 \begin_layout Plain Layout
14014 \begin_inset Flex CharStyle:Code
14017 \begin_layout Plain Layout
14026 \begin_inset Flex CharStyle:Code
14029 \begin_layout Plain Layout
14035 ] Whether fragile commands in this layout should be
14036 \begin_inset Flex CharStyle:Code
14039 \begin_layout Plain Layout
14052 whether the command should itself be protected.) Default is false.
14055 \begin_layout Description
14056 \begin_inset Flex CharStyle:Code
14059 \begin_layout Plain Layout
14066 \begin_inset Flex CharStyle:Code
14069 \begin_layout Plain Layout
14078 \begin_inset Flex CharStyle:Code
14081 \begin_layout Plain Layout
14087 ] As with paragraph styles (see page
14088 \begin_inset CommandInset ref
14089 LatexCommand pageref
14090 reference "des:PathThru"
14098 \begin_layout Description
14099 \begin_inset Flex CharStyle:Code
14102 \begin_layout Plain Layout
14108 As with paragraph styles (see page
14109 \begin_inset CommandInset ref
14110 LatexCommand pageref
14111 reference "des:Preamble"
14118 \begin_layout Description
14119 \begin_inset Flex CharStyle:Code
14122 \begin_layout Plain Layout
14129 \begin_inset Flex CharStyle:Code
14132 \begin_layout Plain Layout
14138 ] As with paragraph styles (see page
14139 \begin_inset CommandInset ref
14140 LatexCommand pageref
14141 reference "des:Requires"
14148 \begin_layout Subsection
14150 \begin_inset CommandInset label
14152 name "sub:Counters"
14159 \begin_layout Standard
14160 Since version 1.3.0 of LyX, it is both possible and necessary to define the
14162 \begin_inset Flex CharStyle:MenuItem
14165 \begin_layout Plain Layout
14172 \begin_inset Flex CharStyle:MenuItem
14175 \begin_layout Plain Layout
14181 , \SpecialChar \ldots{}
14182 ) in the text class itself.
14183 The standard counters are defined in the file
14184 \begin_inset Flex CharStyle:Code
14187 \begin_layout Plain Layout
14193 , so you may have to do no more than add
14196 \begin_layout LyX-Code
14197 Input stdcounters.inc
14200 \begin_layout Standard
14201 to your layout file to get them to work.
14202 But if you want to define custom counters, then you can do so.
14203 The counter declaration must begin with:
14206 \begin_layout LyX-Code
14207 Counter CounterName
14210 \begin_layout Standard
14212 \begin_inset Flex CharStyle:Code
14215 \begin_layout Plain Layout
14221 ' is replaced by the name of the counter.
14222 And it must end with
14223 \begin_inset Quotes eld
14227 \begin_inset Flex CharStyle:Code
14230 \begin_layout Plain Layout
14237 \begin_inset Quotes erd
14241 The following parameters can also be used:
14244 \begin_layout Description
14245 \begin_inset Flex CharStyle:Code
14248 \begin_layout Plain Layout
14249 LabelString [string=""]
14254 when this is defined, this string defines how the counter is displayed.
14255 Setting this value sets
14256 \begin_inset Flex CharStyle:Code
14259 \begin_layout Plain Layout
14260 LabelStringAppendix
14266 The following special constructs can be used in the string:
14270 \begin_layout Itemize
14271 \begin_inset Flex CharStyle:Code
14274 \begin_layout Plain Layout
14282 will be replaced by the expansion of the
14283 \begin_inset Flex CharStyle:Code
14286 \begin_layout Plain Layout
14293 \begin_inset Flex CharStyle:Code
14296 \begin_layout Plain Layout
14297 LabelStringAppendix
14303 \begin_inset Flex CharStyle:Code
14306 \begin_layout Plain Layout
14316 \begin_layout Itemize
14317 counter values can be expressed using LaTeX-like macros
14318 \begin_inset Flex CharStyle:Code
14321 \begin_layout Plain Layout
14338 \begin_inset Flex CharStyle:Code
14341 \begin_layout Plain Layout
14353 \begin_layout Plain Layout
14363 Actually, the situation is a bit more complicated: any
14382 other than those described below will produce arabic numerals.
14383 It would not be surprising to see this change in the future.
14389 \begin_inset Flex CharStyle:Code
14392 \begin_layout Plain Layout
14398 : 1, 2, 3,\SpecialChar \ldots{}
14400 \begin_inset Flex CharStyle:Code
14403 \begin_layout Plain Layout
14409 for lower-case letters: a, b, c, \SpecialChar \ldots{}
14411 \begin_inset Flex CharStyle:Code
14414 \begin_layout Plain Layout
14420 for upper-case letters: A, B, C, \SpecialChar \ldots{}
14422 \begin_inset Flex CharStyle:Code
14425 \begin_layout Plain Layout
14431 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
14433 \begin_inset Flex CharStyle:Code
14436 \begin_layout Plain Layout
14442 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
14444 \begin_inset Flex CharStyle:Code
14447 \begin_layout Plain Layout
14453 for hebrew numerals.
14457 \begin_layout Standard
14458 If LabelString is not defined, a default value is constructed as follows:
14459 if the counter has a master counter
14460 \begin_inset Flex CharStyle:Code
14463 \begin_layout Plain Layout
14470 \begin_inset Flex CharStyle:Code
14473 \begin_layout Plain Layout
14480 \begin_inset Flex CharStyle:Code
14483 \begin_layout Plain Layout
14493 is used; otherwise the string
14494 \begin_inset Flex CharStyle:Code
14497 \begin_layout Plain Layout
14508 \begin_layout Description
14509 \begin_inset Flex CharStyle:Code
14512 \begin_layout Plain Layout
14513 LabelStringAppendix [string=""]
14519 \begin_inset Flex CharStyle:Code
14522 \begin_layout Plain Layout
14528 , but for use in the Appendix.
14531 \begin_layout Description
14532 \begin_inset Flex CharStyle:Code
14535 \begin_layout Plain Layout
14542 \begin_inset Flex CharStyle:Code
14545 \begin_layout Plain Layout
14552 \begin_inset Quotes erd
14556 \begin_inset Quotes erd
14559 ] If this is set to the name of another counter, the present counter will
14560 be reset every time the other one is increased.
14562 \begin_inset Flex CharStyle:Code
14565 \begin_layout Plain Layout
14572 \begin_inset Flex CharStyle:Code
14575 \begin_layout Plain Layout
14584 \begin_layout Subsection
14586 \begin_inset CommandInset label
14588 name "sub:Font-description"
14595 \begin_layout Standard
14596 A font description looks like this:
14599 \begin_layout LyX-Code
14609 \begin_layout LyX-Code
14613 \begin_layout LyX-Code
14617 \begin_layout Standard
14618 The following commands are available:
14621 \begin_layout Description
14622 \begin_inset Flex CharStyle:Code
14625 \begin_layout Plain Layout
14632 \begin_inset Flex CharStyle:Code
14635 \begin_layout Plain Layout
14644 \begin_inset Flex CharStyle:Code
14647 \begin_layout Plain Layout
14654 \begin_inset Flex CharStyle:Code
14657 \begin_layout Plain Layout
14664 \begin_inset Flex CharStyle:Code
14667 \begin_layout Plain Layout
14674 \begin_inset Flex CharStyle:Code
14677 \begin_layout Plain Layout
14684 \begin_inset Flex CharStyle:Code
14687 \begin_layout Plain Layout
14694 \begin_inset Flex CharStyle:Code
14697 \begin_layout Plain Layout
14704 \begin_inset Flex CharStyle:Code
14707 \begin_layout Plain Layout
14714 \begin_inset Flex CharStyle:Code
14717 \begin_layout Plain Layout
14726 \begin_layout Description
14727 \begin_inset Flex CharStyle:Code
14730 \begin_layout Plain Layout
14739 \begin_inset Flex CharStyle:Code
14742 \begin_layout Plain Layout
14753 \begin_inset Flex CharStyle:Code
14756 \begin_layout Plain Layout
14763 \begin_inset Flex CharStyle:Code
14766 \begin_layout Plain Layout
14775 \begin_layout Description
14776 \begin_inset Flex CharStyle:Code
14779 \begin_layout Plain Layout
14786 \begin_inset Flex CharStyle:Code
14789 \begin_layout Plain Layout
14795 ] Valid arguments are:
14796 \begin_inset Flex CharStyle:Code
14799 \begin_layout Plain Layout
14806 \begin_inset Flex CharStyle:Code
14809 \begin_layout Plain Layout
14816 \begin_inset Flex CharStyle:Code
14819 \begin_layout Plain Layout
14826 \begin_inset Flex CharStyle:Code
14829 \begin_layout Plain Layout
14836 \begin_inset Flex CharStyle:Code
14839 \begin_layout Plain Layout
14846 \begin_inset Flex CharStyle:Code
14849 \begin_layout Plain Layout
14856 Each of these turns on or off the corresponding attribute.
14858 \begin_inset Flex CharStyle:Code
14861 \begin_layout Plain Layout
14867 turns on emphasis, and
14868 \begin_inset Flex CharStyle:Code
14871 \begin_layout Plain Layout
14879 \begin_inset Newline newline
14882 If the latter seems puzzling, remember that the font settings for the present
14883 context are generally inherited from the surrounding context.
14885 \begin_inset Flex CharStyle:Code
14888 \begin_layout Plain Layout
14894 would turn off the emphasis that was anyway in effect, say, in a theorem
14898 \begin_layout Description
14899 \begin_inset Flex CharStyle:Code
14902 \begin_layout Plain Layout
14911 \begin_inset Flex CharStyle:Code
14914 \begin_layout Plain Layout
14925 \begin_inset Flex CharStyle:Code
14928 \begin_layout Plain Layout
14937 \begin_layout Description
14938 \begin_inset Flex CharStyle:Code
14941 \begin_layout Plain Layout
14950 \begin_inset Flex CharStyle:Code
14953 \begin_layout Plain Layout
14964 \begin_inset Flex CharStyle:Code
14967 \begin_layout Plain Layout
14974 \begin_inset Flex CharStyle:Code
14977 \begin_layout Plain Layout
14984 \begin_inset Flex CharStyle:Code
14987 \begin_layout Plain Layout
14996 \begin_layout Description
14997 \begin_inset Flex CharStyle:Code
15000 \begin_layout Plain Layout
15007 \begin_inset Flex CharStyle:Code
15010 \begin_layout Plain Layout
15017 \begin_inset Flex CharStyle:Code
15020 \begin_layout Plain Layout
15027 \begin_inset Flex CharStyle:Code
15030 \begin_layout Plain Layout
15039 \begin_inset Flex CharStyle:Code
15042 \begin_layout Plain Layout
15049 \begin_inset Flex CharStyle:Code
15052 \begin_layout Plain Layout
15059 \begin_inset Flex CharStyle:Code
15062 \begin_layout Plain Layout
15069 \begin_inset Flex CharStyle:Code
15072 \begin_layout Plain Layout
15079 \begin_inset Flex CharStyle:Code
15082 \begin_layout Plain Layout
15091 \begin_layout Section
15092 \begin_inset CommandInset label
15094 name "sec:Tags-for-XHTML"
15098 Tags for XHTML output
15101 \begin_layout Standard
15102 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
15103 by layout information.
15104 In general, LyX provides sensible defaults and, as mentioned earlier, it
15105 will even construct default CSS style rules from the other layout tags.
15106 For example, LyX will attempt to use the information provided in the
15107 \begin_inset Flex CharStyle:Code
15110 \begin_layout Plain Layout
15116 declaration for the Chapter style to write CSS that will appropriately
15117 format chapter headings.
15120 \begin_layout Standard
15121 In many cases, then, you may not have to do anything at all to get acceptable
15122 XHTML output for your own environments, custom insets, and so forth.
15123 But in some cases you will, and so LyX provides a number of layout tags
15124 that can be used to customize the XHTML and CSS that are generated.
15127 \begin_layout Standard
15128 Note that there are two tags,
15129 \begin_inset Flex CharStyle:Code
15132 \begin_layout Plain Layout
15139 \begin_inset Flex CharStyle:Code
15142 \begin_layout Plain Layout
15148 that may appear outside style and inset declarations.
15150 \begin_inset CommandInset ref
15151 LatexCommand prettyref
15152 reference "sub:General-text-class"
15156 for details on these.
15159 \begin_layout Subsection
15160 \begin_inset CommandInset label
15162 name "sub:Paragraph-Style-XHTML"
15169 \begin_layout Standard
15170 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
15171 dealing with a normal paragraph, a command, or an environment, where this
15172 is itself determined by the contents of the corresponding
15173 \begin_inset Flex CharStyle:Code
15176 \begin_layout Plain Layout
15186 \begin_layout Standard
15187 For a command or normal paragraph, the output XHTML has the following form:
15190 \begin_layout LyX-Code
15192 \begin_inset Quotes erd
15196 \begin_inset Quotes erd
15202 \begin_layout LyX-Code
15204 \begin_inset Quotes erd
15208 \begin_inset Quotes erd
15214 \begin_layout LyX-Code
15215 Contents of the paragraph.
15218 \begin_layout LyX-Code
15222 \begin_layout Standard
15223 The label tags are of course omitted if the paragraph does not have a label.
15226 \begin_layout Standard
15227 For an environment that is not some sort of list, the XHTML takes this form:
15230 \begin_layout LyX-Code
15232 \begin_inset Quotes erd
15236 \begin_inset Quotes erd
15242 \begin_layout LyX-Code
15244 \begin_inset Quotes erd
15248 \begin_inset Quotes erd
15252 \begin_inset Quotes erd
15256 \begin_inset Quotes erd
15259 >Environment Label</labeltag>First paragraph.</itemtag>
15262 \begin_layout LyX-Code
15263 <itemtag>Second paragraph.</itemtag>
15266 \begin_layout LyX-Code
15270 \begin_layout Standard
15271 Note that the label is output only for the first paragraph, as it should
15272 be for a theorem, for example.
15276 \begin_layout Standard
15277 For a list, we have one of these forms:
15280 \begin_layout LyX-Code
15282 \begin_inset Quotes erd
15286 \begin_inset Quotes erd
15292 \begin_layout LyX-Code
15294 \begin_inset Quotes erd
15298 \begin_inset Quotes erd
15302 \begin_inset Quotes erd
15306 \begin_inset Quotes erd
15309 >List Label</labeltag>First item.</itemtag>
15312 \begin_layout LyX-Code
15314 \begin_inset Quotes erd
15318 \begin_inset Quotes erd
15322 \begin_inset Quotes erd
15326 \begin_inset Quotes erd
15329 >List Label</labeltag>Second item.</itemtag>
15332 \begin_layout LyX-Code
15336 \begin_layout LyX-Code
15340 \begin_layout LyX-Code
15342 \begin_inset Quotes erd
15346 \begin_inset Quotes erd
15352 \begin_layout LyX-Code
15354 \begin_inset Quotes erd
15358 \begin_inset Quotes erd
15361 >List Label</labeltag><itemtag attr=
15362 \begin_inset Quotes erd
15366 \begin_inset Quotes erd
15369 >First item.</itemtag>
15372 \begin_layout LyX-Code
15374 \begin_inset Quotes erd
15378 \begin_inset Quotes erd
15381 >List Label</labeltag><itemtag attr=
15382 \begin_inset Quotes erd
15386 \begin_inset Quotes erd
15389 >Second item.</itemtag>
15392 \begin_layout LyX-Code
15396 \begin_layout Standard
15397 Note the different orders of
15398 \begin_inset Flex CharStyle:Code
15401 \begin_layout Plain Layout
15408 \begin_inset Flex CharStyle:Code
15411 \begin_layout Plain Layout
15418 Which order we get depends upon the setting of
15419 \begin_inset Flex CharStyle:Code
15422 \begin_layout Plain Layout
15429 \begin_inset Flex CharStyle:Code
15432 \begin_layout Plain Layout
15438 is false (the default), you get the first of these, with the label within
15439 the item; if true, you get the second, with the label outside the item.
15442 \begin_layout Standard
15443 The specific tags and attributes output for each paragraph type can be controlle
15444 d by means of the layout tags we are about to describe.
15445 As mentioned earlier, however, LyX uses sensible defaults for many of these,
15446 so you often may not need to do very much to get good XHTML output.
15447 Think of the available tags as there so you can tweak things to your liking.
15450 \begin_layout Description
15451 \begin_inset Flex CharStyle:Code
15454 \begin_layout Plain Layout
15461 \begin_inset Flex CharStyle:Code
15464 \begin_layout Plain Layout
15470 ] Specifies attribute information to be output with the main tag.
15472 \begin_inset Quotes eld
15476 \begin_inset Flex CharStyle:Code
15479 \begin_layout Plain Layout
15486 \begin_inset Quotes erd
15490 By default, LyX will output
15491 \begin_inset Quotes eld
15495 \begin_inset Flex CharStyle:Code
15498 \begin_layout Plain Layout
15505 \begin_inset Quotes erd
15509 \begin_inset Flex CharStyle:Code
15512 \begin_layout Plain Layout
15518 is the LyX name of the layout, made lowercase, for example: chapter.
15521 \begin_layout Description
15522 \begin_inset Flex CharStyle:Code
15525 \begin_layout Plain Layout
15532 \begin_inset Flex CharStyle:Code
15535 \begin_layout Plain Layout
15541 ] Whether to output the default CSS information LyX generates for this layout,
15542 even if additional information is explicitly provided via
15543 \begin_inset Flex CharStyle:Code
15546 \begin_layout Plain Layout
15554 \begin_inset Flex CharStyle:Code
15557 \begin_layout Plain Layout
15563 allows you to alter or augment the generated CSS, rather than to override
15566 \begin_inset Flex CharStyle:Code
15569 \begin_layout Plain Layout
15578 \begin_layout Description
15579 \begin_inset Flex CharStyle:Code
15582 \begin_layout Plain Layout
15589 \begin_inset Flex CharStyle:Code
15592 \begin_layout Plain Layout
15598 ] The tag to be used for individual paragraphs of environments, replacing
15600 \begin_inset Flex CharStyle:Code
15603 \begin_layout Plain Layout
15609 in the examples above.
15611 \begin_inset Flex CharStyle:Code
15614 \begin_layout Plain Layout
15623 \begin_layout Description
15624 \begin_inset Flex CharStyle:Code
15627 \begin_layout Plain Layout
15634 \begin_inset Flex CharStyle:Code
15637 \begin_layout Plain Layout
15643 ] Attributes for the item tag.
15645 \begin_inset Quotes eld
15649 \begin_inset Flex CharStyle:Code
15652 \begin_layout Plain Layout
15653 class=`layoutname_item'
15659 \begin_inset Quotes erd
15665 \begin_layout Description
15666 \begin_inset Flex CharStyle:Code
15669 \begin_layout Plain Layout
15676 \begin_inset Flex CharStyle:Code
15679 \begin_layout Plain Layout
15685 ] The tag to be used for paragraph and item labels, replacing
15686 \begin_inset Flex CharStyle:Code
15689 \begin_layout Plain Layout
15695 in the examples above.
15697 \begin_inset Flex CharStyle:Code
15700 \begin_layout Plain Layout
15709 \begin_layout Description
15710 \begin_inset Flex CharStyle:Code
15713 \begin_layout Plain Layout
15720 \begin_inset Flex CharStyle:Code
15723 \begin_layout Plain Layout
15729 ] Attributes for the label tag.
15731 \begin_inset Quotes eld
15735 \begin_inset Flex CharStyle:Code
15738 \begin_layout Plain Layout
15739 class=`layoutname_label'
15745 \begin_inset Quotes erd
15751 \begin_layout Description
15752 \begin_inset Flex CharStyle:Code
15755 \begin_layout Plain Layout
15762 \begin_inset Flex CharStyle:Code
15765 \begin_layout Plain Layout
15771 ] Meaningful only for list-like environments, this tag controls whether
15772 the label tag is output before or inside the item tag.
15773 This is used, for example, in the description environment, where we want
15775 \begin_inset Flex CharStyle:Code
15778 \begin_layout Plain Layout
15779 <dt>\SpecialChar \ldots{}
15780 </dt><dd>\SpecialChar \ldots{}
15788 \begin_inset Flex CharStyle:Code
15791 \begin_layout Plain Layout
15797 : The label tag is output inside the item tag.
15800 \begin_layout Description
15801 \begin_inset Flex CharStyle:Code
15804 \begin_layout Plain Layout
15810 Information to be output in the
15811 \begin_inset Flex CharStyle:Code
15814 \begin_layout Plain Layout
15820 section when this style is used.
15821 This might, for example, be used to include a
15822 \begin_inset Flex CharStyle:Code
15825 \begin_layout Plain Layout
15832 \begin_inset Flex CharStyle:Code
15835 \begin_layout Plain Layout
15844 \begin_layout Description
15845 \begin_inset Flex CharStyle:Code
15848 \begin_layout Plain Layout
15854 CSS style information to be included when this style is used.
15855 Note that this will automatically be wrapped in a layout-generated
15856 \begin_inset Flex CharStyle:Code
15859 \begin_layout Plain Layout
15865 block, so only the CSS itself need be included.
15868 \begin_layout Description
15869 \begin_inset Flex CharStyle:Code
15872 \begin_layout Plain Layout
15879 \begin_inset Flex CharStyle:Code
15882 \begin_layout Plain Layout
15888 ] The tag to be used for the main label, replacing
15889 \begin_inset Flex CharStyle:Code
15892 \begin_layout Plain Layout
15898 in the examples above.
15900 \begin_inset Flex CharStyle:Code
15903 \begin_layout Plain Layout
15912 \begin_layout Subsection
15916 \begin_layout Standard
15917 The XHTML output of insets can also be controlled by information in layout
15922 \begin_layout Plain Layout
15923 At present, this is true only for
15924 \begin_inset Quotes eld
15928 \begin_inset Quotes erd
15931 insets (insets you can type into) and is not true for
15932 \begin_inset Quotes eld
15936 \begin_inset Quotes erd
15939 insets (insets that are associated with dialog boxes).
15944 Here, too, LyX tries to provide sensible defaults, and it constructs default
15946 But everything can be customized.
15949 \begin_layout Standard
15950 The XHTML LyX outputs for an inset has the following form:
15953 \begin_layout LyX-Code
15955 \begin_inset Quotes erd
15959 \begin_inset Quotes erd
15965 \begin_layout LyX-Code
15966 <labeltag>Label</labeltag>
15969 \begin_layout LyX-Code
15971 \begin_inset Quotes erd
15975 \begin_inset Quotes erd
15978 >Contents of the inset.</innertag>
15981 \begin_layout LyX-Code
15985 \begin_layout Standard
15986 If the inset permits multiple paragraphs---that is, if
15987 \begin_inset Flex CharStyle:Code
15990 \begin_layout Plain Layout
15996 is true---then the contents of the inset will itself be output as paragraphs
15997 formatted according to the styles used for those paragraphs (standard,
15998 quote, and the like).
15999 The label tag is of course omitted if the paragraph does not have a label
16000 and, at present, is always
16001 \begin_inset Flex CharStyle:Code
16004 \begin_layout Plain Layout
16011 The inner tag is optional and, by default, does not appear.
16014 \begin_layout Standard
16015 The specific tags and attributes output for each inset can be controlled
16016 by means of the following layout tags.
16019 \begin_layout Description
16020 \begin_inset Flex CharStyle:Code
16023 \begin_layout Plain Layout
16030 \begin_inset Flex CharStyle:Code
16033 \begin_layout Plain Layout
16039 ] Specifies attribute information to be output with the main tag.
16041 \begin_inset Quotes eld
16045 \begin_inset Flex CharStyle:Code
16048 \begin_layout Plain Layout
16049 class=`myinset' onclick=`\SpecialChar \ldots{}
16056 \begin_inset Quotes erd
16060 By default, LyX will output
16061 \begin_inset Quotes eld
16065 \begin_inset Flex CharStyle:Code
16068 \begin_layout Plain Layout
16075 \begin_inset Quotes erd
16079 \begin_inset Flex CharStyle:Code
16082 \begin_layout Plain Layout
16088 is the LyX name of the inset, made lowercase and with non-alphanumeric
16089 characters converted to underscores, for example: footnote.
16092 \begin_layout Description
16093 \begin_inset Flex CharStyle:Code
16096 \begin_layout Plain Layout
16103 \begin_inset Flex CharStyle:Code
16106 \begin_layout Plain Layout
16116 ] Whether to output the default CSS information LyX generates for this layout,
16117 even if additional information is explicitly provided via
16118 \begin_inset Flex CharStyle:Code
16121 \begin_layout Plain Layout
16129 \begin_inset Flex CharStyle:Code
16132 \begin_layout Plain Layout
16138 allows you to alter or augment the generated CSS, rather than to override
16143 \begin_layout Description
16144 \begin_inset Flex CharStyle:Code
16147 \begin_layout Plain Layout
16154 \begin_inset Flex CharStyle:Code
16157 \begin_layout Plain Layout
16163 ] Attributes for the inner tag.
16165 \begin_inset Quotes eld
16169 \begin_inset Flex CharStyle:Code
16172 \begin_layout Plain Layout
16173 class=`insetname_inner'
16179 \begin_inset Quotes erd
16185 \begin_layout Description
16186 \begin_inset Flex CharStyle:Code
16189 \begin_layout Plain Layout
16196 \begin_inset Flex CharStyle:Code
16199 \begin_layout Plain Layout
16205 ] The inner tag, replacing
16206 \begin_inset Flex CharStyle:Code
16209 \begin_layout Plain Layout
16215 in the examples above.
16216 By default, there is none.
16219 \begin_layout Description
16220 \begin_inset Flex CharStyle:Code
16223 \begin_layout Plain Layout
16230 \begin_inset Flex CharStyle:Code
16233 \begin_layout Plain Layout
16241 ] Whether this inset represents a standalone block of text (such as a footnote)
16242 or instead represents material that is included in the surrounding text
16243 (such as a branch).
16247 \begin_layout Description
16248 \begin_inset Flex CharStyle:Code
16251 \begin_layout Plain Layout
16258 \begin_inset Flex CharStyle:Code
16261 \begin_layout Plain Layout
16267 ] A label for this inset, possibly including a reference to a counter.
16268 For example, for footnote, it might be:
16269 \begin_inset Flex CharStyle:Code
16272 \begin_layout Plain Layout
16281 This is optional, and there is no default.
16284 \begin_layout Description
16285 \begin_inset Flex CharStyle:Code
16288 \begin_layout Plain Layout
16294 Information to be output in the
16295 \begin_inset Flex CharStyle:Code
16298 \begin_layout Plain Layout
16304 section when this style is used.
16305 This might, for example, be used to include a
16306 \begin_inset Flex CharStyle:Code
16309 \begin_layout Plain Layout
16316 \begin_inset Flex CharStyle:Code
16319 \begin_layout Plain Layout
16328 \begin_layout Description
16329 \begin_inset Flex CharStyle:Code
16332 \begin_layout Plain Layout
16338 CSS style information to be included when this style is used.
16339 Note that this will automatically be wrapped in a layout-generated
16340 \begin_inset Flex CharStyle:Code
16343 \begin_layout Plain Layout
16349 block, so only the CSS itself need be included.
16352 \begin_layout Description
16353 \begin_inset Flex CharStyle:Code
16356 \begin_layout Plain Layout
16363 \begin_inset Flex CharStyle:Code
16366 \begin_layout Plain Layout
16372 ] The tag to be used for the main label, replacing
16373 \begin_inset Flex CharStyle:Code
16376 \begin_layout Plain Layout
16382 in the examples above.
16383 The default depends upon the setting of
16384 \begin_inset Flex CharStyle:Code
16387 \begin_layout Plain Layout
16394 \begin_inset Flex CharStyle:Code
16397 \begin_layout Plain Layout
16403 is true, the default is
16404 \begin_inset Flex CharStyle:Code
16407 \begin_layout Plain Layout
16413 ; if it is false, the default is
16414 \begin_inset Flex CharStyle:Code
16417 \begin_layout Plain Layout
16426 \begin_layout Description
16427 \begin_inset Note Note
16430 \begin_layout Subsection
16434 \begin_layout Plain Layout
16435 We have several times mentioned that LyX will generate default CSS style
16436 rules for both insets and paragraph styles, based upon the other layout
16437 information that is provided.
16438 In this section, we shall say a word about which layout information LyX
16447 \begin_layout Chapter
16448 Including External Material
16451 \begin_layout Standard
16452 \begin_inset Box Shadowbox
16461 height_special "totalheight"
16464 \begin_layout Plain Layout
16465 WARNING: This portion of the documentation has not been updated for some
16467 We certainly hope that it is still accurate, but there are no guarantees.
16475 \begin_layout Standard
16476 The use of material from sources external to LyX is covered in detail in
16482 This part of the manual covers what needs to happen behind the scenes for
16483 new sorts of material to be included.
16486 \begin_layout Section
16490 \begin_layout Standard
16491 The external material feature is based on the concept of a
16496 A template is a specification of how LyX should interface with a certain
16498 As bundled, LyX comes with predefined templates for Xfig figures, various
16499 raster format images, chess diagrams, and LilyPond music notation.
16500 You can check the actual list by using the menu
16501 \begin_inset Flex CharStyle:MenuItem
16504 \begin_layout Plain Layout
16505 Insert\SpecialChar \menuseparator
16506 File\SpecialChar \menuseparator
16513 Furthermore, it is possible to roll your own template to support a specific
16515 Later we'll describe in more detail what is involved, and hopefully you
16516 will submit all the templates you create so we can include them in a later
16520 \begin_layout Standard
16521 Another basic idea of the external material feature is to distinguish between
16522 the original file that serves as a base for final material and the produced
16523 file that is included in your exported or printed document.
16524 For example, consider the case of a figure produced with
16525 \begin_inset Flex CharStyle:Code
16528 \begin_layout Plain Layout
16535 The Xfig application itself works on an original file with the
16536 \begin_inset Flex CharStyle:Code
16539 \begin_layout Plain Layout
16546 Within Xfig, you create and change your figure, and when you are done,
16548 \begin_inset Flex CharStyle:Code
16551 \begin_layout Plain Layout
16558 When you want to include the figure in your document, you invoke
16559 \begin_inset Flex CharStyle:Code
16562 \begin_layout Plain Layout
16568 in order to create a PostScript file that can readily be included in your
16571 \begin_inset Flex CharStyle:Code
16574 \begin_layout Plain Layout
16580 file is the original file, and the PostScript file is the produced file.
16583 \begin_layout Standard
16584 This distinction is important in order to allow updating of the material
16585 while you are in the process of writing the document.
16586 Furthermore, it provides us with the flexibility that is needed to support
16587 multiple export formats.
16588 For instance, in the case of a plain text file, it is not exactly an award-winn
16589 ing idea to include the figure as raw PostScript.
16590 Instead, you'd either prefer to just include a reference to the figure
16591 or try to invoke some graphics to ASCII converter to make the final result
16592 look similar to the real graphics.
16593 The external material management allows you to do this, because it is parametri
16594 zed on the different export formats that LyX supports.
16597 \begin_layout Standard
16598 Besides supporting the production of different products according to the
16599 exported format, it supports tight integration with editing and viewing
16601 In the case of an Xfig figure, you are able to invoke Xfig on the original
16602 file with a single click from within the external material dialog in LyX,
16603 and also preview the produced PostScript file with Ghostview with another
16605 No more fiddling around with the command line and/or file browsers to locate
16606 and manipulate the original or produced files.
16607 In this way, you are finally able to take full advantage of the many different
16608 applications that are relevant to use when you write your documents, and
16609 ultimately be more productive.
16612 \begin_layout Section
16613 The external template configuration file
16616 \begin_layout Standard
16617 It is relatively easy to add custom external template definitions to LyX.
16618 However, be aware that doing this in an careless manner most probably
16622 introduce an easily exploitable security hole.
16623 So before you do this, please read the discussion about security in section
16625 \begin_inset CommandInset ref
16627 reference "sec:Security-discussion"
16634 \begin_layout Standard
16635 Having said that, we encourage you to submit any interesting templates that
16640 \begin_layout Standard
16641 The external templates are defined in the
16642 \begin_inset Flex CharStyle:Code
16645 \begin_layout Plain Layout
16646 LyXDir/lib/external_templates
16652 You can place your own version in
16653 \begin_inset Flex CharStyle:Code
16656 \begin_layout Plain Layout
16657 UserDir/external_templates
16665 \begin_layout Standard
16666 A typical template looks like this:
16669 \begin_layout LyX-Code
16673 \begin_layout LyX-Code
16674 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
16677 \begin_layout LyX-Code
16681 \begin_layout LyX-Code
16685 \begin_layout LyX-Code
16689 \begin_layout LyX-Code
16693 \begin_layout LyX-Code
16697 \begin_layout LyX-Code
16698 AutomaticProduction true
16701 \begin_layout LyX-Code
16705 \begin_layout LyX-Code
16709 \begin_layout LyX-Code
16713 \begin_layout LyX-Code
16714 TransformCommand Rotate RotationLatexCommand
16717 \begin_layout LyX-Code
16718 TransformCommand Resize ResizeLatexCommand
16721 \begin_layout LyX-Code
16722 Product "$$RotateFront$$ResizeFront
16725 \begin_layout LyX-Code
16730 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
16733 \begin_layout LyX-Code
16734 $$ResizeBack$$RotateBack"
16737 \begin_layout LyX-Code
16741 \begin_layout LyX-Code
16742 UpdateResult "$$AbsPath$$Basename.pstex_t"
16745 \begin_layout LyX-Code
16746 Requirement "graphicx"
16749 \begin_layout LyX-Code
16750 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
16753 \begin_layout LyX-Code
16754 ReferencedFile latex "$$AbsPath$$Basename.eps"
16757 \begin_layout LyX-Code
16758 ReferencedFile dvi "$$AbsPath$$Basename.eps"
16761 \begin_layout LyX-Code
16765 \begin_layout LyX-Code
16769 \begin_layout LyX-Code
16770 TransformCommand Rotate RotationLatexCommand
16773 \begin_layout LyX-Code
16774 TransformCommand Resize ResizeLatexCommand
16777 \begin_layout LyX-Code
16778 Product "$$RotateFront$$ResizeFront
16781 \begin_layout LyX-Code
16786 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
16789 \begin_layout LyX-Code
16790 $$ResizeBack$$RotateBack"
16793 \begin_layout LyX-Code
16794 UpdateFormat pdftex
16797 \begin_layout LyX-Code
16798 UpdateResult "$$AbsPath$$Basename.pdftex_t"
16801 \begin_layout LyX-Code
16802 Requirement "graphicx"
16805 \begin_layout LyX-Code
16806 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
16809 \begin_layout LyX-Code
16810 ReferencedFile latex "$$AbsPath$$Basename.pdf"
16813 \begin_layout LyX-Code
16817 \begin_layout LyX-Code
16821 \begin_layout LyX-Code
16822 Product "$$Contents(
16824 "$$AbsPath$$Basename.asc
16829 \begin_layout LyX-Code
16830 UpdateFormat asciixfig
16833 \begin_layout LyX-Code
16834 UpdateResult "$$AbsPath$$Basename.asc"
16837 \begin_layout LyX-Code
16841 \begin_layout LyX-Code
16845 \begin_layout LyX-Code
16846 Product "<graphic fileref=
16848 "$$AbsOrRelPathMaster$$Basename.eps
16853 \begin_layout LyX-Code
16857 \begin_layout LyX-Code
16861 \begin_layout LyX-Code
16862 UpdateResult "$$AbsPath$$Basename.eps"
16865 \begin_layout LyX-Code
16866 ReferencedFile docbook "$$AbsPath$$Basename.eps"
16869 \begin_layout LyX-Code
16870 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
16873 \begin_layout LyX-Code
16877 \begin_layout LyX-Code
16878 Product "[XFig: $$FName]"
16881 \begin_layout LyX-Code
16885 \begin_layout LyX-Code
16889 \begin_layout Standard
16890 As you can see, the template is enclosed in
16891 \begin_inset Flex CharStyle:Code
16894 \begin_layout Plain Layout
16900 \SpecialChar \ldots{}
16902 \begin_inset Flex CharStyle:Code
16905 \begin_layout Plain Layout
16912 It contains a header specifying some general settings and, for each supported
16913 primary document file format, a section
16914 \begin_inset Flex CharStyle:Code
16917 \begin_layout Plain Layout
16923 \SpecialChar \ldots{}
16925 \begin_inset Flex CharStyle:Code
16928 \begin_layout Plain Layout
16937 \begin_layout Subsection
16938 The template header
16941 \begin_layout Description
16942 \begin_inset Flex CharStyle:Code
16945 \begin_layout Plain Layout
16946 AutomaticProduction
16947 \begin_inset space ~
16955 Whether the file represented by the template must be generated by LyX.
16956 This command must occur exactly once.
16959 \begin_layout Description
16960 \begin_inset Flex CharStyle:Code
16963 \begin_layout Plain Layout
16965 \begin_inset space ~
16973 A glob pattern that is used in the file dialog to filter out the desired
16975 If there is more than one possible file extension (e.
16976 \begin_inset space \thinspace{}
16980 \begin_inset space \space{}
16984 \begin_inset Flex CharStyle:Code
16987 \begin_layout Plain Layout
16994 \begin_inset Flex CharStyle:Code
16997 \begin_layout Plain Layout
17003 ), use something like
17004 \begin_inset Flex CharStyle:Code
17007 \begin_layout Plain Layout
17014 This command must occur exactly once.
17017 \begin_layout Description
17018 \begin_inset Flex CharStyle:Code
17021 \begin_layout Plain Layout
17023 \begin_inset space ~
17031 The text that is displayed on the button.
17032 This command must occur exactly once.
17035 \begin_layout Description
17036 \begin_inset Flex CharStyle:Code
17039 \begin_layout Plain Layout
17041 \begin_inset space ~
17045 \begin_inset space ~
17053 The help text that is used in the External dialog.
17054 Provide enough information to explain to the user just what the template
17055 can provide him with.
17056 This command must occur exactly once.
17059 \begin_layout Description
17060 \begin_inset Flex CharStyle:Code
17063 \begin_layout Plain Layout
17065 \begin_inset space ~
17073 The file format of the original file.
17074 This must be the name of a format that is known to LyX (see section
17075 \begin_inset CommandInset ref
17077 reference "sec:Formats"
17083 \begin_inset Quotes eld
17087 \begin_inset Flex CharStyle:Code
17090 \begin_layout Plain Layout
17097 \begin_inset Quotes erd
17100 if the template can handle original files of more than one format.
17101 LyX will attempt to interrogate the file itself in order to deduce its
17102 format in this case.
17103 This command must occur exactly once.
17106 \begin_layout Description
17107 \begin_inset Flex CharStyle:Code
17110 \begin_layout Plain Layout
17112 \begin_inset space ~
17120 A unique name for the template.
17121 It must not contain substitution macros (see below).
17124 \begin_layout Description
17125 \begin_inset Flex CharStyle:Code
17128 \begin_layout Plain Layout
17130 \begin_inset space ~
17133 Rotate|Resize|Clip|Extra
17138 This command specifies which transformations are supported by this template.
17139 It may occur zero or more times.
17140 This command enables the corresponding tabs in the external dialog.
17142 \begin_inset Flex CharStyle:Code
17145 \begin_layout Plain Layout
17151 command must have either a corresponding
17152 \begin_inset Flex CharStyle:Code
17155 \begin_layout Plain Layout
17162 \begin_inset Flex CharStyle:Code
17165 \begin_layout Plain Layout
17172 \begin_inset Flex CharStyle:Code
17175 \begin_layout Plain Layout
17182 Otherwise the transformation will not be supported by that format.
17185 \begin_layout Subsection
17189 \begin_layout Description
17190 \begin_inset Flex CharStyle:Code
17193 \begin_layout Plain Layout
17195 \begin_inset space ~
17198 LaTeX|PDFLaTeX|PlainText|DocBook
17203 The primary document file format that this format definition is for.
17204 Not every template has a sensible representation in all document file formats.
17205 Please define nevertheless a
17206 \begin_inset Flex CharStyle:Code
17209 \begin_layout Plain Layout
17215 section for all formats.
17216 Use a dummy text when no representation is available.
17217 Then you can at least see a reference to the external material in the exported
17221 \begin_layout Description
17222 \begin_inset Flex CharStyle:Code
17225 \begin_layout Plain Layout
17227 \begin_inset space ~
17231 \begin_inset space ~
17239 This command defines an additional macro
17240 \begin_inset Flex CharStyle:Code
17243 \begin_layout Plain Layout
17249 for substitution in
17250 \begin_inset Flex CharStyle:Code
17253 \begin_layout Plain Layout
17261 \begin_inset Flex CharStyle:Code
17264 \begin_layout Plain Layout
17270 itself may contain substitution macros.
17271 The advantage over using
17272 \begin_inset Flex CharStyle:Code
17275 \begin_layout Plain Layout
17282 \begin_inset Flex CharStyle:Code
17285 \begin_layout Plain Layout
17291 is that the substituted value of
17292 \begin_inset Flex CharStyle:Code
17295 \begin_layout Plain Layout
17301 is sanitized so that it is a valid optional argument in the document format.
17302 This command may occur zero or more times.
17305 \begin_layout Description
17306 \begin_inset Flex CharStyle:Code
17309 \begin_layout Plain Layout
17311 \begin_inset space ~
17319 The text that is inserted in the exported document.
17320 This is actually the most important command and can be quite complex.
17321 This command must occur exactly once.
17324 \begin_layout Description
17325 \begin_inset Flex CharStyle:Code
17328 \begin_layout Plain Layout
17330 \begin_inset space ~
17338 This command specifies a preamble snippet that will be included in the
17340 It has to be defined using
17341 \begin_inset Flex CharStyle:Code
17344 \begin_layout Plain Layout
17350 \SpecialChar \ldots{}
17352 \begin_inset Flex CharStyle:Code
17355 \begin_layout Plain Layout
17362 This command may occur zero or more times.
17365 \begin_layout Description
17366 \begin_inset Flex CharStyle:Code
17369 \begin_layout Plain Layout
17371 \begin_inset space ~
17375 \begin_inset space ~
17383 This command denotes files that are created by the conversion process and
17384 are needed for a particular export format.
17385 If the filename is relative, it is interpreted relative to the master document.
17386 This command may be given zero or more times.
17389 \begin_layout Description
17390 \begin_inset Flex CharStyle:Code
17393 \begin_layout Plain Layout
17395 \begin_inset space ~
17403 The name of a required LaTeX package.
17404 The package is included via
17405 \begin_inset Flex CharStyle:Code
17408 \begin_layout Plain Layout
17416 in the LaTeX preamble.
17417 This command may occur zero or more times.
17420 \begin_layout Description
17421 \begin_inset Flex CharStyle:Code
17424 \begin_layout Plain Layout
17426 \begin_inset space ~
17430 \begin_inset space ~
17433 RotationLatexCommand
17438 This command specifies that the built in LaTeX command should be used for
17440 This command may occur once or not at all.
17443 \begin_layout Description
17444 \begin_inset Flex CharStyle:Code
17447 \begin_layout Plain Layout
17449 \begin_inset space ~
17453 \begin_inset space ~
17461 This command specifies that the built in LaTeX command should be used for
17463 This command may occur once or not at all.
17466 \begin_layout Description
17467 \begin_inset Flex CharStyle:Code
17470 \begin_layout Plain Layout
17472 \begin_inset space ~
17476 \begin_inset space ~
17479 RotationLatexOption
17484 This command specifies that rotation is done via an optional argument.
17485 This command may occur once or not at all.
17488 \begin_layout Description
17489 \begin_inset Flex CharStyle:Code
17492 \begin_layout Plain Layout
17494 \begin_inset space ~
17498 \begin_inset space ~
17506 This command specifies that resizing is done via an optional argument.
17507 This command may occur once or not at all.
17510 \begin_layout Description
17511 \begin_inset Flex CharStyle:Code
17514 \begin_layout Plain Layout
17516 \begin_inset space ~
17520 \begin_inset space ~
17528 This command specifies that clipping is done via an optional argument.
17529 This command may occur once or not at all.
17532 \begin_layout Description
17533 \begin_inset Flex CharStyle:Code
17536 \begin_layout Plain Layout
17538 \begin_inset space ~
17542 \begin_inset space ~
17550 This command specifies that an extra optional argument is used.
17551 This command may occur once or not at all.
17554 \begin_layout Description
17555 \begin_inset Flex CharStyle:Code
17558 \begin_layout Plain Layout
17560 \begin_inset space ~
17568 The file format of the converted file.
17569 This must be the name of a format that is known to LyX (see the
17570 \begin_inset Flex CharStyle:MenuItem
17573 \begin_layout Plain Layout
17578 ools\SpecialChar \menuseparator
17583 references:Conversion
17589 This command must occur exactly once.
17592 \begin_layout Description
17593 \begin_inset Flex CharStyle:Code
17596 \begin_layout Plain Layout
17598 \begin_inset space ~
17606 The file name of the converted file.
17607 The file name must be absolute.
17608 This command must occur exactly once.
17611 \begin_layout Subsection
17612 Preamble definitions
17615 \begin_layout Standard
17616 The external template configuration file may contain additional preamble
17617 definitions enclosed by
17618 \begin_inset Flex CharStyle:Code
17621 \begin_layout Plain Layout
17627 \SpecialChar \ldots{}
17629 \begin_inset Flex CharStyle:Code
17632 \begin_layout Plain Layout
17639 They can be used by the templates in the
17640 \begin_inset Flex CharStyle:Code
17643 \begin_layout Plain Layout
17652 \begin_layout Section
17653 The substitution mechanism
17656 \begin_layout Standard
17657 When the external material facility invokes an external program, it is done
17658 on the basis of a command defined in the template configuration file.
17659 These commands can contain various macros that are expanded before execution.
17660 Execution always take place in the directory of the containing document.
17663 \begin_layout Standard
17664 Also, whenever external material is to be displayed, the name will be produced
17665 by the substitution mechanism, and most other commands in the template
17666 definition support substitution as well.
17669 \begin_layout Standard
17670 The available macros are the following:
17673 \begin_layout Description
17674 \begin_inset Flex CharStyle:Code
17677 \begin_layout Plain Layout
17678 $$AbsOrRelPathMaster
17683 The file path, absolute or relative to the master LyX document.
17686 \begin_layout Description
17687 \begin_inset Flex CharStyle:Code
17690 \begin_layout Plain Layout
17691 $$AbsOrRelPathParent
17696 The file path, absolute or relative to the LyX document.
17699 \begin_layout Description
17700 \begin_inset Flex CharStyle:Code
17703 \begin_layout Plain Layout
17709 The absolute file path.
17712 \begin_layout Description
17713 \begin_inset Flex CharStyle:Code
17716 \begin_layout Plain Layout
17722 The filename without path and without the extension.
17725 \begin_layout Description
17726 \begin_inset Flex CharStyle:Code
17729 \begin_layout Plain Layout
17731 \begin_inset Quotes eld
17735 \begin_inset Quotes erd
17743 This macro will expand to the contents of the file with the name
17744 \begin_inset Flex CharStyle:Code
17747 \begin_layout Plain Layout
17756 \begin_layout Description
17757 \begin_inset Flex CharStyle:Code
17760 \begin_layout Plain Layout
17766 The file extension (including the dot).
17769 \begin_layout Description
17770 \begin_inset Flex CharStyle:Code
17773 \begin_layout Plain Layout
17779 The filename of the file specified in the external material dialog.
17780 This is either an absolute name, or it is relative to the LyX document.
17783 \begin_layout Description
17784 \begin_inset Flex CharStyle:Code
17787 \begin_layout Plain Layout
17794 \begin_inset Flex CharStyle:Code
17797 \begin_layout Plain Layout
17803 (absolute name or relative to the LyX document).
17806 \begin_layout Description
17807 \begin_inset Flex CharStyle:Code
17810 \begin_layout Plain Layout
17816 The file path, relative to the master LyX document.
17819 \begin_layout Description
17820 \begin_inset Flex CharStyle:Code
17823 \begin_layout Plain Layout
17829 The file path, relative to the LyX document.
17832 \begin_layout Description
17833 \begin_inset Flex CharStyle:Code
17836 \begin_layout Plain Layout
17842 This macro will expand to the absolute path of the system directory.
17843 This is typically used to point to the various helper scripts that are
17847 \begin_layout Description
17848 \begin_inset Flex CharStyle:Code
17851 \begin_layout Plain Layout
17857 A name and full path to a temporary file which will be automatically deleted
17858 whenever the containing document is closed, or the external material insertion
17862 \begin_layout Standard
17863 All path macros contain a trailing directory separator, so you can construct
17865 \begin_inset space \thinspace{}
17869 \begin_inset space \space{}
17872 the absolute filename with
17873 \begin_inset Flex CharStyle:Code
17876 \begin_layout Plain Layout
17877 $$AbsPath$$Basename$$Extension
17885 \begin_layout Standard
17886 The macros above are substituted in all commands unless otherwise noted.
17888 \begin_inset Flex CharStyle:Code
17891 \begin_layout Plain Layout
17897 supports additionally the following substitutions if they are enabled by
17899 \begin_inset Flex CharStyle:Code
17902 \begin_layout Plain Layout
17909 \begin_inset Flex CharStyle:Code
17912 \begin_layout Plain Layout
17921 \begin_layout Description
17922 \begin_inset Flex CharStyle:Code
17925 \begin_layout Plain Layout
17931 The front part of the resize command.
17934 \begin_layout Description
17935 \begin_inset Flex CharStyle:Code
17938 \begin_layout Plain Layout
17944 The back part of the resize command.
17947 \begin_layout Description
17948 \begin_inset Flex CharStyle:Code
17951 \begin_layout Plain Layout
17957 The front part of the rotation command.
17960 \begin_layout Description
17961 \begin_inset Flex CharStyle:Code
17964 \begin_layout Plain Layout
17970 The back part of the rotation command.
17973 \begin_layout Standard
17974 The value string of the
17975 \begin_inset Flex CharStyle:Code
17978 \begin_layout Plain Layout
17984 command supports additionally the following substitutions if they are enabled
17986 \begin_inset Flex CharStyle:Code
17989 \begin_layout Plain Layout
17996 \begin_inset Flex CharStyle:Code
17999 \begin_layout Plain Layout
18008 \begin_layout Description
18009 \begin_inset Flex CharStyle:Code
18012 \begin_layout Plain Layout
18021 \begin_layout Description
18022 \begin_inset Flex CharStyle:Code
18025 \begin_layout Plain Layout
18034 \begin_layout Description
18035 \begin_inset Flex CharStyle:Code
18038 \begin_layout Plain Layout
18047 \begin_layout Description
18048 \begin_inset Flex CharStyle:Code
18051 \begin_layout Plain Layout
18057 The rotation option.
18060 \begin_layout Standard
18061 You may ask why there are so many path macros.
18062 There are mainly two reasons:
18065 \begin_layout Enumerate
18066 Relative and absolute file names should remain relative or absolute, respectivel
18068 Users may have reasons to prefer either form.
18069 Relative names are useful for portable documents that should work on different
18070 machines, for example.
18071 Absolute names may be required by some programs.
18074 \begin_layout Enumerate
18075 LaTeX treats relative file names differently than LyX and other programs
18076 in nested included files.
18077 For LyX, a relative file name is always relative to the document that contains
18079 For LaTeX, it is always relative to the master document.
18080 These two definitions are identical if you have only one document, but
18081 differ if you have a master document that includes part documents.
18082 That means that relative filenames must be transformed when presented to
18084 Fortunately LyX does this automatically for you if you choose the right
18088 \begin_layout Standard
18089 So which path macro should be used in new template definitions? The rule
18093 \begin_layout Itemize
18095 \begin_inset Flex CharStyle:Code
18098 \begin_layout Plain Layout
18104 if an absolute path is required.
18107 \begin_layout Itemize
18109 \begin_inset Flex CharStyle:Code
18112 \begin_layout Plain Layout
18113 $$AbsOrRelPathMaster
18118 if the substituted string is some kind of LaTeX input.
18121 \begin_layout Itemize
18123 \begin_inset Flex CharStyle:Code
18126 \begin_layout Plain Layout
18127 $$AbsOrRelPathParent
18132 in order to preserve the user's choice.
18135 \begin_layout Standard
18136 There are special cases where this rule does not work and e.
18137 \begin_inset space \thinspace{}
18141 \begin_inset space \space{}
18144 relative names are needed, but normally it will work just fine.
18145 One example for such a case is the command
18146 \begin_inset Flex CharStyle:Code
18149 \begin_layout Plain Layout
18150 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
18155 in the XFig template above: We can't use the absolute name because the
18157 \begin_inset Flex CharStyle:Code
18160 \begin_layout Plain Layout
18166 files needs the relative name in order to rewrite the file content.
18169 \begin_layout Section
18170 Security discussion
18171 \begin_inset CommandInset label
18173 name "sec:Security-discussion"
18180 \begin_layout Standard
18181 The external material feature interfaces with a lot of external programs
18182 and does so automatically, so we have to consider the security implications
18184 In particular, since you have the option of including your own filenames
18185 and/or parameter strings and those are expanded into a command, it seems
18186 that it would be possible to create a malicious document which executes
18187 arbitrary commands when a user views or prints the document.
18188 This is something we definitely want to avoid.
18191 \begin_layout Standard
18192 However, since the external program commands are specified in the template
18193 configuration file only, there are no security issues if LyX is properly
18194 configured with safe templates only.
18195 This is so because the external programs are invoked with the
18196 \begin_inset Flex CharStyle:Code
18199 \begin_layout Plain Layout
18205 -system call rather than the
18206 \begin_inset Flex CharStyle:Code
18209 \begin_layout Plain Layout
18215 system-call, so it's not possible to execute arbitrary commands from the
18216 filename or parameter section via the shell.
18219 \begin_layout Standard
18220 This also implies that you are restricted in what command strings you can
18221 use in the external material templates.
18222 In particular, pipes and redirection are not readily available.
18223 This has to be so if LyX should remain safe.
18224 If you want to use some of the shell features, you should write a safe
18225 script to do this in a controlled manner, and then invoke the script from
18226 the command string.
18230 \begin_layout Standard
18231 It is possible to design a template that interacts directly with the shell,
18232 but since this would allow a malicious user to execute arbitrary commands
18233 by writing clever filenames and/or parameters, we generally recommend that
18234 you only use safe scripts that work with the
18235 \begin_inset Flex CharStyle:Code
18238 \begin_layout Plain Layout
18244 system call in a controlled manner.
18245 Of course, for use in a controlled environment, it can be tempting to just
18246 fall back to use ordinary shell scripts.
18247 If you do so, be aware that you
18251 provide an easily exploitable security hole in your system.
18252 Of course it stands to reason that such unsafe templates will never be
18253 included in the standard LyX distribution, although we do encourage people
18254 to submit new templates in the open source tradition.
18255 But LyX as shipped from the official distribution channels will never have
18259 \begin_layout Standard
18260 Including external material provides a lot of power, and you have to be
18261 careful not to introduce security hazards with this power.
18262 A subtle error in a single line in an innocent looking script can open
18263 the door to huge security problems.
18264 So if you do not fully understand the issues, we recommend that you consult
18265 a knowledgeable security professional or the LyX development team if you
18266 have any questions about whether a given template is safe or not.
18267 And do this before you use it in an uncontrolled environment.