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
131 Customizing LyX: Features for the Advanced User
139 \begin_layout Plain Layout
141 If you have comments or error corrections, please send them to the LyX Documenta
143 \begin_inset CommandInset href
145 target "lyx-docs@lists.lyx.org"
152 \begin_inset Quotes eld
156 \begin_inset Quotes erd
159 in the subject header, and please cc the current maintainer of this file,
160 Richard Heck <rgheck@comcast.net>.
166 \begin_inset Newline newline
170 \begin_inset Newline newline
176 \begin_layout Standard
177 \begin_inset CommandInset toc
178 LatexCommand tableofcontents
185 \begin_layout Standard
186 \begin_inset Note Note
189 \begin_layout Plain Layout
190 Please use change tracking when modifying this document.
191 This makes it easier for our translators to recognize things that have
192 been changed, and it helps the maintainer keep up-to-date with what's been
201 \begin_layout Chapter
205 \begin_layout Standard
206 This manual covers the customization features present in LyX.
207 In it, we discuss issues like keyboard shortcuts, screen previewing options,
208 printer options, sending commands to LyX via the LyX Server, internationalizati
209 on, installing new LaTeX classes and LyX layouts, etc.
210 We can't possibly hope to touch on everything you can change—our developers
211 add new features faster than we can document them—but we will explain the
212 most common customizations and hopefully point you in the right direction
213 for some of the more obscure ones.
216 \begin_layout Standard
217 \begin_inset Branch OutDated
220 \begin_layout Standard
221 Information from previous versions of this document that now seems to be
222 outdated is contained in the OutDated branch of this document.
223 By default, this information will not appear in the LaTeX output.
231 \begin_layout Chapter
232 LyX configuration files
235 \begin_layout Standard
236 This chapter aims to help you to find your way through the LyX configuration
238 Before continuing to read this chapter, you should find out where your
239 LyX library and user directories are by using
240 \begin_inset Flex CharStyle:MenuItem
243 \begin_layout Plain Layout
244 Help\SpecialChar \menuseparator
255 The library directory is the place where LyX places its system-wide configurati
256 on files; the user directory is where you can place your modified versions.
257 We will call the former
258 \begin_inset Flex CharStyle:Code
261 \begin_layout Plain Layout
268 \begin_inset Flex CharStyle:MenuItem
271 \begin_layout Plain Layout
277 in the remainder of this document.
281 \begin_layout Section
283 \begin_inset Flex CharStyle:Code
286 \begin_layout Plain Layout
295 \begin_layout Standard
296 \begin_inset Flex CharStyle:Code
299 \begin_layout Plain Layout
305 and its sub-directories contain a number of files and that can be used
306 to customize LyX's behavior.
307 You can change many of these files from within LyX itself through the
308 \begin_inset Flex CharStyle:MenuItem
311 \begin_layout Plain Layout
312 Tools\SpecialChar \menuseparator
319 Most customization that you will want to do in LyX is possible through
321 However, many other inner aspects of LyX can be customized by modifying
323 \begin_inset Flex CharStyle:Code
326 \begin_layout Plain Layout
333 These files fall in different categories, described in the following subsection
337 \begin_layout Subsection
338 Automatically generated files
341 \begin_layout Standard
342 The files, which are to be found in
343 \begin_inset Flex CharStyle:MenuItem
346 \begin_layout Plain Layout
352 , are generated when you configure LyX.
353 They contain various default values that are guessed by inspection.
354 In general, it is not a good idea to modify them, since they might be overwritt
358 \begin_layout Labeling
359 \labelwidthstring 00.00.0000
360 \begin_inset Flex CharStyle:Code
363 \begin_layout Plain Layout
369 contains defaults for various commands.
372 \begin_layout Labeling
373 \labelwidthstring 00.00.0000
374 \begin_inset Flex CharStyle:Code
377 \begin_layout Plain Layout
383 contains the list of packages that have been recognized by LyX.
384 It is currently unused by the LyX program itself, but the information extracted
385 , and more, is made available with
386 \begin_inset Flex CharStyle:MenuItem
389 \begin_layout Plain Layout
390 Help\SpecialChar \menuseparator
403 \begin_layout Labeling
404 \labelwidthstring 00.00.0000
405 \begin_inset Flex CharStyle:Code
408 \begin_layout Plain Layout
414 the list of text classes that have been found in your
415 \begin_inset Flex CharStyle:Code
418 \begin_layout Plain Layout
424 directories, along with the associated LaTeX document class and their descripti
428 \begin_layout Labeling
429 \labelwidthstring 00.00.0000
430 \begin_inset Flex CharStyle:Code
433 \begin_layout Plain Layout
439 the list of layout modules found in your
440 \begin_inset Flex CharStyle:Code
443 \begin_layout Plain Layout
452 \begin_layout Labeling
453 \labelwidthstring 00.00.0000
454 \begin_inset Flex CharStyle:Code
457 \begin_layout Plain Layout
463 lists of various sorts of LaTeX-related files found on your system
466 \begin_layout Labeling
467 \labelwidthstring 00.00.0000
468 \begin_inset Flex CharStyle:Code
471 \begin_layout Plain Layout
477 is automatically generated during configuration from the file
478 \begin_inset Flex CharStyle:Code
481 \begin_layout Plain Layout
488 It contains information on your LaTeX configuration.
491 \begin_layout Subsection
495 \begin_layout Standard
496 These directories are duplicated between
497 \begin_inset Flex CharStyle:Code
500 \begin_layout Plain Layout
507 \begin_inset Flex CharStyle:Code
510 \begin_layout Plain Layout
517 If a particular files exists in both places, the one in
518 \begin_inset Flex CharStyle:Code
521 \begin_layout Plain Layout
530 \begin_layout Labeling
531 \labelwidthstring 00.00.0000
532 \begin_inset Flex CharStyle:Code
535 \begin_layout Plain Layout
541 this directory contains files with the extension
542 \begin_inset Flex CharStyle:Code
545 \begin_layout Plain Layout
551 that define the keybindings used in LyX.
552 If there exists an internationalized version of the bind file named
553 \begin_inset Flex CharStyle:Code
556 \begin_layout Plain Layout
562 , that will be used first.
565 \begin_layout Labeling
566 \labelwidthstring 00.00.0000
567 \begin_inset Flex CharStyle:Code
570 \begin_layout Plain Layout
576 contains graphics files that can be included in documents.
580 \begin_layout Labeling
581 \labelwidthstring 00.00.0000
582 \begin_inset Flex CharStyle:Code
585 \begin_layout Plain Layout
591 contains LyX documentation files (including the one you are currently reading).
593 \begin_inset Flex CharStyle:Code
596 \begin_layout Plain Layout
602 deserves special attention, as noted above.
603 The internationalized help docs are in subdirectories
604 \begin_inset Flex CharStyle:Code
607 \begin_layout Plain Layout
614 \begin_inset Quotes eld
618 \begin_inset Quotes erd
621 is the ISO language code.
627 \begin_inset CommandInset ref
629 reference "cha:Internationalizing-LyX"
636 \begin_layout Labeling
637 \labelwidthstring 00.00.0000
638 \begin_inset Flex CharStyle:Code
641 \begin_layout Plain Layout
647 contains example files that explain how to use some features.
648 In the file browser, press the
649 \begin_inset Flex CharStyle:MenuItem
652 \begin_layout Plain Layout
661 \begin_layout Labeling
662 \labelwidthstring 00.00.0000
663 \begin_inset Flex CharStyle:Code
666 \begin_layout Plain Layout
672 contains image files that are used by the
673 \begin_inset Flex CharStyle:MenuItem
676 \begin_layout Plain Layout
683 In addition, it also contains the individual icons used in the toolbar
684 and the banners that can be shown when LyX is launched.
687 \begin_layout Labeling
688 \labelwidthstring 00.00.0000
689 \begin_inset Flex CharStyle:Code
692 \begin_layout Plain Layout
698 contains keyboard keymapping files.
704 \begin_inset CommandInset ref
706 reference "sec:International-Keymap-Stuff"
713 \begin_layout Labeling
714 \labelwidthstring 00.00.0000
715 \begin_inset Flex CharStyle:Code
718 \begin_layout Plain Layout
724 contains the text class and module files described in Chapter
729 \begin_inset CommandInset ref
731 reference "cha:Installing-New-Document"
738 \begin_layout Labeling
739 \labelwidthstring 00.00.0000
740 \begin_inset Flex CharStyle:Code
743 \begin_layout Plain Layout
750 \begin_inset Flex CharStyle:Code
753 \begin_layout Plain Layout
759 Python scripts used to convert between LyX versions.
760 These can be run from the command line if, say, you want to batch-convert
764 \begin_layout Labeling
765 \labelwidthstring 00.00.0000
766 \begin_inset Flex CharStyle:Code
769 \begin_layout Plain Layout
775 contains some files that demonstrate the capabilities of the
776 \begin_inset Flex CharStyle:MenuItem
779 \begin_layout Plain Layout
790 Also contains some scripts used by LyX itself.
793 \begin_layout Labeling
794 \labelwidthstring 00.00.0000
795 \begin_inset Flex CharStyle:Code
798 \begin_layout Plain Layout
804 contains the standard LyX template files described in Chapter
809 \begin_inset CommandInset ref
811 reference "sec:Creating-Templates"
818 \begin_layout Labeling
819 \labelwidthstring 00.00.0000
820 \begin_inset Flex CharStyle:Code
823 \begin_layout Plain Layout
829 contains files with the extension
830 \begin_inset Flex CharStyle:Code
833 \begin_layout Plain Layout
839 that define the user interface to LyX.
840 That is, the files define which items appear in which menus and the items
841 appearing on the toolbar.
844 \begin_layout Subsection
845 Files you don't want to modify
848 \begin_layout Standard
849 These files are used internally by LyX and you generally do not need to
850 modify them unless you are a developer.
853 \begin_layout Labeling
854 \labelwidthstring 00.00.0000
855 \begin_inset Flex CharStyle:Code
858 \begin_layout Plain Layout
864 this file contains the list of LyX developers.
865 The contents are displayed with the menu entry
866 \begin_inset Flex CharStyle:MenuItem
869 \begin_layout Plain Layout
870 Help\SpecialChar \menuseparator
883 \begin_layout Labeling
884 \labelwidthstring 00.00.0000
885 \begin_inset Flex CharStyle:Code
888 \begin_layout Plain Layout
894 this is a LaTeX script used during the configuration process.
898 \begin_layout Labeling
899 \labelwidthstring 00.00.0000
900 \begin_inset Flex CharStyle:Code
903 \begin_layout Plain Layout
909 this is the script that is used to re-configure LyX.
910 It creates configuration files in the directory it was run from.
913 \begin_layout Subsection
914 Other files needing a line or two...
917 \begin_layout Labeling
918 \labelwidthstring 00.00.0000
919 \begin_inset Flex CharStyle:Code
922 \begin_layout Plain Layout
928 this contains tables describing how different character encodings can be
932 \begin_layout Labeling
933 \labelwidthstring 00.00.0000
934 \begin_inset Flex CharStyle:Code
937 \begin_layout Plain Layout
943 this file contains the templates available to the new
944 \begin_inset Flex CharStyle:MenuItem
947 \begin_layout Plain Layout
960 \begin_layout Labeling
961 \labelwidthstring 00.00.0000
962 \begin_inset Flex CharStyle:Code
965 \begin_layout Plain Layout
971 this file contains a list of all the languages currently supported by LyX.
974 \begin_layout Section
975 Your local configuration directory
978 \begin_layout Standard
979 Even if you are using LyX as an unprivileged user, you might want to change
980 LyX configuration for your own use.
982 \begin_inset Flex CharStyle:Code
985 \begin_layout Plain Layout
991 directory contains all your personal configuration files.
992 This is the directory described as
993 \begin_inset Quotes eld
997 \begin_inset Quotes erd
1001 \begin_inset Flex CharStyle:MenuItem
1004 \begin_layout Plain Layout
1005 Help\SpecialChar \menuseparator
1007 \begin_inset space ~
1016 This directory is used as a mirror of
1017 \begin_inset Flex CharStyle:Code
1020 \begin_layout Plain Layout
1026 , which means that every file in
1027 \begin_inset Flex CharStyle:Code
1030 \begin_layout Plain Layout
1036 is a replacement for the corresponding file in
1037 \begin_inset Flex CharStyle:Code
1040 \begin_layout Plain Layout
1047 Any configuration file described in the above sections can be placed either
1048 in the system-wide directory, in which case it will affect all users, or
1049 in your local directory for your own use.
1052 \begin_layout Standard
1053 To make things clearer, let's provide a few examples:
1056 \begin_layout Itemize
1057 The preferences set in the
1058 \begin_inset Flex CharStyle:MenuItem
1061 \begin_layout Plain Layout
1062 Tools\SpecialChar \menuseparator
1068 dialog are saved to a file
1069 \begin_inset Flex CharStyle:Code
1072 \begin_layout Plain Layout
1079 \begin_inset Flex CharStyle:Code
1082 \begin_layout Plain Layout
1091 \begin_layout Itemize
1092 When you reconfigure using
1093 \begin_inset Flex CharStyle:MenuItem
1096 \begin_layout Plain Layout
1097 Tools\SpecialChar \menuseparator
1104 \begin_inset Flex CharStyle:Code
1107 \begin_layout Plain Layout
1113 script, and the resulting files are written in your local configuration
1115 This means that any additional text class file that you might have added
1117 \begin_inset Flex CharStyle:Code
1120 \begin_layout Plain Layout
1126 will be added to the list of classes in the
1127 \begin_inset Flex CharStyle:MenuItem
1130 \begin_layout Plain Layout
1131 Document\SpecialChar \menuseparator
1140 \begin_layout Itemize
1141 If you get some updated documentation from LyX ftp site and cannot install
1142 it because you do not have sysadmin rights on your system, you can just
1144 \begin_inset Flex CharStyle:Code
1147 \begin_layout Plain Layout
1153 and the items in the
1154 \begin_inset Flex CharStyle:MenuItem
1157 \begin_layout Plain Layout
1163 menu will open them!
1166 \begin_layout Section
1167 Running LyX with multiple configurations
1170 \begin_layout Standard
1171 The configuration freedom of the local configuration directory may not suffice
1172 if you want to have more than one configuration at your disposal.
1173 For example, you may want to be use different key bindings or printer settings
1175 You can achieve this by having several such directories.
1176 You then specify which directory to use at run-time.
1179 \begin_layout Standard
1180 Invoking LyX with the command line switch
1181 \begin_inset Flex CharStyle:Code
1184 \begin_layout Plain Layout
1194 instructs the program to read the configuration from that directory, and
1195 not from the default directory.
1196 (You can determine the default directory by running LyX without the
1197 \begin_inset Flex CharStyle:Code
1200 \begin_layout Plain Layout
1206 switch.) If the specified directory does not exist, LyX offers to create
1207 it for you, just like it does for the default directory on the first time
1208 you run the program.
1209 You can modify the configuration options in this additional user directory
1210 exactly as you would for the default directory.
1211 These directories are completely independent (but read on).
1212 Note that setting the environment variable
1213 \begin_inset Flex CharStyle:Code
1216 \begin_layout Plain Layout
1222 to some value has exactly the same effect.
1225 \begin_layout Standard
1226 Having several configurations also requires more maintenance: if you want
1227 to add a new layout to
1228 \begin_inset Flex CharStyle:Code
1231 \begin_layout Plain Layout
1237 which you want available from all your configurations, you must add it
1238 to each directory separately.
1239 You can avoid this with the following trick: after LyX creates the additional
1240 directory, most of the subdirectories (see above) are empty.
1241 If you want the new configuration to mirror an existing one, replace the
1242 empty subdirectory with a symbolic link to the matching subdirectory in
1243 the existing configuration.
1245 \begin_inset Flex CharStyle:Code
1248 \begin_layout Plain Layout
1254 subdirectory, however, since it contains a file written by the configuration
1255 script (also accessible through
1256 \begin_inset Flex CharStyle:MenuItem
1259 \begin_layout Plain Layout
1260 Tools\SpecialChar \menuseparator
1266 ) which is configuration-specific.
1269 \begin_layout Chapter
1270 The Preferences dialog
1273 \begin_layout Standard
1274 All options of the preferences dialog are described in the Appendix
1276 The Preferences Dialog
1283 For some options you might find here more details.
1286 \begin_layout Section
1288 \begin_inset CommandInset label
1297 \begin_layout Standard
1298 The first step is to define your file formats if they are not already defined.
1300 \begin_inset Flex CharStyle:MenuItem
1303 \begin_layout Plain Layout
1304 Tools\SpecialChar \menuseparator
1312 \begin_inset Flex CharStyle:MenuItem
1315 \begin_layout Plain Layout
1316 File Handling\SpecialChar \menuseparator
1323 \begin_inset Flex CharStyle:MenuItem
1326 \begin_layout Plain Layout
1327 New\SpecialChar \ldots{}
1333 button to define your new format.
1335 \begin_inset Flex CharStyle:MenuItem
1338 \begin_layout Plain Layout
1344 field contains the name used to identify the format in the GUI.
1346 \begin_inset Flex CharStyle:MenuItem
1349 \begin_layout Plain Layout
1355 is used to identify the format internally.
1356 You will also need to enter a file extension.
1357 These are all required.
1359 \begin_inset Flex CharStyle:MenuItem
1362 \begin_layout Plain Layout
1368 field is used to provide a keyboard shortcut on the menus.
1369 (For example, pressing
1370 \begin_inset Flex CharStyle:MenuItem
1373 \begin_layout Plain Layout
1380 \begin_inset Flex CharStyle:MenuItem
1383 \begin_layout Plain Layout
1384 View\SpecialChar \menuseparator
1393 \begin_layout Standard
1395 \begin_inset Flex CharStyle:MenuItem
1398 \begin_layout Plain Layout
1405 \begin_inset Flex CharStyle:MenuItem
1408 \begin_layout Plain Layout
1415 For example, you might want to use
1416 \begin_inset Flex CharStyle:MenuItem
1419 \begin_layout Plain Layout
1425 to view PostScript files.
1426 You can enter the command needed to start the program in the corresponding
1428 In defining this command, you can use the four variables listed in the
1430 The viewer is launched when you view an image in LyX or use the
1431 \begin_inset Flex CharStyle:MenuItem
1434 \begin_layout Plain Layout
1441 The editor is for example launched when you right-click on an image and
1443 \begin_inset Flex CharStyle:MenuItem
1446 \begin_layout Plain Layout
1452 in the appearing context menu.
1455 \begin_layout Standard
1457 \begin_inset Flex CharStyle:MenuItem
1460 \begin_layout Plain Layout
1466 option tells LyX that a format is suitable for document export.
1467 If this is set and if a suitable conversion route exists (see sec.
1468 \begin_inset space \thinspace{}
1472 \begin_inset CommandInset ref
1474 reference "sec:Converters"
1478 ), the format will appear in the
1479 \begin_inset Flex CharStyle:MenuItem
1482 \begin_layout Plain Layout
1483 File\SpecialChar \menuseparator
1490 The format will also appear in the
1491 \begin_inset Flex CharStyle:MenuItem
1494 \begin_layout Plain Layout
1500 menu if a viewer is specified for the format.
1501 Pure image formats, such as
1502 \begin_inset Flex CharStyle:Code
1505 \begin_layout Plain Layout
1511 , should not use this option.
1512 Formats that can both represent vector graphics and documents like
1513 \begin_inset Flex CharStyle:Code
1516 \begin_layout Plain Layout
1525 \begin_layout Standard
1527 \begin_inset Flex CharStyle:MenuItem
1530 \begin_layout Plain Layout
1531 Vector graphics format
1536 tells LyX that a format can contain vector graphics.
1537 This information is used to determine the target format of included graphics
1539 \begin_inset Flex CharStyle:MenuItem
1542 \begin_layout Plain Layout
1549 Included graphics may need to be converted to either
1550 \begin_inset Flex CharStyle:MenuItem
1553 \begin_layout Plain Layout
1560 \begin_inset Flex CharStyle:MenuItem
1563 \begin_layout Plain Layout
1570 \begin_inset Flex CharStyle:MenuItem
1573 \begin_layout Plain Layout
1580 \begin_inset Flex CharStyle:MenuItem
1583 \begin_layout Plain Layout
1589 cannot handle other image formats.
1590 If an included graphic is not already in
1591 \begin_inset Flex CharStyle:MenuItem
1594 \begin_layout Plain Layout
1601 \begin_inset Flex CharStyle:MenuItem
1604 \begin_layout Plain Layout
1611 \begin_inset Flex CharStyle:MenuItem
1614 \begin_layout Plain Layout
1620 format, it is converted to
1621 \begin_inset Flex CharStyle:MenuItem
1624 \begin_layout Plain Layout
1630 if the vector format option is set, and otherwise to
1631 \begin_inset Flex CharStyle:MenuItem
1634 \begin_layout Plain Layout
1643 \begin_layout Section
1647 \begin_layout Standard
1648 Since all conversions from one format to another take place in LyX's temporary
1649 directory, it is sometimes necessary to modify a file before copying it
1650 to the temporary directory in order that the conversion may be performed.
1654 \begin_layout Plain Layout
1655 For example, the file may refer to other files—images, for example—using
1656 relative file names, and these may become invalid when the file is copied
1657 to the temporary directory.
1662 This is done by a Copier: It copies a file to (or from) the temporary directory
1663 and may modify it in the process.
1666 \begin_layout Standard
1667 The definitions of the copiers may use four variables:
1670 \begin_layout Labeling
1671 \labelwidthstring 00.00.0000
1672 \begin_inset Flex CharStyle:Code
1675 \begin_layout Plain Layout
1681 The LyX system directory (e.
1682 \begin_inset space \thinspace{}
1686 \begin_inset space \space{}
1690 \begin_inset Flex CharStyle:MenuItem
1693 \begin_layout Plain Layout
1702 \begin_layout Labeling
1703 \labelwidthstring 00.00.0000
1704 \begin_inset Flex CharStyle:Code
1707 \begin_layout Plain Layout
1716 \begin_layout Labeling
1717 \labelwidthstring 00.00.0000
1718 \begin_inset Flex CharStyle:Code
1721 \begin_layout Plain Layout
1730 \begin_layout Labeling
1731 \labelwidthstring 00.00.0000
1732 \begin_inset Flex CharStyle:Code
1735 \begin_layout Plain Layout
1744 \begin_layout Standard
1745 The latter should be the filename as it would be used in a LaTeX's
1752 It is relevant only when exporting files suitable for such inclusion.
1755 \begin_layout Standard
1756 Copiers can be used to do almost anything with output files.
1757 For example, suppose you want generated pdf files to be copied to a special
1759 \begin_inset Flex CharStyle:Code
1762 \begin_layout Plain Layout
1769 Then you could write a shell script such as this one:
1772 \begin_layout Standard
1773 \begin_inset listings
1777 \begin_layout Plain Layout
1782 \begin_layout Plain Layout
1787 \begin_layout Plain Layout
1789 TOFILE=`basename $2`
1792 \begin_layout Plain Layout
1794 cp $FROMFILE /home/you/pdf/$TOFILE
1799 Save it in your local LyX directory—say,
1800 \begin_inset Flex CharStyle:Code
1803 \begin_layout Plain Layout
1804 /home/you/.lyx/scripts/pdfcopier.sh
1809 —and make it executable, if you need to do so on your platform.
1811 \begin_inset Flex CharStyle:MenuItem
1814 \begin_layout Plain Layout
1815 Tools\SpecialChar \menuseparator
1821 dialog, select under
1822 \begin_inset Flex CharStyle:MenuItem
1825 \begin_layout Plain Layout
1826 File Handling\SpecialChar \menuseparator
1833 \begin_inset Flex CharStyle:MenuItem
1836 \begin_layout Plain Layout
1842 format—or one of the other pdf formats—and enter
1843 \begin_inset Flex CharStyle:Code
1846 \begin_layout Plain Layout
1847 pdfcopier.sh $$i $$o
1853 \begin_inset Flex CharStyle:MenuItem
1856 \begin_layout Plain Layout
1866 \begin_layout Standard
1867 Copiers are used by LyX in various of its own conversions.
1868 For example, if appropriate programs are found, LyX will automatically
1869 install copiers for the
1870 \begin_inset Flex CharStyle:MenuItem
1873 \begin_layout Plain Layout
1880 \begin_inset Flex CharStyle:MenuItem
1883 \begin_layout Plain Layout
1885 \begin_inset space ~
1894 When these formats are exported, the copier sees that not just the main
1895 HTML file but various associated files (style files, images, etc.) are also
1897 All these files are written to a subdirectory of the directory in which
1898 the original LyX file was found.
1902 \begin_layout Plain Layout
1903 This copier can be customized.
1905 \begin_inset Quotes eld
1909 \begin_inset Quotes erd
1912 argument takes a comma-separated list of extensions to be copied; if it
1913 is omitted, all files will be copied.
1915 \begin_inset Quotes eld
1919 \begin_inset Quotes erd
1922 argument determines the extension added to the generated directory.
1924 \begin_inset Quotes eld
1928 \begin_inset Flex CharStyle:MenuItem
1931 \begin_layout Plain Layout
1938 \begin_inset Quotes erd
1941 , so HTML generated from
1942 \begin_inset Flex CharStyle:MenuItem
1945 \begin_layout Plain Layout
1946 /path/to/filename.lyx
1952 \begin_inset Flex CharStyle:MenuItem
1955 \begin_layout Plain Layout
1956 /path/to/filename.html.LyXconv
1970 \begin_layout Section
1972 \begin_inset CommandInset label
1974 name "sec:Converters"
1981 \begin_layout Standard
1982 You can define your own Converters to convert files between different formats.
1984 \begin_inset Flex CharStyle:MenuItem
1987 \begin_layout Plain Layout
1988 Tools\SpecialChar \menuseparator
1989 Preferences\SpecialChar \menuseparator
1990 File Handling\SpecialChar \menuseparator
1999 \begin_layout Standard
2000 To define a new converter, select the
2001 \begin_inset Flex CharStyle:MenuItem
2004 \begin_layout Plain Layout
2006 \begin_inset space ~
2015 \begin_inset Flex CharStyle:MenuItem
2018 \begin_layout Plain Layout
2020 \begin_inset space ~
2028 from the drop-down lists, enter the command needed for the conversion,
2030 \begin_inset Flex CharStyle:MenuItem
2033 \begin_layout Plain Layout
2040 Several variables can be used in the definition of converters:
2043 \begin_layout Labeling
2044 \labelwidthstring 00.00.0000
2045 \begin_inset Flex CharStyle:Code
2048 \begin_layout Plain Layout
2054 The LyX system directory
2057 \begin_layout Labeling
2058 \labelwidthstring 00.00.0000
2059 \begin_inset Flex CharStyle:Code
2062 \begin_layout Plain Layout
2071 \begin_layout Labeling
2072 \labelwidthstring 00.00.0000
2073 \begin_inset Flex CharStyle:Code
2076 \begin_layout Plain Layout
2085 \begin_layout Labeling
2086 \labelwidthstring 00.00.0000
2087 \begin_inset Flex CharStyle:Code
2090 \begin_layout Plain Layout
2096 The base filename of the input file (i.
2097 \begin_inset space \thinspace{}
2100 g., without the extension)
2103 \begin_layout Labeling
2104 \labelwidthstring 00.00.0000
2105 \begin_inset Flex CharStyle:Code
2108 \begin_layout Plain Layout
2114 The path to the input file
2117 \begin_layout Labeling
2118 \labelwidthstring 00.00.0000
2119 \begin_inset Flex CharStyle:Code
2122 \begin_layout Plain Layout
2128 The path to the original input file (this is different from $$p when a
2129 chain of converters is called).
2132 \begin_layout Standard
2134 \begin_inset Flex CharStyle:MenuItem
2137 \begin_layout Plain Layout
2139 \begin_inset space ~
2147 field you can enter the following flags, separated by commas:
2150 \begin_layout Labeling
2151 \labelwidthstring 00.00.0000
2152 \begin_inset Flex CharStyle:Code
2155 \begin_layout Plain Layout
2161 This converter runs some form of LaTeX.
2162 This will make LyX's LaTeX error logs available.
2165 \begin_layout Labeling
2166 \labelwidthstring 00.00.0000
2167 \begin_inset Flex CharStyle:Code
2170 \begin_layout Plain Layout
2177 \begin_inset Flex CharStyle:MenuItem
2180 \begin_layout Plain Layout
2186 file for the conversion.
2189 \begin_layout Labeling
2190 \labelwidthstring 00.00.0000
2191 \begin_inset Flex CharStyle:Code
2194 \begin_layout Plain Layout
2203 \begin_layout Standard
2204 The following three flags are not really flags at all because they take
2206 \begin_inset Flex CharStyle:MenuItem
2209 \begin_layout Plain Layout
2211 \begin_inset space ~
2215 \begin_inset space ~
2226 \begin_layout Labeling
2227 \labelwidthstring 00.00.0000
2228 \begin_inset Flex CharStyle:Code
2231 \begin_layout Plain Layout
2237 If set, the converter's standard error will be redirected to a file
2238 \begin_inset Flex CharStyle:Code
2241 \begin_layout Plain Layout
2247 , and the script given as argument will be run as:
2248 \begin_inset Flex CharStyle:Code
2251 \begin_layout Plain Layout
2252 script < infile.out > infile.log
2258 The argument may contain
2259 \begin_inset Flex CharStyle:Code
2262 \begin_layout Plain Layout
2271 \begin_layout Labeling
2272 \labelwidthstring 00.00.0000
2273 \begin_inset Flex CharStyle:Code
2276 \begin_layout Plain Layout
2282 The name of the directory in which the converter will dump the generated
2284 LyX will not create this directory, and it does not copy anything into
2285 it, though it will copy this directory to the destination.
2286 The argument may contain
2287 \begin_inset Flex CharStyle:Code
2290 \begin_layout Plain Layout
2296 , which will be replaced by the base name of the input and output files,
2297 respectively, when the directory is copied.
2298 \begin_inset Newline newline
2301 Note that resultdir and usetempdir make no sense together.
2302 The latter will be ignored if the former is given.
2305 \begin_layout Labeling
2306 \labelwidthstring 00.00.0000
2307 \begin_inset Flex CharStyle:Code
2310 \begin_layout Plain Layout
2316 Determines the output file name and may, contain
2317 \begin_inset Flex CharStyle:Code
2320 \begin_layout Plain Layout
2327 Sensible only with resultdir and optional even then; if not given, it defaults
2331 \begin_layout Standard
2332 None of these last three are presently used in any of the converters that
2333 are installed with LyX.
2337 \begin_layout Standard
2338 You do not have to define converters for all formats between which you want
2340 For example, you will note that there is no `LyX to PostScript' converter,
2341 but LyX will export PostScript.
2342 It does so by first creating a LaTeX file (no converter needs to be defined
2343 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2344 and finally converting the resulting DVI file to PostScript.
2345 LyX finds such `chains' of converters automatically, and it will always
2346 choose the shortest possible chain.
2347 You can, though, still define multiple conversion methods between file
2349 For example, the standard LyX configuration provides three ways to convert
2350 LaTeX to PDF: Directly, using
2351 \begin_inset Flex CharStyle:MenuItem
2354 \begin_layout Plain Layout
2360 ; via (DVI and) PostScript, using
2361 \begin_inset Flex CharStyle:MenuItem
2364 \begin_layout Plain Layout
2371 \begin_inset Flex CharStyle:MenuItem
2374 \begin_layout Plain Layout
2381 To define such alternate chains, you must define multiple target `file
2382 formats', as described in section
2383 \begin_inset CommandInset ref
2385 reference "sec:Formats"
2390 For example, in the standard configuration, the formats named
2391 \begin_inset Flex CharStyle:MenuItem
2394 \begin_layout Plain Layout
2401 \begin_inset Flex CharStyle:MenuItem
2404 \begin_layout Plain Layout
2411 \begin_inset Flex CharStyle:MenuItem
2414 \begin_layout Plain Layout
2420 are defined, all of which share the extension
2421 \begin_inset Flex CharStyle:MenuItem
2424 \begin_layout Plain Layout
2430 , and which correspond to the conversion methods just mentioned.
2433 \begin_layout Chapter
2434 Internationalizing LyX
2435 \begin_inset CommandInset label
2437 name "cha:Internationalizing-LyX"
2444 \begin_layout Standard
2445 LyX supports using a translated interface.
2446 Last time we checked, LyX provided text in thirty languages.
2447 The language of choice is called your
2452 (For further reading on locale settings, see also the documentation for
2453 locale that comes with your operating system.
2454 For Linux, the manual page for
2455 \begin_inset Flex CharStyle:Code
2458 \begin_layout Plain Layout
2464 could be a good place to start).
2467 \begin_layout Standard
2468 Notice that these translations will work, but do contain a few flaws.
2469 In particular, all dialogs have been designed with the English text in
2470 mind, which means that some of the translated text will be too large to
2471 fit within the space allocated.
2472 This is only a display problem and will not cause any harm.
2473 Also, you will find that some of the translations do not define shortcut
2474 keys for everything.
2475 Sometimes, there are simply not enough free letters to do it.
2476 Other times, the translator just hasn't got around to doing it yet.
2477 Our localization team, which you may wish to join,
2481 \begin_layout Plain Layout
2482 If you are a fluent speaker of a language other than English, joining these
2483 teams is a great way to give back to the LyX community!
2488 will of course try to fix these shortcomings in future versions of LyX.
2491 \begin_layout Section
2495 \begin_layout Subsection
2496 Translating the graphical user interface (text messages).
2499 \begin_layout Standard
2501 \begin_inset Flex CharStyle:Code
2504 \begin_layout Plain Layout
2510 library to handle the internationalization of the interface.
2511 To have LyX speak your favorite language in all menus and dialogs, you
2513 \begin_inset Flex CharStyle:Code
2516 \begin_layout Plain Layout
2522 -file for that language.
2523 When this is available, you'll have to generate a
2524 \begin_inset Flex CharStyle:Code
2527 \begin_layout Plain Layout
2533 -file from it and install the
2534 \begin_inset Flex CharStyle:Code
2537 \begin_layout Plain Layout
2544 The process of doing all of this is explained in the documentation for
2546 \begin_inset Flex CharStyle:Code
2549 \begin_layout Plain Layout
2556 It is possible to do this just for yourself, but if you're going to do
2557 it, you might as well share the results of your labors with the rest of
2559 Send a message to the LyX developers' list for more information about how
2563 \begin_layout Standard
2564 In short, this is what you should do (xx denotes the language code):
2567 \begin_layout Itemize
2568 Check out the LyX source code.
2570 \begin_inset CommandInset href
2572 name "information on the web"
2573 target "http://www.lyx.org/devel/cvs.php"
2580 \begin_layout Itemize
2582 \begin_inset Flex CharStyle:Code
2585 \begin_layout Plain Layout
2591 to the folder of the
2592 \begin_inset Flex CharStyle:Code
2595 \begin_layout Plain Layout
2603 \begin_inset Flex CharStyle:Code
2606 \begin_layout Plain Layout
2614 \begin_inset Flex CharStyle:Code
2617 \begin_layout Plain Layout
2623 doesn't exist anywhere, it can be remade with the console command
2624 \begin_inset Flex CharStyle:Code
2627 \begin_layout Plain Layout
2633 in that directory, or you can use an existing po-file for some other language
2637 \begin_layout Itemize
2639 \begin_inset Flex CharStyle:Code
2642 \begin_layout Plain Layout
2652 \begin_layout Plain Layout
2653 This is just a text file, so it can be edited in any text editor.
2654 But there are also specialized programs that support such editing, such
2659 (for all platforms) or
2668 contains a `mode' for editing
2669 \begin_inset Flex CharStyle:Code
2672 \begin_layout Plain Layout
2683 For some menu- and widget-labels, there are also shortcut keys that should
2685 Those keys are marked after a `|', and should be translated according to
2686 the words and phrases of the language.
2687 You should also fill also out the information at the beginning of the new
2689 \begin_inset Flex CharStyle:Code
2692 \begin_layout Plain Layout
2698 -file with your email-address, etc., so people know where to reach you with
2699 suggestions and entertaining flames.
2702 \begin_layout Standard
2703 If you are just doing this on your own, then:
2706 \begin_layout Itemize
2708 \begin_inset Flex CharStyle:Code
2711 \begin_layout Plain Layout
2718 This can be done with
2719 \begin_inset Flex CharStyle:Code
2722 \begin_layout Plain Layout
2723 msgfmt -o xx.mo < xx.po
2731 \begin_layout Itemize
2733 \begin_inset Flex CharStyle:Code
2736 \begin_layout Plain Layout
2742 -file to your locale-tree, at the correct directory for application messages
2747 xx, and under the name
2748 \begin_inset Flex CharStyle:Code
2751 \begin_layout Plain Layout
2758 \begin_inset space \thinspace{}
2762 \begin_inset space \space{}
2766 \begin_inset Flex CharStyle:Code
2769 \begin_layout Plain Layout
2770 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2780 \begin_layout Standard
2781 As said, however, it would be best if the new
2782 \begin_inset Flex CharStyle:Code
2785 \begin_layout Plain Layout
2791 -file could be added to the LyX distribution, so others can use it.
2792 Adding it involves making additional changes to LyX.
2793 So send an email to the developers' mailing list if you're interested in
2797 \begin_layout Subsubsection
2801 \begin_layout Standard
2802 Sometimes it turns out that one English message needs to be translated into
2803 different messages in the target language.
2804 One example is the message
2805 \begin_inset Flex CharStyle:Code
2808 \begin_layout Plain Layout
2814 which has the German translation
2822 , depending upon exactly what the English
2823 \begin_inset Quotes eld
2827 \begin_inset Quotes erd
2832 \begin_inset Flex CharStyle:Code
2835 \begin_layout Plain Layout
2841 does not handle such ambiguous translations.
2842 Therefore you have to add some context information to the message: Instead
2844 \begin_inset Flex CharStyle:Code
2847 \begin_layout Plain Layout
2854 \begin_inset Flex CharStyle:Code
2857 \begin_layout Plain Layout
2858 To[[as in 'From format x to format y']]
2864 \begin_inset Flex CharStyle:Code
2867 \begin_layout Plain Layout
2868 To[[as in 'From page x to page y']].
2873 Now the two occurrences of
2874 \begin_inset Flex CharStyle:Code
2877 \begin_layout Plain Layout
2884 \begin_inset Flex CharStyle:Code
2887 \begin_layout Plain Layout
2893 and can be translated correctly to
2904 \begin_layout Standard
2905 Of course the context information needs to be stripped off the original
2906 message when no translation is used.
2907 Therefore you have to put it in double square brackets at the end of the
2908 message (see the example above).
2909 The translation mechanism of LyX ensures that everything in double square
2910 brackets at the end of messages is removed before displaying the message.
2913 \begin_layout Subsection
2914 Translating the documentation.
2917 \begin_layout Standard
2918 The online documentation (in the
2919 \begin_inset Flex CharStyle:MenuItem
2922 \begin_layout Plain Layout
2928 -menu) can (and should!) be translated.
2929 If there are translated versions of the documentation available
2933 \begin_layout Plain Layout
2934 As of March 2008, at least some of the documents have been translated into
2935 fourteen languages, with the Tutorial available in a few more.
2940 and the locale is set accordingly, these will be used automagically by
2942 LyX looks for translated versions as
2943 \begin_inset Flex CharStyle:Code
2946 \begin_layout Plain Layout
2947 LyXDir/doc/xx/DocName.lyx
2953 \begin_inset Flex CharStyle:Code
2956 \begin_layout Plain Layout
2962 is the code for the language currently in use.
2963 If there are no translated documents, the default English versions will
2965 Note that the translated versions must have the same filenames (
2966 \begin_inset Flex CharStyle:Code
2969 \begin_layout Plain Layout
2975 above) as the original.
2976 If you feel up to translating the documentation (an excellent way to proof-read
2977 the original documentation by the way!), there are a few things you should
2981 \begin_layout Itemize
2982 Check out the documentation translation web page at
2983 \begin_inset CommandInset href
2985 name "http://www.lyx.org/Translation"
2986 target "http://www.lyx.org/Translation"
2991 That way, you can find out which (if any) documents have already been translate
2992 d into your language.
2993 You can also find out who (if anyone) is organizing the effort to translate
2994 the documentation into your language.
2995 If no one is organizing the effort, please let us know that you're interested.
2998 \begin_layout Standard
2999 Once you get to actually translating, here's a few hints for you that may
3003 \begin_layout Itemize
3004 Join the documentation team! There is information on how to do that in
3005 \begin_inset Flex CharStyle:Code
3008 \begin_layout Plain Layout
3015 \begin_inset Flex CharStyle:MenuItem
3018 \begin_layout Plain Layout
3019 Help\SpecialChar \menuseparator
3025 ), which by the way is the first document you should translate.
3028 \begin_layout Itemize
3029 Learn the typographic conventions for the language you are translating to.
3030 Typography is an ancient art and over the centuries, a great variety of
3031 conventions have developed throughout different parts of the world.
3032 Also study the professional terminology amongst typographers in your country.
3033 Inventing your own terminology will only confuse the users.
3036 (Warning! Typography is addictive!)
3039 \begin_layout Itemize
3040 Make a copy of the document.
3041 This will be your working copy.
3042 You can use this as your personal translated help-file by placing it in
3044 \begin_inset Flex CharStyle:Code
3047 \begin_layout Plain Layout
3056 \begin_layout Itemize
3057 Sometimes the original document (from the LyX-team) will be updated.
3058 Use the source viewer at
3059 \begin_inset CommandInset href
3061 name "http://www.lyx.org/trac/timeline"
3062 target "http://www.lyx.org/trac/timeline"
3066 to see what has been changed.
3067 That way you can easily see which parts of the translated document need
3071 \begin_layout Standard
3072 If you ever find an error in the original document, fix it and notify the
3073 rest of the documentation team of the changes! (You didn't forget to join
3074 the documentation team, did you?)
3077 \begin_layout Standard
3078 \begin_inset Branch OutDated
3081 \begin_layout Section
3082 International Keyboard Support
3085 \begin_layout Standard
3088 [Editor's Note: The following section is by
3096 It needs to be fixed to conform to the new Documentation Style sheet and
3097 to make use of the new v1.0 features.
3098 The whole thing also needs to be merged with the section following it.-jw
3099 It may also be badly out of date.-rh (2008)]
3102 \begin_layout Subsection
3103 Defining Own Keymaps: Keymap File Format
3106 \begin_layout Standard
3107 Let's look at a keyboard definition file a little closer.
3108 It is a plain text file defining
3111 \begin_layout Itemize
3112 key-to-key or key-to-string translations
3115 \begin_layout Itemize
3119 \begin_layout Itemize
3120 dead keys exceptions
3123 \begin_layout Standard
3124 To define key-to-key or key-to-string translation, use this command:
3127 \begin_layout Quotation
3128 \begin_inset Flex CharStyle:Code
3131 \begin_layout Plain Layout
3140 \begin_inset Flex CharStyle:Code
3143 \begin_layout Plain Layout
3152 \begin_layout Standard
3154 \begin_inset Flex CharStyle:Code
3157 \begin_layout Plain Layout
3163 is the key to be translated and
3164 \begin_inset Flex CharStyle:Code
3167 \begin_layout Plain Layout
3173 is the string to be inserted into the document.
3174 To define dead keys, use:
3177 \begin_layout Quotation
3178 \begin_inset Flex CharStyle:Code
3181 \begin_layout Plain Layout
3190 \begin_inset Flex CharStyle:Code
3193 \begin_layout Plain Layout
3202 \begin_layout Standard
3204 \begin_inset Flex CharStyle:Code
3207 \begin_layout Plain Layout
3213 is a keyboard key and
3214 \begin_inset Flex CharStyle:Code
3217 \begin_layout Plain Layout
3224 The following dead keys are supported (shortcut name is in parentheses):
3227 \begin_layout Quotation
3231 \begin_inset space \hfill{}
3237 \begin_layout Quotation
3239 \begin_inset space \hfill{}
3245 \begin_layout Quotation
3247 \begin_inset space \hfill{}
3253 \begin_layout Quotation
3255 \begin_inset space \hfill{}
3261 \begin_layout Quotation
3263 \begin_inset space \hfill{}
3269 \begin_layout Quotation
3271 \begin_inset space \hfill{}
3278 \begin_layout Plain Layout
3290 \begin_layout Quotation
3292 \begin_inset space \hfill{}
3298 \begin_layout Quotation
3300 \begin_inset space \hfill{}
3307 \begin_layout Plain Layout
3319 \begin_layout Quotation
3321 \begin_inset space \hfill{}
3327 \begin_layout Quotation
3329 \begin_inset space \hfill{}
3335 \begin_layout Quotation
3337 \begin_inset space \hfill{}
3344 \begin_layout Plain Layout
3356 \begin_layout Quotation
3358 \begin_inset space \hfill{}
3365 \begin_layout Plain Layout
3377 \begin_layout Quotation
3379 \begin_inset space \hfill{}
3385 \begin_layout Quotation
3386 hungarian umlaut (hug)
3387 \begin_inset space \hfill{}
3393 \begin_layout Quotation
3395 \begin_inset space \hfill{}
3401 \begin_layout Quotation
3403 \begin_inset space \hfill{}
3410 \begin_layout Plain Layout
3422 \begin_layout Standard
3423 Since in many international keyboards there are exceptions to what some
3424 dead keys should do, you can define them using
3427 \begin_layout Quotation
3428 \begin_inset Flex CharStyle:Code
3431 \begin_layout Plain Layout
3439 deadkey key outstring
3442 \begin_layout Standard
3443 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3447 \begin_layout Quotation
3448 \begin_inset Flex CharStyle:Code
3451 \begin_layout Plain Layout
3464 \begin_layout Standard
3465 to make it work correctly.
3466 Also, you have to define as exceptions dead keys over i and j, to remove
3467 the dot from them before inserting an accent mark.
3468 I will change this when the time comes, but so far I haven't had time.
3471 \begin_layout Standard
3472 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3475 \begin_inset Flex CharStyle:Code
3478 \begin_layout Plain Layout
3484 have different meaning.
3486 \begin_inset Flex CharStyle:Code
3489 \begin_layout Plain Layout
3495 marks comments, quotes start and end LaTeX-style commands.
3496 To enter quote, you'll need to use
3497 \begin_inset Flex CharStyle:Code
3500 \begin_layout Plain Layout
3509 \begin_inset Flex CharStyle:Code
3512 \begin_layout Plain Layout
3519 \begin_inset Flex CharStyle:Code
3522 \begin_layout Plain Layout
3533 \begin_layout Standard
3534 If you make a keyboard description file that works for your language, please
3535 mail it to me, so I can include it in the next keymap distribution.
3538 \begin_layout Standard
3539 More keywords will be supported in keymap configuration file in future,
3543 \begin_layout Itemize
3544 \begin_inset Flex CharStyle:Code
3547 \begin_layout Plain Layout
3558 \begin_inset space \hfill{}
3562 \begin_inset Flex CharStyle:Code
3565 \begin_layout Plain Layout
3574 \begin_layout Itemize
3575 \begin_inset Flex CharStyle:Code
3578 \begin_layout Plain Layout
3589 \begin_inset space \hfill{}
3593 \begin_inset Flex CharStyle:Code
3596 \begin_layout Plain Layout
3602 an external keymap translation program
3605 \begin_layout Standard
3606 Also, it should look into
3607 \begin_inset Flex CharStyle:Code
3610 \begin_layout Plain Layout
3616 file for defaults, too (for example, a
3617 \begin_inset Flex CharStyle:Code
3620 \begin_layout Plain Layout
3628 option to include default keyboard).
3636 \begin_layout Section
3637 International Keymap Stuff
3638 \begin_inset CommandInset label
3640 name "sec:International-Keymap-Stuff"
3647 \begin_layout Standard
3648 \begin_inset Note Note
3651 \begin_layout Plain Layout
3652 In doing the revisions on this document in March 2008, I did not look over
3653 this stuff, as I do not understand it.
3654 It would be good if someone else could do so.
3663 \begin_layout Standard
3664 The next two sections describe the
3665 \begin_inset Flex CharStyle:Code
3668 \begin_layout Plain Layout
3677 \begin_inset Flex CharStyle:Code
3680 \begin_layout Plain Layout
3688 file syntax in detail.
3689 These sections should help you design your own key map if the ones provided
3690 do not meet your needs.
3693 \begin_layout Subsection
3697 \begin_layout Standard
3701 \begin_inset Flex CharStyle:Code
3704 \begin_layout Plain Layout
3710 file maps keystrokes to characters or strings.
3711 As the name suggests, it sets a keyboard mapping.
3713 \begin_inset Flex CharStyle:Code
3716 \begin_layout Plain Layout
3727 \begin_inset Flex CharStyle:Code
3730 \begin_layout Plain Layout
3745 \begin_inset Flex CharStyle:Code
3748 \begin_layout Plain Layout
3761 \begin_inset Flex CharStyle:Code
3764 \begin_layout Plain Layout
3773 \begin_inset Flex CharStyle:Code
3776 \begin_layout Plain Layout
3784 are described in this section.
3787 \begin_layout Labeling
3788 \labelwidthstring 00.00.0000
3789 \begin_inset Flex CharStyle:Code
3792 \begin_layout Plain Layout
3800 Map a character to a string
3803 \begin_layout LyX-Code
3818 \begin_layout Standard
3851 the double-quote (")
3868 must be escaped with a preceding backslash (
3879 \begin_layout Standard
3881 \begin_inset Flex CharStyle:MenuItem
3884 \begin_layout Plain Layout
3892 statement to cause the symbol
3893 \begin_inset Flex CharStyle:MenuItem
3896 \begin_layout Plain Layout
3904 to be output for the keystroke
3905 \begin_inset Flex CharStyle:MenuItem
3908 \begin_layout Plain Layout
3919 \begin_layout LyX-Code
3925 \begin_layout Labeling
3926 \labelwidthstring 00.00.0000
3927 \begin_inset Flex CharStyle:Code
3930 \begin_layout Plain Layout
3938 Specify an accent character
3941 \begin_layout LyX-Code
3950 \begin_layout Standard
3951 This will make the cha
3989 This is the dead key
3993 \begin_layout Plain Layout
4000 refers to a key that does not produce a character by itself, but when followed
4001 with another key, produces the desired accent character.
4002 For example, a German characte
4004 r with an umlaut like
4014 can be produced in this manner.
4023 \begin_layout Standard
4036 and then another key not in
4053 followed by the other, not allowed key, as output.
4057 \begin_inset Flex CharStyle:MenuItem
4060 \begin_layout Plain Layout
4068 cancels a dead key, so if
4079 \begin_inset Flex CharStyle:MenuItem
4082 \begin_layout Plain Layout
4091 , the cursor will not go one position backwards but will instead cancel
4107 might have had on the next keystroke.
4111 \begin_layout Standard
4112 The following example specifies that the character ' is to be an acute accent,
4113 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4116 \begin_layout LyX-Code
4119 kmod ' acute aeiouAEIOU
4122 \begin_layout Labeling
4123 \labelwidthstring 00.00.0000
4124 \begin_inset Flex CharStyle:Code
4127 \begin_layout Plain Layout
4133 Specify an exception to the accent character
4136 \begin_layout LyX-Code
4145 \begin_layout Standard
4146 This defines an exce
4187 have been assigned a keystroke with a previous
4190 \begin_inset Flex CharStyle:Code
4193 \begin_layout Plain Layout
4217 must not belong in the
4264 If such a declaration does not exist in
4272 \begin_inset Flex CharStyle:Code
4275 \begin_layout Plain Layout
4309 \begin_inset Flex CharStyle:Code
4312 \begin_layout Plain Layout
4326 \begin_layout Standard
4327 The following command produces causes äi to be produced when you enter acute-i
4331 \begin_layout LyX-Code
4345 \begin_layout Labeling
4346 \labelwidthstring 00.00.0000
4347 \begin_inset Flex CharStyle:Code
4350 \begin_layout Plain Layout
4356 Combine two accent characters
4359 \begin_layout LyX-Code
4365 accent1 accent2 allowed
4368 \begin_layout Standard
4369 This one is getting pretty esoteric.
4370 It allows you to combine the effect
4426 \begin_inset Flex CharStyle:Code
4429 \begin_layout Plain Layout
4457 \begin_layout Standard
4458 Consider this example from the
4459 \begin_inset Flex CharStyle:Code
4462 \begin_layout Plain Layout
4473 \begin_layout LyX-Code
4476 kmod ; acute aeioyvhAEIOYVH
4480 kcomb acute umlaut iyIY
4483 \begin_layout Standard
4484 This allows you to press
4485 \begin_inset Flex CharStyle:MenuItem
4488 \begin_layout Plain Layout
4496 and get the effect of
4497 \begin_inset Flex CharStyle:Code
4500 \begin_layout Plain Layout
4519 in this case cancels the last dead key, so if you press
4520 \begin_inset Flex CharStyle:MenuItem
4523 \begin_layout Plain Layout
4532 \begin_inset Flex CharStyle:Code
4535 \begin_layout Plain Layout
4548 \begin_layout Subsection
4552 \begin_layout Standard
4554 \begin_inset Flex CharStyle:Code
4557 \begin_layout Plain Layout
4565 mapping is performed, a
4566 \begin_inset Flex CharStyle:Code
4569 \begin_layout Plain Layout
4579 file maps the strings that the symbols generate to characters in the current
4581 The LyX distribution currently includes at least the
4582 \begin_inset Flex CharStyle:Code
4585 \begin_layout Plain Layout
4594 \begin_inset Flex CharStyle:Code
4597 \begin_layout Plain Layout
4608 \begin_layout Standard
4610 \begin_inset Flex CharStyle:Code
4613 \begin_layout Plain Layout
4621 file is a sequence of declarations of the form
4624 \begin_layout LyX-Code
4637 \begin_layout Standard
4638 For example, in order to map
4639 \begin_inset Flex CharStyle:MenuItem
4642 \begin_layout Plain Layout
4652 to the corresponding character in the iso-8859-1 set (233), the following
4656 \begin_layout LyX-Code
4664 \begin_layout Standard
4666 \begin_inset Flex CharStyle:Code
4669 \begin_layout Plain Layout
4678 \begin_inset Flex CharStyle:Code
4681 \begin_layout Plain Layout
4699 the same character can apply to more than one string.
4701 \begin_inset Flex CharStyle:Code
4704 \begin_layout Plain Layout
4715 \begin_layout LyX-Code
4727 \begin_inset Newline newline
4743 \begin_layout Standard
4744 If LyX cannot find a mapping for the string produced by the keystroke or
4745 a deadkey sequence, it will check if it looks like an accented char and
4746 try to draw an accent over the character on screen.
4749 \begin_layout Subsection
4753 \begin_layout Standard
4754 There is a second way to add support for international characters through
4755 so-called dead-keys.
4756 A dead-key works in combination with a letter to produce an accented character.
4757 Here, we'll explain how to create a really simple dead-key to illustrate
4761 \begin_layout Standard
4762 Suppose you happen to need the circumflex character,
4763 \begin_inset Quotes eld
4767 \begin_inset Quotes erd
4772 \begin_inset Flex CharStyle:MenuItem
4775 \begin_layout Plain Layout
4782 \begin_inset space ~
4786 \begin_inset Flex CharStyle:MenuItem
4789 \begin_layout Plain Layout
4795 ] to the LyX command
4796 \begin_inset Flex CharStyle:Code
4799 \begin_layout Plain Layout
4806 \begin_inset Flex CharStyle:Code
4809 \begin_layout Plain Layout
4816 Now, whenever you type the
4817 \begin_inset Flex CharStyle:MenuItem
4820 \begin_layout Plain Layout
4826 -key followed by a letter, that letter will have a circumflex accent on
4828 For example, the sequence
4829 \begin_inset Quotes eld
4833 \begin_inset Flex CharStyle:MenuItem
4836 \begin_layout Plain Layout
4843 \begin_inset Quotes erd
4846 produces the letter:
4847 \begin_inset Quotes eld
4851 \begin_inset Quotes erd
4855 If you tried to type
4856 \begin_inset Quotes eld
4860 \begin_inset Flex CharStyle:MenuItem
4863 \begin_layout Plain Layout
4870 \begin_inset Quotes erd
4873 , however, LyX will complain with a beep, since a
4874 \begin_inset Quotes eld
4878 \begin_inset Flex CharStyle:MenuItem
4881 \begin_layout Plain Layout
4888 \begin_inset Quotes erd
4891 never takes a circumflex accent.
4893 \begin_inset Flex CharStyle:MenuItem
4896 \begin_layout Plain Layout
4902 after a dead-key produces the bare-accent.
4903 Please note this last point! If you bind a key to a dead-key, you'll need
4904 to rebind the character on that key to yet another key.
4906 \begin_inset Flex CharStyle:MenuItem
4909 \begin_layout Plain Layout
4915 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
4918 \begin_layout Standard
4919 One common way to bind dead-keys is to use
4920 \begin_inset Flex CharStyle:MenuItem
4923 \begin_layout Plain Layout
4930 \begin_inset Flex CharStyle:MenuItem
4933 \begin_layout Plain Layout
4940 \begin_inset Flex CharStyle:MenuItem
4943 \begin_layout Plain Layout
4949 in combination with an accent, like
4950 \begin_inset Quotes eld
4954 \begin_inset Flex CharStyle:MenuItem
4957 \begin_layout Plain Layout
4964 \begin_inset Quotes erd
4968 \begin_inset Quotes eld
4972 \begin_inset Flex CharStyle:MenuItem
4975 \begin_layout Plain Layout
4982 \begin_inset Quotes erd
4986 \begin_inset Quotes eld
4990 \begin_inset Flex CharStyle:MenuItem
4993 \begin_layout Plain Layout
5000 \begin_inset Quotes erd
5004 Another way involves using
5005 \begin_inset Flex CharStyle:Code
5008 \begin_layout Plain Layout
5015 \begin_inset Flex CharStyle:Code
5018 \begin_layout Plain Layout
5024 to set up the special
5025 \begin_inset Flex CharStyle:Code
5028 \begin_layout Plain Layout
5036 \begin_inset Flex CharStyle:Code
5039 \begin_layout Plain Layout
5045 acts in some ways just like
5046 \begin_inset Flex CharStyle:MenuItem
5049 \begin_layout Plain Layout
5055 and permits you to bind keys to accented characters.
5056 You can also turn keys into dead-keys by binding them to something like
5058 \begin_inset Flex CharStyle:Code
5061 \begin_layout Plain Layout
5067 and then binding this symbolic key to the corresponding LyX command.
5071 \begin_layout Plain Layout
5076 : This is exactly what I do in my
5077 \begin_inset Flex CharStyle:Code
5080 \begin_layout Plain Layout
5087 \begin_inset Flex CharStyle:Code
5090 \begin_layout Plain Layout
5098 \begin_inset Flex CharStyle:MenuItem
5101 \begin_layout Plain Layout
5103 \begin_inset space ~
5112 \begin_inset Flex CharStyle:Code
5115 \begin_layout Plain Layout
5121 and a bunch of these
5122 \begin_inset Quotes eld
5126 \begin_inset Flex CharStyle:Code
5129 \begin_layout Plain Layout
5136 \begin_inset Quotes erd
5139 symbolic keys bound such things as
5140 \begin_inset Flex CharStyle:MenuItem
5143 \begin_layout Plain Layout
5145 \begin_inset space ~
5154 \begin_inset Flex CharStyle:MenuItem
5157 \begin_layout Plain Layout
5159 \begin_inset space ~
5168 This is how I produce my accented characters.
5173 You can make just about anything into the
5174 \begin_inset Flex CharStyle:Code
5177 \begin_layout Plain Layout
5184 \begin_inset Flex CharStyle:MenuItem
5187 \begin_layout Plain Layout
5193 keys, a spare function key, etc.
5194 As for the LyX commands that produce accents, check the entry for
5195 \begin_inset Flex CharStyle:Code
5198 \begin_layout Plain Layout
5209 You'll find the complete list there.
5212 \begin_layout Subsection
5213 Saving your Language Configuration
5216 \begin_layout Standard
5217 You can edit your preferences so that your desired language environment
5218 is automatically configured when LyX starts up, via the
5219 \begin_inset Flex CharStyle:MenuItem
5222 \begin_layout Plain Layout
5223 Edit\SpecialChar \menuseparator
5232 \begin_layout Chapter
5233 Installing New Document Classes, Layouts, and Templates
5234 \begin_inset CommandInset label
5236 name "cha:Installing-New-Document"
5244 \begin_layout Plain Layout
5245 Installing New Document Classes
5253 \begin_layout Standard
5254 In this chapter, we describe the procedures for creating and installing
5255 new LyX layout and template files, as well as offer a refresher on correctly
5256 installing new LaTeX document classes.
5260 \begin_layout Standard
5261 First, let us a say a few words about how one ought to think about the relation
5262 between LyX and LaTeX.
5263 The thing to understand is that, in a certain sense, LyX doesn't know anything
5265 Indeed, from LyX's point of view, LaTeX is just one of several
5266 \begin_inset Quotes eld
5270 \begin_inset Quotes erd
5273 in which it is capable of producing output.
5274 Other such formats are DocBook, plaintext, and XHTML.
5275 LaTeX is, of course, a particularly important format, but very little of
5276 the information LyX has about LaTeX is actually contained in the program
5281 \begin_layout Plain Layout
5282 Some commands are sufficiently complex that they are
5283 \begin_inset Quotes eld
5287 \begin_inset Quotes erd
5291 But the developers generally regard this as a Bad Thing.
5296 Rather, that information, even for the standard classes like
5297 \begin_inset Flex CharStyle:Code
5300 \begin_layout Plain Layout
5306 , is contained in layout files.
5309 \begin_layout Standard
5310 You can think of the layout file for a given document class as a translation
5311 manual between LyX constructs---paragraphs with their corresponding styles,
5312 certain sorts of insets, etc---and the corresponding LaTeX constructs.
5313 Almost everything LyX knows about
5314 \begin_inset Flex CharStyle:Code
5317 \begin_layout Plain Layout
5323 , for example, is contained in the file
5324 \begin_inset Flex CharStyle:Code
5327 \begin_layout Plain Layout
5334 For this reason, anyone intending to write layout files should plan to
5335 study the existing files.
5336 A good place to start is with
5337 \begin_inset Flex CharStyle:Code
5340 \begin_layout Plain Layout
5346 , which just gets `included' in
5347 \begin_inset Flex CharStyle:Code
5350 \begin_layout Plain Layout
5357 \begin_inset Flex CharStyle:Code
5360 \begin_layout Plain Layout
5366 , and many of the other layout files for document classes.
5367 This file is where sections and the like are defined:
5368 \begin_inset Flex CharStyle:Code
5371 \begin_layout Plain Layout
5377 tells LyX how paragraphs that are marked with the Section, Subsection,
5378 etc, styles can be translated into corresponding LaTeX commands.
5380 \begin_inset Flex CharStyle:Code
5383 \begin_layout Plain Layout
5389 file basically just includes several of these
5390 \begin_inset Flex CharStyle:Code
5393 \begin_layout Plain Layout
5402 \begin_layout Standard
5403 Defining the LyX--LaTeX correspondence is not, however, the only thing layout
5405 Their other job is to define how the LyX constructs themselves will appear
5407 The fact that layout files have these two jobs is often a source of confusion,
5408 because they are completely separate.
5409 Telling LyX how to translate a certain paragraph style into LaTeX does
5410 not tell LyX how to display it; conversely, telling LyX how to display
5411 a certain paragraph style does not tell LyX how to translate it into LaTeX,
5412 let alone tell LaTeX how to display it.
5413 So, in general, when you define a new LyX construct, you must always do
5414 two quite separate things: (i)
5415 \begin_inset space ~
5418 tell LyX how to translate it into LaTeX, and (ii)
5419 \begin_inset space ~
5422 tell LyX how to display it.
5425 \begin_layout Standard
5426 Much the same is true, of course, as regards LyX's other backend formats,
5427 though XHTML is in some ways different, because in that case LyX
5431 able, to some extent, anyway, to use information about how it should display
5432 a paragraph on the screen to output information (in the form of CSS) about
5433 how the paragrpah should be displayed in a browser.
5434 Even in this case, however, the distinction between what LyX does internally
5435 and how things are rendered externally remains in force, and the two can
5436 be controlled separately.
5439 \begin_layout Standard
5440 Some definitions: a document class is a LaTeX file (usually ending in
5441 \begin_inset Flex CharStyle:Code
5444 \begin_layout Plain Layout
5451 \begin_inset Flex CharStyle:Code
5454 \begin_layout Plain Layout
5460 ) that describes the format of a document such as an article, report, journal
5461 preprint, etc, and all the commands needed to realize that format.
5462 A layout file is a LyX file that corresponds to a LaTeX document class
5463 and that tells LyX how to
5464 \begin_inset Quotes eld
5468 \begin_inset Quotes erd
5471 things on the screen to make the display look something like the final
5473 More precisely, a layout file describes a
5474 \begin_inset Quotes eld
5478 \begin_inset Quotes erd
5481 which is the internal construct LyX uses to render the screen display.
5483 \begin_inset Quotes eld
5487 \begin_inset Quotes erd
5491 \begin_inset Quotes eld
5495 \begin_inset Quotes erd
5498 can be used somewhat interchangeably, but it is better to refer to the
5499 file as the layout, and the thing living in LyX's memory as the text class.
5500 A template file is simply a LyX document that contains a set of predefined
5501 entries for a given document class—entries that are generally required
5503 Templates are especially useful for things like journal manuscripts that
5504 are to be submitted electronically.
5507 \begin_layout Section
5508 Installing a new LaTeX package
5511 \begin_layout Standard
5512 Some installations may not include a LaTeX package that you would like to
5514 For example, you might need FoilTeX, a package for preparing slides for
5515 overhead projectors.
5516 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5517 a user interface for installing such packages.
5518 For example, with MiKTeX, you start the program
5519 \begin_inset Quotes eld
5523 \begin_inset Quotes erd
5526 to get a list of available packages.
5527 To install one, right click on it or use the toolbar button to install
5532 \begin_layout Standard
5533 If your LaTeX distribution doesn't provide such a user interface, or if
5534 the file is not available through the package browser, then you can follow
5538 \begin_layout Enumerate
5539 Get the package from
5540 \begin_inset CommandInset href
5543 target "http://www.ctan.org/"
5550 \begin_layout Enumerate
5551 You can install the package in several different places.
5552 If you want it to be available for all users on your system, then you should
5553 install it in your `local' TeX tree; if you want (or need) it to be available
5554 just for you, then you can install it in your own `user' TeX tree.
5555 Where these should be created, if they do not already exist, depends upon
5556 the details of your system.
5557 To find out where they are, look in the file
5558 \begin_inset Flex CharStyle:Code
5561 \begin_layout Plain Layout
5571 \begin_layout Plain Layout
5572 This usually lives in the directory
5573 \begin_inset Flex CharStyle:Code
5576 \begin_layout Plain Layout
5582 , though you can run
5583 \begin_inset Flex CharStyle:Code
5586 \begin_layout Plain Layout
5597 The location of the `local' TeX tree is defined by the
5598 \begin_inset Flex CharStyle:Code
5601 \begin_layout Plain Layout
5607 variable; this is usually somewhere like
5608 \begin_inset Flex CharStyle:Code
5611 \begin_layout Plain Layout
5612 /usr/local/share/texmf/
5618 The `user' TeX tree is defined by
5619 \begin_inset Flex CharStyle:Code
5622 \begin_layout Plain Layout
5629 \begin_inset Flex CharStyle:Code
5632 \begin_layout Plain Layout
5639 (If these variables are not predefined, you can define them.) You'll probably
5640 need root permissions to create or modify the `local' tree; but your `user'
5641 tree shouldn't have such limitations.
5644 \begin_layout Enumerate
5646 \begin_inset Flex CharStyle:Code
5649 \begin_layout Plain Layout
5656 \begin_inset Flex CharStyle:Code
5659 \begin_layout Plain Layout
5666 \begin_inset Flex CharStyle:Code
5669 \begin_layout Plain Layout
5676 \begin_inset space \thinspace{}
5680 \begin_inset Newline newline
5684 \begin_inset Flex CharStyle:Code
5687 \begin_layout Plain Layout
5688 TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
5694 \begin_inset Newline newline
5697 But, again, most of this will
5698 \begin_inset Quotes eld
5702 \begin_inset Quotes erd
5708 \begin_layout Enumerate
5709 Your local and user trees must have the same sort of directory structure
5710 as your main existing
5711 \begin_inset Flex CharStyle:Code
5714 \begin_layout Plain Layout
5720 directory, which will be found at
5721 \begin_inset Flex CharStyle:Code
5724 \begin_layout Plain Layout
5731 \begin_inset Flex CharStyle:Code
5734 \begin_layout Plain Layout
5740 .) For example, latex packages should go under
5741 \begin_inset Flex CharStyle:Code
5744 \begin_layout Plain Layout
5745 $TEXMFLOCAL/tex/latex/
5751 \begin_inset Flex CharStyle:Code
5754 \begin_layout Plain Layout
5755 $TEXMFHOME/tex/latex/
5763 \begin_layout Enumerate
5764 Once your tree is properly set up, you can install the package into an appropria
5766 For example, you might install the FoilTeX files into
5767 \begin_inset Flex CharStyle:Code
5770 \begin_layout Plain Layout
5771 $TEXMFLOCAL/tex/latex/foiltex
5778 \begin_inset Flex CharStyle:Code
5781 \begin_layout Plain Layout
5787 directory contains various files.
5790 \begin_layout Enumerate
5791 Finally, you must update the database TeX uses to find files.
5792 On MiKTeX, this is done by pressing the button
5795 \begin_inset space ~
5800 that you find in MiKTeX's
5801 \begin_inset Quotes eld
5805 \begin_inset Quotes erd
5810 \begin_inset Flex CharStyle:Code
5813 \begin_layout Plain Layout
5814 $TEXMFLOCAL/tex/latex/
5820 Under TeXLive and the like, you should run
5821 \begin_inset Flex CharStyle:Code
5824 \begin_layout Plain Layout
5830 from a terminal, with root permissions if necessary.
5834 \begin_layout Standard
5835 Your package is now installed and available to LaTeX.
5836 You can verify this from a terminal by typing `
5837 \begin_inset Flex CharStyle:Code
5840 \begin_layout Plain Layout
5841 kpsewhich yourfile.ext
5847 To make LyX aware of it, however, you will need to reconfigure (
5848 \begin_inset Flex CharStyle:MenuItem
5851 \begin_layout Plain Layout
5852 Tools\SpecialChar \menuseparator
5858 ) and then restart LyX.
5859 If the new package was a document class, such as FoilTeX again, you will
5861 \begin_inset Flex CharStyle:MenuItem
5864 \begin_layout Plain Layout
5871 \begin_inset Flex CharStyle:MenuItem
5874 \begin_layout Plain Layout
5875 Document\SpecialChar \menuseparator
5876 Settings\SpecialChar \menuseparator
5886 \begin_layout Standard
5887 Unless, of course, no layout file is available for your new document class.
5888 That is the topic of the next section.
5891 \begin_layout Section
5895 \begin_layout Standard
5896 This section describes how to write and install your own LyX layout files
5897 and walks through the
5898 \begin_inset Flex CharStyle:Code
5901 \begin_layout Plain Layout
5907 text class as an example.
5909 \begin_inset Flex CharStyle:Code
5912 \begin_layout Plain Layout
5918 files describe what paragraph and character styles are available for a
5919 given document class, how LyX should display them, and how they should
5920 be translated into LaTeX, DocBook, or whatever output format is being used.
5924 \begin_layout Standard
5925 We shall try to provide a thorough description of the process of writing
5927 However, there are so many different types of documents supported by LaTeX,
5928 DocBook, and so forth, that we can't hope to cover every different possibility
5929 or problem you might encounter.
5930 The LyX users' list is frequented by people with lots of experience with
5931 layout design who are willing to share what they've learned, so please
5932 feel free to ask questions there.
5935 \begin_layout Standard
5936 As you prepare to write a new layout, it is extremely helpful to look at
5937 the layouts distributed with LyX.
5938 If you use a nice LaTeX document class that might also be of interest for
5939 others and so write a corresponding LyX layout, you should consider posting
5941 \begin_inset CommandInset href
5943 name "section on the LyX wiki"
5944 target "http://wiki.lyx.org/Layouts/Layouts"
5948 or even to the LyX developers' list, so that it might be included in LyX
5953 \begin_layout Plain Layout
5954 Note that LyX is licensed under the General Public License, so any material
5955 that is contribued to LyX must be similarly licensed.
5963 \begin_layout Standard
5964 All the tags described here are case-insensitive; this means that
5965 \begin_inset Flex CharStyle:Code
5968 \begin_layout Plain Layout
5975 \begin_inset Flex CharStyle:Code
5978 \begin_layout Plain Layout
5985 \begin_inset Flex CharStyle:Code
5988 \begin_layout Plain Layout
5994 are really the same command.
5995 The possible values are printed in brackets after the feature's name.
5996 The default value if a feature isn't specified inside a text class-description
5998 \begin_inset Flex CharStyle:Code
6001 \begin_layout Plain Layout
6010 If the argument has a data type like
6011 \begin_inset Quotes eld
6015 \begin_inset Quotes erd
6019 \begin_inset Quotes eld
6023 \begin_inset Quotes erd
6026 , the default is shown like this:
6027 \begin_inset Flex CharStyle:Code
6030 \begin_layout Plain Layout
6041 \begin_layout Subsection
6043 \begin_inset CommandInset label
6045 name "sub:Layout-modules"
6052 \begin_layout Standard
6053 We have spoken to this point about `layout files'.
6054 But there are different sorts of files that contain layout information.
6055 Layout files, strictly so called, have the
6056 \begin_inset Flex CharStyle:Code
6059 \begin_layout Plain Layout
6065 extension and provide LyX with information about document classes.
6066 As of LyX 1.6, however, layout informtion can also be contained in layout
6072 \begin_inset Flex CharStyle:Code
6075 \begin_layout Plain Layout
6082 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
6083 some modules—such as the endnotes module—specifcally provide support for
6085 In a sense, layout modules are similar to included
6089 \begin_layout Plain Layout
6090 These can have any extension, but by convention have the
6091 \begin_inset Flex CharStyle:Code
6094 \begin_layout Plain Layout
6106 \begin_inset Flex CharStyle:Code
6109 \begin_layout Plain Layout
6115 —in that modules are not specific to a given document class but may be used
6116 with many different classes.
6117 The difference is that using an included file with
6118 \begin_inset Flex CharStyle:Code
6121 \begin_layout Plain Layout
6127 , say, requires editing that file.
6128 Modules, by contrast, are selected in the
6129 \begin_inset Flex CharStyle:MenuItem
6132 \begin_layout Plain Layout
6133 Document\SpecialChar \menuseparator
6142 \begin_layout Standard
6143 Building modules is the easiest way to get started with layout editing,
6144 since it can be as simple as adding a single new paragraph style or flex
6146 But modules may, in principle, contain anything a layout file can contain.
6149 \begin_layout Standard
6150 A module must begin with a line like the following:
6153 \begin_layout LyX-Code
6156 DeclareLyXModule[endnotes.sty]{Endnotes}
6159 \begin_layout Standard
6160 The mandatory argument, in curly brackets, is the name of the module, as
6162 \begin_inset Flex CharStyle:MenuItem
6165 \begin_layout Plain Layout
6166 Document\SpecialChar \menuseparator
6173 The argument in square brackets is optional: It declares any LaTeX packages
6174 on which the module depends.
6175 Please note that only packages about which LyX knows should be listed in
6176 the square brackets.
6180 \begin_layout Plain Layout
6181 The list of such packages is documented only in the source code.
6186 LyX will not check for arbitrary packages.
6187 It is also possible to use the form
6188 \begin_inset Flex CharStyle:MenuItem
6191 \begin_layout Plain Layout
6197 , which declares that the module can only be used when there exists a conversion
6198 chain between the formats `
6199 \begin_inset Flex CharStyle:Code
6202 \begin_layout Plain Layout
6209 \begin_inset Flex CharStyle:Code
6212 \begin_layout Plain Layout
6221 \begin_layout Standard
6222 The module declaration should then be followed by lines like the following:
6225 \begin_layout LyX-Code
6229 \begin_layout LyX-Code
6230 #Adds an endnote command, in addition to footnotes.
6234 \begin_layout LyX-Code
6235 #You will need to add
6237 theendnotes in TeX code where you
6240 \begin_layout LyX-Code
6241 #want the endnotes to appear.
6245 \begin_layout LyX-Code
6249 \begin_layout LyX-Code
6250 #Requires: somemodule | othermodule
6253 \begin_layout LyX-Code
6254 #Excludes: badmodule
6257 \begin_layout Standard
6258 The description is used in
6259 \begin_inset Flex CharStyle:MenuItem
6262 \begin_layout Plain Layout
6263 Document\SpecialChar \menuseparator
6269 to provide the user with information about what the module does.
6271 \begin_inset Flex CharStyle:Code
6274 \begin_layout Plain Layout
6280 line is used to identify other modules with which this one must be used;
6282 \begin_inset Flex CharStyle:Code
6285 \begin_layout Plain Layout
6291 line is used to identify modules with which this one may not be used.
6292 Both are optional, and, as shown, multiple modules should be separated
6293 with the pipe symbol: |.
6294 Note that the required modules are treated disjunctively:
6298 of the required modules must be used.
6303 excluded module may be used.
6304 Note that modules are identified here by their
6309 \begin_inset Flex CharStyle:Code
6312 \begin_layout Plain Layout
6320 \begin_inset Flex CharStyle:Code
6323 \begin_layout Plain Layout
6330 \begin_inset Flex CharStyle:Code
6333 \begin_layout Plain Layout
6342 \begin_layout Standard
6343 After creating a new module, you will need to reconfigure and then restart
6344 LyX for the module to appear in the menu.
6345 However, changes you make to the module will be seen immediately, if you
6347 \begin_inset Flex CharStyle:MenuItem
6350 \begin_layout Plain Layout
6351 Document\SpecialChar \menuseparator
6357 , highlight something, and then hit
6358 \begin_inset Quotes eld
6362 \begin_inset Quotes erd
6368 It is strongly recommended that you save your work before doing so
6373 it is strongly recommended that you not attempt to edit modules while simultaneo
6374 usly working on actual documents
6377 Though of course the developers strive to keep LyX stable in such situations,
6378 syntax errors and the like in your module file could cause strange behavior.
6381 \begin_layout Subsection
6382 Supporting new document classes
6385 \begin_layout Standard
6386 There are two situations you are likely to encounter when wanting to support
6387 a new LaTeX document class, involving LaTeX2e class (
6388 \begin_inset Flex CharStyle:Code
6391 \begin_layout Plain Layout
6398 \begin_inset Flex CharStyle:Code
6401 \begin_layout Plain Layout
6408 Supporting a style file is usually fairly easy.
6409 Supporting a new document class is a bit harder.
6412 \begin_layout Subsection
6414 \begin_inset Flex CharStyle:MenuItem
6417 \begin_layout Plain Layout
6426 \begin_layout Standard
6427 The easier case is the one in which your new document class is provided
6428 as a style file that is to be used in conjunction with an already supported
6430 Gor the sake of the example, we'll assume that the style file is called
6432 \begin_inset Flex CharStyle:MenuItem
6435 \begin_layout Plain Layout
6441 and it is meant to be used with
6442 \begin_inset Flex CharStyle:MenuItem
6445 \begin_layout Plain Layout
6451 , which is a standard class.
6455 \begin_layout Standard
6456 Start by copying the existing class's layout file into your local directory:
6459 \begin_layout LyX-Code
6460 cp report.layout ~/.lyx/layouts/myclass.layout
6463 \begin_layout Standard
6465 \begin_inset Flex CharStyle:Code
6468 \begin_layout Plain Layout
6474 and change the line:
6477 \begin_layout LyX-Code
6480 DeclareLaTeXClass{report}
6483 \begin_layout Standard
6487 \begin_layout LyX-Code
6490 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6493 \begin_layout Standard
6497 \begin_layout LyX-Code
6499 \begin_inset Newline newline
6505 \begin_inset Newline newline
6511 \begin_layout Standard
6512 near the top of the file.
6515 \begin_layout Standard
6516 Start LyX and select
6517 \begin_inset Flex CharStyle:MenuItem
6520 \begin_layout Plain Layout
6521 Tools\SpecialChar \menuseparator
6528 Then restart LyX and try creating a new document.
6530 \begin_inset Flex CharStyle:MenuItem
6533 \begin_layout Plain Layout
6539 " as a document class option in the
6540 \begin_inset Flex CharStyle:MenuItem
6543 \begin_layout Plain Layout
6544 Document\SpecialChar \menuseparator
6551 It is likely that some of the sectioning commands and such in your new
6552 class will work differently from how they worked in the base class—
6553 \begin_inset Flex CharStyle:Code
6556 \begin_layout Plain Layout
6562 in this example—so you can fiddle around with the settings for the different
6563 sections if you wish.
6564 Your new package may also provide commands or environments not present
6566 In this case, you will want to add these to the layout file.
6568 \begin_inset CommandInset ref
6570 reference "sec:TextClass"
6574 for information on how to do so.
6577 \begin_layout Standard
6579 \begin_inset Flex CharStyle:MenuItem
6582 \begin_layout Plain Layout
6588 can be used with several different document classes, and even if it cannot,
6589 you might find it easiest just to user a module that you can load with
6591 The simplest possible such module would be:
6594 \begin_layout LyX-Code
6597 DeclareLyXModule{My Class}
6600 \begin_layout LyX-Code
6604 \begin_layout LyX-Code
6605 #Support for myclass.sty.
6608 \begin_layout LyX-Code
6610 \begin_inset Newline newline
6616 \begin_layout LyX-Code
6618 \begin_inset Newline newline
6624 \begin_layout LyX-Code
6626 \begin_inset Newline newline
6632 \begin_inset Newline newline
6638 \begin_layout Standard
6639 A more complex module might modify the behavior of some existing constructs
6640 or define some new ones.
6642 \begin_inset CommandInset ref
6644 reference "sec:TextClass"
6651 \begin_layout Subsection
6653 \begin_inset Flex CharStyle:MenuItem
6656 \begin_layout Plain Layout
6665 \begin_layout Standard
6666 There are two possibilities here.
6667 One is that the class file is itself based upon an existing document class.
6668 For example, many thesis classes are based upon
6669 \begin_inset Flex CharStyle:MenuItem
6672 \begin_layout Plain Layout
6679 To see whether yours is, look for a line like
6682 \begin_layout LyX-Code
6688 \begin_layout Standard
6690 If so, then you may proceed largely as in the previous section, though
6692 \begin_inset Flex CharStyle:Code
6695 \begin_layout Plain Layout
6701 line will be different.
6702 If your new class is
6703 \begin_inset Flex CharStyle:Code
6706 \begin_layout Plain Layout
6712 , and it is based upon
6713 \begin_inset Flex CharStyle:Code
6716 \begin_layout Plain Layout
6722 , then the line should read:
6726 \begin_layout Plain Layout
6727 And it will be easiest if you save the file to
6728 \begin_inset Flex CharStyle:Code
6731 \begin_layout Plain Layout
6737 : LyX assumes that the document class has the same name as the layout file.
6746 \begin_layout LyX-Code
6749 DeclareLaTeXClass[thesis,book]{thesis}
6752 \begin_layout Standard
6753 If, on the other hand, the new class is not based upon an existing class,
6754 you will probably have to
6755 \begin_inset Quotes eld
6759 \begin_inset Quotes erd
6763 We strongly suggest copying an existing layout file which uses a similar
6764 LaTeX class and then modifying it, if you can do so.
6765 At least use an existing file as a starting point so you can find out what
6766 items you need to worry about.
6767 Again, the specifics are covered below.
6770 \begin_layout Section
6771 \begin_inset CommandInset label
6773 name "sec:TextClass"
6777 Declaring a new text class
6780 \begin_layout Standard
6781 When it's finally time to get your hands dirty and create or edit your own
6782 layout file, the following sections describe what you're up against.
6783 Our advice is to go slowly, save and test often, listen to soothing music,
6784 and enjoy one or two of your favorite adult beverages; more if you are
6785 getting particularly stuck.
6786 It's really not that hard, except that the multitude of options can become
6787 overwhelming if you try to do too much in one sitting.
6788 Go have another adult beverage, just for good measure.
6791 \begin_layout Standard
6795 \begin_layout Standard
6796 Lines in a layout file which begin with
6797 \begin_inset Flex CharStyle:Code
6800 \begin_layout Plain Layout
6807 There is one exception to this rule.
6809 \begin_inset Flex CharStyle:Code
6812 \begin_layout Plain Layout
6818 files should begin with a line like:
6821 \begin_layout LyX-Code
6824 #% Do not delete the line below; configure depends on this
6827 \begin_layout LyX-Code
6832 DeclareLaTeXClass{article}
6835 \begin_layout Standard
6836 The second line is used when you configure LyX.
6837 The layout file is read by the LaTeX script
6838 \begin_inset Flex CharStyle:Code
6841 \begin_layout Plain Layout
6847 , in a special mode where
6848 \begin_inset Flex CharStyle:Code
6851 \begin_layout Plain Layout
6858 The first line is just a LaTeX comment, and the second one contains the
6859 declaration of the text class.
6860 If these lines appear in a file named
6861 \begin_inset Flex CharStyle:Code
6864 \begin_layout Plain Layout
6870 , then they define a text class of name
6871 \begin_inset Flex CharStyle:Code
6874 \begin_layout Plain Layout
6880 (the name of the layout file) which uses the LaTeX document class
6881 \begin_inset Flex CharStyle:Code
6884 \begin_layout Plain Layout
6890 (the default is to use the same name as the layout).
6892 \begin_inset Quotes eld
6896 \begin_inset Quotes erd
6899 that appears above is used as a description of the text class in the
6900 \begin_inset Flex CharStyle:MenuItem
6903 \begin_layout Plain Layout
6904 Document\SpecialChar \menuseparator
6913 \begin_layout Standard
6914 Let's assume that you wrote your own text class that uses the
6915 \begin_inset Flex CharStyle:Code
6918 \begin_layout Plain Layout
6924 document class, but where you changed the appearance of the section headings.
6925 If you put it in a file
6926 \begin_inset Flex CharStyle:Code
6929 \begin_layout Plain Layout
6935 , the header of this file should be:
6938 \begin_layout LyX-Code
6941 #% Do not delete the line below; configure depends on this
6944 \begin_layout LyX-Code
6949 DeclareLaTeXClass[article]{article (with my own headings)}
6952 \begin_layout Standard
6953 This declares a text class
6954 \begin_inset Flex CharStyle:Code
6957 \begin_layout Plain Layout
6963 , associated with the LaTeX document class
6964 \begin_inset Flex CharStyle:Code
6967 \begin_layout Plain Layout
6974 \begin_inset Quotes eld
6977 article (with my own headings)
6978 \begin_inset Quotes erd
6982 If your text class depends on several packages, you can declare it as:
6985 \begin_layout LyX-Code
6988 #% Do not delete the line below; configure depends on this
6991 \begin_layout LyX-Code
6996 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
6999 \begin_layout Standard
7000 This indicates that your text class uses the
7001 \begin_inset Flex CharStyle:Code
7004 \begin_layout Plain Layout
7011 Finally, it is also possible to declare classes for DocBook code.
7012 Typical declarations will look like:
7015 \begin_layout LyX-Code
7018 #% Do not delete the line below; configure depends on this
7021 \begin_layout LyX-Code
7026 DeclareDocBookClass[article]{SGML (DocBook article)}
7029 \begin_layout Standard
7030 Note that these declarations can also be given an optional parameter declaring
7031 the name of the document class (but not a list).
7034 \begin_layout Standard
7035 So, to be as explicit as possible, the form of the layout declaration is:
7038 \begin_layout LyX-Code
7043 DeclareLaTeXClass[class,package.sty]{layout description}
7046 \begin_layout Standard
7047 The class need only be specified if the name of the LaTeX class file and
7048 the name of the layout file are different; if the name of the class file
7049 is not specified, then LyX will simply assume that it is the same as the
7050 name of the layout file.
7053 \begin_layout Standard
7054 When the text class has been modified to your taste, all you have to do
7055 is to copy it either to
7056 \begin_inset Flex CharStyle:Code
7059 \begin_layout Plain Layout
7066 \begin_inset Flex CharStyle:Code
7069 \begin_layout Plain Layout
7076 \begin_inset Flex CharStyle:MenuItem
7079 \begin_layout Plain Layout
7080 Tools\SpecialChar \menuseparator
7086 , exit LyX and restart.
7087 Then your new text class should be available along with the others.
7090 \begin_layout Standard
7091 Once the layout file is installed, you can edit it and see your changes
7092 without having to reconfigure or to restart LyX.
7093 In versions of LyX prior to 1.6, this was not true.
7094 As a result, editing layout files was very time consuming.
7095 Beginning with 1.6, however, you can force a reload of the layout currently
7096 in use by using the LyX function
7097 \begin_inset Flex CharStyle:MenuItem
7100 \begin_layout Plain Layout
7107 There is no default binding for this function—though, of course, you can
7108 bind it to a key yourself.
7109 But you use this function simply by entering it in the mini-buffer.
7113 \begin_layout Standard
7118 : This is very much an `advanced feature'.
7123 recommended that you save your work before using this function.
7128 recommended that you not attempt to edit layout information while simultaneousl
7129 y working on a document that you care about.
7130 Use a test document.
7131 Syntax errors and the like in your layout file could cause peculiar behavior.
7132 In particular, such errors could cause LyX to regard the current layout
7133 as invalid and to attempt to switch to some other layout.
7134 The LyX team strives to keep LyX stable in such situations, but safe is
7139 \begin_layout Plain Layout
7140 And while we're giving advice, make regular backups.
7141 And be nice to your mother.
7149 \begin_layout Subsection
7153 \begin_layout Standard
7154 The first non-comment line of any layout file, included file, or module
7159 contain the file format number:
7162 \begin_layout Description
7163 \begin_inset Flex CharStyle:Code
7166 \begin_layout Plain Layout
7173 \begin_inset Flex CharStyle:Code
7176 \begin_layout Plain Layout
7182 ] The format of the layout file.
7185 \begin_layout Standard
7186 This tag was introduced with LyX 1.4.0.
7187 Layout files from LyX 1.3.x and earlier don't have an explicit file format
7188 and are considered to be of format 1.
7189 The format for the present version of LyX is format
7190 \begin_inset Flex CharStyle:Code
7193 \begin_layout Plain Layout
7200 But LyX is capable of reading earlier formats, too, just as it is capable
7201 of reading files produced by earlier versions of LyX.
7204 \begin_layout Subsection
7205 General text class parameters
7208 \begin_layout Standard
7209 These are the general parameters which describe the form of the entire document:
7212 \begin_layout Description
7213 \begin_inset Flex CharStyle:Code
7216 \begin_layout Plain Layout
7222 Adds information to the document preamble.
7224 \begin_inset Quotes eld
7228 \begin_inset Flex CharStyle:Code
7231 \begin_layout Plain Layout
7238 \begin_inset Quotes erd
7244 \begin_layout Description
7245 \begin_inset Flex CharStyle:Code
7248 \begin_layout Plain Layout
7254 Describes various global options supported by the document class.
7256 \begin_inset space ~
7260 \begin_inset CommandInset ref
7262 reference "sub:ClassOptions"
7268 \begin_inset Quotes eld
7272 \begin_inset Flex CharStyle:Code
7275 \begin_layout Plain Layout
7282 \begin_inset Quotes erd
7288 \begin_layout Description
7289 \begin_inset Flex CharStyle:Code
7292 \begin_layout Plain Layout
7299 \begin_inset Flex CharStyle:Code
7302 \begin_layout Plain Layout
7311 \begin_inset Flex CharStyle:Code
7314 \begin_layout Plain Layout
7320 ] Whether the class should
7324 to having one or two columns.
7325 Can be changed in the
7326 \begin_inset Flex CharStyle:MenuItem
7329 \begin_layout Plain Layout
7330 Document\SpecialChar \menuseparator
7339 \begin_layout Description
7340 \begin_inset Flex CharStyle:Code
7343 \begin_layout Plain Layout
7350 \begin_inset Flex CharStyle:Code
7353 \begin_layout Plain Layout
7359 ] This sequence defines the properties for a counter.
7360 If the counter does not yet exist, it is created; if it does exist, it
7363 \begin_inset Quotes eld
7367 \begin_inset Flex CharStyle:Code
7370 \begin_layout Plain Layout
7377 \begin_inset Quotes erd
7381 \begin_inset Newline newline
7385 \begin_inset space ~
7389 \begin_inset CommandInset ref
7391 reference "sub:Counters"
7395 for details on counters.
7398 \begin_layout Description
7399 \begin_inset Flex CharStyle:Code
7402 \begin_layout Plain Layout
7408 Sets the default font used to display the document.
7410 \begin_inset space ~
7414 \begin_inset CommandInset ref
7416 reference "sub:Font-description"
7420 for how to declare fonts.
7422 \begin_inset Quotes eld
7426 \begin_inset Flex CharStyle:Code
7429 \begin_layout Plain Layout
7436 \begin_inset Quotes erd
7442 \begin_layout Description
7443 \begin_inset Flex CharStyle:Code
7446 \begin_layout Plain Layout
7453 \begin_inset Flex CharStyle:Code
7456 \begin_layout Plain Layout
7462 Specifies a module to be included by default with this document class.
7463 The module should be specified by filename without the
7464 \begin_inset Flex CharStyle:Code
7467 \begin_layout Plain Layout
7474 The user can still remove the module, but it will be active at the outset.
7475 (This applies only when new files are created, or when this class is chosen
7476 for an existing document.)
7479 \begin_layout Description
7480 \begin_inset Flex CharStyle:Code
7483 \begin_layout Plain Layout
7490 \begin_inset Flex CharStyle:Code
7493 \begin_layout Plain Layout
7499 ] This is the style that will be assigned to new paragraphs, usually
7500 \begin_inset Flex CharStyle:MenuItem
7503 \begin_layout Plain Layout
7510 This will default to the first defined style if not given, but you are
7511 encouraged to use this directive.
7514 \begin_layout Description
7515 \begin_inset Flex CharStyle:Code
7518 \begin_layout Plain Layout
7525 \begin_inset Flex CharStyle:Code
7528 \begin_layout Plain Layout
7534 ] This tag indicates that the module in question—which should be specified
7535 by filename without the
7536 \begin_inset Flex CharStyle:Code
7539 \begin_layout Plain Layout
7545 extension—cannot be used with this document class.
7546 This might be used in a journal-specific layout file to prevent, say, the
7548 \begin_inset Flex CharStyle:Code
7551 \begin_layout Plain Layout
7557 module that numbers theorems by section.
7562 be used in a module.
7563 Modules have their own way of excluding other modules (see
7564 \begin_inset CommandInset ref
7566 reference "sub:Layout-modules"
7573 \begin_layout Description
7574 \begin_inset Flex CharStyle:Code
7577 \begin_layout Plain Layout
7583 Defines a new float.
7585 \begin_inset space ~
7589 \begin_inset CommandInset ref
7591 reference "sub:Floats"
7597 \begin_inset Quotes eld
7601 \begin_inset Flex CharStyle:Code
7604 \begin_layout Plain Layout
7611 \begin_inset Quotes erd
7617 \begin_layout Description
7618 \begin_inset Flex CharStyle:Code
7621 \begin_layout Plain Layout
7628 \begin_inset Flex CharStyle:Code
7631 \begin_layout Plain Layout
7637 ] Modifies the properties of the given counter.
7638 If the counter does not exist, the section is ignored.
7640 \begin_inset Quotes eld
7644 \begin_inset Flex CharStyle:Code
7647 \begin_layout Plain Layout
7654 \begin_inset Quotes erd
7658 \begin_inset Newline newline
7662 \begin_inset space ~
7666 \begin_inset CommandInset ref
7668 reference "sub:Counters"
7672 for details on counters.
7675 \begin_layout Description
7676 \begin_inset Flex CharStyle:Code
7679 \begin_layout Plain Layout
7686 \begin_inset Flex CharStyle:Code
7689 \begin_layout Plain Layout
7695 ] Modifies the properties of the given paragraph style.
7696 If the style does not exist, the section is ignored.
7698 \begin_inset Quotes eld
7702 \begin_inset Flex CharStyle:Code
7705 \begin_layout Plain Layout
7712 \begin_inset Quotes erd
7718 \begin_layout Description
7719 \begin_inset Flex CharStyle:Code
7722 \begin_layout Plain Layout
7728 As its name implies, this command allows you to include another layout
7729 definition file within yours to avoid duplicating commands.
7730 Common examples are the standard layout files, for example,
7731 \begin_inset Flex CharStyle:Code
7734 \begin_layout Plain Layout
7740 , which contains most of the basic layouts.
7743 \begin_layout Description
7744 \begin_inset Flex CharStyle:Code
7747 \begin_layout Plain Layout
7753 This section (re-)defines the layout of an inset.
7754 It can be applied to an existing inset or to a new, user-defined inset,
7755 e.g., a new character style.
7757 \begin_inset Quotes eld
7761 \begin_inset Flex CharStyle:Code
7764 \begin_layout Plain Layout
7771 \begin_inset Quotes erd
7775 \begin_inset Newline newline
7779 \begin_inset space ~
7783 \begin_inset CommandInset ref
7785 reference "sub:Flex-insets-and"
7789 for more information.
7793 \begin_layout Description
7794 \begin_inset Flex CharStyle:Code
7797 \begin_layout Plain Layout
7804 \begin_inset Flex CharStyle:Code
7807 \begin_layout Plain Layout
7813 ] A string that indicates the width of the left margin on the screen, for
7815 \begin_inset Quotes eld
7819 \begin_inset Quotes erd
7823 (Note that this is not a `length', like
7824 \begin_inset Quotes eld
7828 \begin_inset Quotes erd
7834 \begin_layout Description
7835 \begin_inset Flex CharStyle:Code
7838 \begin_layout Plain Layout
7844 This command deletes an existing float.
7845 This is particularly useful when you want to suppress a float that has
7846 been defined in an input file.
7849 \begin_layout Description
7850 \begin_inset Flex CharStyle:Code
7853 \begin_layout Plain Layout
7859 This command deletes an existing style.
7860 This is particularly useful when you want to suppress a style that has
7861 be defined in an input file.
7864 \begin_layout Description
7865 \begin_inset Flex CharStyle:Code
7868 \begin_layout Plain Layout
7874 A string indicating the file format (as defined in the Preferences dialog)
7875 produced by this class.
7876 It is mainly useful when
7877 \begin_inset Flex CharStyle:Code
7880 \begin_layout Plain Layout
7886 is `literate' and one wants to define a new type of literate document.
7887 This string is reset to `docbook', `latex', or `literate' when the correspondin
7889 \begin_inset Flex CharStyle:Code
7892 \begin_layout Plain Layout
7898 parameter is encountered.
7901 \begin_layout Description
7902 \begin_inset Flex CharStyle:Code
7905 \begin_layout Plain Layout
7911 A string indicating what sort of output documents using this class will
7913 At present, the options are: `docbook', `latex', and `literate'.
7916 \begin_layout Description
7917 \begin_inset Flex CharStyle:Code
7920 \begin_layout Plain Layout
7929 \begin_inset Flex CharStyle:Code
7932 \begin_layout Plain Layout
7943 \begin_inset Flex CharStyle:Code
7946 \begin_layout Plain Layout
7953 \begin_inset Flex CharStyle:Code
7956 \begin_layout Plain Layout
7962 ] The default pagestyle.
7963 Can be changed in the
7964 \begin_inset Flex CharStyle:MenuItem
7967 \begin_layout Plain Layout
7968 Document\SpecialChar \menuseparator
7977 \begin_layout Description
7978 \begin_inset Flex CharStyle:Code
7981 \begin_layout Plain Layout
7987 Sets the preamble for the LaTeX document.
7988 Note that this will completely override any prior
7989 \begin_inset Flex CharStyle:Code
7992 \begin_layout Plain Layout
7999 \begin_inset Flex CharStyle:Code
8002 \begin_layout Plain Layout
8010 \begin_inset Flex CharStyle:Code
8013 \begin_layout Plain Layout
8019 if you just want to add material to the preamble.) Must end with
8020 \begin_inset Quotes eld
8024 \begin_inset Flex CharStyle:Code
8027 \begin_layout Plain Layout
8034 \begin_inset Quotes erd
8040 \begin_layout Description
8041 \begin_inset Flex CharStyle:Code
8044 \begin_layout Plain Layout
8051 \begin_inset Flex CharStyle:Code
8054 \begin_layout Plain Layout
8061 \begin_inset Flex CharStyle:Code
8064 \begin_layout Plain Layout
8073 \begin_inset Flex CharStyle:Code
8076 \begin_layout Plain Layout
8082 ] Whether the class already provides the feature
8083 \begin_inset Flex CharStyle:Code
8086 \begin_layout Plain Layout
8093 A feature is in general the name of a package (
8094 \begin_inset Flex CharStyle:Code
8097 \begin_layout Plain Layout
8104 \begin_inset Flex CharStyle:Code
8107 \begin_layout Plain Layout
8113 , \SpecialChar \ldots{}
8115 \begin_inset Flex CharStyle:Code
8118 \begin_layout Plain Layout
8125 \begin_inset Flex CharStyle:Code
8128 \begin_layout Plain Layout
8134 ,\SpecialChar \ldots{}
8135 ); the complete list of supported features is unfortunately not documented
8136 outside the LyX source code—but see
8137 \begin_inset Flex CharStyle:Code
8140 \begin_layout Plain Layout
8146 if you're interested.
8148 \begin_inset Flex CharStyle:MenuItem
8151 \begin_layout Plain Layout
8152 Help\SpecialChar \menuseparator
8158 also gives an overview of the supported packages.
8161 \begin_layout Description
8162 \begin_inset Flex CharStyle:Code
8165 \begin_layout Plain Layout
8172 \begin_inset Flex CharStyle:Code
8175 \begin_layout Plain Layout
8181 ] Indicates that this layout provides the functionality of the module mentioned,
8182 which should be specified by the filename without the
8183 \begin_inset Flex CharStyle:Code
8186 \begin_layout Plain Layout
8193 This will typically be used if the layout includes the module directly,
8194 rather than using the
8195 \begin_inset Flex CharStyle:Code
8198 \begin_layout Plain Layout
8204 tag to indicate that it ought to be used.
8205 It could also be used in a module that provided an alternate implementation
8206 of the same functionality.
8209 \begin_layout Description
8210 \begin_inset Flex CharStyle:Code
8213 \begin_layout Plain Layout
8220 \begin_inset Flex CharStyle:Code
8223 \begin_layout Plain Layout
8229 ] Whether the class requires the feature
8230 \begin_inset Flex CharStyle:Code
8233 \begin_layout Plain Layout
8240 Multiple features must be separated by commas.
8241 Note that you can only request supported features.
8243 \begin_inset Flex CharStyle:Code
8246 \begin_layout Plain Layout
8252 for a list of these.)
8255 \begin_layout Description
8256 \begin_inset Flex CharStyle:Code
8259 \begin_layout Plain Layout
8265 A string that indicates the width of the right margin on the screen, for
8267 \begin_inset Quotes eld
8271 \begin_inset Quotes erd
8277 \begin_layout Description
8278 \begin_inset Flex CharStyle:Code
8281 \begin_layout Plain Layout
8287 Sets which divisions get numbered.
8289 \begin_inset Flex CharStyle:Code
8292 \begin_layout Plain Layout
8301 \begin_layout Description
8302 \begin_inset Flex CharStyle:Code
8305 \begin_layout Plain Layout
8314 \begin_inset Flex CharStyle:Code
8317 \begin_layout Plain Layout
8328 \begin_inset Flex CharStyle:Code
8331 \begin_layout Plain Layout
8337 ] Whether the class-default should be printing on one or both sides of the
8339 Can be changed in the
8340 \begin_inset Flex CharStyle:MenuItem
8343 \begin_layout Plain Layout
8344 Document\SpecialChar \menuseparator
8353 \begin_layout Description
8354 \begin_inset Flex CharStyle:Code
8357 \begin_layout Plain Layout
8363 This sequence defines a paragraph style.
8364 If the style does not yet exist, it is created; if it does exist, its parameter
8367 \begin_inset Quotes eld
8371 \begin_inset Flex CharStyle:Code
8374 \begin_layout Plain Layout
8381 \begin_inset Quotes erd
8385 \begin_inset Newline newline
8389 \begin_inset space ~
8393 \begin_inset CommandInset ref
8395 reference "sub:Paragraph-Styles"
8399 for details on paragraph styles.
8402 \begin_layout Description
8403 \begin_inset Flex CharStyle:Code
8406 \begin_layout Plain Layout
8413 \begin_inset Flex CharStyle:Code
8416 \begin_layout Plain Layout
8422 ] The name of the command or environment to be used with
8423 \begin_inset Flex CharStyle:Code
8426 \begin_layout Plain Layout
8435 \begin_layout Description
8436 \begin_inset Flex CharStyle:Code
8439 \begin_layout Plain Layout
8446 \begin_inset Flex CharStyle:Code
8449 \begin_layout Plain Layout
8458 \begin_inset Flex CharStyle:Code
8461 \begin_layout Plain Layout
8467 ] Indicates what kind of markup is used to define the title of a document.
8469 \begin_inset Flex CharStyle:Code
8472 \begin_layout Plain Layout
8478 means that the macro with name
8479 \begin_inset Flex CharStyle:Code
8482 \begin_layout Plain Layout
8488 will be inserted after the last layout which has
8489 \begin_inset Quotes eld
8493 \begin_inset Flex CharStyle:Code
8496 \begin_layout Plain Layout
8503 \begin_inset Quotes erd
8508 \begin_inset Flex CharStyle:Code
8511 \begin_layout Plain Layout
8517 corresponds to the case where the block of paragraphs which have
8518 \begin_inset Quotes eld
8522 \begin_inset Flex CharStyle:Code
8525 \begin_layout Plain Layout
8532 \begin_inset Quotes erd
8535 should be enclosed into the
8536 \begin_inset Flex CharStyle:Code
8539 \begin_layout Plain Layout
8548 \begin_layout Description
8549 \begin_inset Flex CharStyle:Code
8552 \begin_layout Plain Layout
8558 Sets which divisions are included in the table of contents.
8560 \begin_inset Flex CharStyle:Code
8563 \begin_layout Plain Layout
8572 \begin_layout Subsection
8573 \begin_inset Flex CharStyle:Code
8576 \begin_layout Plain Layout
8583 \begin_inset CommandInset label
8585 name "sub:ClassOptions"
8592 \begin_layout Standard
8594 \begin_inset Flex CharStyle:Code
8597 \begin_layout Plain Layout
8603 section can contain the following entries:
8606 \begin_layout Description
8607 \begin_inset Flex CharStyle:Code
8610 \begin_layout Plain Layout
8617 \begin_inset Flex CharStyle:Code
8620 \begin_layout Plain Layout
8626 ] The list of available font sizes for the document's main font, separated
8628 \begin_inset Quotes eld
8632 \begin_inset Flex CharStyle:Code
8635 \begin_layout Plain Layout
8642 \begin_inset Quotes erd
8648 \begin_layout Description
8649 \begin_inset Flex CharStyle:Code
8652 \begin_layout Plain Layout
8658 Used to set the DTD line with XML-based output classes.
8660 \begin_inset space \thinspace{}
8664 \begin_inset Quotes eld
8667 -//OASIS//DTD DocBook V4.2//EN
8668 \begin_inset Quotes erd
8674 \begin_layout Description
8675 \begin_inset Flex CharStyle:Code
8678 \begin_layout Plain Layout
8685 \begin_inset Flex CharStyle:Code
8688 \begin_layout Plain Layout
8689 string="empty|plain|headings|fancy"
8694 ] The list of available page styles, separated by
8695 \begin_inset Quotes eld
8699 \begin_inset Flex CharStyle:Code
8702 \begin_layout Plain Layout
8709 \begin_inset Quotes erd
8715 \begin_layout Description
8716 \begin_inset Flex CharStyle:Code
8719 \begin_layout Plain Layout
8726 \begin_inset Flex CharStyle:Code
8729 \begin_layout Plain Layout
8735 ] Some document class options, separated by a comma, that will be added
8736 to the optional part of the
8737 \begin_inset Flex CharStyle:Code
8740 \begin_layout Plain Layout
8751 \begin_layout Standard
8753 \begin_inset Flex CharStyle:Code
8756 \begin_layout Plain Layout
8762 section must end with
8763 \begin_inset Quotes eld
8767 \begin_inset Flex CharStyle:Code
8770 \begin_layout Plain Layout
8777 \begin_inset Quotes erd
8783 \begin_layout Subsection
8785 \begin_inset CommandInset label
8787 name "sub:Paragraph-Styles"
8794 \begin_layout Standard
8795 A paragraph style description looks like this:
8799 \begin_layout Plain Layout
8800 Note that this will either define a new layout or modify an existing one.
8808 \begin_layout LyX-Code
8815 \begin_layout LyX-Code
8819 \begin_layout LyX-Code
8823 \begin_layout Standard
8824 where the following commands are allowed:
8827 \begin_layout Description
8828 \begin_inset Flex CharStyle:Code
8831 \begin_layout Plain Layout
8838 \begin_inset Flex CharStyle:Code
8841 \begin_layout Plain Layout
8846 , left, right, center
8851 ] Paragraph alignment.
8854 \begin_layout Description
8855 \begin_inset Flex CharStyle:Code
8858 \begin_layout Plain Layout
8865 \begin_inset Flex CharStyle:Code
8868 \begin_layout Plain Layout
8873 , left, right, center
8878 ] A comma separated list of permitted alignments.
8879 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
8881 For example a right-aligned or centered enumeration isn't possible.)
8884 \begin_layout Description
8885 \begin_inset Flex CharStyle:Code
8888 \begin_layout Plain Layout
8894 Language dependent information to be included in the LaTeX preamble when
8896 Note that this will completely override any prior
8897 \begin_inset Flex CharStyle:Code
8900 \begin_layout Plain Layout
8908 \begin_inset Quotes eld
8912 \begin_inset Flex CharStyle:Code
8915 \begin_layout Plain Layout
8922 \begin_inset Quotes erd
8926 The contents of this tag will occur once in the LaTeX preamble for each
8927 language used by the document.
8928 Each time, the following substitutions are made:
8932 \begin_layout Itemize
8933 \begin_inset Flex CharStyle:Code
8936 \begin_layout Plain Layout
8942 is replaced by the language name (as used by the babel package).
8945 \begin_layout Itemize
8947 \begin_inset Quotes eld
8951 \begin_inset Quotes erd
8955 \begin_inset Flex CharStyle:Code
8958 \begin_layout Plain Layout
8964 replaces its argument by the translation of the argument to the current
8968 \begin_layout Standard
8969 This preamble snippet will only be used if the document contains more than
8970 one language and the babel package is used.
8974 \begin_layout Description
8975 \begin_inset Flex CharStyle:Code
8978 \begin_layout Plain Layout
8985 \begin_inset Flex CharStyle:Code
8988 \begin_layout Plain Layout
8998 \begin_layout Plain Layout
8999 Note that a `float' here is a real number, such as: 1.5.
9004 The vertical space with which the last of a chain of paragraphs with this
9005 layout is separated from the following paragraph.
9006 If the next paragraph has another layout, the separations are not simply
9007 added, but the maximum is taken.
9010 \begin_layout Description
9011 \begin_inset Flex CharStyle:Code
9014 \begin_layout Plain Layout
9021 \begin_inset Flex CharStyle:Code
9024 \begin_layout Plain Layout
9030 The category for this style.
9031 This is used to group related styles in the Layout combobox on the toolbar.
9032 Any string can be used, but you may want to use existing categories with
9037 \begin_layout Description
9038 \begin_inset Flex CharStyle:Code
9041 \begin_layout Plain Layout
9047 Depth of XML command.
9048 Used only with XML-type formats.
9051 \begin_layout Description
9052 \begin_inset Flex CharStyle:Code
9055 \begin_layout Plain Layout
9062 \begin_inset CommandInset label
9064 name "des:CopyStyle"
9069 \begin_inset Flex CharStyle:Code
9072 \begin_layout Plain Layout
9078 Copies all the features of an existing style into the current one.
9082 \begin_layout Description
9083 \begin_inset Flex CharStyle:Code
9086 \begin_layout Plain Layout
9092 The name of a style whose preamble should be output
9097 This allows to ensure some ordering of the preamble snippets when macros
9098 definitions depend on one another.
9102 \begin_layout Plain Layout
9103 Note that, besides that functionality, there is no way to ensure any ordering
9105 The ordering that you see in a given version of LyX may change without
9106 warning in later versions.
9114 \begin_layout Description
9115 \begin_inset Flex CharStyle:Code
9118 \begin_layout Plain Layout
9125 \begin_inset Flex CharStyle:Code
9128 \begin_layout Plain Layout
9133 , Box, Filled_Box, Static
9138 ] The type of label that stands at the end of the paragraph (or sequence
9140 \begin_inset Flex CharStyle:Code
9143 \begin_layout Plain Layout
9150 \begin_inset Flex CharStyle:Code
9153 \begin_layout Plain Layout
9160 \begin_inset Flex CharStyle:Code
9163 \begin_layout Plain Layout
9170 \begin_inset Flex CharStyle:Code
9173 \begin_layout Plain Layout
9181 \begin_inset Flex CharStyle:Code
9184 \begin_layout Plain Layout
9191 \begin_inset Quotes eld
9195 \begin_inset Quotes erd
9199 \begin_inset Flex CharStyle:Code
9202 \begin_layout Plain Layout
9209 \begin_inset Flex CharStyle:Code
9212 \begin_layout Plain Layout
9213 \begin_inset space ~
9222 \begin_inset space ~
9225 black) square suitable for end of proof markers,
9226 \begin_inset Flex CharStyle:Code
9229 \begin_layout Plain Layout
9235 is an explicit text string.
9238 \begin_layout Description
9239 \begin_inset Flex CharStyle:Code
9242 \begin_layout Plain Layout
9249 \begin_inset Flex CharStyle:Code
9252 \begin_layout Plain Layout
9258 ] The string used for a label with a
9259 \begin_inset Flex CharStyle:Code
9262 \begin_layout Plain Layout
9269 \begin_inset Flex CharStyle:Code
9272 \begin_layout Plain Layout
9282 \begin_layout Description
9283 \begin_inset Flex CharStyle:Code
9286 \begin_layout Plain Layout
9293 \begin_inset Flex CharStyle:Code
9296 \begin_layout Plain Layout
9307 \begin_inset Flex CharStyle:Code
9310 \begin_layout Plain Layout
9319 \begin_layout Description
9320 \begin_inset Flex CharStyle:Code
9323 \begin_layout Plain Layout
9330 \begin_inset Flex CharStyle:Code
9333 \begin_layout Plain Layout
9343 ] With this parameter the
9344 \begin_inset Flex CharStyle:MenuItem
9347 \begin_layout Plain Layout
9354 \begin_inset Quotes eld
9357 Vertical space above
9358 \begin_inset Quotes erd
9362 \begin_inset Flex CharStyle:MenuItem
9365 \begin_layout Plain Layout
9366 Edit\SpecialChar \menuseparator
9368 \begin_inset space ~
9376 dialog can be set when initializing a paragraph with this style.
9380 \begin_layout Plain Layout
9383 Note from Jean-Marc:
9385 I'm not sure that this setting has much use, and it should probably be
9386 removed in later versions.
9394 \begin_layout Description
9395 \begin_inset Flex CharStyle:Code
9398 \begin_layout Plain Layout
9404 The font used for both the text body
9410 \begin_inset space ~
9414 \begin_inset CommandInset ref
9416 reference "sub:Font-description"
9421 Note that defining this font automatically defines the
9422 \begin_inset Flex CharStyle:Code
9425 \begin_layout Plain Layout
9432 So you should define this one first if you also want to define
9433 \begin_inset Flex CharStyle:Code
9436 \begin_layout Plain Layout
9445 \begin_layout Description
9446 \begin_inset Flex CharStyle:Code
9449 \begin_layout Plain Layout
9456 \begin_inset CommandInset label
9458 name "des:FreeSpacing"
9465 \begin_inset Flex CharStyle:Code
9468 \begin_layout Plain Layout
9479 \begin_inset Flex CharStyle:Code
9482 \begin_layout Plain Layout
9488 ] Usually LyX doesn't allow you to insert more than one space between words,
9489 since a space is considered as the separation between two words, not a
9490 character or symbol of its own.
9491 This is a very fine thing but sometimes annoying, for example, when typing
9492 program code or plain LaTeX code.
9494 \begin_inset Flex CharStyle:Code
9497 \begin_layout Plain Layout
9504 Note that LyX will create protected blanks for the additional blanks when
9505 in another mode than LaTeX-mode.
9508 \begin_layout Description
9509 \begin_inset Flex CharStyle:Code
9512 \begin_layout Plain Layout
9518 [[FIXME]] (Used only with XML-type formats.)
9521 \begin_layout Description
9522 \begin_inset Flex CharStyle:Code
9525 \begin_layout Plain Layout
9532 \begin_inset Flex CharStyle:Code
9535 \begin_layout Plain Layout
9541 If 1, marks the layout as to be included in the document preamble rather
9542 than in the document body.
9543 This is useful for document classes that want such information as the title
9544 and author to appear in the preamble.
9547 \begin_layout Description
9548 \begin_inset Flex CharStyle:Code
9551 \begin_layout Plain Layout
9558 \begin_inset Flex CharStyle:Code
9561 \begin_layout Plain Layout
9567 If 1, marks the layout as being part of a title block (see also the
9568 \begin_inset Flex CharStyle:Code
9571 \begin_layout Plain Layout
9578 \begin_inset Flex CharStyle:Code
9581 \begin_layout Plain Layout
9590 \begin_layout Description
9591 \begin_inset Flex CharStyle:Code
9594 \begin_layout Plain Layout
9601 \begin_inset Flex CharStyle:Code
9604 \begin_layout Plain Layout
9610 ] This provides extra space between paragraphs that have the same layout.
9611 If you put other layouts into an environment, each is separated with the
9613 \begin_inset Flex CharStyle:Code
9616 \begin_layout Plain Layout
9623 But the whole items of the environment are additionally separated with
9625 \begin_inset Flex CharStyle:Code
9628 \begin_layout Plain Layout
9640 \begin_layout Description
9641 \begin_inset Flex CharStyle:Code
9644 \begin_layout Plain Layout
9650 [[FIXME]] (Used only with XML-type formats.)
9653 \begin_layout Description
9654 \begin_inset Flex CharStyle:Code
9657 \begin_layout Plain Layout
9664 \begin_inset CommandInset label
9666 name "des:KeepEmpty"
9673 \begin_inset Flex CharStyle:Code
9676 \begin_layout Plain Layout
9687 \begin_inset Flex CharStyle:Code
9690 \begin_layout Plain Layout
9696 ] Usually LyX does not allow you to leave a paragraph empty, since it would
9697 lead to empty LaTeX output.
9698 There are some cases where this could be desirable however: in a letter
9699 template, the required fields can be provided as empty fields, so that
9700 people do not forget them; in some special classes, a layout can be used
9701 as some kind of break, which does not contain actual text.
9704 \begin_layout Description
9705 \begin_inset Flex CharStyle:Code
9708 \begin_layout Plain Layout
9714 [float=0] The vertical space between the label and the text body.
9715 Only used for labels that are above the text body (
9716 \begin_inset Flex CharStyle:Code
9719 \begin_layout Plain Layout
9726 \begin_inset Flex CharStyle:Code
9729 \begin_layout Plain Layout
9730 Centered_Top_Environment
9738 \begin_layout Description
9739 \begin_inset Flex CharStyle:Code
9742 \begin_layout Plain Layout
9749 \begin_inset Flex CharStyle:Code
9752 \begin_layout Plain Layout
9759 \begin_inset Newline newline
9762 The name of the counter for automatic numbering.
9764 \begin_inset Newline newline
9772 \begin_inset Flex CharStyle:Code
9775 \begin_layout Plain Layout
9782 \begin_inset Flex CharStyle:Code
9785 \begin_layout Plain Layout
9792 In that case, the counter will be stepped each time the layout appears.
9794 \begin_inset Newline newline
9802 \begin_inset Flex CharStyle:Code
9805 \begin_layout Plain Layout
9812 \begin_inset Flex CharStyle:Code
9815 \begin_layout Plain Layout
9821 , though this case is a bit complicated.
9823 \begin_inset Quotes eld
9827 \begin_inset Flex CharStyle:Code
9830 \begin_layout Plain Layout
9837 \begin_inset Quotes erd
9841 Then the actual counters used are
9842 \begin_inset Flex CharStyle:Code
9845 \begin_layout Plain Layout
9852 \begin_inset Flex CharStyle:Code
9855 \begin_layout Plain Layout
9862 \begin_inset Flex CharStyle:Code
9865 \begin_layout Plain Layout
9872 \begin_inset Flex CharStyle:Code
9875 \begin_layout Plain Layout
9882 These counters must all be declared separately.
9883 \begin_inset Newline newline
9887 \begin_inset CommandInset ref
9889 reference "sub:Counters"
9893 for details on counters.
9896 \begin_layout Description
9897 \begin_inset Flex CharStyle:Code
9900 \begin_layout Plain Layout
9906 The font used for the label.
9908 \begin_inset space ~
9912 \begin_inset CommandInset ref
9914 reference "sub:Font-description"
9921 \begin_layout Description
9922 \begin_inset Flex CharStyle:Code
9925 \begin_layout Plain Layout
9931 Text that indicates how far a label should be indented.
9934 \begin_layout Description
9935 \begin_inset Flex CharStyle:Code
9938 \begin_layout Plain Layout
9945 \begin_inset Flex CharStyle:Code
9948 \begin_layout Plain Layout
9954 ] The horizontal space between the label and the text body.
9955 Only used for labels that are not above the text body.
9958 \begin_layout Description
9959 \begin_inset Flex CharStyle:Code
9962 \begin_layout Plain Layout
9969 \begin_inset Flex CharStyle:Code
9972 \begin_layout Plain Layout
9978 ] The string used for a label with a
9979 \begin_inset Flex CharStyle:Code
9982 \begin_layout Plain Layout
9990 \begin_inset Flex CharStyle:Code
9993 \begin_layout Plain Layout
9999 is set, this string can be contain the special formatting commands described
10001 \begin_inset CommandInset ref
10003 reference "sub:Counters"
10011 \begin_layout Plain Layout
10012 For the sake of backwards compatibility, the string
10013 \begin_inset Flex CharStyle:Code
10016 \begin_layout Plain Layout
10026 will be replaced by the expanded
10027 \begin_inset Flex CharStyle:Code
10030 \begin_layout Plain Layout
10037 \begin_inset Flex CharStyle:Code
10040 \begin_layout Plain Layout
10049 This feature is now obsolete and should be replaced by the mechanisms of
10051 \begin_inset CommandInset ref
10053 reference "sub:Counters"
10065 \begin_layout Description
10066 \begin_inset Flex CharStyle:Code
10069 \begin_layout Plain Layout
10070 LabelStringAppendix
10076 \begin_inset Flex CharStyle:Code
10079 \begin_layout Plain Layout
10085 ] This is used inside the appendix instead of
10086 \begin_inset Flex CharStyle:Code
10089 \begin_layout Plain Layout
10097 \begin_inset Flex CharStyle:Code
10100 \begin_layout Plain Layout
10107 \begin_inset Flex CharStyle:Code
10110 \begin_layout Plain Layout
10111 LabelStringAppendix
10119 \begin_layout Description
10120 \begin_inset Flex CharStyle:Code
10123 \begin_layout Plain Layout
10129 [FIXME] (Used only with XML-type formats.)
10132 \begin_layout Description
10133 \begin_inset Flex CharStyle:Code
10136 \begin_layout Plain Layout
10143 \begin_inset Flex CharStyle:Code
10146 \begin_layout Plain Layout
10151 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
10152 Enumerate, Itemize, Bibliography
10161 \begin_layout Itemize
10162 \begin_inset Flex CharStyle:Code
10165 \begin_layout Plain Layout
10171 means the label is the very first word (up to the first real blank).
10172 Use protected spaces (like
10173 \begin_inset space ~
10176 that one) if you want more than one word as the label.
10180 \begin_layout Itemize
10181 \begin_inset Flex CharStyle:Code
10184 \begin_layout Plain Layout
10190 means the label is simply whatever
10191 \begin_inset Flex CharStyle:Code
10194 \begin_layout Plain Layout
10201 Note that this really is `static'.
10204 \begin_layout Itemize
10205 \begin_inset Flex CharStyle:Code
10208 \begin_layout Plain Layout
10215 \begin_inset Flex CharStyle:Code
10218 \begin_layout Plain Layout
10219 Centered_Top_Environment
10224 are special cases of
10225 \begin_inset Flex CharStyle:Code
10228 \begin_layout Plain Layout
10235 The label will be printed above the paragraph, but only at the top of an
10236 environment or the top of a chain of paragraphs with this layout.
10237 This might be used with the
10238 \begin_inset Flex CharStyle:MenuItem
10241 \begin_layout Plain Layout
10247 layout, for example.
10250 \begin_layout Itemize
10251 \begin_inset Flex CharStyle:Code
10254 \begin_layout Plain Layout
10260 is a special case for the caption-labels
10261 \begin_inset Quotes eld
10265 \begin_inset Quotes erd
10269 \begin_inset Quotes eld
10273 \begin_inset Quotes erd
10278 \begin_inset Flex CharStyle:Code
10281 \begin_layout Plain Layout
10287 means the (hardcoded) label string depends on the kind of float: It is
10288 hardcoded to be `FloatType N', where N is the value of the counter associated
10292 \begin_layout Itemize
10294 \begin_inset Flex CharStyle:Code
10297 \begin_layout Plain Layout
10303 label type defines automatically numbered labels.
10305 \begin_inset Flex CharStyle:Code
10308 \begin_layout Plain Layout
10314 will be expanded to resolve any counter references it contains: For example,
10316 \begin_inset Quotes eld
10320 \begin_inset Flex CharStyle:Code
10323 \begin_layout Plain Layout
10334 \begin_inset Quotes erd
10339 \begin_inset CommandInset ref
10341 reference "sub:Counters"
10345 for more information on counters.
10348 \begin_layout Itemize
10349 \begin_inset Flex CharStyle:Code
10352 \begin_layout Plain Layout
10358 produces the usual sort of enumeration labels.
10359 At present, it is hardcoded to use Arabic numerals, lowercase letters,
10360 small Roman numerals, and uppercase letters for the four possible depths.
10363 \begin_layout Itemize
10364 \begin_inset Flex CharStyle:Code
10367 \begin_layout Plain Layout
10373 produces various bullets at the different levels.
10374 It is also hardcoded.
10377 \begin_layout Itemize
10378 \begin_inset Flex CharStyle:Code
10381 \begin_layout Plain Layout
10387 is used internally by LyX and should be used only with
10388 \begin_inset Flex CharStyle:Code
10391 \begin_layout Plain Layout
10392 LatexType BibEnvironment
10401 \begin_layout Description
10402 \begin_inset Flex CharStyle:Code
10405 \begin_layout Plain Layout
10412 \begin_inset Flex CharStyle:Code
10415 \begin_layout Plain Layout
10421 , but this preamble snippet occurs independently from the babel package,
10422 and only for the document language.
10424 \begin_inset Quotes eld
10428 \begin_inset Flex CharStyle:Code
10431 \begin_layout Plain Layout
10438 \begin_inset Quotes erd
10445 \begin_layout Standard
10446 If the style defines text that appears in the typeset document, it may use
10448 \begin_inset Flex CharStyle:Code
10451 \begin_layout Plain Layout
10458 \begin_inset Flex CharStyle:Code
10461 \begin_layout Plain Layout
10467 to support non-english and even multilanguage documents correctly.
10468 The following excerpt (from the
10469 \begin_inset Flex CharStyle:Code
10472 \begin_layout Plain Layout
10478 file) shows how this works:
10481 \begin_layout LyX-Code
10485 \begin_layout LyX-Code
10488 theoremstyle{remark}
10491 \begin_layout LyX-Code
10494 newtheorem{claim}[thm]{
10501 \begin_layout LyX-Code
10505 \begin_layout LyX-Code
10509 \begin_layout LyX-Code
10514 claimname}{_(Claim)}
10517 \begin_layout LyX-Code
10521 \begin_layout LyX-Code
10525 \begin_layout LyX-Code
10529 \begin_layout LyX-Code
10538 claimname}{_(Claim)}}
10541 \begin_layout LyX-Code
10545 \begin_layout Standard
10546 The key to correct translation of the user visible text is the definition
10548 \begin_inset Flex CharStyle:Code
10551 \begin_layout Plain Layout
10559 in the language preamble.
10560 This command holds the name of the theorem that will appear in the output.
10562 \begin_inset Flex CharStyle:Code
10565 \begin_layout Plain Layout
10571 then uses the commands offered by the babel package to redefine
10572 \begin_inset Flex CharStyle:Code
10575 \begin_layout Plain Layout
10583 for each used language in multilanguage documents.
10587 \begin_layout Description
10588 \begin_inset Flex CharStyle:Code
10591 \begin_layout Plain Layout
10597 The name of the corresponding LaTeX stuff.
10598 Either the environment or command name.
10601 \begin_layout Description
10602 \begin_inset Flex CharStyle:Code
10605 \begin_layout Plain Layout
10611 An optional parameter for the corresponding
10612 \begin_inset Flex CharStyle:Code
10615 \begin_layout Plain Layout
10622 This parameter cannot be changed from within LyX.
10625 \begin_layout Description
10626 \begin_inset Flex CharStyle:Code
10629 \begin_layout Plain Layout
10636 \begin_inset CommandInset label
10638 name "des:LatexType"
10643 \begin_inset Flex CharStyle:Code
10646 \begin_layout Plain Layout
10651 , Command, Environment, Item_Environment,
10657 \begin_inset Flex CharStyle:Code
10660 \begin_layout Plain Layout
10661 List_Environment, Bib_Environment
10666 ] How the layout should be translated into LaTeX.
10670 \begin_layout Plain Layout
10671 \begin_inset Flex CharStyle:Code
10674 \begin_layout Plain Layout
10680 is perhaps a bit misleading, since these rules apply to SGML classes, too.
10681 Visit the SGML class files for specific examples.
10690 \begin_layout Itemize
10691 \begin_inset Flex CharStyle:Code
10694 \begin_layout Plain Layout
10700 means nothing special.
10704 \begin_layout Itemize
10705 \begin_inset Flex CharStyle:Code
10708 \begin_layout Plain Layout
10715 \begin_inset Flex CharStyle:Code
10718 \begin_layout Plain Layout
10725 {\SpecialChar \ldots{}
10734 \begin_layout Itemize
10735 \begin_inset Flex CharStyle:Code
10738 \begin_layout Plain Layout
10745 \begin_inset Flex CharStyle:Code
10748 \begin_layout Plain Layout
10755 }\SpecialChar \ldots{}
10771 \begin_layout Itemize
10772 \begin_inset Flex CharStyle:Code
10775 \begin_layout Plain Layout
10782 \begin_inset Flex CharStyle:Code
10785 \begin_layout Plain Layout
10792 \begin_inset Flex CharStyle:Code
10795 \begin_layout Plain Layout
10803 is generated for each paragraph of this environment.
10807 \begin_layout Itemize
10808 \begin_inset Flex CharStyle:Code
10811 \begin_layout Plain Layout
10818 \begin_inset Flex CharStyle:Code
10821 \begin_layout Plain Layout
10828 \begin_inset Flex CharStyle:Code
10831 \begin_layout Plain Layout
10837 is passed as an argument to the environment.
10839 \begin_inset Flex CharStyle:Code
10842 \begin_layout Plain Layout
10848 can be defined in the
10849 \begin_inset Flex CharStyle:MenuItem
10852 \begin_layout Plain Layout
10857 ayout\SpecialChar \menuseparator
10871 \begin_layout Standard
10872 Putting the last few things together, the LaTeX output will be either:
10875 \begin_layout LyX-Code
10878 latexname[latexparam]{\SpecialChar \ldots{}
10882 \begin_layout Standard
10886 \begin_layout LyX-Code
10889 begin{latexname}[latexparam] \SpecialChar \ldots{}
10895 \begin_layout Standard
10896 depending upon the LaTeX type.
10900 \begin_layout Description
10901 \begin_inset Flex CharStyle:Code
10904 \begin_layout Plain Layout
10911 \begin_inset Flex CharStyle:Code
10914 \begin_layout Plain Layout
10920 ] If you put layouts into environments, the leftmargins are not simply added,
10921 but added with a factor
10922 \begin_inset Formula $\frac{4}{depth+4}$
10926 Note that this parameter is also used when the margin is defined as
10927 \begin_inset Flex CharStyle:Code
10930 \begin_layout Plain Layout
10937 \begin_inset Flex CharStyle:Code
10940 \begin_layout Plain Layout
10947 Then it is added to the manual or dynamic margin.
10949 \begin_inset Newline newline
10952 The argument is passed as a string.
10954 \begin_inset Quotes eld
10958 \begin_inset Flex CharStyle:Code
10961 \begin_layout Plain Layout
10968 \begin_inset Quotes erd
10971 means that the paragraph is indented with the width of
10972 \begin_inset Quotes eld
10976 \begin_inset Flex CharStyle:Code
10979 \begin_layout Plain Layout
10986 \begin_inset Quotes erd
10989 in the normal font.
10990 You can get a negative width by prefixing the string with
10991 \begin_inset Quotes eld
10995 \begin_inset Flex CharStyle:Code
10998 \begin_layout Plain Layout
11005 \begin_inset Quotes erd
11009 This way was chosen so that the look is the same with each used screen
11014 \begin_layout Description
11015 \begin_inset Flex CharStyle:Code
11018 \begin_layout Plain Layout
11025 \begin_inset Flex CharStyle:Code
11028 \begin_layout Plain Layout
11033 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11039 \begin_inset Newline newline
11042 The kind of margin that the layout has on the left side.
11044 \begin_inset Flex CharStyle:Code
11047 \begin_layout Plain Layout
11053 just means a fixed margin.
11055 \begin_inset Flex CharStyle:Code
11058 \begin_layout Plain Layout
11064 means that the left margin depends on the string entered in the
11065 \begin_inset Flex CharStyle:MenuItem
11068 \begin_layout Plain Layout
11069 Edit\SpecialChar \menuseparator
11071 \begin_inset space ~
11080 This is used to typeset nice lists without tabulators.
11082 \begin_inset Flex CharStyle:Code
11085 \begin_layout Plain Layout
11091 means that the margin depends on the size of the label.
11092 This is used for automatic enumerated headlines.
11093 It is obvious that the headline
11094 \begin_inset Quotes eld
11097 5.4.3.2.1 Very long headline
11098 \begin_inset Quotes erd
11101 must have a wider left margin (as wide as
11102 \begin_inset Quotes eld
11106 \begin_inset Quotes erd
11109 plus the space) than
11110 \begin_inset Quotes eld
11113 3.2 Very long headline
11114 \begin_inset Quotes erd
11118 \begin_inset Quotes eld
11122 \begin_inset Quotes erd
11125 are not able to do this.
11127 \begin_inset Flex CharStyle:Code
11130 \begin_layout Plain Layout
11136 is similar, but only the very first row of the paragraph is dynamic, while
11137 the others are static; this is used, for example, for descriptions.
11139 \begin_inset Flex CharStyle:Code
11142 \begin_layout Plain Layout
11148 means the margin is chosen in a way that the longest row of this paragraph
11149 fits to the right margin.
11150 This is used to typeset an address on the right edge of the page.
11153 \begin_layout Description
11154 \begin_inset Flex CharStyle:Code
11157 \begin_layout Plain Layout
11164 \begin_inset Flex CharStyle:Code
11167 \begin_layout Plain Layout
11176 \begin_inset Flex CharStyle:Code
11179 \begin_layout Plain Layout
11185 ] Whether fragile commands in this layout should be
11186 \begin_inset Flex CharStyle:Code
11189 \begin_layout Plain Layout
11202 whether this command should itself be protected.)
11205 \begin_layout Description
11206 \begin_inset Flex CharStyle:Code
11209 \begin_layout Plain Layout
11216 \begin_inset Flex CharStyle:Code
11219 \begin_layout Plain Layout
11226 \begin_inset Flex CharStyle:Code
11229 \begin_layout Plain Layout
11237 ] Whether newlines are translated into LaTeX newlines (
11238 \begin_inset Flex CharStyle:Code
11241 \begin_layout Plain Layout
11252 The translation can be switched off to allow more comfortable LaTeX editing
11256 \begin_layout Description
11257 \begin_inset Flex CharStyle:Code
11260 \begin_layout Plain Layout
11267 \begin_inset Flex CharStyle:Code
11270 \begin_layout Plain Layout
11277 \begin_inset Flex CharStyle:Code
11280 \begin_layout Plain Layout
11288 ] Whether the following Paragraph is allowed to indent its very first row.
11290 \begin_inset Flex CharStyle:Code
11293 \begin_layout Plain Layout
11299 means that it is not allowed to do so;
11300 \begin_inset Flex CharStyle:Code
11303 \begin_layout Plain Layout
11309 means it could do so if it wants to.
11312 \begin_layout Description
11313 \begin_inset Flex CharStyle:Code
11316 \begin_layout Plain Layout
11322 Name of a layout that has replaced this layout.
11323 This is used to rename a layout, while keeping backward compatibility.
11326 \begin_layout Description
11327 \begin_inset Flex CharStyle:Code
11330 \begin_layout Plain Layout
11337 \begin_inset Flex CharStyle:Code
11340 \begin_layout Plain Layout
11346 ] The number of optional arguments that can be used with this layout.
11347 This is useful for things like section headings, and only makes sense with
11351 \begin_layout Description
11352 \begin_inset Flex CharStyle:Code
11355 \begin_layout Plain Layout
11362 \begin_inset Flex CharStyle:Code
11365 \begin_layout Plain Layout
11371 ] The indent of the very first line of a paragraph.
11373 \begin_inset Flex CharStyle:Code
11376 \begin_layout Plain Layout
11382 will be fixed for a certain layout.
11383 The exception is Standard layout, since the indentation of a Standard layout
11384 paragraph can be prohibited with
11385 \begin_inset Flex CharStyle:Code
11388 \begin_layout Plain Layout
11395 Also, Standard layout paragraphs inside environments use the
11396 \begin_inset Flex CharStyle:Code
11399 \begin_layout Plain Layout
11405 of the environment, not their native one.
11406 For example, Standard paragraphs inside an enumeration are not indented.
11409 \begin_layout Description
11410 \begin_inset Flex CharStyle:Code
11413 \begin_layout Plain Layout
11420 \begin_inset Flex CharStyle:Code
11423 \begin_layout Plain Layout
11429 ] The vertical space between two paragraphs of this layout.
11432 \begin_layout Description
11433 \begin_inset Flex CharStyle:Code
11436 \begin_layout Plain Layout
11443 \begin_inset Flex CharStyle:Code
11446 \begin_layout Plain Layout
11452 ] LyX allows the user to choose either
11453 \begin_inset Quotes eld
11457 \begin_inset Quotes erd
11461 \begin_inset Quotes eld
11465 \begin_inset Quotes erd
11468 to typeset a document.
11470 \begin_inset Quotes eld
11474 \begin_inset Quotes erd
11477 is chosen, this value is completely ignored.
11479 \begin_inset Quotes eld
11483 \begin_inset Quotes erd
11486 is chosen, the parindent of a LaTeXtype
11487 \begin_inset Quotes eld
11491 \begin_inset Quotes erd
11494 layout is ignored and all paragraphs are separated by this parskip argument.
11495 The vertical space is calculated with
11496 \begin_inset Flex CharStyle:Code
11499 \begin_layout Plain Layout
11501 \begin_inset space ~
11510 \begin_inset Flex CharStyle:Code
11513 \begin_layout Plain Layout
11519 is the height of a row with the normal font.
11520 This way, the look stays the same with different screen fonts.
11523 \begin_layout Description
11524 \begin_inset Flex CharStyle:Code
11527 \begin_layout Plain Layout
11534 \begin_inset CommandInset label
11536 name "des:PathThru"
11543 \begin_inset Flex CharStyle:Code
11546 \begin_layout Plain Layout
11557 \begin_inset Flex CharStyle:Code
11560 \begin_layout Plain Layout
11566 ] Whether the contents of this paragraph should be output in raw form, meaning
11567 without special translations that LaTeX would require.
11570 \begin_layout Description
11571 \begin_inset Flex CharStyle:Code
11574 \begin_layout Plain Layout
11581 \begin_inset CommandInset label
11583 name "des:Preamble"
11587 Information to be included in the LaTeX preamble when this style is used.
11588 Used to define macros, load packages, etc., required by this particular
11591 \begin_inset Quotes eld
11595 \begin_inset Flex CharStyle:Code
11598 \begin_layout Plain Layout
11605 \begin_inset Quotes erd
11611 \begin_layout Description
11612 \begin_inset Flex CharStyle:Code
11615 \begin_layout Plain Layout
11622 \begin_inset Flex CharStyle:Code
11625 \begin_layout Plain Layout
11632 \begin_inset CommandInset label
11634 name "des:Requires"
11638 Whether the layout requires the feature
11639 \begin_inset Flex CharStyle:Code
11642 \begin_layout Plain Layout
11649 See the description of
11650 \begin_inset Flex CharStyle:Code
11653 \begin_layout Plain Layout
11660 \begin_inset CommandInset ref
11661 LatexCommand pageref
11662 reference "des:FreeSpacing"
11666 ) for information on `features'.
11670 \begin_layout Description
11671 \begin_inset Flex CharStyle:Code
11674 \begin_layout Plain Layout
11681 \begin_inset Flex CharStyle:Code
11684 \begin_layout Plain Layout
11691 \begin_inset Flex CharStyle:Code
11694 \begin_layout Plain Layout
11703 \begin_layout Description
11704 \begin_inset Flex CharStyle:Code
11707 \begin_layout Plain Layout
11714 \begin_inset Flex CharStyle:Code
11717 \begin_layout Plain Layout
11722 , onehalf, double, other
11731 ] This defines what the default spacing should be in the layout.
11733 \begin_inset Flex CharStyle:Code
11736 \begin_layout Plain Layout
11743 \begin_inset Flex CharStyle:Code
11746 \begin_layout Plain Layout
11753 \begin_inset Flex CharStyle:Code
11756 \begin_layout Plain Layout
11762 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
11763 If you specify the argument
11764 \begin_inset Flex CharStyle:Code
11767 \begin_layout Plain Layout
11773 , then you should also provide a numerical argument which will be the actual
11775 Note that, contrary to other parameters,
11776 \begin_inset Flex CharStyle:Code
11779 \begin_layout Plain Layout
11785 implies the generation of specific LaTeX code, using the package
11788 \begin_inset Flex CharStyle:Code
11791 \begin_layout Plain Layout
11800 \begin_layout Description
11801 \begin_inset Flex CharStyle:Code
11804 \begin_layout Plain Layout
11810 The font used for the text body .
11812 \begin_inset CommandInset ref
11814 reference "sub:Font-description"
11821 \begin_layout Description
11822 \begin_inset Flex CharStyle:Code
11825 \begin_layout Plain Layout
11833 The level of the style in the table of contents.
11834 This is used for automatic numbering of section headings.
11837 \begin_layout Description
11838 \begin_inset Flex CharStyle:Code
11841 \begin_layout Plain Layout
11848 \begin_inset Flex CharStyle:Code
11851 \begin_layout Plain Layout
11857 ] The vertical space with which the very first of a chain of paragraphs
11858 with this layout is separated from the previous paragraph.
11859 If the previous paragraph has another layout, the separations are not simply
11860 added, but the maximum is taken.
11863 \begin_layout Subsection
11865 \begin_inset CommandInset label
11874 \begin_layout Standard
11875 Since version 1.3.0 of LyX, it is has been both possible and necessary to
11876 define the floats (
11877 \begin_inset Flex CharStyle:MenuItem
11880 \begin_layout Plain Layout
11887 \begin_inset Flex CharStyle:MenuItem
11890 \begin_layout Plain Layout
11896 , \SpecialChar \ldots{}
11897 ) in the text class itself.
11898 Standard floats are included in the file
11899 \begin_inset Flex CharStyle:Code
11902 \begin_layout Plain Layout
11908 , so you may have to do no more than add
11911 \begin_layout LyX-Code
11912 Input stdfloats.inc
11915 \begin_layout Standard
11916 to your layout file.
11917 If you want to implement a text class that proposes some other float types
11918 (like the AGU class bundled with LyX), the information below will hopefully
11922 \begin_layout Description
11923 \begin_inset Flex CharStyle:Code
11926 \begin_layout Plain Layout
11933 \begin_inset Flex CharStyle:Code
11936 \begin_layout Plain Layout
11943 \begin_inset Quotes erd
11947 \begin_inset Quotes erd
11950 ] The file name extension of an auxiliary file for the list of figures (or
11952 LaTeX writes the captions to this file.
11955 \begin_layout Description
11956 \begin_inset Flex CharStyle:Code
11959 \begin_layout Plain Layout
11966 \begin_inset Flex CharStyle:Code
11969 \begin_layout Plain Layout
11976 \begin_inset Quotes erd
11980 \begin_inset Quotes erd
11983 ] The string that will be used in the menus and also for the caption.
11984 This is translated to the current language if babel is used.
11987 \begin_layout Description
11988 \begin_inset Flex CharStyle:Code
11991 \begin_layout Plain Layout
11998 \begin_inset Flex CharStyle:Code
12001 \begin_layout Plain Layout
12010 \begin_inset Flex CharStyle:Code
12013 \begin_layout Plain Layout
12020 \begin_inset Flex CharStyle:Code
12023 \begin_layout Plain Layout
12029 if the float is already defined by the LaTeX document class.
12031 \begin_inset Flex CharStyle:Code
12034 \begin_layout Plain Layout
12040 , the float will be defined using the LaTeX package
12041 \begin_inset Flex CharStyle:Code
12044 \begin_layout Plain Layout
12053 \begin_layout Description
12054 \begin_inset Flex CharStyle:Code
12057 \begin_layout Plain Layout
12064 \begin_inset Flex CharStyle:Code
12067 \begin_layout Plain Layout
12074 \begin_inset Quotes erd
12078 \begin_inset Quotes erd
12081 ] The heading used for the list of floats.
12082 This is translated to the document language.
12085 \begin_layout Description
12086 \begin_inset Flex CharStyle:Code
12089 \begin_layout Plain Layout
12096 \begin_inset Flex CharStyle:Code
12099 \begin_layout Plain Layout
12106 \begin_inset Quotes erd
12110 \begin_inset Quotes erd
12113 ] This (optional) argument determines whether floats of this class will
12114 be numbered within some sectional unit of the document.
12115 For example, if within is equal to
12116 \begin_inset Flex CharStyle:Code
12119 \begin_layout Plain Layout
12125 , the floats will be numbered within chapters.
12129 \begin_layout Description
12130 \begin_inset Flex CharStyle:Code
12133 \begin_layout Plain Layout
12140 \begin_inset Flex CharStyle:Code
12143 \begin_layout Plain Layout
12150 \begin_inset Quotes erd
12154 \begin_inset Quotes erd
12157 ] The default placement for the given class of floats.
12158 The string should be as in standard LaTeX:
12159 \begin_inset Flex CharStyle:Code
12162 \begin_layout Plain Layout
12169 \begin_inset Flex CharStyle:Code
12172 \begin_layout Plain Layout
12179 \begin_inset Flex CharStyle:Code
12182 \begin_layout Plain Layout
12189 \begin_inset Flex CharStyle:Code
12192 \begin_layout Plain Layout
12198 for top, bottom, page, and here, respectively.
12202 \begin_layout Plain Layout
12203 Note that the order of these letters in the string is irrelevant, like in
12209 On top of that there is a new type,
12210 \begin_inset Flex CharStyle:Code
12213 \begin_layout Plain Layout
12219 , which does not really correspond to a float, since it means: put it
12220 \begin_inset Quotes eld
12224 \begin_inset Quotes erd
12228 Note however that the
12229 \begin_inset Flex CharStyle:Code
12232 \begin_layout Plain Layout
12238 specifier is special and, because of implementation details, cannot be
12239 used in non-built in float types.
12240 If you do not understand what this means, just use
12241 \begin_inset Quotes eld
12245 \begin_inset Flex CharStyle:Code
12248 \begin_layout Plain Layout
12255 \begin_inset Quotes erd
12261 \begin_layout Description
12262 \begin_inset Flex CharStyle:Code
12265 \begin_layout Plain Layout
12272 \begin_inset Flex CharStyle:Code
12275 \begin_layout Plain Layout
12282 \begin_inset Quotes erd
12286 \begin_inset Quotes erd
12289 ] The style used when defining the float using
12290 \begin_inset Flex CharStyle:Code
12293 \begin_layout Plain Layout
12304 \begin_layout Description
12305 \begin_inset Flex CharStyle:Code
12308 \begin_layout Plain Layout
12315 \begin_inset Flex CharStyle:Code
12318 \begin_layout Plain Layout
12325 \begin_inset Quotes erd
12329 \begin_inset Quotes erd
12333 \begin_inset Quotes eld
12337 \begin_inset Quotes erd
12340 of the new class of floats, like program or algorithm.
12341 After the appropriate
12342 \begin_inset Flex CharStyle:Code
12345 \begin_layout Plain Layout
12354 \begin_inset Flex CharStyle:Code
12357 \begin_layout Plain Layout
12366 \begin_inset Flex CharStyle:Code
12369 \begin_layout Plain Layout
12380 \begin_layout Standard
12381 Note that defining a float with type
12382 \begin_inset Flex CharStyle:Code
12385 \begin_layout Plain Layout
12393 automatically defines the corresponding counter with name
12394 \begin_inset Flex CharStyle:Code
12397 \begin_layout Plain Layout
12408 \begin_layout Subsection
12409 Flex insets and InsetLayout
12410 \begin_inset CommandInset label
12412 name "sub:Flex-insets-and"
12419 \begin_layout Standard
12420 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
12421 these are called Flex insets.
12425 \begin_layout Standard
12426 Flex insets come in three different kinds:
12429 \begin_layout Itemize
12431 \begin_inset Flex CharStyle:Code
12434 \begin_layout Plain Layout
12440 ): These define semantic markup corresponding to such LaTeX commands as
12442 \begin_inset Flex CharStyle:Code
12445 \begin_layout Plain Layout
12454 \begin_inset Flex CharStyle:Code
12457 \begin_layout Plain Layout
12468 \begin_layout Itemize
12470 \begin_inset Flex CharStyle:Code
12473 \begin_layout Plain Layout
12479 ): These can be used to define custom collapsible insets, similar to TeX
12480 code, footnote, and the like.
12481 An obvious example is an endnote inset, which is defined in the
12482 \begin_inset Flex CharStyle:Code
12485 \begin_layout Plain Layout
12494 \begin_layout Itemize
12496 \begin_inset Flex CharStyle:Code
12499 \begin_layout Plain Layout
12505 ): For use with DocBook classes.
12508 \begin_layout Standard
12509 Flex insets are defined using the
12510 \begin_inset Flex CharStyle:Code
12513 \begin_layout Plain Layout
12519 tag, which shall be explained in a moment.
12522 \begin_layout Standard
12524 \begin_inset Flex CharStyle:Code
12527 \begin_layout Plain Layout
12533 tag also serves another function: It can be used to customize the general
12534 layout of many different types of insets.
12536 \begin_inset Flex CharStyle:Code
12539 \begin_layout Plain Layout
12545 can be used to customize the layout parameters for footnotes, marginal
12546 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
12547 boxes, tables, algorithms, URLs, and optional arguments, as well as to
12548 define Flex insets.
12551 \begin_layout Standard
12553 \begin_inset Flex CharStyle:Code
12556 \begin_layout Plain Layout
12562 definition must begin with a line of the form:
12565 \begin_layout LyX-Code
12569 \begin_layout Standard
12571 \begin_inset Flex CharStyle:Code
12574 \begin_layout Plain Layout
12580 indicates the inset whose layout is being defined, and here there are two
12584 \begin_layout Enumerate
12585 The layout for a pre-existing inset is being modified.
12586 In this case, can be
12587 \begin_inset Flex CharStyle:Code
12590 \begin_layout Plain Layout
12596 any one of the following:
12597 \begin_inset Flex CharStyle:Code
12600 \begin_layout Plain Layout
12607 \begin_inset Flex CharStyle:Code
12610 \begin_layout Plain Layout
12617 \begin_inset Flex CharStyle:Code
12620 \begin_layout Plain Layout
12627 \begin_inset Flex CharStyle:Code
12630 \begin_layout Plain Layout
12637 \begin_inset Flex CharStyle:Code
12640 \begin_layout Plain Layout
12647 \begin_inset Flex CharStyle:Code
12650 \begin_layout Plain Layout
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
12697 \begin_inset Flex CharStyle:Code
12700 \begin_layout Plain Layout
12707 \begin_inset Flex CharStyle:Code
12710 \begin_layout Plain Layout
12717 \begin_inset Flex CharStyle:Code
12720 \begin_layout Plain Layout
12727 \begin_inset Flex CharStyle:Code
12730 \begin_layout Plain Layout
12737 \begin_inset Flex CharStyle:Code
12740 \begin_layout Plain Layout
12747 \begin_inset Flex CharStyle:Code
12750 \begin_layout Plain Layout
12757 \begin_inset Flex CharStyle:Code
12760 \begin_layout Plain Layout
12767 \begin_inset Flex CharStyle:Code
12770 \begin_layout Plain Layout
12777 \begin_inset Flex CharStyle:Code
12780 \begin_layout Plain Layout
12787 \begin_inset Flex CharStyle:Code
12790 \begin_layout Plain Layout
12799 \begin_layout Enumerate
12800 The layout for a Flex inset is being defined.
12802 \begin_inset Flex CharStyle:Code
12805 \begin_layout Plain Layout
12811 can be any valid identifier not used by a pre-existing inset.
12812 Note that the definition of a flex inset must
12817 \begin_inset Flex CharStyle:Code
12820 \begin_layout Plain Layout
12829 \begin_layout Standard
12831 \begin_inset Flex CharStyle:Code
12834 \begin_layout Plain Layout
12840 definition can contain the following entries:
12843 \begin_layout Description
12844 \begin_inset Flex CharStyle:Code
12847 \begin_layout Plain Layout
12853 The color for the inset's background.
12854 The valid colors are defined in
12855 \begin_inset Flex CharStyle:Code
12858 \begin_layout Plain Layout
12867 \begin_layout Description
12868 \begin_inset Flex CharStyle:Code
12871 \begin_layout Plain Layout
12877 As with paragraph styles (see page
12878 \begin_inset CommandInset ref
12880 reference "des:CopyStyle"
12887 \begin_layout Description
12888 \begin_inset Flex CharStyle:Code
12891 \begin_layout Plain Layout
12898 \begin_inset Flex CharStyle:Code
12901 \begin_layout Plain Layout
12910 \begin_inset Flex CharStyle:Code
12913 \begin_layout Plain Layout
12919 ] Indicates whether the user may employ the Paragraph Settings dialog to
12920 customize the paragraph.
12923 \begin_layout Description
12924 \begin_inset Flex CharStyle:Code
12927 \begin_layout Plain Layout
12934 \begin_inset Flex CharStyle:Code
12937 \begin_layout Plain Layout
12944 \begin_inset Flex CharStyle:Code
12947 \begin_layout Plain Layout
12954 \begin_inset Flex CharStyle:Code
12957 \begin_layout Plain Layout
12963 , describing the rendering style used for the inset's frame and buttons.
12964 Footnotes generally use
12965 \begin_inset Flex CharStyle:Code
12968 \begin_layout Plain Layout
12974 , ERT insets generally
12975 \begin_inset Flex CharStyle:Code
12978 \begin_layout Plain Layout
12984 , and character styles
12985 \begin_inset Flex CharStyle:Code
12988 \begin_layout Plain Layout
12997 \begin_layout Description
12998 \begin_inset Flex CharStyle:Code
13001 \begin_layout Plain Layout
13007 Required at the end of the InsetLayout declarations.
13010 \begin_layout Description
13011 \begin_inset Flex CharStyle:Code
13014 \begin_layout Plain Layout
13020 The font used for both the text body
13026 \begin_inset space ~
13030 \begin_inset CommandInset ref
13032 reference "sub:Font-description"
13037 Note that defining this font automatically defines the
13038 \begin_inset Flex CharStyle:Code
13041 \begin_layout Plain Layout
13047 to the same value, so define this first and define
13048 \begin_inset Flex CharStyle:Code
13051 \begin_layout Plain Layout
13057 later if you want them to be different.
13060 \begin_layout Description
13061 \begin_inset Flex CharStyle:Code
13064 \begin_layout Plain Layout
13071 \begin_inset Quotes eld
13075 \begin_inset Quotes erd
13078 language, leading to Left-to-Right (latin) output, e.
13079 \begin_inset space \thinspace{}
13083 \begin_inset space \space{}
13086 in TeX code or URL.
13090 \begin_layout Description
13091 \begin_inset Flex CharStyle:Code
13094 \begin_layout Plain Layout
13101 \begin_inset Flex CharStyle:Code
13104 \begin_layout Plain Layout
13113 \begin_inset Flex CharStyle:Code
13116 \begin_layout Plain Layout
13122 ] Indicates whether the PlainLayout should be used or, instead, the user
13123 can change the paragraph style used in the inset.
13126 \begin_layout Description
13127 \begin_inset Flex CharStyle:Code
13130 \begin_layout Plain Layout
13136 As with paragraph styles (see page
13137 \begin_inset CommandInset ref
13138 LatexCommand pageref
13139 reference "des:FreeSpacing"
13146 \begin_layout Description
13147 \begin_inset Flex CharStyle:Code
13150 \begin_layout Plain Layout
13157 \begin_inset Flex CharStyle:Code
13160 \begin_layout Plain Layout
13169 \begin_inset Flex CharStyle:Code
13172 \begin_layout Plain Layout
13178 ] Whether to include the contents of this inset in the strings generated
13179 for the `Outline' pane.
13180 One would not, for example, want the content of a footnote in a section
13181 header to be included in the TOC displayed in the outline, but one would
13182 normally want the content of a character style displayed.
13183 Default is false: not to include.
13186 \begin_layout Description
13187 \begin_inset Flex CharStyle:Code
13190 \begin_layout Plain Layout
13196 As with paragraph styles (see page
13197 \begin_inset CommandInset ref
13198 LatexCommand pageref
13199 reference "des:KeepEmpty"
13206 \begin_layout Description
13207 \begin_inset Flex CharStyle:Code
13210 \begin_layout Plain Layout
13216 The font used for the label.
13218 \begin_inset space ~
13222 \begin_inset CommandInset ref
13224 reference "sub:Font-description"
13229 Note that this definition can never appear before
13230 \begin_inset Flex CharStyle:Code
13233 \begin_layout Plain Layout
13239 , lest it be ineffective.
13242 \begin_layout Description
13243 \begin_inset Flex CharStyle:Code
13246 \begin_layout Plain Layout
13252 What will be displayed on the button or elsewhere as the inset label.
13253 Some inset types (TeX code and Branch) modify this label on the fly.
13256 \begin_layout Description
13257 \begin_inset Flex CharStyle:Code
13260 \begin_layout Plain Layout
13266 The name of the corresponding LaTeX stuff.
13267 Either the environment or command name.
13270 \begin_layout Description
13271 \begin_inset Flex CharStyle:Code
13274 \begin_layout Plain Layout
13280 The optional parameter for the corresponding
13281 \begin_inset Flex CharStyle:Code
13284 \begin_layout Plain Layout
13290 stuff, including possible bracket pairs like
13291 \begin_inset Flex CharStyle:Code
13294 \begin_layout Plain Layout
13301 This parameter cannot be changed from within LyX.
13304 \begin_layout Description
13305 \begin_inset Flex CharStyle:Code
13308 \begin_layout Plain Layout
13314 As with paragraph styles (see page
13315 \begin_inset CommandInset ref
13316 LatexCommand pageref
13317 reference "des:LatexType"
13324 \begin_layout Description
13325 \begin_inset Flex CharStyle:Code
13328 \begin_layout Plain Layout
13335 \begin_inset Flex CharStyle:Code
13338 \begin_layout Plain Layout
13345 \begin_inset Flex CharStyle:Code
13348 \begin_layout Plain Layout
13355 \begin_inset Flex CharStyle:Code
13358 \begin_layout Plain Layout
13365 \begin_inset Flex CharStyle:Code
13368 \begin_layout Plain Layout
13374 (indicating a dummy definition ending definitions of charstyles, etc).
13375 This entry is required in and is only meaningful for Flex insets.
13376 Among other things, it determines on which menu this inset will appear.
13379 \begin_layout Description
13380 \begin_inset Flex CharStyle:Code
13383 \begin_layout Plain Layout
13390 \begin_inset Flex CharStyle:Code
13393 \begin_layout Plain Layout
13402 \begin_inset Flex CharStyle:Code
13405 \begin_layout Plain Layout
13411 ] Whether multiple paragraphs are permitted in this inset.
13412 This will also set CustomPars to the same value and ForcePlain to the opposite
13414 These can be reset to other values, if they are used
13421 \begin_layout Description
13422 \begin_inset Flex CharStyle:Code
13425 \begin_layout Plain Layout
13432 \begin_inset Flex CharStyle:Code
13435 \begin_layout Plain Layout
13444 \begin_inset Flex CharStyle:Code
13447 \begin_layout Plain Layout
13453 ] Whether fragile commands in this layout should be
13454 \begin_inset Flex CharStyle:Code
13457 \begin_layout Plain Layout
13470 whether the command should itself be protected.)
13473 \begin_layout Description
13474 \begin_inset Flex CharStyle:Code
13477 \begin_layout Plain Layout
13484 \begin_inset Flex CharStyle:Code
13487 \begin_layout Plain Layout
13496 \begin_inset Flex CharStyle:Code
13499 \begin_layout Plain Layout
13505 ] As with paragraph styles (see page
13506 \begin_inset CommandInset ref
13508 reference "des:PathThru"
13515 \begin_layout Description
13516 \begin_inset Flex CharStyle:Code
13519 \begin_layout Plain Layout
13525 As with paragraph styles (see page
13526 \begin_inset CommandInset ref
13527 LatexCommand pageref
13528 reference "des:Preamble"
13535 \begin_layout Description
13536 \begin_inset Flex CharStyle:Code
13539 \begin_layout Plain Layout
13546 \begin_inset Flex CharStyle:Code
13549 \begin_layout Plain Layout
13555 ] As with paragraph styles (see page
13556 \begin_inset CommandInset ref
13557 LatexCommand pageref
13558 reference "des:Requires"
13565 \begin_layout Subsection
13567 \begin_inset CommandInset label
13569 name "sub:Counters"
13576 \begin_layout Standard
13577 Since version 1.3.0 of LyX, it is both possible and necessary to define the
13579 \begin_inset Flex CharStyle:MenuItem
13582 \begin_layout Plain Layout
13589 \begin_inset Flex CharStyle:MenuItem
13592 \begin_layout Plain Layout
13598 , \SpecialChar \ldots{}
13599 ) in the text class itself.
13600 The standard counters are defined in the file
13601 \begin_inset Flex CharStyle:Code
13604 \begin_layout Plain Layout
13610 , so you may have to do no more than add
13613 \begin_layout LyX-Code
13614 Input stdcounters.inc
13617 \begin_layout Standard
13618 to your layout file to get them to work.
13619 But if you want to define custom counters, then you can do so.
13620 The counter declaration must begin with:
13623 \begin_layout LyX-Code
13624 Counter CounterName
13627 \begin_layout Standard
13629 \begin_inset Flex CharStyle:Code
13632 \begin_layout Plain Layout
13638 ' is replaced by the name of the counter.
13639 And it must end with
13640 \begin_inset Quotes eld
13644 \begin_inset Flex CharStyle:Code
13647 \begin_layout Plain Layout
13654 \begin_inset Quotes erd
13658 The following parameters can also be used:
13661 \begin_layout Description
13662 \begin_inset Flex CharStyle:Code
13665 \begin_layout Plain Layout
13666 LabelString [string=""]
13671 when this is defined, this string defines how the counter is displayed.
13672 Setting this value sets
13673 \begin_inset Flex CharStyle:Code
13676 \begin_layout Plain Layout
13677 LabelStringAppendix
13683 The following special constructs can be used in the string:
13687 \begin_layout Itemize
13688 \begin_inset Flex CharStyle:Code
13691 \begin_layout Plain Layout
13699 will be replaced by the expansion of the
13700 \begin_inset Flex CharStyle:Code
13703 \begin_layout Plain Layout
13710 \begin_inset Flex CharStyle:Code
13713 \begin_layout Plain Layout
13714 LabelStringAppendix
13720 \begin_inset Flex CharStyle:Code
13723 \begin_layout Plain Layout
13733 \begin_layout Itemize
13734 counter values can be expressed using LaTeX-like macros
13735 \begin_inset Flex CharStyle:Code
13738 \begin_layout Plain Layout
13755 \begin_inset Flex CharStyle:Code
13758 \begin_layout Plain Layout
13770 \begin_layout Plain Layout
13780 Actually, the situation is a bit more complicated: any
13799 other than those described below will produce arabic numerals.
13800 It would not be surprising to see this change in the future.
13806 \begin_inset Flex CharStyle:Code
13809 \begin_layout Plain Layout
13815 : 1, 2, 3,\SpecialChar \ldots{}
13817 \begin_inset Flex CharStyle:Code
13820 \begin_layout Plain Layout
13826 for lower-case letters: a, b, c, \SpecialChar \ldots{}
13828 \begin_inset Flex CharStyle:Code
13831 \begin_layout Plain Layout
13837 for upper-case letters: A, B, C, \SpecialChar \ldots{}
13839 \begin_inset Flex CharStyle:Code
13842 \begin_layout Plain Layout
13848 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
13850 \begin_inset Flex CharStyle:Code
13853 \begin_layout Plain Layout
13859 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
13861 \begin_inset Flex CharStyle:Code
13864 \begin_layout Plain Layout
13870 for hebrew numerals.
13874 \begin_layout Standard
13875 If LabelString is not defined, a default value is constructed as follows:
13876 if the counter has a master counter
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
13910 is used; otherwise the string
13911 \begin_inset Flex CharStyle:Code
13914 \begin_layout Plain Layout
13925 \begin_layout Description
13926 \begin_inset Flex CharStyle:Code
13929 \begin_layout Plain Layout
13930 LabelStringAppendix [string=""]
13936 \begin_inset Flex CharStyle:Code
13939 \begin_layout Plain Layout
13945 , but for use in the Appendix.
13948 \begin_layout Description
13949 \begin_inset Flex CharStyle:Code
13952 \begin_layout Plain Layout
13959 \begin_inset Flex CharStyle:Code
13962 \begin_layout Plain Layout
13969 \begin_inset Quotes erd
13973 \begin_inset Quotes erd
13976 ] If this is set to the name of another counter, the present counter will
13977 be reset every time the other one is increased.
13979 \begin_inset Flex CharStyle:Code
13982 \begin_layout Plain Layout
13989 \begin_inset Flex CharStyle:Code
13992 \begin_layout Plain Layout
14001 \begin_layout Subsection
14003 \begin_inset CommandInset label
14005 name "sub:Font-description"
14012 \begin_layout Standard
14013 A font description looks like this:
14016 \begin_layout LyX-Code
14026 \begin_layout LyX-Code
14030 \begin_layout LyX-Code
14034 \begin_layout Standard
14035 The following commands are available:
14038 \begin_layout Description
14039 \begin_inset Flex CharStyle:Code
14042 \begin_layout Plain Layout
14049 \begin_inset Flex CharStyle:Code
14052 \begin_layout Plain Layout
14061 \begin_inset Flex CharStyle:Code
14064 \begin_layout Plain Layout
14071 \begin_inset Flex CharStyle:Code
14074 \begin_layout Plain Layout
14081 \begin_inset Flex CharStyle:Code
14084 \begin_layout Plain Layout
14091 \begin_inset Flex CharStyle:Code
14094 \begin_layout Plain Layout
14101 \begin_inset Flex CharStyle:Code
14104 \begin_layout Plain Layout
14111 \begin_inset Flex CharStyle:Code
14114 \begin_layout Plain Layout
14121 \begin_inset Flex CharStyle:Code
14124 \begin_layout Plain Layout
14131 \begin_inset Flex CharStyle:Code
14134 \begin_layout Plain Layout
14143 \begin_layout Description
14144 \begin_inset Flex CharStyle:Code
14147 \begin_layout Plain Layout
14156 \begin_inset Flex CharStyle:Code
14159 \begin_layout Plain Layout
14170 \begin_inset Flex CharStyle:Code
14173 \begin_layout Plain Layout
14180 \begin_inset Flex CharStyle:Code
14183 \begin_layout Plain Layout
14192 \begin_layout Description
14193 \begin_inset Flex CharStyle:Code
14196 \begin_layout Plain Layout
14203 \begin_inset Flex CharStyle:Code
14206 \begin_layout Plain Layout
14212 ] Valid arguments are:
14213 \begin_inset Flex CharStyle:Code
14216 \begin_layout Plain Layout
14223 \begin_inset Flex CharStyle:Code
14226 \begin_layout Plain Layout
14233 \begin_inset Flex CharStyle:Code
14236 \begin_layout Plain Layout
14243 \begin_inset Flex CharStyle:Code
14246 \begin_layout Plain Layout
14253 \begin_inset Flex CharStyle:Code
14256 \begin_layout Plain Layout
14263 \begin_inset Flex CharStyle:Code
14266 \begin_layout Plain Layout
14273 Each of these turns on or off the corresponding attribute.
14275 \begin_inset Flex CharStyle:Code
14278 \begin_layout Plain Layout
14284 turns on emphasis, and
14285 \begin_inset Flex CharStyle:Code
14288 \begin_layout Plain Layout
14296 \begin_inset Newline newline
14299 If the latter seems puzzling, remember that the font settings for the present
14300 context are generally inherited from the surrounding context.
14302 \begin_inset Flex CharStyle:Code
14305 \begin_layout Plain Layout
14311 would turn off the emphasis that was anyway in effect, say, in a theorem
14315 \begin_layout Description
14316 \begin_inset Flex CharStyle:Code
14319 \begin_layout Plain Layout
14328 \begin_inset Flex CharStyle:Code
14331 \begin_layout Plain Layout
14342 \begin_inset Flex CharStyle:Code
14345 \begin_layout Plain Layout
14354 \begin_layout Description
14355 \begin_inset Flex CharStyle:Code
14358 \begin_layout Plain Layout
14367 \begin_inset Flex CharStyle:Code
14370 \begin_layout Plain Layout
14381 \begin_inset Flex CharStyle:Code
14384 \begin_layout Plain Layout
14391 \begin_inset Flex CharStyle:Code
14394 \begin_layout Plain Layout
14401 \begin_inset Flex CharStyle:Code
14404 \begin_layout Plain Layout
14413 \begin_layout Description
14414 \begin_inset Flex CharStyle:Code
14417 \begin_layout Plain Layout
14424 \begin_inset Flex CharStyle:Code
14427 \begin_layout Plain Layout
14434 \begin_inset Flex CharStyle:Code
14437 \begin_layout Plain Layout
14444 \begin_inset Flex CharStyle:Code
14447 \begin_layout Plain Layout
14456 \begin_inset Flex CharStyle:Code
14459 \begin_layout Plain Layout
14466 \begin_inset Flex CharStyle:Code
14469 \begin_layout Plain Layout
14476 \begin_inset Flex CharStyle:Code
14479 \begin_layout Plain Layout
14486 \begin_inset Flex CharStyle:Code
14489 \begin_layout Plain Layout
14496 \begin_inset Flex CharStyle:Code
14499 \begin_layout Plain Layout
14508 \begin_layout Subsection
14509 Upgrading old layout files
14512 \begin_layout Standard
14513 The file format of layout files changes from time to time, so old layout
14514 files need to be converted.
14515 This process has been automated since LyX 1.4.0: If LyX reads an old format
14516 layout file it will call the conversion tool
14517 \begin_inset Flex CharStyle:Code
14520 \begin_layout Plain Layout
14521 LyXDir/scripts/layout2layout.py
14526 and convert it to a temporary file in current format.
14527 The original file is left untouched.
14528 If you want to convert the layout file permanently, just call the converter
14532 \begin_layout LyX-Code
14533 python $LyXDir/scripts/layout2layout.py myclass.layout myclassnew.layout
14536 \begin_layout Standard
14537 (You need to replace
14538 \begin_inset Flex CharStyle:Code
14541 \begin_layout Plain Layout
14547 with the name of your LyX system directory, unless you happen to have defined
14548 such an environment variable.) Then copy
14549 \begin_inset Flex CharStyle:Code
14552 \begin_layout Plain Layout
14559 \begin_inset Flex CharStyle:Code
14562 \begin_layout Plain Layout
14571 \begin_layout Standard
14572 The automatic conversion only handles syntax changes.
14573 It cannot handle the case where the contents of included files was changed,
14574 so these will have to be converted separately.
14577 \begin_layout Section
14579 \begin_inset CommandInset label
14581 name "sec:Creating-Templates"
14588 \begin_layout Standard
14589 Templates are created just like usual documents.
14590 The only difference is that usual documents contain all possible settings,
14591 including the font scheme and the paper size.
14592 Usually a user doesn't want a template to overwrite his defaults in these
14594 For that reason, the designer of a template should remove the corresponding
14596 \begin_inset Flex CharStyle:Code
14599 \begin_layout Plain Layout
14608 \begin_inset Flex CharStyle:Code
14611 \begin_layout Plain Layout
14619 from the template LyX file.
14620 This can be done with any simple text-editor, for example
14621 \begin_inset Flex CharStyle:Code
14624 \begin_layout Plain Layout
14631 \begin_inset Flex CharStyle:Code
14634 \begin_layout Plain Layout
14644 \begin_layout Standard
14645 Put the edited template files you create in
14646 \begin_inset Flex CharStyle:Code
14649 \begin_layout Plain Layout
14655 , copy the ones you use from the global template directory in
14656 \begin_inset Flex CharStyle:Code
14659 \begin_layout Plain Layout
14665 to the same place, and redefine the template path in the
14666 \begin_inset Flex CharStyle:MenuItem
14669 \begin_layout Plain Layout
14670 Tools\SpecialChar \menuseparator
14671 Preferences\SpecialChar \menuseparator
14680 \begin_layout Standard
14681 Note that there is a template which has a particular meaning:
14682 \begin_inset Flex CharStyle:Code
14685 \begin_layout Plain Layout
14692 This template is loaded every time you create a new document with
14693 \begin_inset Flex CharStyle:MenuItem
14696 \begin_layout Plain Layout
14697 File\SpecialChar \menuseparator
14703 in order to provide useful defaults.
14704 To create this template from inside LyX, all you have to do is to open
14705 a document with the correct settings, and use the
14706 \begin_inset Flex CharStyle:MenuItem
14709 \begin_layout Plain Layout
14710 Save as Document Defaults
14718 \begin_layout Chapter
14719 Including External Material
14722 \begin_layout Standard
14723 \begin_inset Box Shadowbox
14732 height_special "totalheight"
14735 \begin_layout Plain Layout
14736 WARNING: This portion of the documentation has not been updated for some
14738 We certainly hope that it is still accurate, but there are no guarantees.
14746 \begin_layout Standard
14747 The use of material from sources external to LyX is covered in detail in
14753 This part of the manual covers what needs to happen behind the scenes for
14754 new sorts of material to be included.
14757 \begin_layout Section
14761 \begin_layout Standard
14762 The external material feature is based on the concept of a
14767 A template is a specification of how LyX should interface with a certain
14769 As bundled, LyX comes with predefined templates for Xfig figures, various
14770 raster format images, chess diagrams, and LilyPond music notation.
14771 You can check the actual list by using the menu
14772 \begin_inset Flex CharStyle:MenuItem
14775 \begin_layout Plain Layout
14776 Insert\SpecialChar \menuseparator
14777 File\SpecialChar \menuseparator
14784 Furthermore, it is possible to roll your own template to support a specific
14786 Later we'll describe in more detail what is involved, and hopefully you
14787 will submit all the templates you create so we can include them in a later
14791 \begin_layout Standard
14792 Another basic idea of the external material feature is to distinguish between
14793 the original file that serves as a base for final material and the produced
14794 file that is included in your exported or printed document.
14795 For example, consider the case of a figure produced with
14796 \begin_inset Flex CharStyle:Code
14799 \begin_layout Plain Layout
14806 The Xfig application itself works on an original file with the
14807 \begin_inset Flex CharStyle:Code
14810 \begin_layout Plain Layout
14817 Within Xfig, you create and change your figure, and when you are done,
14819 \begin_inset Flex CharStyle:Code
14822 \begin_layout Plain Layout
14829 When you want to include the figure in your document, you invoke
14830 \begin_inset Flex CharStyle:Code
14833 \begin_layout Plain Layout
14839 in order to create a PostScript file that can readily be included in your
14842 \begin_inset Flex CharStyle:Code
14845 \begin_layout Plain Layout
14851 file is the original file, and the PostScript file is the produced file.
14854 \begin_layout Standard
14855 This distinction is important in order to allow updating of the material
14856 while you are in the process of writing the document.
14857 Furthermore, it provides us with the flexibility that is needed to support
14858 multiple export formats.
14859 For instance, in the case of a plain text file, it is not exactly an award-winn
14860 ing idea to include the figure as raw PostScript.
14861 Instead, you'd either prefer to just include a reference to the figure
14862 or try to invoke some graphics to ASCII converter to make the final result
14863 look similar to the real graphics.
14864 The external material management allows you to do this, because it is parametri
14865 zed on the different export formats that LyX supports.
14868 \begin_layout Standard
14869 Besides supporting the production of different products according to the
14870 exported format, it supports tight integration with editing and viewing
14872 In the case of an Xfig figure, you are able to invoke Xfig on the original
14873 file with a single click from within the external material dialog in LyX,
14874 and also preview the produced PostScript file with Ghostview with another
14876 No more fiddling around with the command line and/or file browsers to locate
14877 and manipulate the original or produced files.
14878 In this way, you are finally able to take full advantage of the many different
14879 applications that are relevant to use when you write your documents, and
14880 ultimately be more productive.
14883 \begin_layout Section
14884 The external template configuration file
14887 \begin_layout Standard
14888 It is relatively easy to add custom external template definitions to LyX.
14889 However, be aware that doing this in an careless manner most probably
14893 introduce an easily exploitable security hole.
14894 So before you do this, please read the discussion about security in section
14896 \begin_inset CommandInset ref
14898 reference "sec:Security-discussion"
14905 \begin_layout Standard
14906 Having said that, we encourage you to submit any interesting templates that
14911 \begin_layout Standard
14912 The external templates are defined in the
14913 \begin_inset Flex CharStyle:Code
14916 \begin_layout Plain Layout
14917 LyXDir/lib/external_templates
14923 You can place your own version in
14924 \begin_inset Flex CharStyle:Code
14927 \begin_layout Plain Layout
14928 UserDir/external_templates
14936 \begin_layout Standard
14937 A typical template looks like this:
14940 \begin_layout LyX-Code
14944 \begin_layout LyX-Code
14945 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
14948 \begin_layout LyX-Code
14952 \begin_layout LyX-Code
14956 \begin_layout LyX-Code
14960 \begin_layout LyX-Code
14964 \begin_layout LyX-Code
14968 \begin_layout LyX-Code
14969 AutomaticProduction true
14972 \begin_layout LyX-Code
14976 \begin_layout LyX-Code
14980 \begin_layout LyX-Code
14984 \begin_layout LyX-Code
14985 TransformCommand Rotate RotationLatexCommand
14988 \begin_layout LyX-Code
14989 TransformCommand Resize ResizeLatexCommand
14992 \begin_layout LyX-Code
14993 Product "$$RotateFront$$ResizeFront
14996 \begin_layout LyX-Code
15001 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
15004 \begin_layout LyX-Code
15005 $$ResizeBack$$RotateBack"
15008 \begin_layout LyX-Code
15012 \begin_layout LyX-Code
15013 UpdateResult "$$AbsPath$$Basename.pstex_t"
15016 \begin_layout LyX-Code
15017 Requirement "graphicx"
15020 \begin_layout LyX-Code
15021 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
15024 \begin_layout LyX-Code
15025 ReferencedFile latex "$$AbsPath$$Basename.eps"
15028 \begin_layout LyX-Code
15029 ReferencedFile dvi "$$AbsPath$$Basename.eps"
15032 \begin_layout LyX-Code
15036 \begin_layout LyX-Code
15040 \begin_layout LyX-Code
15041 TransformCommand Rotate RotationLatexCommand
15044 \begin_layout LyX-Code
15045 TransformCommand Resize ResizeLatexCommand
15048 \begin_layout LyX-Code
15049 Product "$$RotateFront$$ResizeFront
15052 \begin_layout LyX-Code
15057 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
15060 \begin_layout LyX-Code
15061 $$ResizeBack$$RotateBack"
15064 \begin_layout LyX-Code
15065 UpdateFormat pdftex
15068 \begin_layout LyX-Code
15069 UpdateResult "$$AbsPath$$Basename.pdftex_t"
15072 \begin_layout LyX-Code
15073 Requirement "graphicx"
15076 \begin_layout LyX-Code
15077 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
15080 \begin_layout LyX-Code
15081 ReferencedFile latex "$$AbsPath$$Basename.pdf"
15084 \begin_layout LyX-Code
15088 \begin_layout LyX-Code
15092 \begin_layout LyX-Code
15093 Product "$$Contents(
15095 "$$AbsPath$$Basename.asc
15100 \begin_layout LyX-Code
15101 UpdateFormat asciixfig
15104 \begin_layout LyX-Code
15105 UpdateResult "$$AbsPath$$Basename.asc"
15108 \begin_layout LyX-Code
15112 \begin_layout LyX-Code
15116 \begin_layout LyX-Code
15117 Product "<graphic fileref=
15119 "$$AbsOrRelPathMaster$$Basename.eps
15124 \begin_layout LyX-Code
15128 \begin_layout LyX-Code
15132 \begin_layout LyX-Code
15133 UpdateResult "$$AbsPath$$Basename.eps"
15136 \begin_layout LyX-Code
15137 ReferencedFile docbook "$$AbsPath$$Basename.eps"
15140 \begin_layout LyX-Code
15141 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
15144 \begin_layout LyX-Code
15148 \begin_layout LyX-Code
15149 Product "[XFig: $$FName]"
15152 \begin_layout LyX-Code
15156 \begin_layout LyX-Code
15160 \begin_layout Standard
15161 As you can see, the template is enclosed in
15162 \begin_inset Flex CharStyle:Code
15165 \begin_layout Plain Layout
15171 \SpecialChar \ldots{}
15173 \begin_inset Flex CharStyle:Code
15176 \begin_layout Plain Layout
15183 It contains a header specifying some general settings and, for each supported
15184 primary document file format, a section
15185 \begin_inset Flex CharStyle:Code
15188 \begin_layout Plain Layout
15194 \SpecialChar \ldots{}
15196 \begin_inset Flex CharStyle:Code
15199 \begin_layout Plain Layout
15208 \begin_layout Subsection
15209 The template header
15212 \begin_layout Description
15213 \begin_inset Flex CharStyle:Code
15216 \begin_layout Plain Layout
15217 AutomaticProduction
15218 \begin_inset space ~
15226 Whether the file represented by the template must be generated by LyX.
15227 This command must occur exactly once.
15230 \begin_layout Description
15231 \begin_inset Flex CharStyle:Code
15234 \begin_layout Plain Layout
15236 \begin_inset space ~
15244 A glob pattern that is used in the file dialog to filter out the desired
15246 If there is more than one possible file extension (e.
15247 \begin_inset space \thinspace{}
15251 \begin_inset space \space{}
15255 \begin_inset Flex CharStyle:Code
15258 \begin_layout Plain Layout
15265 \begin_inset Flex CharStyle:Code
15268 \begin_layout Plain Layout
15274 ), use something like
15275 \begin_inset Flex CharStyle:Code
15278 \begin_layout Plain Layout
15285 This command must occur exactly once.
15288 \begin_layout Description
15289 \begin_inset Flex CharStyle:Code
15292 \begin_layout Plain Layout
15294 \begin_inset space ~
15302 The text that is displayed on the button.
15303 This command must occur exactly once.
15306 \begin_layout Description
15307 \begin_inset Flex CharStyle:Code
15310 \begin_layout Plain Layout
15312 \begin_inset space ~
15316 \begin_inset space ~
15324 The help text that is used in the External dialog.
15325 Provide enough information to explain to the user just what the template
15326 can provide him with.
15327 This command must occur exactly once.
15330 \begin_layout Description
15331 \begin_inset Flex CharStyle:Code
15334 \begin_layout Plain Layout
15336 \begin_inset space ~
15344 The file format of the original file.
15345 This must be the name of a format that is known to LyX (see section
15346 \begin_inset CommandInset ref
15348 reference "sec:Formats"
15354 \begin_inset Quotes eld
15358 \begin_inset Flex CharStyle:Code
15361 \begin_layout Plain Layout
15368 \begin_inset Quotes erd
15371 if the template can handle original files of more than one format.
15372 LyX will attempt to interrogate the file itself in order to deduce its
15373 format in this case.
15374 This command must occur exactly once.
15377 \begin_layout Description
15378 \begin_inset Flex CharStyle:Code
15381 \begin_layout Plain Layout
15383 \begin_inset space ~
15391 A unique name for the template.
15392 It must not contain substitution macros (see below).
15395 \begin_layout Description
15396 \begin_inset Flex CharStyle:Code
15399 \begin_layout Plain Layout
15401 \begin_inset space ~
15404 Rotate|Resize|Clip|Extra
15409 This command specifies which transformations are supported by this template.
15410 It may occur zero or more times.
15411 This command enables the corresponding tabs in the external dialog.
15413 \begin_inset Flex CharStyle:Code
15416 \begin_layout Plain Layout
15422 command must have either a corresponding
15423 \begin_inset Flex CharStyle:Code
15426 \begin_layout Plain Layout
15433 \begin_inset Flex CharStyle:Code
15436 \begin_layout Plain Layout
15443 \begin_inset Flex CharStyle:Code
15446 \begin_layout Plain Layout
15453 Otherwise the transformation will not be supported by that format.
15456 \begin_layout Subsection
15460 \begin_layout Description
15461 \begin_inset Flex CharStyle:Code
15464 \begin_layout Plain Layout
15466 \begin_inset space ~
15469 LaTeX|PDFLaTeX|PlainText|DocBook
15474 The primary document file format that this format definition is for.
15475 Not every template has a sensible representation in all document file formats.
15476 Please define nevertheless a
15477 \begin_inset Flex CharStyle:Code
15480 \begin_layout Plain Layout
15486 section for all formats.
15487 Use a dummy text when no representation is available.
15488 Then you can at least see a reference to the external material in the exported
15492 \begin_layout Description
15493 \begin_inset Flex CharStyle:Code
15496 \begin_layout Plain Layout
15498 \begin_inset space ~
15502 \begin_inset space ~
15510 This command defines an additional macro
15511 \begin_inset Flex CharStyle:Code
15514 \begin_layout Plain Layout
15520 for substitution in
15521 \begin_inset Flex CharStyle:Code
15524 \begin_layout Plain Layout
15532 \begin_inset Flex CharStyle:Code
15535 \begin_layout Plain Layout
15541 itself may contain substitution macros.
15542 The advantage over using
15543 \begin_inset Flex CharStyle:Code
15546 \begin_layout Plain Layout
15553 \begin_inset Flex CharStyle:Code
15556 \begin_layout Plain Layout
15562 is that the substituted value of
15563 \begin_inset Flex CharStyle:Code
15566 \begin_layout Plain Layout
15572 is sanitized so that it is a valid optional argument in the document format.
15573 This command may occur zero or more times.
15576 \begin_layout Description
15577 \begin_inset Flex CharStyle:Code
15580 \begin_layout Plain Layout
15582 \begin_inset space ~
15590 The text that is inserted in the exported document.
15591 This is actually the most important command and can be quite complex.
15592 This command must occur exactly once.
15595 \begin_layout Description
15596 \begin_inset Flex CharStyle:Code
15599 \begin_layout Plain Layout
15601 \begin_inset space ~
15609 This command specifies a preamble snippet that will be included in the
15611 It has to be defined using
15612 \begin_inset Flex CharStyle:Code
15615 \begin_layout Plain Layout
15621 \SpecialChar \ldots{}
15623 \begin_inset Flex CharStyle:Code
15626 \begin_layout Plain Layout
15633 This command may occur zero or more times.
15636 \begin_layout Description
15637 \begin_inset Flex CharStyle:Code
15640 \begin_layout Plain Layout
15642 \begin_inset space ~
15646 \begin_inset space ~
15654 This command denotes files that are created by the conversion process and
15655 are needed for a particular export format.
15656 If the filename is relative, it is interpreted relative to the master document.
15657 This command may be given zero or more times.
15660 \begin_layout Description
15661 \begin_inset Flex CharStyle:Code
15664 \begin_layout Plain Layout
15666 \begin_inset space ~
15674 The name of a required LaTeX package.
15675 The package is included via
15676 \begin_inset Flex CharStyle:Code
15679 \begin_layout Plain Layout
15687 in the LaTeX preamble.
15688 This command may occur zero or more times.
15691 \begin_layout Description
15692 \begin_inset Flex CharStyle:Code
15695 \begin_layout Plain Layout
15697 \begin_inset space ~
15701 \begin_inset space ~
15704 RotationLatexCommand
15709 This command specifies that the built in LaTeX command should be used for
15711 This command may occur once or not at all.
15714 \begin_layout Description
15715 \begin_inset Flex CharStyle:Code
15718 \begin_layout Plain Layout
15720 \begin_inset space ~
15724 \begin_inset space ~
15732 This command specifies that the built in LaTeX command should be used for
15734 This command may occur once or not at all.
15737 \begin_layout Description
15738 \begin_inset Flex CharStyle:Code
15741 \begin_layout Plain Layout
15743 \begin_inset space ~
15747 \begin_inset space ~
15750 RotationLatexOption
15755 This command specifies that rotation is done via an optional argument.
15756 This command may occur once or not at all.
15759 \begin_layout Description
15760 \begin_inset Flex CharStyle:Code
15763 \begin_layout Plain Layout
15765 \begin_inset space ~
15769 \begin_inset space ~
15777 This command specifies that resizing is done via an optional argument.
15778 This command may occur once or not at all.
15781 \begin_layout Description
15782 \begin_inset Flex CharStyle:Code
15785 \begin_layout Plain Layout
15787 \begin_inset space ~
15791 \begin_inset space ~
15799 This command specifies that clipping is done via an optional argument.
15800 This command may occur once or not at all.
15803 \begin_layout Description
15804 \begin_inset Flex CharStyle:Code
15807 \begin_layout Plain Layout
15809 \begin_inset space ~
15813 \begin_inset space ~
15821 This command specifies that an extra optional argument is used.
15822 This command may occur once or not at all.
15825 \begin_layout Description
15826 \begin_inset Flex CharStyle:Code
15829 \begin_layout Plain Layout
15831 \begin_inset space ~
15839 The file format of the converted file.
15840 This must be the name of a format that is known to LyX (see the
15841 \begin_inset Flex CharStyle:MenuItem
15844 \begin_layout Plain Layout
15849 ools\SpecialChar \menuseparator
15854 references:Conversion
15860 This command must occur exactly once.
15863 \begin_layout Description
15864 \begin_inset Flex CharStyle:Code
15867 \begin_layout Plain Layout
15869 \begin_inset space ~
15877 The file name of the converted file.
15878 The file name must be absolute.
15879 This command must occur exactly once.
15882 \begin_layout Subsection
15883 Preamble definitions
15886 \begin_layout Standard
15887 The external template configuration file may contain additional preamble
15888 definitions enclosed by
15889 \begin_inset Flex CharStyle:Code
15892 \begin_layout Plain Layout
15898 \SpecialChar \ldots{}
15900 \begin_inset Flex CharStyle:Code
15903 \begin_layout Plain Layout
15910 They can be used by the templates in the
15911 \begin_inset Flex CharStyle:Code
15914 \begin_layout Plain Layout
15923 \begin_layout Section
15924 The substitution mechanism
15927 \begin_layout Standard
15928 When the external material facility invokes an external program, it is done
15929 on the basis of a command defined in the template configuration file.
15930 These commands can contain various macros that are expanded before execution.
15931 Execution always take place in the directory of the containing document.
15934 \begin_layout Standard
15935 Also, whenever external material is to be displayed, the name will be produced
15936 by the substitution mechanism, and most other commands in the template
15937 definition support substitution as well.
15940 \begin_layout Standard
15941 The available macros are the following:
15944 \begin_layout Description
15945 \begin_inset Flex CharStyle:Code
15948 \begin_layout Plain Layout
15949 $$AbsOrRelPathMaster
15954 The file path, absolute or relative to the master LyX document.
15957 \begin_layout Description
15958 \begin_inset Flex CharStyle:Code
15961 \begin_layout Plain Layout
15962 $$AbsOrRelPathParent
15967 The file path, absolute or relative to the LyX document.
15970 \begin_layout Description
15971 \begin_inset Flex CharStyle:Code
15974 \begin_layout Plain Layout
15980 The absolute file path.
15983 \begin_layout Description
15984 \begin_inset Flex CharStyle:Code
15987 \begin_layout Plain Layout
15993 The filename without path and without the extension.
15996 \begin_layout Description
15997 \begin_inset Flex CharStyle:Code
16000 \begin_layout Plain Layout
16002 \begin_inset Quotes eld
16006 \begin_inset Quotes erd
16014 This macro will expand to the contents of the file with the name
16015 \begin_inset Flex CharStyle:Code
16018 \begin_layout Plain Layout
16027 \begin_layout Description
16028 \begin_inset Flex CharStyle:Code
16031 \begin_layout Plain Layout
16037 The file extension (including the dot).
16040 \begin_layout Description
16041 \begin_inset Flex CharStyle:Code
16044 \begin_layout Plain Layout
16050 The filename of the file specified in the external material dialog.
16051 This is either an absolute name, or it is relative to the LyX document.
16054 \begin_layout Description
16055 \begin_inset Flex CharStyle:Code
16058 \begin_layout Plain Layout
16065 \begin_inset Flex CharStyle:Code
16068 \begin_layout Plain Layout
16074 (absolute name or relative to the LyX document).
16077 \begin_layout Description
16078 \begin_inset Flex CharStyle:Code
16081 \begin_layout Plain Layout
16087 The file path, relative to the master LyX document.
16090 \begin_layout Description
16091 \begin_inset Flex CharStyle:Code
16094 \begin_layout Plain Layout
16100 The file path, relative to the LyX document.
16103 \begin_layout Description
16104 \begin_inset Flex CharStyle:Code
16107 \begin_layout Plain Layout
16113 This macro will expand to the absolute path of the system directory.
16114 This is typically used to point to the various helper scripts that are
16118 \begin_layout Description
16119 \begin_inset Flex CharStyle:Code
16122 \begin_layout Plain Layout
16128 A name and full path to a temporary file which will be automatically deleted
16129 whenever the containing document is closed, or the external material insertion
16133 \begin_layout Standard
16134 All path macros contain a trailing directory separator, so you can construct
16136 \begin_inset space \thinspace{}
16140 \begin_inset space \space{}
16143 the absolute filename with
16144 \begin_inset Flex CharStyle:Code
16147 \begin_layout Plain Layout
16148 $$AbsPath$$Basename$$Extension
16156 \begin_layout Standard
16157 The macros above are substituted in all commands unless otherwise noted.
16159 \begin_inset Flex CharStyle:Code
16162 \begin_layout Plain Layout
16168 supports additionally the following substitutions if they are enabled by
16170 \begin_inset Flex CharStyle:Code
16173 \begin_layout Plain Layout
16180 \begin_inset Flex CharStyle:Code
16183 \begin_layout Plain Layout
16192 \begin_layout Description
16193 \begin_inset Flex CharStyle:Code
16196 \begin_layout Plain Layout
16202 The front part of the resize command.
16205 \begin_layout Description
16206 \begin_inset Flex CharStyle:Code
16209 \begin_layout Plain Layout
16215 The back part of the resize command.
16218 \begin_layout Description
16219 \begin_inset Flex CharStyle:Code
16222 \begin_layout Plain Layout
16228 The front part of the rotation command.
16231 \begin_layout Description
16232 \begin_inset Flex CharStyle:Code
16235 \begin_layout Plain Layout
16241 The back part of the rotation command.
16244 \begin_layout Standard
16245 The value string of the
16246 \begin_inset Flex CharStyle:Code
16249 \begin_layout Plain Layout
16255 command supports additionally the following substitutions if they are enabled
16257 \begin_inset Flex CharStyle:Code
16260 \begin_layout Plain Layout
16267 \begin_inset Flex CharStyle:Code
16270 \begin_layout Plain Layout
16279 \begin_layout Description
16280 \begin_inset Flex CharStyle:Code
16283 \begin_layout Plain Layout
16292 \begin_layout Description
16293 \begin_inset Flex CharStyle:Code
16296 \begin_layout Plain Layout
16305 \begin_layout Description
16306 \begin_inset Flex CharStyle:Code
16309 \begin_layout Plain Layout
16318 \begin_layout Description
16319 \begin_inset Flex CharStyle:Code
16322 \begin_layout Plain Layout
16328 The rotation option.
16331 \begin_layout Standard
16332 You may ask why there are so many path macros.
16333 There are mainly two reasons:
16336 \begin_layout Enumerate
16337 Relative and absolute file names should remain relative or absolute, respectivel
16339 Users may have reasons to prefer either form.
16340 Relative names are useful for portable documents that should work on different
16341 machines, for example.
16342 Absolute names may be required by some programs.
16345 \begin_layout Enumerate
16346 LaTeX treats relative file names differently than LyX and other programs
16347 in nested included files.
16348 For LyX, a relative file name is always relative to the document that contains
16350 For LaTeX, it is always relative to the master document.
16351 These two definitions are identical if you have only one document, but
16352 differ if you have a master document that includes part documents.
16353 That means that relative filenames must be transformed when presented to
16355 Fortunately LyX does this automatically for you if you choose the right
16359 \begin_layout Standard
16360 So which path macro should be used in new template definitions? The rule
16364 \begin_layout Itemize
16366 \begin_inset Flex CharStyle:Code
16369 \begin_layout Plain Layout
16375 if an absolute path is required.
16378 \begin_layout Itemize
16380 \begin_inset Flex CharStyle:Code
16383 \begin_layout Plain Layout
16384 $$AbsOrRelPathMaster
16389 if the substituted string is some kind of LaTeX input.
16392 \begin_layout Itemize
16394 \begin_inset Flex CharStyle:Code
16397 \begin_layout Plain Layout
16398 $$AbsOrRelPathParent
16403 in order to preserve the user's choice.
16406 \begin_layout Standard
16407 There are special cases where this rule does not work and e.
16408 \begin_inset space \thinspace{}
16412 \begin_inset space \space{}
16415 relative names are needed, but normally it will work just fine.
16416 One example for such a case is the command
16417 \begin_inset Flex CharStyle:Code
16420 \begin_layout Plain Layout
16421 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
16426 in the XFig template above: We can't use the absolute name because the
16428 \begin_inset Flex CharStyle:Code
16431 \begin_layout Plain Layout
16437 files needs the relative name in order to rewrite the file content.
16440 \begin_layout Section
16441 Security discussion
16442 \begin_inset CommandInset label
16444 name "sec:Security-discussion"
16451 \begin_layout Standard
16452 The external material feature interfaces with a lot of external programs
16453 and does so automatically, so we have to consider the security implications
16455 In particular, since you have the option of including your own filenames
16456 and/or parameter strings and those are expanded into a command, it seems
16457 that it would be possible to create a malicious document which executes
16458 arbitrary commands when a user views or prints the document.
16459 This is something we definitely want to avoid.
16462 \begin_layout Standard
16463 However, since the external program commands are specified in the template
16464 configuration file only, there are no security issues if LyX is properly
16465 configured with safe templates only.
16466 This is so because the external programs are invoked with the
16467 \begin_inset Flex CharStyle:Code
16470 \begin_layout Plain Layout
16476 -system call rather than the
16477 \begin_inset Flex CharStyle:Code
16480 \begin_layout Plain Layout
16486 system-call, so it's not possible to execute arbitrary commands from the
16487 filename or parameter section via the shell.
16490 \begin_layout Standard
16491 This also implies that you are restricted in what command strings you can
16492 use in the external material templates.
16493 In particular, pipes and redirection are not readily available.
16494 This has to be so if LyX should remain safe.
16495 If you want to use some of the shell features, you should write a safe
16496 script to do this in a controlled manner, and then invoke the script from
16497 the command string.
16501 \begin_layout Standard
16502 It is possible to design a template that interacts directly with the shell,
16503 but since this would allow a malicious user to execute arbitrary commands
16504 by writing clever filenames and/or parameters, we generally recommend that
16505 you only use safe scripts that work with the
16506 \begin_inset Flex CharStyle:Code
16509 \begin_layout Plain Layout
16515 system call in a controlled manner.
16516 Of course, for use in a controlled environment, it can be tempting to just
16517 fall back to use ordinary shell scripts.
16518 If you do so, be aware that you
16522 provide an easily exploitable security hole in your system.
16523 Of course it stands to reason that such unsafe templates will never be
16524 included in the standard LyX distribution, although we do encourage people
16525 to submit new templates in the open source tradition.
16526 But LyX as shipped from the official distribution channels will never have
16530 \begin_layout Standard
16531 Including external material provides a lot of power, and you have to be
16532 careful not to introduce security hazards with this power.
16533 A subtle error in a single line in an innocent looking script can open
16534 the door to huge security problems.
16535 So if you do not fully understand the issues, we recommend that you consult
16536 a knowledgeable security professional or the LyX development team if you
16537 have any questions about whether a given template is safe or not.
16538 And do this before you use it in an uncontrolled environment.