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 NNN.
7190 \begin_inset Note Note
7193 \begin_layout Plain Layout
7199 But LyX is capable of reading earlier formats, too, just as it is capable
7200 of reading files produced by earlier versions of LyX.
7203 \begin_layout Subsection
7204 General text class parameters
7207 \begin_layout Standard
7208 These are the general parameters which describe the form of the entire document:
7211 \begin_layout Description
7212 \begin_inset Flex CharStyle:Code
7215 \begin_layout Plain Layout
7221 Adds information to the document preamble.
7223 \begin_inset Quotes eld
7227 \begin_inset Flex CharStyle:Code
7230 \begin_layout Plain Layout
7237 \begin_inset Quotes erd
7243 \begin_layout Description
7244 \begin_inset Flex CharStyle:Code
7247 \begin_layout Plain Layout
7253 Describes various global options supported by the document class.
7255 \begin_inset space ~
7259 \begin_inset CommandInset ref
7261 reference "sub:ClassOptions"
7267 \begin_inset Quotes eld
7271 \begin_inset Flex CharStyle:Code
7274 \begin_layout Plain Layout
7281 \begin_inset Quotes erd
7287 \begin_layout Description
7288 \begin_inset Flex CharStyle:Code
7291 \begin_layout Plain Layout
7298 \begin_inset Flex CharStyle:Code
7301 \begin_layout Plain Layout
7310 \begin_inset Flex CharStyle:Code
7313 \begin_layout Plain Layout
7319 ] Whether the class should
7323 to having one or two columns.
7324 Can be changed in the
7325 \begin_inset Flex CharStyle:MenuItem
7328 \begin_layout Plain Layout
7329 Document\SpecialChar \menuseparator
7338 \begin_layout Description
7339 \begin_inset Flex CharStyle:Code
7342 \begin_layout Plain Layout
7349 \begin_inset Flex CharStyle:Code
7352 \begin_layout Plain Layout
7358 ] This sequence defines the properties for a counter.
7359 If the counter does not yet exist, it is created; if it does exist, it
7362 \begin_inset Quotes eld
7366 \begin_inset Flex CharStyle:Code
7369 \begin_layout Plain Layout
7376 \begin_inset Quotes erd
7380 \begin_inset Newline newline
7384 \begin_inset space ~
7388 \begin_inset CommandInset ref
7390 reference "sub:Counters"
7394 for details on counters.
7397 \begin_layout Description
7398 \begin_inset Flex CharStyle:Code
7401 \begin_layout Plain Layout
7407 Sets the default font used to display the document.
7409 \begin_inset space ~
7413 \begin_inset CommandInset ref
7415 reference "sub:Font-description"
7419 for how to declare fonts.
7421 \begin_inset Quotes eld
7425 \begin_inset Flex CharStyle:Code
7428 \begin_layout Plain Layout
7435 \begin_inset Quotes erd
7441 \begin_layout Description
7442 \begin_inset Flex CharStyle:Code
7445 \begin_layout Plain Layout
7452 \begin_inset Flex CharStyle:Code
7455 \begin_layout Plain Layout
7461 Specifies a module to be included by default with this document class.
7462 The module should be specified by filename without the
7463 \begin_inset Flex CharStyle:Code
7466 \begin_layout Plain Layout
7473 The user can still remove the module, but it will be active at the outset.
7474 (This applies only when new files are created, or when this class is chosen
7475 for an existing document.)
7478 \begin_layout Description
7479 \begin_inset Flex CharStyle:Code
7482 \begin_layout Plain Layout
7489 \begin_inset Flex CharStyle:Code
7492 \begin_layout Plain Layout
7498 ] This is the style that will be assigned to new paragraphs, usually
7499 \begin_inset Flex CharStyle:MenuItem
7502 \begin_layout Plain Layout
7509 This will default to the first defined style if not given, but you are
7510 encouraged to use this directive.
7513 \begin_layout Description
7514 \begin_inset Flex CharStyle:Code
7517 \begin_layout Plain Layout
7524 \begin_inset Flex CharStyle:Code
7527 \begin_layout Plain Layout
7533 ] This tag indicates that the module in question—which should be specified
7534 by filename without the
7535 \begin_inset Flex CharStyle:Code
7538 \begin_layout Plain Layout
7544 extension—cannot be used with this document class.
7545 This might be used in a journal-specific layout file to prevent, say, the
7547 \begin_inset Flex CharStyle:Code
7550 \begin_layout Plain Layout
7556 module that numbers theorems by section.
7561 be used in a module.
7562 Modules have their own way of excluding other modules (see
7563 \begin_inset CommandInset ref
7565 reference "sub:Layout-modules"
7572 \begin_layout Description
7573 \begin_inset Flex CharStyle:Code
7576 \begin_layout Plain Layout
7582 Defines a new float.
7584 \begin_inset space ~
7588 \begin_inset CommandInset ref
7590 reference "sub:Floats"
7596 \begin_inset Quotes eld
7600 \begin_inset Flex CharStyle:Code
7603 \begin_layout Plain Layout
7610 \begin_inset Quotes erd
7616 \begin_layout Description
7617 \begin_inset Flex CharStyle:Code
7620 \begin_layout Plain Layout
7627 \begin_inset Flex CharStyle:Code
7630 \begin_layout Plain Layout
7636 ] Modifies the properties of the given counter.
7637 If the counter does not exist, the section is ignored.
7639 \begin_inset Quotes eld
7643 \begin_inset Flex CharStyle:Code
7646 \begin_layout Plain Layout
7653 \begin_inset Quotes erd
7657 \begin_inset Newline newline
7661 \begin_inset space ~
7665 \begin_inset CommandInset ref
7667 reference "sub:Counters"
7671 for details on counters.
7674 \begin_layout Description
7675 \begin_inset Flex CharStyle:Code
7678 \begin_layout Plain Layout
7685 \begin_inset Flex CharStyle:Code
7688 \begin_layout Plain Layout
7694 ] Modifies the properties of the given paragraph style.
7695 If the style does not exist, the section is ignored.
7697 \begin_inset Quotes eld
7701 \begin_inset Flex CharStyle:Code
7704 \begin_layout Plain Layout
7711 \begin_inset Quotes erd
7717 \begin_layout Description
7718 \begin_inset Flex CharStyle:Code
7721 \begin_layout Plain Layout
7727 As its name implies, this command allows you to include another layout
7728 definition file within yours to avoid duplicating commands.
7729 Common examples are the standard layout files, for example,
7730 \begin_inset Flex CharStyle:Code
7733 \begin_layout Plain Layout
7739 , which contains most of the basic layouts.
7742 \begin_layout Description
7743 \begin_inset Flex CharStyle:Code
7746 \begin_layout Plain Layout
7752 This section (re-)defines the layout of an inset.
7753 It can be applied to an existing inset or to a new, user-defined inset,
7754 e.g., a new character style.
7756 \begin_inset Quotes eld
7760 \begin_inset Flex CharStyle:Code
7763 \begin_layout Plain Layout
7770 \begin_inset Quotes erd
7774 \begin_inset Newline newline
7778 \begin_inset space ~
7782 \begin_inset CommandInset ref
7784 reference "sub:Flex-insets-and"
7788 for more information.
7792 \begin_layout Description
7793 \begin_inset Flex CharStyle:Code
7796 \begin_layout Plain Layout
7803 \begin_inset Flex CharStyle:Code
7806 \begin_layout Plain Layout
7812 ] A string that indicates the width of the left margin on the screen, for
7814 \begin_inset Quotes eld
7818 \begin_inset Quotes erd
7822 (Note that this is not a `length', like
7823 \begin_inset Quotes eld
7827 \begin_inset Quotes erd
7833 \begin_layout Description
7834 \begin_inset Flex CharStyle:Code
7837 \begin_layout Plain Layout
7843 This command deletes an existing float.
7844 This is particularly useful when you want to suppress a float that has
7845 been defined in an input file.
7848 \begin_layout Description
7849 \begin_inset Flex CharStyle:Code
7852 \begin_layout Plain Layout
7858 This command deletes an existing style.
7859 This is particularly useful when you want to suppress a style that has
7860 be defined in an input file.
7863 \begin_layout Description
7864 \begin_inset Flex CharStyle:Code
7867 \begin_layout Plain Layout
7873 A string indicating the file format (as defined in the Preferences dialog)
7874 produced by this class.
7875 It is mainly useful when
7876 \begin_inset Flex CharStyle:Code
7879 \begin_layout Plain Layout
7885 is `literate' and one wants to define a new type of literate document.
7886 This string is reset to `docbook', `latex', or `literate' when the correspondin
7888 \begin_inset Flex CharStyle:Code
7891 \begin_layout Plain Layout
7897 parameter is encountered.
7900 \begin_layout Description
7901 \begin_inset Flex CharStyle:Code
7904 \begin_layout Plain Layout
7910 A string indicating what sort of output documents using this class will
7912 At present, the options are: `docbook', `latex', and `literate'.
7915 \begin_layout Description
7916 \begin_inset Flex CharStyle:Code
7919 \begin_layout Plain Layout
7928 \begin_inset Flex CharStyle:Code
7931 \begin_layout Plain Layout
7942 \begin_inset Flex CharStyle:Code
7945 \begin_layout Plain Layout
7952 \begin_inset Flex CharStyle:Code
7955 \begin_layout Plain Layout
7961 ] The default pagestyle.
7962 Can be changed in the
7963 \begin_inset Flex CharStyle:MenuItem
7966 \begin_layout Plain Layout
7967 Document\SpecialChar \menuseparator
7976 \begin_layout Description
7977 \begin_inset Flex CharStyle:Code
7980 \begin_layout Plain Layout
7986 Sets the preamble for the LaTeX document.
7987 Note that this will completely override any prior
7988 \begin_inset Flex CharStyle:Code
7991 \begin_layout Plain Layout
7998 \begin_inset Flex CharStyle:Code
8001 \begin_layout Plain Layout
8009 \begin_inset Flex CharStyle:Code
8012 \begin_layout Plain Layout
8018 if you just want to add material to the preamble.) Must end with
8019 \begin_inset Quotes eld
8023 \begin_inset Flex CharStyle:Code
8026 \begin_layout Plain Layout
8033 \begin_inset Quotes erd
8039 \begin_layout Description
8040 \begin_inset Flex CharStyle:Code
8043 \begin_layout Plain Layout
8050 \begin_inset Flex CharStyle:Code
8053 \begin_layout Plain Layout
8060 \begin_inset Flex CharStyle:Code
8063 \begin_layout Plain Layout
8072 \begin_inset Flex CharStyle:Code
8075 \begin_layout Plain Layout
8081 ] Whether the class already provides the feature
8082 \begin_inset Flex CharStyle:Code
8085 \begin_layout Plain Layout
8092 A feature is in general the name of a package (
8093 \begin_inset Flex CharStyle:Code
8096 \begin_layout Plain Layout
8103 \begin_inset Flex CharStyle:Code
8106 \begin_layout Plain Layout
8112 , \SpecialChar \ldots{}
8114 \begin_inset Flex CharStyle:Code
8117 \begin_layout Plain Layout
8124 \begin_inset Flex CharStyle:Code
8127 \begin_layout Plain Layout
8133 ,\SpecialChar \ldots{}
8134 ); the complete list of supported features is unfortunately not documented
8135 outside the LyX source code—but see
8136 \begin_inset Flex CharStyle:Code
8139 \begin_layout Plain Layout
8145 if you're interested.
8147 \begin_inset Flex CharStyle:MenuItem
8150 \begin_layout Plain Layout
8151 Help\SpecialChar \menuseparator
8157 also gives an overview of the supported packages.
8160 \begin_layout Description
8161 \begin_inset Flex CharStyle:Code
8164 \begin_layout Plain Layout
8171 \begin_inset Flex CharStyle:Code
8174 \begin_layout Plain Layout
8180 ] Indicates that this layout provides the functionality of the module mentioned,
8181 which should be specified by the filename without the
8182 \begin_inset Flex CharStyle:Code
8185 \begin_layout Plain Layout
8192 This will typically be used if the layout includes the module directly,
8193 rather than using the
8194 \begin_inset Flex CharStyle:Code
8197 \begin_layout Plain Layout
8203 tag to indicate that it ought to be used.
8204 It could also be used in a module that provided an alternate implementation
8205 of the same functionality.
8208 \begin_layout Description
8209 \begin_inset Flex CharStyle:Code
8212 \begin_layout Plain Layout
8219 \begin_inset Flex CharStyle:Code
8222 \begin_layout Plain Layout
8228 ] Whether the class requires the feature
8229 \begin_inset Flex CharStyle:Code
8232 \begin_layout Plain Layout
8239 Multiple features must be separated by commas.
8240 Note that you can only request supported features.
8242 \begin_inset Flex CharStyle:Code
8245 \begin_layout Plain Layout
8251 for a list of these.)
8254 \begin_layout Description
8255 \begin_inset Flex CharStyle:Code
8258 \begin_layout Plain Layout
8264 A string that indicates the width of the right margin on the screen, for
8266 \begin_inset Quotes eld
8270 \begin_inset Quotes erd
8276 \begin_layout Description
8277 \begin_inset Flex CharStyle:Code
8280 \begin_layout Plain Layout
8286 Sets which divisions get numbered.
8288 \begin_inset Flex CharStyle:Code
8291 \begin_layout Plain Layout
8300 \begin_layout Description
8301 \begin_inset Flex CharStyle:Code
8304 \begin_layout Plain Layout
8313 \begin_inset Flex CharStyle:Code
8316 \begin_layout Plain Layout
8327 \begin_inset Flex CharStyle:Code
8330 \begin_layout Plain Layout
8336 ] Whether the class-default should be printing on one or both sides of the
8338 Can be changed in the
8339 \begin_inset Flex CharStyle:MenuItem
8342 \begin_layout Plain Layout
8343 Document\SpecialChar \menuseparator
8352 \begin_layout Description
8353 \begin_inset Flex CharStyle:Code
8356 \begin_layout Plain Layout
8362 This sequence defines a paragraph style.
8363 If the style does not yet exist, it is created; if it does exist, its parameter
8366 \begin_inset Quotes eld
8370 \begin_inset Flex CharStyle:Code
8373 \begin_layout Plain Layout
8380 \begin_inset Quotes erd
8384 \begin_inset Newline newline
8388 \begin_inset space ~
8392 \begin_inset CommandInset ref
8394 reference "sub:Paragraph-Styles"
8398 for details on paragraph styles.
8401 \begin_layout Description
8402 \begin_inset Flex CharStyle:Code
8405 \begin_layout Plain Layout
8412 \begin_inset Flex CharStyle:Code
8415 \begin_layout Plain Layout
8421 ] The name of the command or environment to be used with
8422 \begin_inset Flex CharStyle:Code
8425 \begin_layout Plain Layout
8434 \begin_layout Description
8435 \begin_inset Flex CharStyle:Code
8438 \begin_layout Plain Layout
8445 \begin_inset Flex CharStyle:Code
8448 \begin_layout Plain Layout
8457 \begin_inset Flex CharStyle:Code
8460 \begin_layout Plain Layout
8466 ] Indicates what kind of markup is used to define the title of a document.
8468 \begin_inset Flex CharStyle:Code
8471 \begin_layout Plain Layout
8477 means that the macro with name
8478 \begin_inset Flex CharStyle:Code
8481 \begin_layout Plain Layout
8487 will be inserted after the last layout which has
8488 \begin_inset Quotes eld
8492 \begin_inset Flex CharStyle:Code
8495 \begin_layout Plain Layout
8502 \begin_inset Quotes erd
8507 \begin_inset Flex CharStyle:Code
8510 \begin_layout Plain Layout
8516 corresponds to the case where the block of paragraphs which have
8517 \begin_inset Quotes eld
8521 \begin_inset Flex CharStyle:Code
8524 \begin_layout Plain Layout
8531 \begin_inset Quotes erd
8534 should be enclosed into the
8535 \begin_inset Flex CharStyle:Code
8538 \begin_layout Plain Layout
8547 \begin_layout Description
8548 \begin_inset Flex CharStyle:Code
8551 \begin_layout Plain Layout
8557 Sets which divisions are included in the table of contents.
8559 \begin_inset Flex CharStyle:Code
8562 \begin_layout Plain Layout
8571 \begin_layout Subsection
8572 \begin_inset Flex CharStyle:Code
8575 \begin_layout Plain Layout
8582 \begin_inset CommandInset label
8584 name "sub:ClassOptions"
8591 \begin_layout Standard
8593 \begin_inset Flex CharStyle:Code
8596 \begin_layout Plain Layout
8602 section can contain the following entries:
8605 \begin_layout Description
8606 \begin_inset Flex CharStyle:Code
8609 \begin_layout Plain Layout
8616 \begin_inset Flex CharStyle:Code
8619 \begin_layout Plain Layout
8625 ] The list of available font sizes for the document's main font, separated
8627 \begin_inset Quotes eld
8631 \begin_inset Flex CharStyle:Code
8634 \begin_layout Plain Layout
8641 \begin_inset Quotes erd
8647 \begin_layout Description
8648 \begin_inset Flex CharStyle:Code
8651 \begin_layout Plain Layout
8657 Used to set the DTD line with XML-based output classes.
8659 \begin_inset space \thinspace{}
8663 \begin_inset Quotes eld
8666 -//OASIS//DTD DocBook V4.2//EN
8667 \begin_inset Quotes erd
8673 \begin_layout Description
8674 \begin_inset Flex CharStyle:Code
8677 \begin_layout Plain Layout
8684 \begin_inset Flex CharStyle:Code
8687 \begin_layout Plain Layout
8688 string="empty|plain|headings|fancy"
8693 ] The list of available page styles, separated by
8694 \begin_inset Quotes eld
8698 \begin_inset Flex CharStyle:Code
8701 \begin_layout Plain Layout
8708 \begin_inset Quotes erd
8714 \begin_layout Description
8715 \begin_inset Flex CharStyle:Code
8718 \begin_layout Plain Layout
8725 \begin_inset Flex CharStyle:Code
8728 \begin_layout Plain Layout
8734 ] Some document class options, separated by a comma, that will be added
8735 to the optional part of the
8736 \begin_inset Flex CharStyle:Code
8739 \begin_layout Plain Layout
8750 \begin_layout Standard
8752 \begin_inset Flex CharStyle:Code
8755 \begin_layout Plain Layout
8761 section must end with
8762 \begin_inset Quotes eld
8766 \begin_inset Flex CharStyle:Code
8769 \begin_layout Plain Layout
8776 \begin_inset Quotes erd
8782 \begin_layout Subsection
8784 \begin_inset CommandInset label
8786 name "sub:Paragraph-Styles"
8793 \begin_layout Standard
8794 A paragraph style description looks like this:
8798 \begin_layout Plain Layout
8799 Note that this will either define a new layout or modify an existing one.
8807 \begin_layout LyX-Code
8814 \begin_layout LyX-Code
8818 \begin_layout LyX-Code
8822 \begin_layout Standard
8823 where the following commands are allowed:
8826 \begin_layout Description
8827 \begin_inset Flex CharStyle:Code
8830 \begin_layout Plain Layout
8837 \begin_inset Flex CharStyle:Code
8840 \begin_layout Plain Layout
8845 , left, right, center
8850 ] Paragraph alignment.
8853 \begin_layout Description
8854 \begin_inset Flex CharStyle:Code
8857 \begin_layout Plain Layout
8864 \begin_inset Flex CharStyle:Code
8867 \begin_layout Plain Layout
8872 , left, right, center
8877 ] A comma separated list of permitted alignments.
8878 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
8880 For example a right-aligned or centered enumeration isn't possible.)
8883 \begin_layout Description
8884 \begin_inset Flex CharStyle:Code
8887 \begin_layout Plain Layout
8893 Language dependent information to be included in the LaTeX preamble when
8895 Note that this will completely override any prior
8896 \begin_inset Flex CharStyle:Code
8899 \begin_layout Plain Layout
8907 \begin_inset Quotes eld
8911 \begin_inset Flex CharStyle:Code
8914 \begin_layout Plain Layout
8921 \begin_inset Quotes erd
8925 The contents of this tag will occur once in the LaTeX preamble for each
8926 language used by the document.
8927 Each time, the following substitutions are made:
8931 \begin_layout Itemize
8932 \begin_inset Flex CharStyle:Code
8935 \begin_layout Plain Layout
8941 is replaced by the language name (as used by the babel package).
8944 \begin_layout Itemize
8946 \begin_inset Quotes eld
8950 \begin_inset Quotes erd
8954 \begin_inset Flex CharStyle:Code
8957 \begin_layout Plain Layout
8963 replaces its argument by the translation of the argument to the current
8967 \begin_layout Standard
8968 This preamble snippet will only be used if the document contains more than
8969 one language and the babel package is used.
8973 \begin_layout Description
8974 \begin_inset Flex CharStyle:Code
8977 \begin_layout Plain Layout
8984 \begin_inset Flex CharStyle:Code
8987 \begin_layout Plain Layout
8997 \begin_layout Plain Layout
8998 Note that a `float' here is a real number, such as: 1.5.
9003 The vertical space with which the last of a chain of paragraphs with this
9004 layout is separated from the following paragraph.
9005 If the next paragraph has another layout, the separations are not simply
9006 added, but the maximum is taken.
9009 \begin_layout Description
9010 \begin_inset Flex CharStyle:Code
9013 \begin_layout Plain Layout
9020 \begin_inset Flex CharStyle:Code
9023 \begin_layout Plain Layout
9029 The category for this style.
9030 This is used to group related styles in the Layout combobox on the toolbar.
9031 Any string can be used, but you may want to use existing categories with
9036 \begin_layout Description
9037 \begin_inset Flex CharStyle:Code
9040 \begin_layout Plain Layout
9046 Depth of XML command.
9047 Used only with XML-type formats.
9050 \begin_layout Description
9051 \begin_inset Flex CharStyle:Code
9054 \begin_layout Plain Layout
9061 \begin_inset CommandInset label
9063 name "des:CopyStyle"
9068 \begin_inset Flex CharStyle:Code
9071 \begin_layout Plain Layout
9077 Copies all the features of an existing style into the current one.
9081 \begin_layout Description
9082 \begin_inset Flex CharStyle:Code
9085 \begin_layout Plain Layout
9091 The name of a style whose preamble should be output
9096 This allows to ensure some ordering of the preamble snippets when macros
9097 definitions depend on one another.
9101 \begin_layout Plain Layout
9102 Note that, besides that functionality, there is no way to ensure any ordering
9104 The ordering that you see in a given version of LyX may change without
9105 warning in later versions.
9113 \begin_layout Description
9114 \begin_inset Flex CharStyle:Code
9117 \begin_layout Plain Layout
9124 \begin_inset Flex CharStyle:Code
9127 \begin_layout Plain Layout
9132 , Box, Filled_Box, Static
9137 ] The type of label that stands at the end of the paragraph (or sequence
9139 \begin_inset Flex CharStyle:Code
9142 \begin_layout Plain Layout
9149 \begin_inset Flex CharStyle:Code
9152 \begin_layout Plain Layout
9159 \begin_inset Flex CharStyle:Code
9162 \begin_layout Plain Layout
9169 \begin_inset Flex CharStyle:Code
9172 \begin_layout Plain Layout
9180 \begin_inset Flex CharStyle:Code
9183 \begin_layout Plain Layout
9190 \begin_inset Quotes eld
9194 \begin_inset Quotes erd
9198 \begin_inset Flex CharStyle:Code
9201 \begin_layout Plain Layout
9208 \begin_inset Flex CharStyle:Code
9211 \begin_layout Plain Layout
9212 \begin_inset space ~
9221 \begin_inset space ~
9224 black) square suitable for end of proof markers,
9225 \begin_inset Flex CharStyle:Code
9228 \begin_layout Plain Layout
9234 is an explicit text string.
9237 \begin_layout Description
9238 \begin_inset Flex CharStyle:Code
9241 \begin_layout Plain Layout
9248 \begin_inset Flex CharStyle:Code
9251 \begin_layout Plain Layout
9257 ] The string used for a label with a
9258 \begin_inset Flex CharStyle:Code
9261 \begin_layout Plain Layout
9268 \begin_inset Flex CharStyle:Code
9271 \begin_layout Plain Layout
9281 \begin_layout Description
9282 \begin_inset Flex CharStyle:Code
9285 \begin_layout Plain Layout
9292 \begin_inset Flex CharStyle:Code
9295 \begin_layout Plain Layout
9306 \begin_inset Flex CharStyle:Code
9309 \begin_layout Plain Layout
9318 \begin_layout Description
9319 \begin_inset Flex CharStyle:Code
9322 \begin_layout Plain Layout
9329 \begin_inset Flex CharStyle:Code
9332 \begin_layout Plain Layout
9342 ] With this parameter the
9343 \begin_inset Flex CharStyle:MenuItem
9346 \begin_layout Plain Layout
9353 \begin_inset Quotes eld
9356 Vertical space above
9357 \begin_inset Quotes erd
9361 \begin_inset Flex CharStyle:MenuItem
9364 \begin_layout Plain Layout
9365 Edit\SpecialChar \menuseparator
9367 \begin_inset space ~
9375 dialog can be set when initializing a paragraph with this style.
9379 \begin_layout Plain Layout
9382 Note from Jean-Marc:
9384 I'm not sure that this setting has much use, and it should probably be
9385 removed in later versions.
9393 \begin_layout Description
9394 \begin_inset Flex CharStyle:Code
9397 \begin_layout Plain Layout
9403 The font used for both the text body
9409 \begin_inset space ~
9413 \begin_inset CommandInset ref
9415 reference "sub:Font-description"
9420 Note that defining this font automatically defines the
9421 \begin_inset Flex CharStyle:Code
9424 \begin_layout Plain Layout
9431 So you should define this one first if you also want to define
9432 \begin_inset Flex CharStyle:Code
9435 \begin_layout Plain Layout
9444 \begin_layout Description
9445 \begin_inset Flex CharStyle:Code
9448 \begin_layout Plain Layout
9455 \begin_inset CommandInset label
9457 name "des:FreeSpacing"
9464 \begin_inset Flex CharStyle:Code
9467 \begin_layout Plain Layout
9478 \begin_inset Flex CharStyle:Code
9481 \begin_layout Plain Layout
9487 ] Usually LyX doesn't allow you to insert more than one space between words,
9488 since a space is considered as the separation between two words, not a
9489 character or symbol of its own.
9490 This is a very fine thing but sometimes annoying, for example, when typing
9491 program code or plain LaTeX code.
9493 \begin_inset Flex CharStyle:Code
9496 \begin_layout Plain Layout
9503 Note that LyX will create protected blanks for the additional blanks when
9504 in another mode than LaTeX-mode.
9507 \begin_layout Description
9508 \begin_inset Flex CharStyle:Code
9511 \begin_layout Plain Layout
9517 [[FIXME]] (Used only with XML-type formats.)
9520 \begin_layout Description
9521 \begin_inset Flex CharStyle:Code
9524 \begin_layout Plain Layout
9531 \begin_inset Flex CharStyle:Code
9534 \begin_layout Plain Layout
9540 If 1, marks the layout as to be included in the document preamble rather
9541 than in the document body.
9542 This is useful for document classes that want such information as the title
9543 and author to appear in the preamble.
9546 \begin_layout Description
9547 \begin_inset Flex CharStyle:Code
9550 \begin_layout Plain Layout
9557 \begin_inset Flex CharStyle:Code
9560 \begin_layout Plain Layout
9566 If 1, marks the layout as being part of a title block (see also the
9567 \begin_inset Flex CharStyle:Code
9570 \begin_layout Plain Layout
9577 \begin_inset Flex CharStyle:Code
9580 \begin_layout Plain Layout
9589 \begin_layout Description
9590 \begin_inset Flex CharStyle:Code
9593 \begin_layout Plain Layout
9600 \begin_inset Flex CharStyle:Code
9603 \begin_layout Plain Layout
9609 ] This provides extra space between paragraphs that have the same layout.
9610 If you put other layouts into an environment, each is separated with the
9612 \begin_inset Flex CharStyle:Code
9615 \begin_layout Plain Layout
9622 But the whole items of the environment are additionally separated with
9624 \begin_inset Flex CharStyle:Code
9627 \begin_layout Plain Layout
9639 \begin_layout Description
9640 \begin_inset Flex CharStyle:Code
9643 \begin_layout Plain Layout
9649 [[FIXME]] (Used only with XML-type formats.)
9652 \begin_layout Description
9653 \begin_inset Flex CharStyle:Code
9656 \begin_layout Plain Layout
9663 \begin_inset CommandInset label
9665 name "des:KeepEmpty"
9672 \begin_inset Flex CharStyle:Code
9675 \begin_layout Plain Layout
9686 \begin_inset Flex CharStyle:Code
9689 \begin_layout Plain Layout
9695 ] Usually LyX does not allow you to leave a paragraph empty, since it would
9696 lead to empty LaTeX output.
9697 There are some cases where this could be desirable however: in a letter
9698 template, the required fields can be provided as empty fields, so that
9699 people do not forget them; in some special classes, a layout can be used
9700 as some kind of break, which does not contain actual text.
9703 \begin_layout Description
9704 \begin_inset Flex CharStyle:Code
9707 \begin_layout Plain Layout
9713 [float=0] The vertical space between the label and the text body.
9714 Only used for labels that are above the text body (
9715 \begin_inset Flex CharStyle:Code
9718 \begin_layout Plain Layout
9725 \begin_inset Flex CharStyle:Code
9728 \begin_layout Plain Layout
9729 Centered_Top_Environment
9737 \begin_layout Description
9738 \begin_inset Flex CharStyle:Code
9741 \begin_layout Plain Layout
9748 \begin_inset Flex CharStyle:Code
9751 \begin_layout Plain Layout
9758 \begin_inset Newline newline
9761 The name of the counter for automatic numbering.
9763 \begin_inset Newline newline
9771 \begin_inset Flex CharStyle:Code
9774 \begin_layout Plain Layout
9781 \begin_inset Flex CharStyle:Code
9784 \begin_layout Plain Layout
9791 In that case, the counter will be stepped each time the layout appears.
9793 \begin_inset Newline newline
9801 \begin_inset Flex CharStyle:Code
9804 \begin_layout Plain Layout
9811 \begin_inset Flex CharStyle:Code
9814 \begin_layout Plain Layout
9820 , though this case is a bit complicated.
9822 \begin_inset Quotes eld
9826 \begin_inset Flex CharStyle:Code
9829 \begin_layout Plain Layout
9836 \begin_inset Quotes erd
9840 Then the actual counters used are
9841 \begin_inset Flex CharStyle:Code
9844 \begin_layout Plain Layout
9851 \begin_inset Flex CharStyle:Code
9854 \begin_layout Plain Layout
9861 \begin_inset Flex CharStyle:Code
9864 \begin_layout Plain Layout
9871 \begin_inset Flex CharStyle:Code
9874 \begin_layout Plain Layout
9881 These counters must all be declared separately.
9882 \begin_inset Newline newline
9886 \begin_inset CommandInset ref
9888 reference "sub:Counters"
9892 for details on counters.
9895 \begin_layout Description
9896 \begin_inset Flex CharStyle:Code
9899 \begin_layout Plain Layout
9905 The font used for the label.
9907 \begin_inset space ~
9911 \begin_inset CommandInset ref
9913 reference "sub:Font-description"
9920 \begin_layout Description
9921 \begin_inset Flex CharStyle:Code
9924 \begin_layout Plain Layout
9930 Text that indicates how far a label should be indented.
9933 \begin_layout Description
9934 \begin_inset Flex CharStyle:Code
9937 \begin_layout Plain Layout
9944 \begin_inset Flex CharStyle:Code
9947 \begin_layout Plain Layout
9953 ] The horizontal space between the label and the text body.
9954 Only used for labels that are not above the text body.
9957 \begin_layout Description
9958 \begin_inset Flex CharStyle:Code
9961 \begin_layout Plain Layout
9968 \begin_inset Flex CharStyle:Code
9971 \begin_layout Plain Layout
9977 ] The string used for a label with a
9978 \begin_inset Flex CharStyle:Code
9981 \begin_layout Plain Layout
9989 \begin_inset Flex CharStyle:Code
9992 \begin_layout Plain Layout
9998 is set, this string can be contain the special formatting commands described
10000 \begin_inset CommandInset ref
10002 reference "sub:Counters"
10010 \begin_layout Plain Layout
10011 For the sake of backwards compatibility, the string
10012 \begin_inset Flex CharStyle:Code
10015 \begin_layout Plain Layout
10025 will be replaced by the expanded
10026 \begin_inset Flex CharStyle:Code
10029 \begin_layout Plain Layout
10036 \begin_inset Flex CharStyle:Code
10039 \begin_layout Plain Layout
10048 This feature is now obsolete and should be replaced by the mechanisms of
10050 \begin_inset CommandInset ref
10052 reference "sub:Counters"
10064 \begin_layout Description
10065 \begin_inset Flex CharStyle:Code
10068 \begin_layout Plain Layout
10069 LabelStringAppendix
10075 \begin_inset Flex CharStyle:Code
10078 \begin_layout Plain Layout
10084 ] This is used inside the appendix instead of
10085 \begin_inset Flex CharStyle:Code
10088 \begin_layout Plain Layout
10096 \begin_inset Flex CharStyle:Code
10099 \begin_layout Plain Layout
10106 \begin_inset Flex CharStyle:Code
10109 \begin_layout Plain Layout
10110 LabelStringAppendix
10118 \begin_layout Description
10119 \begin_inset Flex CharStyle:Code
10122 \begin_layout Plain Layout
10128 [FIXME] (Used only with XML-type formats.)
10131 \begin_layout Description
10132 \begin_inset Flex CharStyle:Code
10135 \begin_layout Plain Layout
10142 \begin_inset Flex CharStyle:Code
10145 \begin_layout Plain Layout
10150 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
10151 Enumerate, Itemize, Bibliography
10160 \begin_layout Itemize
10161 \begin_inset Flex CharStyle:Code
10164 \begin_layout Plain Layout
10170 means the label is the very first word (up to the first real blank).
10171 Use protected spaces (like
10172 \begin_inset space ~
10175 that one) if you want more than one word as the label.
10179 \begin_layout Itemize
10180 \begin_inset Flex CharStyle:Code
10183 \begin_layout Plain Layout
10189 means the label is simply whatever
10190 \begin_inset Flex CharStyle:Code
10193 \begin_layout Plain Layout
10200 Note that this really is `static'.
10203 \begin_layout Itemize
10204 \begin_inset Flex CharStyle:Code
10207 \begin_layout Plain Layout
10214 \begin_inset Flex CharStyle:Code
10217 \begin_layout Plain Layout
10218 Centered_Top_Environment
10223 are special cases of
10224 \begin_inset Flex CharStyle:Code
10227 \begin_layout Plain Layout
10234 The label will be printed above the paragraph, but only at the top of an
10235 environment or the top of a chain of paragraphs with this layout.
10236 This might be used with the
10237 \begin_inset Flex CharStyle:MenuItem
10240 \begin_layout Plain Layout
10246 layout, for example.
10249 \begin_layout Itemize
10250 \begin_inset Flex CharStyle:Code
10253 \begin_layout Plain Layout
10259 is a special case for the caption-labels
10260 \begin_inset Quotes eld
10264 \begin_inset Quotes erd
10268 \begin_inset Quotes eld
10272 \begin_inset Quotes erd
10277 \begin_inset Flex CharStyle:Code
10280 \begin_layout Plain Layout
10286 means the (hardcoded) label string depends on the kind of float: It is
10287 hardcoded to be `FloatType N', where N is the value of the counter associated
10291 \begin_layout Itemize
10293 \begin_inset Flex CharStyle:Code
10296 \begin_layout Plain Layout
10302 label type defines automatically numbered labels.
10304 \begin_inset Flex CharStyle:Code
10307 \begin_layout Plain Layout
10313 will be expanded to resolve any counter references it contains: For example,
10315 \begin_inset Quotes eld
10319 \begin_inset Flex CharStyle:Code
10322 \begin_layout Plain Layout
10333 \begin_inset Quotes erd
10338 \begin_inset CommandInset ref
10340 reference "sub:Counters"
10344 for more information on counters.
10347 \begin_layout Itemize
10348 \begin_inset Flex CharStyle:Code
10351 \begin_layout Plain Layout
10357 produces the usual sort of enumeration labels.
10358 At present, it is hardcoded to use Arabic numerals, lowercase letters,
10359 small Roman numerals, and uppercase letters for the four possible depths.
10362 \begin_layout Itemize
10363 \begin_inset Flex CharStyle:Code
10366 \begin_layout Plain Layout
10372 produces various bullets at the different levels.
10373 It is also hardcoded.
10376 \begin_layout Itemize
10377 \begin_inset Flex CharStyle:Code
10380 \begin_layout Plain Layout
10386 is used internally by LyX and should be used only with
10387 \begin_inset Flex CharStyle:Code
10390 \begin_layout Plain Layout
10391 LatexType BibEnvironment
10400 \begin_layout Description
10401 \begin_inset Flex CharStyle:Code
10404 \begin_layout Plain Layout
10411 \begin_inset Flex CharStyle:Code
10414 \begin_layout Plain Layout
10420 , but this preamble snippet occurs independently from the babel package,
10421 and only for the document language.
10423 \begin_inset Quotes eld
10427 \begin_inset Flex CharStyle:Code
10430 \begin_layout Plain Layout
10437 \begin_inset Quotes erd
10444 \begin_layout Standard
10445 If the style defines text that appears in the typeset document, it may use
10447 \begin_inset Flex CharStyle:Code
10450 \begin_layout Plain Layout
10457 \begin_inset Flex CharStyle:Code
10460 \begin_layout Plain Layout
10466 to support non-english and even multilanguage documents correctly.
10467 The following excerpt (from the
10468 \begin_inset Flex CharStyle:Code
10471 \begin_layout Plain Layout
10477 file) shows how this works:
10480 \begin_layout LyX-Code
10484 \begin_layout LyX-Code
10487 theoremstyle{remark}
10490 \begin_layout LyX-Code
10493 newtheorem{claim}[thm]{
10500 \begin_layout LyX-Code
10504 \begin_layout LyX-Code
10508 \begin_layout LyX-Code
10513 claimname}{_(Claim)}
10516 \begin_layout LyX-Code
10520 \begin_layout LyX-Code
10524 \begin_layout LyX-Code
10528 \begin_layout LyX-Code
10537 claimname}{_(Claim)}}
10540 \begin_layout LyX-Code
10544 \begin_layout Standard
10545 The key to correct translation of the user visible text is the definition
10547 \begin_inset Flex CharStyle:Code
10550 \begin_layout Plain Layout
10558 in the language preamble.
10559 This command holds the name of the theorem that will appear in the output.
10561 \begin_inset Flex CharStyle:Code
10564 \begin_layout Plain Layout
10570 then uses the commands offered by the babel package to redefine
10571 \begin_inset Flex CharStyle:Code
10574 \begin_layout Plain Layout
10582 for each used language in multilanguage documents.
10586 \begin_layout Description
10587 \begin_inset Flex CharStyle:Code
10590 \begin_layout Plain Layout
10596 The name of the corresponding LaTeX stuff.
10597 Either the environment or command name.
10600 \begin_layout Description
10601 \begin_inset Flex CharStyle:Code
10604 \begin_layout Plain Layout
10610 An optional parameter for the corresponding
10611 \begin_inset Flex CharStyle:Code
10614 \begin_layout Plain Layout
10621 This parameter cannot be changed from within LyX.
10624 \begin_layout Description
10625 \begin_inset Flex CharStyle:Code
10628 \begin_layout Plain Layout
10635 \begin_inset CommandInset label
10637 name "des:LatexType"
10642 \begin_inset Flex CharStyle:Code
10645 \begin_layout Plain Layout
10650 , Command, Environment, Item_Environment,
10656 \begin_inset Flex CharStyle:Code
10659 \begin_layout Plain Layout
10660 List_Environment, Bib_Environment
10665 ] How the layout should be translated into LaTeX.
10669 \begin_layout Plain Layout
10670 \begin_inset Flex CharStyle:Code
10673 \begin_layout Plain Layout
10679 is perhaps a bit misleading, since these rules apply to SGML classes, too.
10680 Visit the SGML class files for specific examples.
10689 \begin_layout Itemize
10690 \begin_inset Flex CharStyle:Code
10693 \begin_layout Plain Layout
10699 means nothing special.
10703 \begin_layout Itemize
10704 \begin_inset Flex CharStyle:Code
10707 \begin_layout Plain Layout
10714 \begin_inset Flex CharStyle:Code
10717 \begin_layout Plain Layout
10724 {\SpecialChar \ldots{}
10733 \begin_layout Itemize
10734 \begin_inset Flex CharStyle:Code
10737 \begin_layout Plain Layout
10744 \begin_inset Flex CharStyle:Code
10747 \begin_layout Plain Layout
10754 }\SpecialChar \ldots{}
10770 \begin_layout Itemize
10771 \begin_inset Flex CharStyle:Code
10774 \begin_layout Plain Layout
10781 \begin_inset Flex CharStyle:Code
10784 \begin_layout Plain Layout
10791 \begin_inset Flex CharStyle:Code
10794 \begin_layout Plain Layout
10802 is generated for each paragraph of this environment.
10806 \begin_layout Itemize
10807 \begin_inset Flex CharStyle:Code
10810 \begin_layout Plain Layout
10817 \begin_inset Flex CharStyle:Code
10820 \begin_layout Plain Layout
10827 \begin_inset Flex CharStyle:Code
10830 \begin_layout Plain Layout
10836 is passed as an argument to the environment.
10838 \begin_inset Flex CharStyle:Code
10841 \begin_layout Plain Layout
10847 can be defined in the
10848 \begin_inset Flex CharStyle:MenuItem
10851 \begin_layout Plain Layout
10856 ayout\SpecialChar \menuseparator
10870 \begin_layout Standard
10871 Putting the last few things together, the LaTeX output will be either:
10874 \begin_layout LyX-Code
10877 latexname[latexparam]{\SpecialChar \ldots{}
10881 \begin_layout Standard
10885 \begin_layout LyX-Code
10888 begin{latexname}[latexparam] \SpecialChar \ldots{}
10894 \begin_layout Standard
10895 depending upon the LaTeX type.
10899 \begin_layout Description
10900 \begin_inset Flex CharStyle:Code
10903 \begin_layout Plain Layout
10910 \begin_inset Flex CharStyle:Code
10913 \begin_layout Plain Layout
10919 ] If you put layouts into environments, the leftmargins are not simply added,
10920 but added with a factor
10921 \begin_inset Formula $\frac{4}{depth+4}$
10925 Note that this parameter is also used when the margin is defined as
10926 \begin_inset Flex CharStyle:Code
10929 \begin_layout Plain Layout
10936 \begin_inset Flex CharStyle:Code
10939 \begin_layout Plain Layout
10946 Then it is added to the manual or dynamic margin.
10948 \begin_inset Newline newline
10951 The argument is passed as a string.
10953 \begin_inset Quotes eld
10957 \begin_inset Flex CharStyle:Code
10960 \begin_layout Plain Layout
10967 \begin_inset Quotes erd
10970 means that the paragraph is indented with the width of
10971 \begin_inset Quotes eld
10975 \begin_inset Flex CharStyle:Code
10978 \begin_layout Plain Layout
10985 \begin_inset Quotes erd
10988 in the normal font.
10989 You can get a negative width by prefixing the string with
10990 \begin_inset Quotes eld
10994 \begin_inset Flex CharStyle:Code
10997 \begin_layout Plain Layout
11004 \begin_inset Quotes erd
11008 This way was chosen so that the look is the same with each used screen
11013 \begin_layout Description
11014 \begin_inset Flex CharStyle:Code
11017 \begin_layout Plain Layout
11024 \begin_inset Flex CharStyle:Code
11027 \begin_layout Plain Layout
11032 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11038 \begin_inset Newline newline
11041 The kind of margin that the layout has on the left side.
11043 \begin_inset Flex CharStyle:Code
11046 \begin_layout Plain Layout
11052 just means a fixed margin.
11054 \begin_inset Flex CharStyle:Code
11057 \begin_layout Plain Layout
11063 means that the left margin depends on the string entered in the
11064 \begin_inset Flex CharStyle:MenuItem
11067 \begin_layout Plain Layout
11068 Edit\SpecialChar \menuseparator
11070 \begin_inset space ~
11079 This is used to typeset nice lists without tabulators.
11081 \begin_inset Flex CharStyle:Code
11084 \begin_layout Plain Layout
11090 means that the margin depends on the size of the label.
11091 This is used for automatic enumerated headlines.
11092 It is obvious that the headline
11093 \begin_inset Quotes eld
11096 5.4.3.2.1 Very long headline
11097 \begin_inset Quotes erd
11100 must have a wider left margin (as wide as
11101 \begin_inset Quotes eld
11105 \begin_inset Quotes erd
11108 plus the space) than
11109 \begin_inset Quotes eld
11112 3.2 Very long headline
11113 \begin_inset Quotes erd
11117 \begin_inset Quotes eld
11121 \begin_inset Quotes erd
11124 are not able to do this.
11126 \begin_inset Flex CharStyle:Code
11129 \begin_layout Plain Layout
11135 is similar, but only the very first row of the paragraph is dynamic, while
11136 the others are static; this is used, for example, for descriptions.
11138 \begin_inset Flex CharStyle:Code
11141 \begin_layout Plain Layout
11147 means the margin is chosen in a way that the longest row of this paragraph
11148 fits to the right margin.
11149 This is used to typeset an address on the right edge of the page.
11152 \begin_layout Description
11153 \begin_inset Flex CharStyle:Code
11156 \begin_layout Plain Layout
11163 \begin_inset Flex CharStyle:Code
11166 \begin_layout Plain Layout
11175 \begin_inset Flex CharStyle:Code
11178 \begin_layout Plain Layout
11184 ] Whether fragile commands in this layout should be
11185 \begin_inset Flex CharStyle:Code
11188 \begin_layout Plain Layout
11201 whether this command should itself be protected.)
11204 \begin_layout Description
11205 \begin_inset Flex CharStyle:Code
11208 \begin_layout Plain Layout
11215 \begin_inset Flex CharStyle:Code
11218 \begin_layout Plain Layout
11225 \begin_inset Flex CharStyle:Code
11228 \begin_layout Plain Layout
11236 ] Whether newlines are translated into LaTeX newlines (
11237 \begin_inset Flex CharStyle:Code
11240 \begin_layout Plain Layout
11251 The translation can be switched off to allow more comfortable LaTeX editing
11255 \begin_layout Description
11256 \begin_inset Flex CharStyle:Code
11259 \begin_layout Plain Layout
11266 \begin_inset Flex CharStyle:Code
11269 \begin_layout Plain Layout
11276 \begin_inset Flex CharStyle:Code
11279 \begin_layout Plain Layout
11287 ] Whether the following Paragraph is allowed to indent its very first row.
11289 \begin_inset Flex CharStyle:Code
11292 \begin_layout Plain Layout
11298 means that it is not allowed to do so;
11299 \begin_inset Flex CharStyle:Code
11302 \begin_layout Plain Layout
11308 means it could do so if it wants to.
11311 \begin_layout Description
11312 \begin_inset Flex CharStyle:Code
11315 \begin_layout Plain Layout
11321 Name of a layout that has replaced this layout.
11322 This is used to rename a layout, while keeping backward compatibility.
11325 \begin_layout Description
11326 \begin_inset Flex CharStyle:Code
11329 \begin_layout Plain Layout
11336 \begin_inset Flex CharStyle:Code
11339 \begin_layout Plain Layout
11345 ] The number of optional arguments that can be used with this layout.
11346 This is useful for things like section headings, and only makes sense with
11350 \begin_layout Description
11351 \begin_inset Flex CharStyle:Code
11354 \begin_layout Plain Layout
11361 \begin_inset Flex CharStyle:Code
11364 \begin_layout Plain Layout
11370 ] The indent of the very first line of a paragraph.
11372 \begin_inset Flex CharStyle:Code
11375 \begin_layout Plain Layout
11381 will be fixed for a certain layout.
11382 The exception is Standard layout, since the indentation of a Standard layout
11383 paragraph can be prohibited with
11384 \begin_inset Flex CharStyle:Code
11387 \begin_layout Plain Layout
11394 Also, Standard layout paragraphs inside environments use the
11395 \begin_inset Flex CharStyle:Code
11398 \begin_layout Plain Layout
11404 of the environment, not their native one.
11405 For example, Standard paragraphs inside an enumeration are not indented.
11408 \begin_layout Description
11409 \begin_inset Flex CharStyle:Code
11412 \begin_layout Plain Layout
11419 \begin_inset Flex CharStyle:Code
11422 \begin_layout Plain Layout
11428 ] The vertical space between two paragraphs of this layout.
11431 \begin_layout Description
11432 \begin_inset Flex CharStyle:Code
11435 \begin_layout Plain Layout
11442 \begin_inset Flex CharStyle:Code
11445 \begin_layout Plain Layout
11451 ] LyX allows the user to choose either
11452 \begin_inset Quotes eld
11456 \begin_inset Quotes erd
11460 \begin_inset Quotes eld
11464 \begin_inset Quotes erd
11467 to typeset a document.
11469 \begin_inset Quotes eld
11473 \begin_inset Quotes erd
11476 is chosen, this value is completely ignored.
11478 \begin_inset Quotes eld
11482 \begin_inset Quotes erd
11485 is chosen, the parindent of a LaTeXtype
11486 \begin_inset Quotes eld
11490 \begin_inset Quotes erd
11493 layout is ignored and all paragraphs are separated by this parskip argument.
11494 The vertical space is calculated with
11495 \begin_inset Flex CharStyle:Code
11498 \begin_layout Plain Layout
11500 \begin_inset space ~
11509 \begin_inset Flex CharStyle:Code
11512 \begin_layout Plain Layout
11518 is the height of a row with the normal font.
11519 This way, the look stays the same with different screen fonts.
11522 \begin_layout Description
11523 \begin_inset Flex CharStyle:Code
11526 \begin_layout Plain Layout
11533 \begin_inset CommandInset label
11535 name "des:PathThru"
11542 \begin_inset Flex CharStyle:Code
11545 \begin_layout Plain Layout
11556 \begin_inset Flex CharStyle:Code
11559 \begin_layout Plain Layout
11565 ] Whether the contents of this paragraph should be output in raw form, meaning
11566 without special translations that LaTeX would require.
11569 \begin_layout Description
11570 \begin_inset Flex CharStyle:Code
11573 \begin_layout Plain Layout
11580 \begin_inset CommandInset label
11582 name "des:Preamble"
11586 Information to be included in the LaTeX preamble when this style is used.
11587 Used to define macros, load packages, etc., required by this particular
11590 \begin_inset Quotes eld
11594 \begin_inset Flex CharStyle:Code
11597 \begin_layout Plain Layout
11604 \begin_inset Quotes erd
11610 \begin_layout Description
11611 \begin_inset Flex CharStyle:Code
11614 \begin_layout Plain Layout
11621 \begin_inset Flex CharStyle:Code
11624 \begin_layout Plain Layout
11631 \begin_inset CommandInset label
11633 name "des:Requires"
11637 Whether the layout requires the feature
11638 \begin_inset Flex CharStyle:Code
11641 \begin_layout Plain Layout
11648 See the description of
11649 \begin_inset Flex CharStyle:Code
11652 \begin_layout Plain Layout
11659 \begin_inset CommandInset ref
11660 LatexCommand pageref
11661 reference "des:FreeSpacing"
11665 ) for information on `features'.
11669 \begin_layout Description
11670 \begin_inset Flex CharStyle:Code
11673 \begin_layout Plain Layout
11680 \begin_inset Flex CharStyle:Code
11683 \begin_layout Plain Layout
11690 \begin_inset Flex CharStyle:Code
11693 \begin_layout Plain Layout
11702 \begin_layout Description
11703 \begin_inset Flex CharStyle:Code
11706 \begin_layout Plain Layout
11713 \begin_inset Flex CharStyle:Code
11716 \begin_layout Plain Layout
11721 , onehalf, double, other
11730 ] This defines what the default spacing should be in the layout.
11732 \begin_inset Flex CharStyle:Code
11735 \begin_layout Plain Layout
11742 \begin_inset Flex CharStyle:Code
11745 \begin_layout Plain Layout
11752 \begin_inset Flex CharStyle:Code
11755 \begin_layout Plain Layout
11761 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
11762 If you specify the argument
11763 \begin_inset Flex CharStyle:Code
11766 \begin_layout Plain Layout
11772 , then you should also provide a numerical argument which will be the actual
11774 Note that, contrary to other parameters,
11775 \begin_inset Flex CharStyle:Code
11778 \begin_layout Plain Layout
11784 implies the generation of specific LaTeX code, using the package
11787 \begin_inset Flex CharStyle:Code
11790 \begin_layout Plain Layout
11799 \begin_layout Description
11800 \begin_inset Flex CharStyle:Code
11803 \begin_layout Plain Layout
11809 The font used for the text body .
11811 \begin_inset CommandInset ref
11813 reference "sub:Font-description"
11820 \begin_layout Description
11821 \begin_inset Flex CharStyle:Code
11824 \begin_layout Plain Layout
11832 The level of the style in the table of contents.
11833 This is used for automatic numbering of section headings.
11836 \begin_layout Description
11837 \begin_inset Flex CharStyle:Code
11840 \begin_layout Plain Layout
11847 \begin_inset Flex CharStyle:Code
11850 \begin_layout Plain Layout
11856 ] The vertical space with which the very first of a chain of paragraphs
11857 with this layout is separated from the previous paragraph.
11858 If the previous paragraph has another layout, the separations are not simply
11859 added, but the maximum is taken.
11862 \begin_layout Subsection
11864 \begin_inset CommandInset label
11873 \begin_layout Standard
11874 Since version 1.3.0 of LyX, it is has been both possible and necessary to
11875 define the floats (
11876 \begin_inset Flex CharStyle:MenuItem
11879 \begin_layout Plain Layout
11886 \begin_inset Flex CharStyle:MenuItem
11889 \begin_layout Plain Layout
11895 , \SpecialChar \ldots{}
11896 ) in the text class itself.
11897 Standard floats are included in the file
11898 \begin_inset Flex CharStyle:Code
11901 \begin_layout Plain Layout
11907 , so you may have to do no more than add
11910 \begin_layout LyX-Code
11911 Input stdfloats.inc
11914 \begin_layout Standard
11915 to your layout file.
11916 If you want to implement a text class that proposes some other float types
11917 (like the AGU class bundled with LyX), the information below will hopefully
11921 \begin_layout Description
11922 \begin_inset Flex CharStyle:Code
11925 \begin_layout Plain Layout
11932 \begin_inset Flex CharStyle:Code
11935 \begin_layout Plain Layout
11942 \begin_inset Quotes erd
11946 \begin_inset Quotes erd
11949 ] The file name extension of an auxiliary file for the list of figures (or
11951 LaTeX writes the captions to this file.
11954 \begin_layout Description
11955 \begin_inset Flex CharStyle:Code
11958 \begin_layout Plain Layout
11965 \begin_inset Flex CharStyle:Code
11968 \begin_layout Plain Layout
11975 \begin_inset Quotes erd
11979 \begin_inset Quotes erd
11982 ] The string that will be used in the menus and also for the caption.
11983 This is translated to the current language if babel is used.
11986 \begin_layout Description
11987 \begin_inset Flex CharStyle:Code
11990 \begin_layout Plain Layout
11997 \begin_inset Flex CharStyle:Code
12000 \begin_layout Plain Layout
12009 \begin_inset Flex CharStyle:Code
12012 \begin_layout Plain Layout
12019 \begin_inset Flex CharStyle:Code
12022 \begin_layout Plain Layout
12028 if the float is already defined by the LaTeX document class.
12030 \begin_inset Flex CharStyle:Code
12033 \begin_layout Plain Layout
12039 , the float will be defined using the LaTeX package
12040 \begin_inset Flex CharStyle:Code
12043 \begin_layout Plain Layout
12052 \begin_layout Description
12053 \begin_inset Flex CharStyle:Code
12056 \begin_layout Plain Layout
12063 \begin_inset Flex CharStyle:Code
12066 \begin_layout Plain Layout
12073 \begin_inset Quotes erd
12077 \begin_inset Quotes erd
12080 ] The heading used for the list of floats.
12081 This is translated to the document language.
12084 \begin_layout Description
12085 \begin_inset Flex CharStyle:Code
12088 \begin_layout Plain Layout
12095 \begin_inset Flex CharStyle:Code
12098 \begin_layout Plain Layout
12105 \begin_inset Quotes erd
12109 \begin_inset Quotes erd
12112 ] This (optional) argument determines whether floats of this class will
12113 be numbered within some sectional unit of the document.
12114 For example, if within is equal to
12115 \begin_inset Flex CharStyle:Code
12118 \begin_layout Plain Layout
12124 , the floats will be numbered within chapters.
12128 \begin_layout Description
12129 \begin_inset Flex CharStyle:Code
12132 \begin_layout Plain Layout
12139 \begin_inset Flex CharStyle:Code
12142 \begin_layout Plain Layout
12149 \begin_inset Quotes erd
12153 \begin_inset Quotes erd
12156 ] The default placement for the given class of floats.
12157 The string should be as in standard LaTeX:
12158 \begin_inset Flex CharStyle:Code
12161 \begin_layout Plain Layout
12168 \begin_inset Flex CharStyle:Code
12171 \begin_layout Plain Layout
12178 \begin_inset Flex CharStyle:Code
12181 \begin_layout Plain Layout
12188 \begin_inset Flex CharStyle:Code
12191 \begin_layout Plain Layout
12197 for top, bottom, page, and here, respectively.
12201 \begin_layout Plain Layout
12202 Note that the order of these letters in the string is irrelevant, like in
12208 On top of that there is a new type,
12209 \begin_inset Flex CharStyle:Code
12212 \begin_layout Plain Layout
12218 , which does not really correspond to a float, since it means: put it
12219 \begin_inset Quotes eld
12223 \begin_inset Quotes erd
12227 Note however that the
12228 \begin_inset Flex CharStyle:Code
12231 \begin_layout Plain Layout
12237 specifier is special and, because of implementation details, cannot be
12238 used in non-built in float types.
12239 If you do not understand what this means, just use
12240 \begin_inset Quotes eld
12244 \begin_inset Flex CharStyle:Code
12247 \begin_layout Plain Layout
12254 \begin_inset Quotes erd
12260 \begin_layout Description
12261 \begin_inset Flex CharStyle:Code
12264 \begin_layout Plain Layout
12271 \begin_inset Flex CharStyle:Code
12274 \begin_layout Plain Layout
12281 \begin_inset Quotes erd
12285 \begin_inset Quotes erd
12288 ] The style used when defining the float using
12289 \begin_inset Flex CharStyle:Code
12292 \begin_layout Plain Layout
12303 \begin_layout Description
12304 \begin_inset Flex CharStyle:Code
12307 \begin_layout Plain Layout
12314 \begin_inset Flex CharStyle:Code
12317 \begin_layout Plain Layout
12324 \begin_inset Quotes erd
12328 \begin_inset Quotes erd
12332 \begin_inset Quotes eld
12336 \begin_inset Quotes erd
12339 of the new class of floats, like program or algorithm.
12340 After the appropriate
12341 \begin_inset Flex CharStyle:Code
12344 \begin_layout Plain Layout
12353 \begin_inset Flex CharStyle:Code
12356 \begin_layout Plain Layout
12365 \begin_inset Flex CharStyle:Code
12368 \begin_layout Plain Layout
12379 \begin_layout Standard
12380 Note that defining a float with type
12381 \begin_inset Flex CharStyle:Code
12384 \begin_layout Plain Layout
12392 automatically defines the corresponding counter with name
12393 \begin_inset Flex CharStyle:Code
12396 \begin_layout Plain Layout
12407 \begin_layout Subsection
12408 Flex insets and InsetLayout
12409 \begin_inset CommandInset label
12411 name "sub:Flex-insets-and"
12418 \begin_layout Standard
12419 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
12420 these are called Flex insets.
12424 \begin_layout Standard
12425 Flex insets come in three different kinds:
12428 \begin_layout Itemize
12430 \begin_inset Flex CharStyle:Code
12433 \begin_layout Plain Layout
12439 ): These define semantic markup corresponding to such LaTeX commands as
12441 \begin_inset Flex CharStyle:Code
12444 \begin_layout Plain Layout
12453 \begin_inset Flex CharStyle:Code
12456 \begin_layout Plain Layout
12467 \begin_layout Itemize
12469 \begin_inset Flex CharStyle:Code
12472 \begin_layout Plain Layout
12478 ): These can be used to define custom collapsible insets, similar to TeX
12479 code, footnote, and the like.
12480 An obvious example is an endnote inset, which is defined in the
12481 \begin_inset Flex CharStyle:Code
12484 \begin_layout Plain Layout
12493 \begin_layout Itemize
12495 \begin_inset Flex CharStyle:Code
12498 \begin_layout Plain Layout
12504 ): For use with DocBook classes.
12507 \begin_layout Standard
12508 Flex insets are defined using the
12509 \begin_inset Flex CharStyle:Code
12512 \begin_layout Plain Layout
12518 tag, which shall be explained in a moment.
12521 \begin_layout Standard
12523 \begin_inset Flex CharStyle:Code
12526 \begin_layout Plain Layout
12532 tag also serves another function: It can be used to customize the general
12533 layout of many different types of insets.
12535 \begin_inset Flex CharStyle:Code
12538 \begin_layout Plain Layout
12544 can be used to customize the layout parameters for footnotes, marginal
12545 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
12546 boxes, tables, algorithms, URLs, and optional arguments, as well as to
12547 define Flex insets.
12550 \begin_layout Standard
12552 \begin_inset Flex CharStyle:Code
12555 \begin_layout Plain Layout
12561 definition must begin with a line of the form:
12564 \begin_layout LyX-Code
12568 \begin_layout Standard
12570 \begin_inset Flex CharStyle:Code
12573 \begin_layout Plain Layout
12579 indicates the inset whose layout is being defined, and here there are two
12583 \begin_layout Enumerate
12584 The layout for a pre-existing inset is being modified.
12585 In this case, can be
12586 \begin_inset Flex CharStyle:Code
12589 \begin_layout Plain Layout
12595 any one of the following:
12596 \begin_inset Flex CharStyle:Code
12599 \begin_layout Plain Layout
12606 \begin_inset Flex CharStyle:Code
12609 \begin_layout Plain Layout
12616 \begin_inset Flex CharStyle:Code
12619 \begin_layout Plain Layout
12626 \begin_inset Flex CharStyle:Code
12629 \begin_layout Plain Layout
12636 \begin_inset Flex CharStyle:Code
12639 \begin_layout Plain Layout
12646 \begin_inset Flex CharStyle:Code
12649 \begin_layout Plain Layout
12656 \begin_inset Flex CharStyle:Code
12659 \begin_layout Plain Layout
12666 \begin_inset Flex CharStyle:Code
12669 \begin_layout Plain Layout
12676 \begin_inset Flex CharStyle:Code
12679 \begin_layout Plain Layout
12686 \begin_inset Flex CharStyle:Code
12689 \begin_layout Plain Layout
12696 \begin_inset Flex CharStyle:Code
12699 \begin_layout Plain Layout
12706 \begin_inset Flex CharStyle:Code
12709 \begin_layout Plain Layout
12716 \begin_inset Flex CharStyle:Code
12719 \begin_layout Plain Layout
12726 \begin_inset Flex CharStyle:Code
12729 \begin_layout Plain Layout
12736 \begin_inset Flex CharStyle:Code
12739 \begin_layout Plain Layout
12746 \begin_inset Flex CharStyle:Code
12749 \begin_layout Plain Layout
12756 \begin_inset Flex CharStyle:Code
12759 \begin_layout Plain Layout
12766 \begin_inset Flex CharStyle:Code
12769 \begin_layout Plain Layout
12776 \begin_inset Flex CharStyle:Code
12779 \begin_layout Plain Layout
12786 \begin_inset Flex CharStyle:Code
12789 \begin_layout Plain Layout
12798 \begin_layout Enumerate
12799 The layout for a Flex inset is being defined.
12801 \begin_inset Flex CharStyle:Code
12804 \begin_layout Plain Layout
12810 can be any valid identifier not used by a pre-existing inset.
12811 Note that the definition of a flex inset must
12816 \begin_inset Flex CharStyle:Code
12819 \begin_layout Plain Layout
12828 \begin_layout Standard
12830 \begin_inset Flex CharStyle:Code
12833 \begin_layout Plain Layout
12839 definition can contain the following entries:
12842 \begin_layout Description
12843 \begin_inset Flex CharStyle:Code
12846 \begin_layout Plain Layout
12852 The color for the inset's background.
12853 The valid colors are defined in
12854 \begin_inset Flex CharStyle:Code
12857 \begin_layout Plain Layout
12866 \begin_layout Description
12867 \begin_inset Flex CharStyle:Code
12870 \begin_layout Plain Layout
12876 As with paragraph styles (see page
12877 \begin_inset CommandInset ref
12879 reference "des:CopyStyle"
12886 \begin_layout Description
12887 \begin_inset Flex CharStyle:Code
12890 \begin_layout Plain Layout
12897 \begin_inset Flex CharStyle:Code
12900 \begin_layout Plain Layout
12909 \begin_inset Flex CharStyle:Code
12912 \begin_layout Plain Layout
12918 ] Indicates whether the user may employ the Paragraph Settings dialog to
12919 customize the paragraph.
12922 \begin_layout Description
12923 \begin_inset Flex CharStyle:Code
12926 \begin_layout Plain Layout
12933 \begin_inset Flex CharStyle:Code
12936 \begin_layout Plain Layout
12943 \begin_inset Flex CharStyle:Code
12946 \begin_layout Plain Layout
12953 \begin_inset Flex CharStyle:Code
12956 \begin_layout Plain Layout
12962 , describing the rendering style used for the inset's frame and buttons.
12963 Footnotes generally use
12964 \begin_inset Flex CharStyle:Code
12967 \begin_layout Plain Layout
12973 , ERT insets generally
12974 \begin_inset Flex CharStyle:Code
12977 \begin_layout Plain Layout
12983 , and character styles
12984 \begin_inset Flex CharStyle:Code
12987 \begin_layout Plain Layout
12996 \begin_layout Description
12997 \begin_inset Flex CharStyle:Code
13000 \begin_layout Plain Layout
13006 Required at the end of the InsetLayout declarations.
13009 \begin_layout Description
13010 \begin_inset Flex CharStyle:Code
13013 \begin_layout Plain Layout
13019 The font used for both the text body
13025 \begin_inset space ~
13029 \begin_inset CommandInset ref
13031 reference "sub:Font-description"
13036 Note that defining this font automatically defines the
13037 \begin_inset Flex CharStyle:Code
13040 \begin_layout Plain Layout
13046 to the same value, so define this first and define
13047 \begin_inset Flex CharStyle:Code
13050 \begin_layout Plain Layout
13056 later if you want them to be different.
13059 \begin_layout Description
13060 \begin_inset Flex CharStyle:Code
13063 \begin_layout Plain Layout
13070 \begin_inset Quotes eld
13074 \begin_inset Quotes erd
13077 language, leading to Left-to-Right (latin) output, e.
13078 \begin_inset space \thinspace{}
13082 \begin_inset space \space{}
13085 in TeX code or URL.
13089 \begin_layout Description
13090 \begin_inset Flex CharStyle:Code
13093 \begin_layout Plain Layout
13100 \begin_inset Flex CharStyle:Code
13103 \begin_layout Plain Layout
13112 \begin_inset Flex CharStyle:Code
13115 \begin_layout Plain Layout
13121 ] Indicates whether the PlainLayout should be used or, instead, the user
13122 can change the paragraph style used in the inset.
13125 \begin_layout Description
13126 \begin_inset Flex CharStyle:Code
13129 \begin_layout Plain Layout
13135 As with paragraph styles (see page
13136 \begin_inset CommandInset ref
13137 LatexCommand pageref
13138 reference "des:FreeSpacing"
13145 \begin_layout Description
13146 \begin_inset Flex CharStyle:Code
13149 \begin_layout Plain Layout
13156 \begin_inset Flex CharStyle:Code
13159 \begin_layout Plain Layout
13168 \begin_inset Flex CharStyle:Code
13171 \begin_layout Plain Layout
13177 ] Whether to include the contents of this inset in the strings generated
13178 for the `Outline' pane.
13179 One would not, for example, want the content of a footnote in a section
13180 header to be included in the TOC displayed in the outline, but one would
13181 normally want the content of a character style displayed.
13182 Default is false: not to include.
13185 \begin_layout Description
13186 \begin_inset Flex CharStyle:Code
13189 \begin_layout Plain Layout
13195 As with paragraph styles (see page
13196 \begin_inset CommandInset ref
13197 LatexCommand pageref
13198 reference "des:KeepEmpty"
13205 \begin_layout Description
13206 \begin_inset Flex CharStyle:Code
13209 \begin_layout Plain Layout
13215 The font used for the label.
13217 \begin_inset space ~
13221 \begin_inset CommandInset ref
13223 reference "sub:Font-description"
13228 Note that this definition can never appear before
13229 \begin_inset Flex CharStyle:Code
13232 \begin_layout Plain Layout
13238 , lest it be ineffective.
13241 \begin_layout Description
13242 \begin_inset Flex CharStyle:Code
13245 \begin_layout Plain Layout
13251 What will be displayed on the button or elsewhere as the inset label.
13252 Some inset types (TeX code and Branch) modify this label on the fly.
13255 \begin_layout Description
13256 \begin_inset Flex CharStyle:Code
13259 \begin_layout Plain Layout
13265 The name of the corresponding LaTeX stuff.
13266 Either the environment or command name.
13269 \begin_layout Description
13270 \begin_inset Flex CharStyle:Code
13273 \begin_layout Plain Layout
13279 The optional parameter for the corresponding
13280 \begin_inset Flex CharStyle:Code
13283 \begin_layout Plain Layout
13289 stuff, including possible bracket pairs like
13290 \begin_inset Flex CharStyle:Code
13293 \begin_layout Plain Layout
13300 This parameter cannot be changed from within LyX.
13303 \begin_layout Description
13304 \begin_inset Flex CharStyle:Code
13307 \begin_layout Plain Layout
13313 As with paragraph styles (see page
13314 \begin_inset CommandInset ref
13315 LatexCommand pageref
13316 reference "des:LatexType"
13323 \begin_layout Description
13324 \begin_inset Flex CharStyle:Code
13327 \begin_layout Plain Layout
13334 \begin_inset Flex CharStyle:Code
13337 \begin_layout Plain Layout
13344 \begin_inset Flex CharStyle:Code
13347 \begin_layout Plain Layout
13354 \begin_inset Flex CharStyle:Code
13357 \begin_layout Plain Layout
13364 \begin_inset Flex CharStyle:Code
13367 \begin_layout Plain Layout
13373 (indicating a dummy definition ending definitions of charstyles, etc).
13374 This entry is required in and is only meaningful for Flex insets.
13375 Among other things, it determines on which menu this inset will appear.
13378 \begin_layout Description
13379 \begin_inset Flex CharStyle:Code
13382 \begin_layout Plain Layout
13389 \begin_inset Flex CharStyle:Code
13392 \begin_layout Plain Layout
13401 \begin_inset Flex CharStyle:Code
13404 \begin_layout Plain Layout
13410 ] Whether multiple paragraphs are permitted in this inset.
13411 This will also set CustomPars to the same value and ForcePlain to the opposite
13413 These can be reset to other values, if they are used
13420 \begin_layout Description
13421 \begin_inset Flex CharStyle:Code
13424 \begin_layout Plain Layout
13431 \begin_inset Flex CharStyle:Code
13434 \begin_layout Plain Layout
13443 \begin_inset Flex CharStyle:Code
13446 \begin_layout Plain Layout
13452 ] Whether fragile commands in this layout should be
13453 \begin_inset Flex CharStyle:Code
13456 \begin_layout Plain Layout
13469 whether the command should itself be protected.)
13472 \begin_layout Description
13473 \begin_inset Flex CharStyle:Code
13476 \begin_layout Plain Layout
13483 \begin_inset Flex CharStyle:Code
13486 \begin_layout Plain Layout
13495 \begin_inset Flex CharStyle:Code
13498 \begin_layout Plain Layout
13504 ] As with paragraph styles (see page
13505 \begin_inset CommandInset ref
13507 reference "des:PathThru"
13514 \begin_layout Description
13515 \begin_inset Flex CharStyle:Code
13518 \begin_layout Plain Layout
13524 As with paragraph styles (see page
13525 \begin_inset CommandInset ref
13526 LatexCommand pageref
13527 reference "des:Preamble"
13534 \begin_layout Description
13535 \begin_inset Flex CharStyle:Code
13538 \begin_layout Plain Layout
13545 \begin_inset Flex CharStyle:Code
13548 \begin_layout Plain Layout
13554 ] As with paragraph styles (see page
13555 \begin_inset CommandInset ref
13556 LatexCommand pageref
13557 reference "des:Requires"
13564 \begin_layout Subsection
13566 \begin_inset CommandInset label
13568 name "sub:Counters"
13575 \begin_layout Standard
13576 Since version 1.3.0 of LyX, it is both possible and necessary to define the
13578 \begin_inset Flex CharStyle:MenuItem
13581 \begin_layout Plain Layout
13588 \begin_inset Flex CharStyle:MenuItem
13591 \begin_layout Plain Layout
13597 , \SpecialChar \ldots{}
13598 ) in the text class itself.
13599 The standard counters are defined in the file
13600 \begin_inset Flex CharStyle:Code
13603 \begin_layout Plain Layout
13609 , so you may have to do no more than add
13612 \begin_layout LyX-Code
13613 Input stdcounters.inc
13616 \begin_layout Standard
13617 to your layout file to get them to work.
13618 But if you want to define custom counters, then you can do so.
13619 The counter declaration must begin with:
13622 \begin_layout LyX-Code
13623 Counter CounterName
13626 \begin_layout Standard
13628 \begin_inset Flex CharStyle:Code
13631 \begin_layout Plain Layout
13637 ' is replaced by the name of the counter.
13638 And it must end with
13639 \begin_inset Quotes eld
13643 \begin_inset Flex CharStyle:Code
13646 \begin_layout Plain Layout
13653 \begin_inset Quotes erd
13657 The following parameters can also be used:
13660 \begin_layout Description
13661 \begin_inset Flex CharStyle:Code
13664 \begin_layout Plain Layout
13665 LabelString [string=""]
13670 when this is defined, this string defines how the counter is displayed.
13671 Setting this value sets
13672 \begin_inset Flex CharStyle:Code
13675 \begin_layout Plain Layout
13676 LabelStringAppendix
13682 The following special constructs can be used in the string:
13686 \begin_layout Itemize
13687 \begin_inset Flex CharStyle:Code
13690 \begin_layout Plain Layout
13698 will be replaced by the expansion of the
13699 \begin_inset Flex CharStyle:Code
13702 \begin_layout Plain Layout
13709 \begin_inset Flex CharStyle:Code
13712 \begin_layout Plain Layout
13713 LabelStringAppendix
13719 \begin_inset Flex CharStyle:Code
13722 \begin_layout Plain Layout
13732 \begin_layout Itemize
13733 counter values can be expressed using LaTeX-like macros
13734 \begin_inset Flex CharStyle:Code
13737 \begin_layout Plain Layout
13754 \begin_inset Flex CharStyle:Code
13757 \begin_layout Plain Layout
13769 \begin_layout Plain Layout
13779 Actually, the situation is a bit more complicated: any
13798 other than those described below will produce arabic numerals.
13799 It would not be surprising to see this change in the future.
13805 \begin_inset Flex CharStyle:Code
13808 \begin_layout Plain Layout
13814 : 1, 2, 3,\SpecialChar \ldots{}
13816 \begin_inset Flex CharStyle:Code
13819 \begin_layout Plain Layout
13825 for lower-case letters: a, b, c, \SpecialChar \ldots{}
13827 \begin_inset Flex CharStyle:Code
13830 \begin_layout Plain Layout
13836 for upper-case letters: A, B, C, \SpecialChar \ldots{}
13838 \begin_inset Flex CharStyle:Code
13841 \begin_layout Plain Layout
13847 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
13849 \begin_inset Flex CharStyle:Code
13852 \begin_layout Plain Layout
13858 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
13860 \begin_inset Flex CharStyle:Code
13863 \begin_layout Plain Layout
13869 for hebrew numerals.
13873 \begin_layout Standard
13874 If LabelString is not defined, a default value is constructed as follows:
13875 if the counter has a master counter
13876 \begin_inset Flex CharStyle:Code
13879 \begin_layout Plain Layout
13886 \begin_inset Flex CharStyle:Code
13889 \begin_layout Plain Layout
13896 \begin_inset Flex CharStyle:Code
13899 \begin_layout Plain Layout
13909 is used; otherwise the string
13910 \begin_inset Flex CharStyle:Code
13913 \begin_layout Plain Layout
13924 \begin_layout Description
13925 \begin_inset Flex CharStyle:Code
13928 \begin_layout Plain Layout
13929 LabelStringAppendix [string=""]
13935 \begin_inset Flex CharStyle:Code
13938 \begin_layout Plain Layout
13944 , but for use in the Appendix.
13947 \begin_layout Description
13948 \begin_inset Flex CharStyle:Code
13951 \begin_layout Plain Layout
13958 \begin_inset Flex CharStyle:Code
13961 \begin_layout Plain Layout
13968 \begin_inset Quotes erd
13972 \begin_inset Quotes erd
13975 ] If this is set to the name of another counter, the present counter will
13976 be reset every time the other one is increased.
13978 \begin_inset Flex CharStyle:Code
13981 \begin_layout Plain Layout
13988 \begin_inset Flex CharStyle:Code
13991 \begin_layout Plain Layout
14000 \begin_layout Subsection
14002 \begin_inset CommandInset label
14004 name "sub:Font-description"
14011 \begin_layout Standard
14012 A font description looks like this:
14015 \begin_layout LyX-Code
14025 \begin_layout LyX-Code
14029 \begin_layout LyX-Code
14033 \begin_layout Standard
14034 The following commands are available:
14037 \begin_layout Description
14038 \begin_inset Flex CharStyle:Code
14041 \begin_layout Plain Layout
14048 \begin_inset Flex CharStyle:Code
14051 \begin_layout Plain Layout
14060 \begin_inset Flex CharStyle:Code
14063 \begin_layout Plain Layout
14070 \begin_inset Flex CharStyle:Code
14073 \begin_layout Plain Layout
14080 \begin_inset Flex CharStyle:Code
14083 \begin_layout Plain Layout
14090 \begin_inset Flex CharStyle:Code
14093 \begin_layout Plain Layout
14100 \begin_inset Flex CharStyle:Code
14103 \begin_layout Plain Layout
14110 \begin_inset Flex CharStyle:Code
14113 \begin_layout Plain Layout
14120 \begin_inset Flex CharStyle:Code
14123 \begin_layout Plain Layout
14130 \begin_inset Flex CharStyle:Code
14133 \begin_layout Plain Layout
14142 \begin_layout Description
14143 \begin_inset Flex CharStyle:Code
14146 \begin_layout Plain Layout
14155 \begin_inset Flex CharStyle:Code
14158 \begin_layout Plain Layout
14169 \begin_inset Flex CharStyle:Code
14172 \begin_layout Plain Layout
14179 \begin_inset Flex CharStyle:Code
14182 \begin_layout Plain Layout
14191 \begin_layout Description
14192 \begin_inset Flex CharStyle:Code
14195 \begin_layout Plain Layout
14202 \begin_inset Flex CharStyle:Code
14205 \begin_layout Plain Layout
14211 ] Valid arguments are:
14212 \begin_inset Flex CharStyle:Code
14215 \begin_layout Plain Layout
14222 \begin_inset Flex CharStyle:Code
14225 \begin_layout Plain Layout
14232 \begin_inset Flex CharStyle:Code
14235 \begin_layout Plain Layout
14242 \begin_inset Flex CharStyle:Code
14245 \begin_layout Plain Layout
14252 \begin_inset Flex CharStyle:Code
14255 \begin_layout Plain Layout
14262 \begin_inset Flex CharStyle:Code
14265 \begin_layout Plain Layout
14272 Each of these turns on or off the corresponding attribute.
14274 \begin_inset Flex CharStyle:Code
14277 \begin_layout Plain Layout
14283 turns on emphasis, and
14284 \begin_inset Flex CharStyle:Code
14287 \begin_layout Plain Layout
14295 \begin_inset Newline newline
14298 If the latter seems puzzling, remember that the font settings for the present
14299 context are generally inherited from the surrounding context.
14301 \begin_inset Flex CharStyle:Code
14304 \begin_layout Plain Layout
14310 would turn off the emphasis that was anyway in effect, say, in a theorem
14314 \begin_layout Description
14315 \begin_inset Flex CharStyle:Code
14318 \begin_layout Plain Layout
14327 \begin_inset Flex CharStyle:Code
14330 \begin_layout Plain Layout
14341 \begin_inset Flex CharStyle:Code
14344 \begin_layout Plain Layout
14353 \begin_layout Description
14354 \begin_inset Flex CharStyle:Code
14357 \begin_layout Plain Layout
14366 \begin_inset Flex CharStyle:Code
14369 \begin_layout Plain Layout
14380 \begin_inset Flex CharStyle:Code
14383 \begin_layout Plain Layout
14390 \begin_inset Flex CharStyle:Code
14393 \begin_layout Plain Layout
14400 \begin_inset Flex CharStyle:Code
14403 \begin_layout Plain Layout
14412 \begin_layout Description
14413 \begin_inset Flex CharStyle:Code
14416 \begin_layout Plain Layout
14423 \begin_inset Flex CharStyle:Code
14426 \begin_layout Plain Layout
14433 \begin_inset Flex CharStyle:Code
14436 \begin_layout Plain Layout
14443 \begin_inset Flex CharStyle:Code
14446 \begin_layout Plain Layout
14455 \begin_inset Flex CharStyle:Code
14458 \begin_layout Plain Layout
14465 \begin_inset Flex CharStyle:Code
14468 \begin_layout Plain Layout
14475 \begin_inset Flex CharStyle:Code
14478 \begin_layout Plain Layout
14485 \begin_inset Flex CharStyle:Code
14488 \begin_layout Plain Layout
14495 \begin_inset Flex CharStyle:Code
14498 \begin_layout Plain Layout
14507 \begin_layout Subsection
14508 Upgrading old layout files
14511 \begin_layout Standard
14512 The file format of layout files changes from time to time, so old layout
14513 files need to be converted.
14514 This process has been automated since LyX 1.4.0: If LyX reads an old format
14515 layout file it will call the conversion tool
14516 \begin_inset Flex CharStyle:Code
14519 \begin_layout Plain Layout
14520 LyXDir/scripts/layout2layout.py
14525 and convert it to a temporary file in current format.
14526 The original file is left untouched.
14527 If you want to convert the layout file permanently, just call the converter
14531 \begin_layout LyX-Code
14532 python $LyXDir/scripts/layout2layout.py myclass.layout myclassnew.layout
14535 \begin_layout Standard
14536 (You need to replace
14537 \begin_inset Flex CharStyle:Code
14540 \begin_layout Plain Layout
14546 with the name of your LyX system directory, unless you happen to have defined
14547 such an environment variable.) Then copy
14548 \begin_inset Flex CharStyle:Code
14551 \begin_layout Plain Layout
14558 \begin_inset Flex CharStyle:Code
14561 \begin_layout Plain Layout
14570 \begin_layout Standard
14571 The automatic conversion only handles syntax changes.
14572 It cannot handle the case where the contents of included files was changed,
14573 so these will have to be converted separately.
14576 \begin_layout Section
14578 \begin_inset CommandInset label
14580 name "sec:Creating-Templates"
14587 \begin_layout Standard
14588 Templates are created just like usual documents.
14589 The only difference is that usual documents contain all possible settings,
14590 including the font scheme and the paper size.
14591 Usually a user doesn't want a template to overwrite his defaults in these
14593 For that reason, the designer of a template should remove the corresponding
14595 \begin_inset Flex CharStyle:Code
14598 \begin_layout Plain Layout
14607 \begin_inset Flex CharStyle:Code
14610 \begin_layout Plain Layout
14618 from the template LyX file.
14619 This can be done with any simple text-editor, for example
14620 \begin_inset Flex CharStyle:Code
14623 \begin_layout Plain Layout
14630 \begin_inset Flex CharStyle:Code
14633 \begin_layout Plain Layout
14643 \begin_layout Standard
14644 Put the edited template files you create in
14645 \begin_inset Flex CharStyle:Code
14648 \begin_layout Plain Layout
14654 , copy the ones you use from the global template directory in
14655 \begin_inset Flex CharStyle:Code
14658 \begin_layout Plain Layout
14664 to the same place, and redefine the template path in the
14665 \begin_inset Flex CharStyle:MenuItem
14668 \begin_layout Plain Layout
14669 Tools\SpecialChar \menuseparator
14670 Preferences\SpecialChar \menuseparator
14679 \begin_layout Standard
14680 Note that there is a template which has a particular meaning:
14681 \begin_inset Flex CharStyle:Code
14684 \begin_layout Plain Layout
14691 This template is loaded every time you create a new document with
14692 \begin_inset Flex CharStyle:MenuItem
14695 \begin_layout Plain Layout
14696 File\SpecialChar \menuseparator
14702 in order to provide useful defaults.
14703 To create this template from inside LyX, all you have to do is to open
14704 a document with the correct settings, and use the
14705 \begin_inset Flex CharStyle:MenuItem
14708 \begin_layout Plain Layout
14709 Save as Document Defaults
14717 \begin_layout Chapter
14718 Including External Material
14721 \begin_layout Standard
14722 \begin_inset Box Shadowbox
14731 height_special "totalheight"
14734 \begin_layout Plain Layout
14735 WARNING: This portion of the documentation has not been updated for some
14737 We certainly hope that it is still accurate, but there are no guarantees.
14745 \begin_layout Standard
14746 The use of material from sources external to LyX is covered in detail in
14752 This part of the manual covers what needs to happen behind the scenes for
14753 new sorts of material to be included.
14756 \begin_layout Section
14760 \begin_layout Standard
14761 The external material feature is based on the concept of a
14766 A template is a specification of how LyX should interface with a certain
14768 As bundled, LyX comes with predefined templates for Xfig figures, various
14769 raster format images, chess diagrams, and LilyPond music notation.
14770 You can check the actual list by using the menu
14771 \begin_inset Flex CharStyle:MenuItem
14774 \begin_layout Plain Layout
14775 Insert\SpecialChar \menuseparator
14776 File\SpecialChar \menuseparator
14783 Furthermore, it is possible to roll your own template to support a specific
14785 Later we'll describe in more detail what is involved, and hopefully you
14786 will submit all the templates you create so we can include them in a later
14790 \begin_layout Standard
14791 Another basic idea of the external material feature is to distinguish between
14792 the original file that serves as a base for final material and the produced
14793 file that is included in your exported or printed document.
14794 For example, consider the case of a figure produced with
14795 \begin_inset Flex CharStyle:Code
14798 \begin_layout Plain Layout
14805 The Xfig application itself works on an original file with the
14806 \begin_inset Flex CharStyle:Code
14809 \begin_layout Plain Layout
14816 Within Xfig, you create and change your figure, and when you are done,
14818 \begin_inset Flex CharStyle:Code
14821 \begin_layout Plain Layout
14828 When you want to include the figure in your document, you invoke
14829 \begin_inset Flex CharStyle:Code
14832 \begin_layout Plain Layout
14838 in order to create a PostScript file that can readily be included in your
14841 \begin_inset Flex CharStyle:Code
14844 \begin_layout Plain Layout
14850 file is the original file, and the PostScript file is the produced file.
14853 \begin_layout Standard
14854 This distinction is important in order to allow updating of the material
14855 while you are in the process of writing the document.
14856 Furthermore, it provides us with the flexibility that is needed to support
14857 multiple export formats.
14858 For instance, in the case of a plain text file, it is not exactly an award-winn
14859 ing idea to include the figure as raw PostScript.
14860 Instead, you'd either prefer to just include a reference to the figure
14861 or try to invoke some graphics to ASCII converter to make the final result
14862 look similar to the real graphics.
14863 The external material management allows you to do this, because it is parametri
14864 zed on the different export formats that LyX supports.
14867 \begin_layout Standard
14868 Besides supporting the production of different products according to the
14869 exported format, it supports tight integration with editing and viewing
14871 In the case of an Xfig figure, you are able to invoke Xfig on the original
14872 file with a single click from within the external material dialog in LyX,
14873 and also preview the produced PostScript file with Ghostview with another
14875 No more fiddling around with the command line and/or file browsers to locate
14876 and manipulate the original or produced files.
14877 In this way, you are finally able to take full advantage of the many different
14878 applications that are relevant to use when you write your documents, and
14879 ultimately be more productive.
14882 \begin_layout Section
14883 The external template configuration file
14886 \begin_layout Standard
14887 It is relatively easy to add custom external template definitions to LyX.
14888 However, be aware that doing this in an careless manner most probably
14892 introduce an easily exploitable security hole.
14893 So before you do this, please read the discussion about security in section
14895 \begin_inset CommandInset ref
14897 reference "sec:Security-discussion"
14904 \begin_layout Standard
14905 Having said that, we encourage you to submit any interesting templates that
14910 \begin_layout Standard
14911 The external templates are defined in the
14912 \begin_inset Flex CharStyle:Code
14915 \begin_layout Plain Layout
14916 LyXDir/lib/external_templates
14922 You can place your own version in
14923 \begin_inset Flex CharStyle:Code
14926 \begin_layout Plain Layout
14927 UserDir/external_templates
14935 \begin_layout Standard
14936 A typical template looks like this:
14939 \begin_layout LyX-Code
14943 \begin_layout LyX-Code
14944 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
14947 \begin_layout LyX-Code
14951 \begin_layout LyX-Code
14955 \begin_layout LyX-Code
14959 \begin_layout LyX-Code
14963 \begin_layout LyX-Code
14967 \begin_layout LyX-Code
14968 AutomaticProduction true
14971 \begin_layout LyX-Code
14975 \begin_layout LyX-Code
14979 \begin_layout LyX-Code
14983 \begin_layout LyX-Code
14984 TransformCommand Rotate RotationLatexCommand
14987 \begin_layout LyX-Code
14988 TransformCommand Resize ResizeLatexCommand
14991 \begin_layout LyX-Code
14992 Product "$$RotateFront$$ResizeFront
14995 \begin_layout LyX-Code
15000 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
15003 \begin_layout LyX-Code
15004 $$ResizeBack$$RotateBack"
15007 \begin_layout LyX-Code
15011 \begin_layout LyX-Code
15012 UpdateResult "$$AbsPath$$Basename.pstex_t"
15015 \begin_layout LyX-Code
15016 Requirement "graphicx"
15019 \begin_layout LyX-Code
15020 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
15023 \begin_layout LyX-Code
15024 ReferencedFile latex "$$AbsPath$$Basename.eps"
15027 \begin_layout LyX-Code
15028 ReferencedFile dvi "$$AbsPath$$Basename.eps"
15031 \begin_layout LyX-Code
15035 \begin_layout LyX-Code
15039 \begin_layout LyX-Code
15040 TransformCommand Rotate RotationLatexCommand
15043 \begin_layout LyX-Code
15044 TransformCommand Resize ResizeLatexCommand
15047 \begin_layout LyX-Code
15048 Product "$$RotateFront$$ResizeFront
15051 \begin_layout LyX-Code
15056 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
15059 \begin_layout LyX-Code
15060 $$ResizeBack$$RotateBack"
15063 \begin_layout LyX-Code
15064 UpdateFormat pdftex
15067 \begin_layout LyX-Code
15068 UpdateResult "$$AbsPath$$Basename.pdftex_t"
15071 \begin_layout LyX-Code
15072 Requirement "graphicx"
15075 \begin_layout LyX-Code
15076 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
15079 \begin_layout LyX-Code
15080 ReferencedFile latex "$$AbsPath$$Basename.pdf"
15083 \begin_layout LyX-Code
15087 \begin_layout LyX-Code
15091 \begin_layout LyX-Code
15092 Product "$$Contents(
15094 "$$AbsPath$$Basename.asc
15099 \begin_layout LyX-Code
15100 UpdateFormat asciixfig
15103 \begin_layout LyX-Code
15104 UpdateResult "$$AbsPath$$Basename.asc"
15107 \begin_layout LyX-Code
15111 \begin_layout LyX-Code
15115 \begin_layout LyX-Code
15116 Product "<graphic fileref=
15118 "$$AbsOrRelPathMaster$$Basename.eps
15123 \begin_layout LyX-Code
15127 \begin_layout LyX-Code
15131 \begin_layout LyX-Code
15132 UpdateResult "$$AbsPath$$Basename.eps"
15135 \begin_layout LyX-Code
15136 ReferencedFile docbook "$$AbsPath$$Basename.eps"
15139 \begin_layout LyX-Code
15140 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
15143 \begin_layout LyX-Code
15147 \begin_layout LyX-Code
15148 Product "[XFig: $$FName]"
15151 \begin_layout LyX-Code
15155 \begin_layout LyX-Code
15159 \begin_layout Standard
15160 As you can see, the template is enclosed in
15161 \begin_inset Flex CharStyle:Code
15164 \begin_layout Plain Layout
15170 \SpecialChar \ldots{}
15172 \begin_inset Flex CharStyle:Code
15175 \begin_layout Plain Layout
15182 It contains a header specifying some general settings and, for each supported
15183 primary document file format, a section
15184 \begin_inset Flex CharStyle:Code
15187 \begin_layout Plain Layout
15193 \SpecialChar \ldots{}
15195 \begin_inset Flex CharStyle:Code
15198 \begin_layout Plain Layout
15207 \begin_layout Subsection
15208 The template header
15211 \begin_layout Description
15212 \begin_inset Flex CharStyle:Code
15215 \begin_layout Plain Layout
15216 AutomaticProduction
15217 \begin_inset space ~
15225 Whether the file represented by the template must be generated by LyX.
15226 This command must occur exactly once.
15229 \begin_layout Description
15230 \begin_inset Flex CharStyle:Code
15233 \begin_layout Plain Layout
15235 \begin_inset space ~
15243 A glob pattern that is used in the file dialog to filter out the desired
15245 If there is more than one possible file extension (e.
15246 \begin_inset space \thinspace{}
15250 \begin_inset space \space{}
15254 \begin_inset Flex CharStyle:Code
15257 \begin_layout Plain Layout
15264 \begin_inset Flex CharStyle:Code
15267 \begin_layout Plain Layout
15273 ), use something like
15274 \begin_inset Flex CharStyle:Code
15277 \begin_layout Plain Layout
15284 This command must occur exactly once.
15287 \begin_layout Description
15288 \begin_inset Flex CharStyle:Code
15291 \begin_layout Plain Layout
15293 \begin_inset space ~
15301 The text that is displayed on the button.
15302 This command must occur exactly once.
15305 \begin_layout Description
15306 \begin_inset Flex CharStyle:Code
15309 \begin_layout Plain Layout
15311 \begin_inset space ~
15315 \begin_inset space ~
15323 The help text that is used in the External dialog.
15324 Provide enough information to explain to the user just what the template
15325 can provide him with.
15326 This command must occur exactly once.
15329 \begin_layout Description
15330 \begin_inset Flex CharStyle:Code
15333 \begin_layout Plain Layout
15335 \begin_inset space ~
15343 The file format of the original file.
15344 This must be the name of a format that is known to LyX (see section
15345 \begin_inset CommandInset ref
15347 reference "sec:Formats"
15353 \begin_inset Quotes eld
15357 \begin_inset Flex CharStyle:Code
15360 \begin_layout Plain Layout
15367 \begin_inset Quotes erd
15370 if the template can handle original files of more than one format.
15371 LyX will attempt to interrogate the file itself in order to deduce its
15372 format in this case.
15373 This command must occur exactly once.
15376 \begin_layout Description
15377 \begin_inset Flex CharStyle:Code
15380 \begin_layout Plain Layout
15382 \begin_inset space ~
15390 A unique name for the template.
15391 It must not contain substitution macros (see below).
15394 \begin_layout Description
15395 \begin_inset Flex CharStyle:Code
15398 \begin_layout Plain Layout
15400 \begin_inset space ~
15403 Rotate|Resize|Clip|Extra
15408 This command specifies which transformations are supported by this template.
15409 It may occur zero or more times.
15410 This command enables the corresponding tabs in the external dialog.
15412 \begin_inset Flex CharStyle:Code
15415 \begin_layout Plain Layout
15421 command must have either a corresponding
15422 \begin_inset Flex CharStyle:Code
15425 \begin_layout Plain Layout
15432 \begin_inset Flex CharStyle:Code
15435 \begin_layout Plain Layout
15442 \begin_inset Flex CharStyle:Code
15445 \begin_layout Plain Layout
15452 Otherwise the transformation will not be supported by that format.
15455 \begin_layout Subsection
15459 \begin_layout Description
15460 \begin_inset Flex CharStyle:Code
15463 \begin_layout Plain Layout
15465 \begin_inset space ~
15468 LaTeX|PDFLaTeX|PlainText|DocBook
15473 The primary document file format that this format definition is for.
15474 Not every template has a sensible representation in all document file formats.
15475 Please define nevertheless a
15476 \begin_inset Flex CharStyle:Code
15479 \begin_layout Plain Layout
15485 section for all formats.
15486 Use a dummy text when no representation is available.
15487 Then you can at least see a reference to the external material in the exported
15491 \begin_layout Description
15492 \begin_inset Flex CharStyle:Code
15495 \begin_layout Plain Layout
15497 \begin_inset space ~
15501 \begin_inset space ~
15509 This command defines an additional macro
15510 \begin_inset Flex CharStyle:Code
15513 \begin_layout Plain Layout
15519 for substitution in
15520 \begin_inset Flex CharStyle:Code
15523 \begin_layout Plain Layout
15531 \begin_inset Flex CharStyle:Code
15534 \begin_layout Plain Layout
15540 itself may contain substitution macros.
15541 The advantage over using
15542 \begin_inset Flex CharStyle:Code
15545 \begin_layout Plain Layout
15552 \begin_inset Flex CharStyle:Code
15555 \begin_layout Plain Layout
15561 is that the substituted value of
15562 \begin_inset Flex CharStyle:Code
15565 \begin_layout Plain Layout
15571 is sanitized so that it is a valid optional argument in the document format.
15572 This command may occur zero or more times.
15575 \begin_layout Description
15576 \begin_inset Flex CharStyle:Code
15579 \begin_layout Plain Layout
15581 \begin_inset space ~
15589 The text that is inserted in the exported document.
15590 This is actually the most important command and can be quite complex.
15591 This command must occur exactly once.
15594 \begin_layout Description
15595 \begin_inset Flex CharStyle:Code
15598 \begin_layout Plain Layout
15600 \begin_inset space ~
15608 This command specifies a preamble snippet that will be included in the
15610 It has to be defined using
15611 \begin_inset Flex CharStyle:Code
15614 \begin_layout Plain Layout
15620 \SpecialChar \ldots{}
15622 \begin_inset Flex CharStyle:Code
15625 \begin_layout Plain Layout
15632 This command may occur zero or more times.
15635 \begin_layout Description
15636 \begin_inset Flex CharStyle:Code
15639 \begin_layout Plain Layout
15641 \begin_inset space ~
15645 \begin_inset space ~
15653 This command denotes files that are created by the conversion process and
15654 are needed for a particular export format.
15655 If the filename is relative, it is interpreted relative to the master document.
15656 This command may be given zero or more times.
15659 \begin_layout Description
15660 \begin_inset Flex CharStyle:Code
15663 \begin_layout Plain Layout
15665 \begin_inset space ~
15673 The name of a required LaTeX package.
15674 The package is included via
15675 \begin_inset Flex CharStyle:Code
15678 \begin_layout Plain Layout
15686 in the LaTeX preamble.
15687 This command may occur zero or more times.
15690 \begin_layout Description
15691 \begin_inset Flex CharStyle:Code
15694 \begin_layout Plain Layout
15696 \begin_inset space ~
15700 \begin_inset space ~
15703 RotationLatexCommand
15708 This command specifies that the built in LaTeX command should be used for
15710 This command may occur once or not at all.
15713 \begin_layout Description
15714 \begin_inset Flex CharStyle:Code
15717 \begin_layout Plain Layout
15719 \begin_inset space ~
15723 \begin_inset space ~
15731 This command specifies that the built in LaTeX command should be used for
15733 This command may occur once or not at all.
15736 \begin_layout Description
15737 \begin_inset Flex CharStyle:Code
15740 \begin_layout Plain Layout
15742 \begin_inset space ~
15746 \begin_inset space ~
15749 RotationLatexOption
15754 This command specifies that rotation is done via an optional argument.
15755 This command may occur once or not at all.
15758 \begin_layout Description
15759 \begin_inset Flex CharStyle:Code
15762 \begin_layout Plain Layout
15764 \begin_inset space ~
15768 \begin_inset space ~
15776 This command specifies that resizing is done via an optional argument.
15777 This command may occur once or not at all.
15780 \begin_layout Description
15781 \begin_inset Flex CharStyle:Code
15784 \begin_layout Plain Layout
15786 \begin_inset space ~
15790 \begin_inset space ~
15798 This command specifies that clipping is done via an optional argument.
15799 This command may occur once or not at all.
15802 \begin_layout Description
15803 \begin_inset Flex CharStyle:Code
15806 \begin_layout Plain Layout
15808 \begin_inset space ~
15812 \begin_inset space ~
15820 This command specifies that an extra optional argument is used.
15821 This command may occur once or not at all.
15824 \begin_layout Description
15825 \begin_inset Flex CharStyle:Code
15828 \begin_layout Plain Layout
15830 \begin_inset space ~
15838 The file format of the converted file.
15839 This must be the name of a format that is known to LyX (see the
15840 \begin_inset Flex CharStyle:MenuItem
15843 \begin_layout Plain Layout
15848 ools\SpecialChar \menuseparator
15853 references:Conversion
15859 This command must occur exactly once.
15862 \begin_layout Description
15863 \begin_inset Flex CharStyle:Code
15866 \begin_layout Plain Layout
15868 \begin_inset space ~
15876 The file name of the converted file.
15877 The file name must be absolute.
15878 This command must occur exactly once.
15881 \begin_layout Subsection
15882 Preamble definitions
15885 \begin_layout Standard
15886 The external template configuration file may contain additional preamble
15887 definitions enclosed by
15888 \begin_inset Flex CharStyle:Code
15891 \begin_layout Plain Layout
15897 \SpecialChar \ldots{}
15899 \begin_inset Flex CharStyle:Code
15902 \begin_layout Plain Layout
15909 They can be used by the templates in the
15910 \begin_inset Flex CharStyle:Code
15913 \begin_layout Plain Layout
15922 \begin_layout Section
15923 The substitution mechanism
15926 \begin_layout Standard
15927 When the external material facility invokes an external program, it is done
15928 on the basis of a command defined in the template configuration file.
15929 These commands can contain various macros that are expanded before execution.
15930 Execution always take place in the directory of the containing document.
15933 \begin_layout Standard
15934 Also, whenever external material is to be displayed, the name will be produced
15935 by the substitution mechanism, and most other commands in the template
15936 definition support substitution as well.
15939 \begin_layout Standard
15940 The available macros are the following:
15943 \begin_layout Description
15944 \begin_inset Flex CharStyle:Code
15947 \begin_layout Plain Layout
15948 $$AbsOrRelPathMaster
15953 The file path, absolute or relative to the master LyX document.
15956 \begin_layout Description
15957 \begin_inset Flex CharStyle:Code
15960 \begin_layout Plain Layout
15961 $$AbsOrRelPathParent
15966 The file path, absolute or relative to the LyX document.
15969 \begin_layout Description
15970 \begin_inset Flex CharStyle:Code
15973 \begin_layout Plain Layout
15979 The absolute file path.
15982 \begin_layout Description
15983 \begin_inset Flex CharStyle:Code
15986 \begin_layout Plain Layout
15992 The filename without path and without the extension.
15995 \begin_layout Description
15996 \begin_inset Flex CharStyle:Code
15999 \begin_layout Plain Layout
16001 \begin_inset Quotes eld
16005 \begin_inset Quotes erd
16013 This macro will expand to the contents of the file with the name
16014 \begin_inset Flex CharStyle:Code
16017 \begin_layout Plain Layout
16026 \begin_layout Description
16027 \begin_inset Flex CharStyle:Code
16030 \begin_layout Plain Layout
16036 The file extension (including the dot).
16039 \begin_layout Description
16040 \begin_inset Flex CharStyle:Code
16043 \begin_layout Plain Layout
16049 The filename of the file specified in the external material dialog.
16050 This is either an absolute name, or it is relative to the LyX document.
16053 \begin_layout Description
16054 \begin_inset Flex CharStyle:Code
16057 \begin_layout Plain Layout
16064 \begin_inset Flex CharStyle:Code
16067 \begin_layout Plain Layout
16073 (absolute name or relative to the LyX document).
16076 \begin_layout Description
16077 \begin_inset Flex CharStyle:Code
16080 \begin_layout Plain Layout
16086 The file path, relative to the master LyX document.
16089 \begin_layout Description
16090 \begin_inset Flex CharStyle:Code
16093 \begin_layout Plain Layout
16099 The file path, relative to the LyX document.
16102 \begin_layout Description
16103 \begin_inset Flex CharStyle:Code
16106 \begin_layout Plain Layout
16112 This macro will expand to the absolute path of the system directory.
16113 This is typically used to point to the various helper scripts that are
16117 \begin_layout Description
16118 \begin_inset Flex CharStyle:Code
16121 \begin_layout Plain Layout
16127 A name and full path to a temporary file which will be automatically deleted
16128 whenever the containing document is closed, or the external material insertion
16132 \begin_layout Standard
16133 All path macros contain a trailing directory separator, so you can construct
16135 \begin_inset space \thinspace{}
16139 \begin_inset space \space{}
16142 the absolute filename with
16143 \begin_inset Flex CharStyle:Code
16146 \begin_layout Plain Layout
16147 $$AbsPath$$Basename$$Extension
16155 \begin_layout Standard
16156 The macros above are substituted in all commands unless otherwise noted.
16158 \begin_inset Flex CharStyle:Code
16161 \begin_layout Plain Layout
16167 supports additionally the following substitutions if they are enabled by
16169 \begin_inset Flex CharStyle:Code
16172 \begin_layout Plain Layout
16179 \begin_inset Flex CharStyle:Code
16182 \begin_layout Plain Layout
16191 \begin_layout Description
16192 \begin_inset Flex CharStyle:Code
16195 \begin_layout Plain Layout
16201 The front part of the resize command.
16204 \begin_layout Description
16205 \begin_inset Flex CharStyle:Code
16208 \begin_layout Plain Layout
16214 The back part of the resize command.
16217 \begin_layout Description
16218 \begin_inset Flex CharStyle:Code
16221 \begin_layout Plain Layout
16227 The front part of the rotation command.
16230 \begin_layout Description
16231 \begin_inset Flex CharStyle:Code
16234 \begin_layout Plain Layout
16240 The back part of the rotation command.
16243 \begin_layout Standard
16244 The value string of the
16245 \begin_inset Flex CharStyle:Code
16248 \begin_layout Plain Layout
16254 command supports additionally the following substitutions if they are enabled
16256 \begin_inset Flex CharStyle:Code
16259 \begin_layout Plain Layout
16266 \begin_inset Flex CharStyle:Code
16269 \begin_layout Plain Layout
16278 \begin_layout Description
16279 \begin_inset Flex CharStyle:Code
16282 \begin_layout Plain Layout
16291 \begin_layout Description
16292 \begin_inset Flex CharStyle:Code
16295 \begin_layout Plain Layout
16304 \begin_layout Description
16305 \begin_inset Flex CharStyle:Code
16308 \begin_layout Plain Layout
16317 \begin_layout Description
16318 \begin_inset Flex CharStyle:Code
16321 \begin_layout Plain Layout
16327 The rotation option.
16330 \begin_layout Standard
16331 You may ask why there are so many path macros.
16332 There are mainly two reasons:
16335 \begin_layout Enumerate
16336 Relative and absolute file names should remain relative or absolute, respectivel
16338 Users may have reasons to prefer either form.
16339 Relative names are useful for portable documents that should work on different
16340 machines, for example.
16341 Absolute names may be required by some programs.
16344 \begin_layout Enumerate
16345 LaTeX treats relative file names differently than LyX and other programs
16346 in nested included files.
16347 For LyX, a relative file name is always relative to the document that contains
16349 For LaTeX, it is always relative to the master document.
16350 These two definitions are identical if you have only one document, but
16351 differ if you have a master document that includes part documents.
16352 That means that relative filenames must be transformed when presented to
16354 Fortunately LyX does this automatically for you if you choose the right
16358 \begin_layout Standard
16359 So which path macro should be used in new template definitions? The rule
16363 \begin_layout Itemize
16365 \begin_inset Flex CharStyle:Code
16368 \begin_layout Plain Layout
16374 if an absolute path is required.
16377 \begin_layout Itemize
16379 \begin_inset Flex CharStyle:Code
16382 \begin_layout Plain Layout
16383 $$AbsOrRelPathMaster
16388 if the substituted string is some kind of LaTeX input.
16391 \begin_layout Itemize
16393 \begin_inset Flex CharStyle:Code
16396 \begin_layout Plain Layout
16397 $$AbsOrRelPathParent
16402 in order to preserve the user's choice.
16405 \begin_layout Standard
16406 There are special cases where this rule does not work and e.
16407 \begin_inset space \thinspace{}
16411 \begin_inset space \space{}
16414 relative names are needed, but normally it will work just fine.
16415 One example for such a case is the command
16416 \begin_inset Flex CharStyle:Code
16419 \begin_layout Plain Layout
16420 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
16425 in the XFig template above: We can't use the absolute name because the
16427 \begin_inset Flex CharStyle:Code
16430 \begin_layout Plain Layout
16436 files needs the relative name in order to rewrite the file content.
16439 \begin_layout Section
16440 Security discussion
16441 \begin_inset CommandInset label
16443 name "sec:Security-discussion"
16450 \begin_layout Standard
16451 The external material feature interfaces with a lot of external programs
16452 and does so automatically, so we have to consider the security implications
16454 In particular, since you have the option of including your own filenames
16455 and/or parameter strings and those are expanded into a command, it seems
16456 that it would be possible to create a malicious document which executes
16457 arbitrary commands when a user views or prints the document.
16458 This is something we definitely want to avoid.
16461 \begin_layout Standard
16462 However, since the external program commands are specified in the template
16463 configuration file only, there are no security issues if LyX is properly
16464 configured with safe templates only.
16465 This is so because the external programs are invoked with the
16466 \begin_inset Flex CharStyle:Code
16469 \begin_layout Plain Layout
16475 -system call rather than the
16476 \begin_inset Flex CharStyle:Code
16479 \begin_layout Plain Layout
16485 system-call, so it's not possible to execute arbitrary commands from the
16486 filename or parameter section via the shell.
16489 \begin_layout Standard
16490 This also implies that you are restricted in what command strings you can
16491 use in the external material templates.
16492 In particular, pipes and redirection are not readily available.
16493 This has to be so if LyX should remain safe.
16494 If you want to use some of the shell features, you should write a safe
16495 script to do this in a controlled manner, and then invoke the script from
16496 the command string.
16500 \begin_layout Standard
16501 It is possible to design a template that interacts directly with the shell,
16502 but since this would allow a malicious user to execute arbitrary commands
16503 by writing clever filenames and/or parameters, we generally recommend that
16504 you only use safe scripts that work with the
16505 \begin_inset Flex CharStyle:Code
16508 \begin_layout Plain Layout
16514 system call in a controlled manner.
16515 Of course, for use in a controlled environment, it can be tempting to just
16516 fall back to use ordinary shell scripts.
16517 If you do so, be aware that you
16521 provide an easily exploitable security hole in your system.
16522 Of course it stands to reason that such unsafe templates will never be
16523 included in the standard LyX distribution, although we do encourage people
16524 to submit new templates in the open source tradition.
16525 But LyX as shipped from the official distribution channels will never have
16529 \begin_layout Standard
16530 Including external material provides a lot of power, and you have to be
16531 careful not to introduce security hazards with this power.
16532 A subtle error in a single line in an innocent looking script can open
16533 the door to huge security problems.
16534 So if you do not fully understand the issues, we recommend that you consult
16535 a knowledgeable security professional or the LyX development team if you
16536 have any questions about whether a given template is safe or not.
16537 And do this before you use it in an uncontrolled environment.