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 the User's Guide prints
10 % out as advertised. If you mess with this preamble,
11 % parts of the User's Guide 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}}
67 \font_typewriter default
68 \font_default_family default
76 \default_output_format default
80 \pdf_title "LyX Configuration Manual"
81 \pdf_author "LyX Team"
82 \pdf_subject "LyX-documentation Customization"
83 \pdf_keywords "LyX, documentation, customization"
85 \pdf_bookmarksnumbered true
86 \pdf_bookmarksopen true
87 \pdf_bookmarksopenlevel 1
92 \pdf_pdfusetitle false
93 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true,pdfstartview=XYZ, plainpages=false, pdfpagelabels"
101 \paperorientation portrait
102 \backgroundcolor #ffffff
109 \paragraph_separation indent
111 \quotes_language english
114 \paperpagestyle headings
115 \tracking_changes false
116 \output_changes false
127 Customizing LyX: Features for the Advanced User
135 \begin_layout Plain Layout
137 If you have comments or error corrections, please send them to the LyX Documenta
139 \begin_inset CommandInset href
141 target "lyx-docs@lists.lyx.org"
148 \begin_inset Quotes eld
152 \begin_inset Quotes erd
155 in the subject header, and please cc the current maintainer of this file,
156 Richard Heck <rgheck@comcast.net>.
162 \begin_inset Newline newline
166 \begin_inset Newline newline
172 \begin_layout Standard
173 \begin_inset CommandInset toc
174 LatexCommand tableofcontents
181 \begin_layout Standard
182 \begin_inset Note Note
185 \begin_layout Plain Layout
186 Please use change tracking when modifying this document.
187 This makes it easier for our translators to recognize things that have
188 been changed, and it helps the maintainer keep up-to-date with what's been
197 \begin_layout Chapter
201 \begin_layout Standard
202 This manual covers the customization features present in LyX.
203 In it, we discuss issues like keyboard shortcuts, screen previewing options,
204 printer options, sending commands to LyX via the LyX Server, internationalizati
205 on, installing new LaTeX classes and LyX layouts, etc.
206 We can't possibly hope to touch on everything you can change—our developers
207 add new features faster than we can document them—but we will explain the
208 most common customizations and hopefully point you in the right direction
209 for some of the more obscure ones.
212 \begin_layout Standard
213 \begin_inset Branch OutDated
216 \begin_layout Standard
217 Information from previous versions of this document that now seems to be
218 outdated is contained in the OutDated branch of this document.
219 By default, this information will not appear in the LaTeX output.
227 \begin_layout Chapter
228 LyX configuration files
231 \begin_layout Standard
232 This chapter aims to help you to find your way through the LyX configuration
234 Before continuing to read this chapter, you should find out where your
235 LyX library and user directories are by using
236 \begin_inset Flex CharStyle:MenuItem
239 \begin_layout Plain Layout
240 Help\SpecialChar \menuseparator
251 The library directory is the place where LyX places its system-wide configurati
252 on files; the user directory is where you can place your modified versions.
253 We will call the former
254 \begin_inset Flex CharStyle:Code
257 \begin_layout Plain Layout
264 \begin_inset Flex CharStyle:MenuItem
267 \begin_layout Plain Layout
273 in the remainder of this document.
277 \begin_layout Section
279 \begin_inset Flex CharStyle:Code
282 \begin_layout Plain Layout
291 \begin_layout Standard
292 \begin_inset Flex CharStyle:Code
295 \begin_layout Plain Layout
301 and its sub-directories contain a number of files and that can be used
302 to customize LyX's behavior.
303 You can change many of these files from within LyX itself through the
304 \begin_inset Flex CharStyle:MenuItem
307 \begin_layout Plain Layout
308 Tools\SpecialChar \menuseparator
315 Most customization that you will want to do in LyX is possible through
317 However, many other inner aspects of LyX can be customized by modifying
319 \begin_inset Flex CharStyle:Code
322 \begin_layout Plain Layout
329 These files fall in different categories, described in the following subsection
333 \begin_layout Subsection
334 Automatically generated files
337 \begin_layout Standard
338 The files, which are to be found in
339 \begin_inset Flex CharStyle:MenuItem
342 \begin_layout Plain Layout
348 , are generated when you configure LyX.
349 They contain various default values that are guessed by inspection.
350 In general, it is not a good idea to modify them, since they might be overwritt
354 \begin_layout Labeling
355 \labelwidthstring 00.00.0000
356 \begin_inset Flex CharStyle:Code
359 \begin_layout Plain Layout
365 contains defaults for various commands.
368 \begin_layout Labeling
369 \labelwidthstring 00.00.0000
370 \begin_inset Flex CharStyle:Code
373 \begin_layout Plain Layout
379 contains the list of packages that have been recognized by LyX.
380 It is currently unused by the LyX program itself, but the information extracted
381 , and more, is made available with
382 \begin_inset Flex CharStyle:MenuItem
385 \begin_layout Plain Layout
386 Help\SpecialChar \menuseparator
399 \begin_layout Labeling
400 \labelwidthstring 00.00.0000
401 \begin_inset Flex CharStyle:Code
404 \begin_layout Plain Layout
410 the list of text classes that have been found in your
411 \begin_inset Flex CharStyle:Code
414 \begin_layout Plain Layout
420 directories, along with the associated LaTeX document class and their descripti
424 \begin_layout Labeling
425 \labelwidthstring 00.00.0000
426 \begin_inset Flex CharStyle:Code
429 \begin_layout Plain Layout
435 the list of layout modules found in your
436 \begin_inset Flex CharStyle:Code
439 \begin_layout Plain Layout
448 \begin_layout Labeling
449 \labelwidthstring 00.00.0000
450 \begin_inset Flex CharStyle:Code
453 \begin_layout Plain Layout
459 lists of various sorts of LaTeX-related files found on your system
462 \begin_layout Labeling
463 \labelwidthstring 00.00.0000
464 \begin_inset Flex CharStyle:Code
467 \begin_layout Plain Layout
473 is automatically generated during configuration from the file
474 \begin_inset Flex CharStyle:Code
477 \begin_layout Plain Layout
484 It contains information on your LaTeX configuration.
487 \begin_layout Subsection
491 \begin_layout Standard
492 These directories are duplicated between
493 \begin_inset Flex CharStyle:Code
496 \begin_layout Plain Layout
503 \begin_inset Flex CharStyle:Code
506 \begin_layout Plain Layout
513 If a particular files exists in both places, the one in
514 \begin_inset Flex CharStyle:Code
517 \begin_layout Plain Layout
526 \begin_layout Labeling
527 \labelwidthstring 00.00.0000
528 \begin_inset Flex CharStyle:Code
531 \begin_layout Plain Layout
537 this directory contains files with the extension
538 \begin_inset Flex CharStyle:Code
541 \begin_layout Plain Layout
547 that define the keybindings used in LyX.
548 If there exists an internationalized version of the bind file named
549 \begin_inset Flex CharStyle:Code
552 \begin_layout Plain Layout
558 , that will be used first.
561 \begin_layout Labeling
562 \labelwidthstring 00.00.0000
563 \begin_inset Flex CharStyle:Code
566 \begin_layout Plain Layout
572 contains graphics files that can be included in documents.
576 \begin_layout Labeling
577 \labelwidthstring 00.00.0000
578 \begin_inset Flex CharStyle:Code
581 \begin_layout Plain Layout
587 contains LyX documentation files (including the one you are currently reading).
589 \begin_inset Flex CharStyle:Code
592 \begin_layout Plain Layout
598 deserves special attention, as noted above.
599 The internationalized help docs are in subdirectories
600 \begin_inset Flex CharStyle:Code
603 \begin_layout Plain Layout
610 \begin_inset Quotes eld
614 \begin_inset Quotes erd
617 is the ISO language code.
623 \begin_inset CommandInset ref
625 reference "cha:Internationalizing-LyX"
632 \begin_layout Labeling
633 \labelwidthstring 00.00.0000
634 \begin_inset Flex CharStyle:Code
637 \begin_layout Plain Layout
643 contains example files that explain how to use some features.
644 In the file browser, press the
645 \begin_inset Flex CharStyle:MenuItem
648 \begin_layout Plain Layout
657 \begin_layout Labeling
658 \labelwidthstring 00.00.0000
659 \begin_inset Flex CharStyle:Code
662 \begin_layout Plain Layout
668 contains image files that are used by the
669 \begin_inset Flex CharStyle:MenuItem
672 \begin_layout Plain Layout
679 In addition, it also contains the individual icons used in the toolbar
680 and the banners that can be shown when LyX is launched.
683 \begin_layout Labeling
684 \labelwidthstring 00.00.0000
685 \begin_inset Flex CharStyle:Code
688 \begin_layout Plain Layout
694 contains keyboard keymapping files.
700 \begin_inset CommandInset ref
702 reference "sec:keymap"
709 \begin_layout Labeling
710 \labelwidthstring 00.00.0000
711 \begin_inset Flex CharStyle:Code
714 \begin_layout Plain Layout
720 contains the text class and module files described in Chapter
725 \begin_inset CommandInset ref
727 reference "cha:Installing-New-Document"
734 \begin_layout Labeling
735 \labelwidthstring 00.00.0000
736 \begin_inset Flex CharStyle:Code
739 \begin_layout Plain Layout
746 \begin_inset Flex CharStyle:Code
749 \begin_layout Plain Layout
755 Python scripts used to convert between LyX versions.
756 These can be run from the command line if, say, you want to batch-convert
760 \begin_layout Labeling
761 \labelwidthstring 00.00.0000
762 \begin_inset Flex CharStyle:Code
765 \begin_layout Plain Layout
771 contains some files that demonstrate the capabilities of the
772 \begin_inset Flex CharStyle:MenuItem
775 \begin_layout Plain Layout
786 Also contains some scripts used by LyX itself.
789 \begin_layout Labeling
790 \labelwidthstring 00.00.0000
791 \begin_inset Flex CharStyle:Code
794 \begin_layout Plain Layout
800 contains the standard LyX template files described in Chapter
805 \begin_inset CommandInset ref
807 reference "sec:Creating-Templates"
814 \begin_layout Labeling
815 \labelwidthstring 00.00.0000
816 \begin_inset Flex CharStyle:Code
819 \begin_layout Plain Layout
825 contains files with the extension
826 \begin_inset Flex CharStyle:Code
829 \begin_layout Plain Layout
835 that define the user interface to LyX.
836 That is, the files define which items appear in which menus and the items
837 appearing on the toolbar.
840 \begin_layout Subsection
841 Files you don't want to modify
844 \begin_layout Standard
845 These files are used internally by LyX and you generally do not need to
846 modify them unless you are a developer.
849 \begin_layout Labeling
850 \labelwidthstring 00.00.0000
851 \begin_inset Flex CharStyle:Code
854 \begin_layout Plain Layout
860 this file contains the list of LyX developers.
861 The contents are displayed with the menu entry
862 \begin_inset Flex CharStyle:MenuItem
865 \begin_layout Plain Layout
866 Help\SpecialChar \menuseparator
879 \begin_layout Labeling
880 \labelwidthstring 00.00.0000
881 \begin_inset Flex CharStyle:Code
884 \begin_layout Plain Layout
890 this is a LaTeX script used during the configuration process.
894 \begin_layout Labeling
895 \labelwidthstring 00.00.0000
896 \begin_inset Flex CharStyle:Code
899 \begin_layout Plain Layout
905 this is the script that is used to re-configure LyX.
906 It creates configuration files in the directory it was run from.
909 \begin_layout Subsection
910 Other files needing a line or two...
913 \begin_layout Labeling
914 \labelwidthstring 00.00.0000
915 \begin_inset Flex CharStyle:Code
918 \begin_layout Plain Layout
924 this contains tables describing how different character encodings can be
928 \begin_layout Labeling
929 \labelwidthstring 00.00.0000
930 \begin_inset Flex CharStyle:Code
933 \begin_layout Plain Layout
939 this file contains the templates available to the new
940 \begin_inset Flex CharStyle:MenuItem
943 \begin_layout Plain Layout
956 \begin_layout Labeling
957 \labelwidthstring 00.00.0000
958 \begin_inset Flex CharStyle:Code
961 \begin_layout Plain Layout
967 this file contains a list of all the languages currently supported by LyX.
970 \begin_layout Section
971 Your local configuration directory
974 \begin_layout Standard
975 Even if you are using LyX as an unprivileged user, you might want to change
976 LyX configuration for your own use.
978 \begin_inset Flex CharStyle:Code
981 \begin_layout Plain Layout
987 directory contains all your personal configuration files.
988 This is the directory described as
989 \begin_inset Quotes eld
993 \begin_inset Quotes erd
997 \begin_inset Flex CharStyle:MenuItem
1000 \begin_layout Plain Layout
1001 Help\SpecialChar \menuseparator
1003 \begin_inset space ~
1012 This directory is used as a mirror of
1013 \begin_inset Flex CharStyle:Code
1016 \begin_layout Plain Layout
1022 , which means that every file in
1023 \begin_inset Flex CharStyle:Code
1026 \begin_layout Plain Layout
1032 is a replacement for the corresponding file in
1033 \begin_inset Flex CharStyle:Code
1036 \begin_layout Plain Layout
1043 Any configuration file described in the above sections can be placed either
1044 in the system-wide directory, in which case it will affect all users, or
1045 in your local directory for your own use.
1048 \begin_layout Standard
1049 To make things clearer, let's provide a few examples:
1052 \begin_layout Itemize
1053 The preferences set in the
1054 \begin_inset Flex CharStyle:MenuItem
1057 \begin_layout Plain Layout
1058 Tools\SpecialChar \menuseparator
1064 dialog are saved to a file
1065 \begin_inset Flex CharStyle:Code
1068 \begin_layout Plain Layout
1075 \begin_inset Flex CharStyle:Code
1078 \begin_layout Plain Layout
1087 \begin_layout Itemize
1088 When you reconfigure using
1089 \begin_inset Flex CharStyle:MenuItem
1092 \begin_layout Plain Layout
1093 Tools\SpecialChar \menuseparator
1100 \begin_inset Flex CharStyle:Code
1103 \begin_layout Plain Layout
1109 script, and the resulting files are written in your local configuration
1111 This means that any additional text class file that you might have added
1113 \begin_inset Flex CharStyle:Code
1116 \begin_layout Plain Layout
1122 will be added to the list of classes in the
1123 \begin_inset Flex CharStyle:MenuItem
1126 \begin_layout Plain Layout
1127 Document\SpecialChar \menuseparator
1136 \begin_layout Itemize
1137 If you get some updated documentation from LyX ftp site and cannot install
1138 it because you do not have sysadmin rights on your system, you can just
1140 \begin_inset Flex CharStyle:Code
1143 \begin_layout Plain Layout
1149 and the items in the
1150 \begin_inset Flex CharStyle:MenuItem
1153 \begin_layout Plain Layout
1159 menu will open them!
1162 \begin_layout Section
1163 Running LyX with multiple configurations
1166 \begin_layout Standard
1167 The configuration freedom of the local configuration directory may not suffice
1168 if you want to have more than one configuration at your disposal.
1169 For example, you may want to be use different key bindings or printer settings
1171 You can achieve this by having several such directories.
1172 You then specify which directory to use at run-time.
1175 \begin_layout Standard
1176 Invoking LyX with the command line switch
1177 \begin_inset Flex CharStyle:Code
1180 \begin_layout Plain Layout
1190 instructs the program to read the configuration from that directory, and
1191 not from the default directory.
1192 (You can determine the default directory by running LyX without the
1193 \begin_inset Flex CharStyle:Code
1196 \begin_layout Plain Layout
1202 switch.) If the specified directory does not exist, LyX offers to create
1203 it for you, just like it does for the default directory on the first time
1204 you run the program.
1205 You can modify the configuration options in this additional user directory
1206 exactly as you would for the default directory.
1207 These directories are completely independent (but read on).
1208 Note that setting the environment variable
1209 \begin_inset Flex CharStyle:Code
1212 \begin_layout Plain Layout
1218 to some value has exactly the same effect.
1221 \begin_layout Standard
1222 Having several configurations also requires more maintenance: if you want
1223 to add a new layout to
1224 \begin_inset Flex CharStyle:Code
1227 \begin_layout Plain Layout
1233 which you want available from all your configurations, you must add it
1234 to each directory separately.
1235 You can avoid this with the following trick: after LyX creates the additional
1236 directory, most of the subdirectories (see above) are empty.
1237 If you want the new configuration to mirror an existing one, replace the
1238 empty subdirectory with a symbolic link to the matching subdirectory in
1239 the existing configuration.
1241 \begin_inset Flex CharStyle:Code
1244 \begin_layout Plain Layout
1250 subdirectory, however, since it contains a file written by the configuration
1251 script (also accessible through
1252 \begin_inset Flex CharStyle:MenuItem
1255 \begin_layout Plain Layout
1256 Tools\SpecialChar \menuseparator
1262 ) which is configuration-specific.
1265 \begin_layout Chapter
1266 The Preferences dialog
1269 \begin_layout Standard
1270 All options of the preferences dialog are described in the Appendix
1272 The Preferences Dialog
1279 For some options you might find here more details.
1282 \begin_layout Section
1284 \begin_inset CommandInset label
1293 \begin_layout Standard
1294 The first step is to define your file formats if they are not already defined.
1296 \begin_inset Flex CharStyle:MenuItem
1299 \begin_layout Plain Layout
1300 Tools\SpecialChar \menuseparator
1308 \begin_inset Flex CharStyle:MenuItem
1311 \begin_layout Plain Layout
1312 File Handling\SpecialChar \menuseparator
1319 \begin_inset Flex CharStyle:MenuItem
1322 \begin_layout Plain Layout
1323 New\SpecialChar \ldots{}
1329 button to define your new format.
1331 \begin_inset Flex CharStyle:MenuItem
1334 \begin_layout Plain Layout
1340 field contains the named used to identify the format in the GUI.
1342 \begin_inset Flex CharStyle:MenuItem
1345 \begin_layout Plain Layout
1351 is used to identify the format internally.
1352 You will also need to enter a file extension.
1353 These are all required.
1355 \begin_inset Flex CharStyle:MenuItem
1358 \begin_layout Plain Layout
1364 field is used to provide a keyboard shortcut on the menus.
1365 (For example, pressing
1366 \begin_inset Flex CharStyle:MenuItem
1369 \begin_layout Plain Layout
1376 \begin_inset Flex CharStyle:MenuItem
1379 \begin_layout Plain Layout
1380 View\SpecialChar \menuseparator
1389 \begin_layout Standard
1391 \begin_inset Flex CharStyle:MenuItem
1394 \begin_layout Plain Layout
1401 \begin_inset Flex CharStyle:MenuItem
1404 \begin_layout Plain Layout
1411 For example, you might want to use
1412 \begin_inset Flex CharStyle:MenuItem
1415 \begin_layout Plain Layout
1421 to view PostScript files.
1422 You can enter the command needed to start the program in the corresponding
1424 In defining this command, you can use the four variables listed in the
1426 The viewer is launched when you view an image in LyX or use the
1427 \begin_inset Flex CharStyle:MenuItem
1430 \begin_layout Plain Layout
1437 The editor is for example launched when you press the
1438 \begin_inset Flex CharStyle:MenuItem
1441 \begin_layout Plain Layout
1448 \begin_inset Flex CharStyle:MenuItem
1451 \begin_layout Plain Layout
1458 \begin_inset Flex CharStyle:MenuItem
1461 \begin_layout Plain Layout
1470 \begin_layout Standard
1472 \begin_inset Flex CharStyle:MenuItem
1475 \begin_layout Plain Layout
1481 option tells LyX that a format is suitable for document export.
1482 If this is is set and if a suitable conversion route exists (see sec.
1483 \begin_inset space \thinspace{}
1487 \begin_inset CommandInset ref
1489 reference "sec:Converters"
1493 ), the format will appear in the
1494 \begin_inset Flex CharStyle:MenuItem
1497 \begin_layout Plain Layout
1498 File\SpecialChar \menuseparator
1505 The format will also appear in the
1506 \begin_inset Flex CharStyle:MenuItem
1509 \begin_layout Plain Layout
1515 menu if a viewer is specified for the format.
1516 Pure image formats, such as
1517 \begin_inset Flex CharStyle:Code
1520 \begin_layout Plain Layout
1526 , should not use this option.
1527 Formats that can both represent vector graphics and documents like
1528 \begin_inset Flex CharStyle:Code
1531 \begin_layout Plain Layout
1540 \begin_layout Standard
1542 \begin_inset Flex CharStyle:MenuItem
1545 \begin_layout Plain Layout
1546 Vector graphics format
1551 tells LyX that a format can contain vector graphics.
1552 This information is used to determine the target format of included graphics
1554 \begin_inset Flex CharStyle:MenuItem
1557 \begin_layout Plain Layout
1564 Included graphics may need to be converted to either
1565 \begin_inset Flex CharStyle:MenuItem
1568 \begin_layout Plain Layout
1575 \begin_inset Flex CharStyle:MenuItem
1578 \begin_layout Plain Layout
1585 \begin_inset Flex CharStyle:MenuItem
1588 \begin_layout Plain Layout
1595 \begin_inset Flex CharStyle:MenuItem
1598 \begin_layout Plain Layout
1604 cannot handle other image formats.
1605 If an included graphic is not already in
1606 \begin_inset Flex CharStyle:MenuItem
1609 \begin_layout Plain Layout
1616 \begin_inset Flex CharStyle:MenuItem
1619 \begin_layout Plain Layout
1626 \begin_inset Flex CharStyle:MenuItem
1629 \begin_layout Plain Layout
1635 format, it is converted to
1636 \begin_inset Flex CharStyle:MenuItem
1639 \begin_layout Plain Layout
1645 if the vector format option is set, and otherwise to
1646 \begin_inset Flex CharStyle:MenuItem
1649 \begin_layout Plain Layout
1658 \begin_layout Section
1662 \begin_layout Standard
1663 Since all conversions from one format to another take place in LyX's temporary
1664 directory, it is sometimes necessary to modify a file before copying it
1665 to the temporary directory in order that the conversion may be performed.
1669 \begin_layout Plain Layout
1670 For example, the file may refer to other files—images, for example—using
1671 relative file names, and these may become invalid when the file is copied
1672 to the temporary directory.
1677 This is done by a Copier: It copies a file to (or from) the temporary directory
1678 and may modify it in the process.
1681 \begin_layout Standard
1682 The definitions of the copiers may use four variables:
1685 \begin_layout Labeling
1686 \labelwidthstring 00.00.0000
1687 \begin_inset Flex CharStyle:Code
1690 \begin_layout Plain Layout
1696 The LyX system directory (e.
1697 \begin_inset space \thinspace{}
1701 \begin_inset space \space{}
1705 \begin_inset Flex CharStyle:MenuItem
1708 \begin_layout Plain Layout
1717 \begin_layout Labeling
1718 \labelwidthstring 00.00.0000
1719 \begin_inset Flex CharStyle:Code
1722 \begin_layout Plain Layout
1731 \begin_layout Labeling
1732 \labelwidthstring 00.00.0000
1733 \begin_inset Flex CharStyle:Code
1736 \begin_layout Plain Layout
1745 \begin_layout Labeling
1746 \labelwidthstring 00.00.0000
1747 \begin_inset Flex CharStyle:Code
1750 \begin_layout Plain Layout
1759 \begin_layout Standard
1760 The latter should be the filename as it would be used in a LaTeX's
1767 It is relevant only when exporting files suitable for such inclusion.
1770 \begin_layout Standard
1771 Copiers can be used to do almost anything with output files.
1772 For example, suppose you want generated pdf files to be copied to a special
1774 \begin_inset Flex CharStyle:Code
1777 \begin_layout Plain Layout
1784 Then you could write a shell script such as this one:
1787 \begin_layout Standard
1788 \begin_inset listings
1792 \begin_layout Plain Layout
1797 \begin_layout Plain Layout
1802 \begin_layout Plain Layout
1804 TOFILE=`basename $2`
1807 \begin_layout Plain Layout
1809 cp $FROMFILE /home/you/pdf/$TOFILE
1814 Save that in your local LyX directory—say,
1815 \begin_inset Flex CharStyle:Code
1818 \begin_layout Plain Layout
1819 /home/you/.lyx/scripts/pdfcopier.sh
1824 —and make it executable, if you need to do so on your platform.
1826 \begin_inset Flex CharStyle:MenuItem
1829 \begin_layout Plain Layout
1830 Tools\SpecialChar \menuseparator
1836 dialog, select under
1837 \begin_inset Flex CharStyle:MenuItem
1840 \begin_layout Plain Layout
1841 File Handling\SpecialChar \menuseparator
1848 \begin_inset Flex CharStyle:MenuItem
1851 \begin_layout Plain Layout
1857 format—or one of the other pdf formats—and enter
1858 \begin_inset Flex CharStyle:Code
1861 \begin_layout Plain Layout
1862 pdfcopier.sh $$i $$o
1868 \begin_inset Flex CharStyle:MenuItem
1871 \begin_layout Plain Layout
1881 \begin_layout Standard
1882 Copiers are used by LyX in various of its own conversions.
1883 For example, if appropriate programs are found, LyX will automatically
1884 install copiers for the
1885 \begin_inset Flex CharStyle:MenuItem
1888 \begin_layout Plain Layout
1895 \begin_inset Flex CharStyle:MenuItem
1898 \begin_layout Plain Layout
1900 \begin_inset space ~
1909 When these formats are exported, the copier sees that not just the main
1910 HTML file but various associated files (style files, images, etc.) are also
1912 All these files are written to a subdirectory of the directory in which
1913 the original LyX file was found.
1917 \begin_layout Plain Layout
1918 This copier can be customized.
1920 \begin_inset Quotes eld
1924 \begin_inset Quotes erd
1927 argument takes a comma-separated list of extensions to be copied; if it
1928 is omitted, all files will be copied.
1930 \begin_inset Quotes eld
1934 \begin_inset Quotes erd
1937 argument determines the extension added to the generated directory.
1939 \begin_inset Quotes eld
1943 \begin_inset Flex CharStyle:MenuItem
1946 \begin_layout Plain Layout
1953 \begin_inset Quotes erd
1956 , so HTML generated from
1957 \begin_inset Flex CharStyle:MenuItem
1960 \begin_layout Plain Layout
1961 /path/to/filename.lyx
1967 \begin_inset Flex CharStyle:MenuItem
1970 \begin_layout Plain Layout
1971 /path/to/filename.html.LyXconv
1985 \begin_layout Section
1987 \begin_inset CommandInset label
1989 name "sec:Converters"
1996 \begin_layout Standard
1997 You can define your own Converters to convert files between different formats.
1999 \begin_inset Flex CharStyle:MenuItem
2002 \begin_layout Plain Layout
2003 Tools\SpecialChar \menuseparator
2004 Preferences\SpecialChar \menuseparator
2005 File Handling\SpecialChar \menuseparator
2014 \begin_layout Standard
2015 To define a new converter, select the
2016 \begin_inset Flex CharStyle:MenuItem
2019 \begin_layout Plain Layout
2021 \begin_inset space ~
2030 \begin_inset Flex CharStyle:MenuItem
2033 \begin_layout Plain Layout
2035 \begin_inset space ~
2043 from the drop-down lists, enter the command needed for the conversion,
2045 \begin_inset Flex CharStyle:MenuItem
2048 \begin_layout Plain Layout
2055 Several variables can be used in the definition of converters:
2058 \begin_layout Labeling
2059 \labelwidthstring 00.00.0000
2060 \begin_inset Flex CharStyle:Code
2063 \begin_layout Plain Layout
2069 The LyX system directory
2072 \begin_layout Labeling
2073 \labelwidthstring 00.00.0000
2074 \begin_inset Flex CharStyle:Code
2077 \begin_layout Plain Layout
2086 \begin_layout Labeling
2087 \labelwidthstring 00.00.0000
2088 \begin_inset Flex CharStyle:Code
2091 \begin_layout Plain Layout
2100 \begin_layout Labeling
2101 \labelwidthstring 00.00.0000
2102 \begin_inset Flex CharStyle:Code
2105 \begin_layout Plain Layout
2111 The base filename of the input file (i.
2112 \begin_inset space \thinspace{}
2115 g., without the extension)
2118 \begin_layout Labeling
2119 \labelwidthstring 00.00.0000
2120 \begin_inset Flex CharStyle:Code
2123 \begin_layout Plain Layout
2129 The path to the input file
2132 \begin_layout Labeling
2133 \labelwidthstring 00.00.0000
2134 \begin_inset Flex CharStyle:Code
2137 \begin_layout Plain Layout
2143 The path to the original input file (this is different from $$p when chain
2144 of converters is called).
2147 \begin_layout Standard
2149 \begin_inset Flex CharStyle:MenuItem
2152 \begin_layout Plain Layout
2154 \begin_inset space ~
2162 field you can enter the following flags, separated by commas:
2165 \begin_layout Labeling
2166 \labelwidthstring 00.00.0000
2167 \begin_inset Flex CharStyle:Code
2170 \begin_layout Plain Layout
2176 This converter runs some form of LaTeX.
2177 This will make LyX's LaTeX error logs available.
2180 \begin_layout Labeling
2181 \labelwidthstring 00.00.0000
2182 \begin_inset Flex CharStyle:Code
2185 \begin_layout Plain Layout
2192 \begin_inset Flex CharStyle:MenuItem
2195 \begin_layout Plain Layout
2201 file for the conversion.
2204 \begin_layout Labeling
2205 \labelwidthstring 00.00.0000
2206 \begin_inset Flex CharStyle:Code
2209 \begin_layout Plain Layout
2218 \begin_layout Standard
2219 The following three flags are not really flags at all because they take
2221 \begin_inset Flex CharStyle:MenuItem
2224 \begin_layout Plain Layout
2226 \begin_inset space ~
2230 \begin_inset space ~
2241 \begin_layout Labeling
2242 \labelwidthstring 00.00.0000
2243 \begin_inset Flex CharStyle:Code
2246 \begin_layout Plain Layout
2252 If set, the converter's standard error will be redirected to a file
2253 \begin_inset Flex CharStyle:Code
2256 \begin_layout Plain Layout
2262 , and the script given as argument will be run as:
2263 \begin_inset Flex CharStyle:Code
2266 \begin_layout Plain Layout
2267 script <infile.out >infile.log
2273 The argument may contain
2274 \begin_inset Flex CharStyle:Code
2277 \begin_layout Plain Layout
2286 \begin_layout Labeling
2287 \labelwidthstring 00.00.0000
2288 \begin_inset Flex CharStyle:Code
2291 \begin_layout Plain Layout
2297 The name of the directory in which the converter will dump the generated
2299 LyX will not create this directory, and it does not copy anything into
2300 it, though it will copy this directory to the destination.
2301 The argument may contain
2302 \begin_inset Flex CharStyle:Code
2305 \begin_layout Plain Layout
2311 , which will be replaced by the base name of the input and output files,
2312 respectively, when the directory is copied.
2313 \begin_inset Newline newline
2316 Note that resultdir and usetempdir make no sense together.
2317 The latter will be ignored if the former is given.
2320 \begin_layout Labeling
2321 \labelwidthstring 00.00.0000
2322 \begin_inset Flex CharStyle:Code
2325 \begin_layout Plain Layout
2331 Determines the output file name and may, contain
2332 \begin_inset Flex CharStyle:Code
2335 \begin_layout Plain Layout
2342 Sensible only with resultdir and optional even then; if not given, it defaults
2346 \begin_layout Standard
2347 None of these last three are presently used in any of the converters that
2348 are installed with LyX.
2352 \begin_layout Standard
2353 You do not have to define converters between all the formats between which
2354 you want to convert.
2355 For example, you will note that there is no `LyX to PostScript' converter,
2356 but LyX will export PostScript.
2357 It does so by first creating a LaTeX file (no converter needs to be defined
2358 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2359 and finally converting the resulting DVI file to PostScript.
2360 LyX finds such `chains' of converters automatically, and it will always
2361 choose the shortest possible chain.
2362 You can, though, still define multiple conversion methods between file
2364 For example, the standard LyX configuration provides three ways to convert
2365 LaTeX to PDF: Directly, using
2366 \begin_inset Flex CharStyle:MenuItem
2369 \begin_layout Plain Layout
2375 ; via (DVI and) PostScript, using
2376 \begin_inset Flex CharStyle:MenuItem
2379 \begin_layout Plain Layout
2386 \begin_inset Flex CharStyle:MenuItem
2389 \begin_layout Plain Layout
2396 To define such alternate chains, you must define multiple target `file
2397 formats', as described in section
2398 \begin_inset CommandInset ref
2400 reference "sec:Formats"
2405 For example, in the standard configuration, the formats named
2406 \begin_inset Flex CharStyle:MenuItem
2409 \begin_layout Plain Layout
2416 \begin_inset Flex CharStyle:MenuItem
2419 \begin_layout Plain Layout
2426 \begin_inset Flex CharStyle:MenuItem
2429 \begin_layout Plain Layout
2435 are defined, all of which share the extension
2436 \begin_inset Flex CharStyle:MenuItem
2439 \begin_layout Plain Layout
2445 , and which correspond to the conversion methods just mentioned.
2448 \begin_layout Chapter
2449 Internationalizing LyX
2450 \begin_inset CommandInset label
2452 name "cha:Internationalizing-LyX"
2459 \begin_layout Standard
2460 LyX supports using a translated interface.
2461 Last time we checked, LyX provided text in thirty languages.
2462 The language of choice is called your
2467 (For further reading on locale settings, see also the documentation for
2468 locale that comes with your operating system.
2469 For Linux, the manual page for
2470 \begin_inset Flex CharStyle:Code
2473 \begin_layout Plain Layout
2479 could be a good place to start).
2482 \begin_layout Standard
2483 Notice that these translations will work, but do contain a few flaws.
2484 In particular, all dialogs have been designed with the English text in
2485 mind, which means that some of the translated text will be too large to
2486 fit within the space allocated.
2487 This is only a display problem and will not cause any harm.
2488 Also, you will find that some of the translations do not define shortcut
2489 keys for everything.
2490 Sometimes, there are simply not enough free letters to do it.
2491 Other times, the translator just hasn't got around to doing it yet.
2492 Our localization team, which you may wish to join,
2496 \begin_layout Plain Layout
2497 If you are a fluent speaker of a language other than English, joining these
2498 teams is a great way to give back to the LyX community!
2503 will of course try to fix these shortcomings in future versions of LyX.
2506 \begin_layout Section
2510 \begin_layout Subsection
2511 Translating the graphical user interface (text messages).
2514 \begin_layout Standard
2516 \begin_inset Flex CharStyle:Code
2519 \begin_layout Plain Layout
2525 library to handle the internationalization of the interface.
2526 To have LyX speak your favorite language in all menus and dialogs, you
2528 \begin_inset Flex CharStyle:Code
2531 \begin_layout Plain Layout
2537 -file for that language.
2538 When this is available, you'll have to generate a
2539 \begin_inset Flex CharStyle:Code
2542 \begin_layout Plain Layout
2548 -file from it and install the
2549 \begin_inset Flex CharStyle:Code
2552 \begin_layout Plain Layout
2559 The process of doing all of this is explained in the documentation for
2561 \begin_inset Flex CharStyle:Code
2564 \begin_layout Plain Layout
2571 It is possible to do this just for yourself, but if you're going to do
2572 it, you might as well share the results of your labors with the rest of
2574 Send a message to the LyX developers' list for more information about how
2578 \begin_layout Standard
2579 In short, this is what you should do (xx denotes the language code):
2582 \begin_layout Itemize
2583 Check out the LyX source code.
2585 \begin_inset CommandInset href
2587 name "information on the web"
2588 target "http://www.lyx.org/devel/cvs.php"
2595 \begin_layout Itemize
2597 \begin_inset Flex CharStyle:Code
2600 \begin_layout Plain Layout
2606 to the folder of the
2607 \begin_inset Flex CharStyle:Code
2610 \begin_layout Plain Layout
2618 \begin_inset Flex CharStyle:Code
2621 \begin_layout Plain Layout
2629 \begin_inset Flex CharStyle:Code
2632 \begin_layout Plain Layout
2638 doesn't exist anywhere, it can be remade with the console command
2639 \begin_inset Flex CharStyle:Code
2642 \begin_layout Plain Layout
2648 in that directory, or you can use an existing po-file for some other language
2652 \begin_layout Itemize
2654 \begin_inset Flex CharStyle:Code
2657 \begin_layout Plain Layout
2667 \begin_layout Plain Layout
2668 This is just a text file, so it can be edited in any text editor.
2669 But there are also specialized programs that support such editing, such
2674 (for all platforms) or
2683 contains a `mode' for editing
2684 \begin_inset Flex CharStyle:Code
2687 \begin_layout Plain Layout
2698 For some menu- and widget-labels, there are also shortcut keys that should
2700 Those keys are marked after a `|', and should be translated according to
2701 the words and phrases of the language.
2702 You should also fill also out the information at the beginning of the new
2704 \begin_inset Flex CharStyle:Code
2707 \begin_layout Plain Layout
2713 -file with your email-address, etc., so people know where to reach you with
2714 suggestions and entertaining flames.
2717 \begin_layout Standard
2718 If you are just doing this on your own, then:
2721 \begin_layout Itemize
2723 \begin_inset Flex CharStyle:Code
2726 \begin_layout Plain Layout
2733 This can be done with
2734 \begin_inset Flex CharStyle:Code
2737 \begin_layout Plain Layout
2738 msgfmt -o xx.mo < xx.po
2746 \begin_layout Itemize
2748 \begin_inset Flex CharStyle:Code
2751 \begin_layout Plain Layout
2757 -file to your locale-tree, at the correct directory for application messages
2762 xx, and under the name
2763 \begin_inset Flex CharStyle:Code
2766 \begin_layout Plain Layout
2773 \begin_inset space \thinspace{}
2777 \begin_inset space \space{}
2781 \begin_inset Flex CharStyle:Code
2784 \begin_layout Plain Layout
2785 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2795 \begin_layout Standard
2796 As said, however, it would be best if the new
2797 \begin_inset Flex CharStyle:Code
2800 \begin_layout Plain Layout
2806 -file could be added to the LyX distribution, so others can use it.
2807 Adding it involves making additional changes to LyX.
2808 So send an email to the developers' mailing list if you're interested in
2812 \begin_layout Subsubsection
2816 \begin_layout Standard
2817 Sometimes it turns out that one English message needs to be translated into
2818 different messages in the target language.
2819 One example is the message
2820 \begin_inset Flex CharStyle:Code
2823 \begin_layout Plain Layout
2829 which has the German translation
2837 , depending upon exactly what the English
2838 \begin_inset Quotes eld
2842 \begin_inset Quotes erd
2847 \begin_inset Flex CharStyle:Code
2850 \begin_layout Plain Layout
2856 does not handle such ambiguous translations.
2857 Therefore you have to add some context information to the message: Instead
2859 \begin_inset Flex CharStyle:Code
2862 \begin_layout Plain Layout
2869 \begin_inset Flex CharStyle:Code
2872 \begin_layout Plain Layout
2873 To[[as in 'From format x to format y']]
2879 \begin_inset Flex CharStyle:Code
2882 \begin_layout Plain Layout
2883 To[[as in 'From page x to page y']].
2888 Now the two occurrences of
2889 \begin_inset Flex CharStyle:Code
2892 \begin_layout Plain Layout
2899 \begin_inset Flex CharStyle:Code
2902 \begin_layout Plain Layout
2908 and can be translated correctly to
2919 \begin_layout Standard
2920 Of course the context information needs to be stripped off the original
2921 message when no translation is used.
2922 Therefore you have to put it in double square brackets at the end of the
2923 message (see the example above).
2924 The translation mechanism of LyX ensures that everything in double square
2925 brackets at the end of messages is removed before displaying the message.
2928 \begin_layout Subsection
2929 Translating the documentation.
2932 \begin_layout Standard
2933 The online documentation (in the
2934 \begin_inset Flex CharStyle:MenuItem
2937 \begin_layout Plain Layout
2943 -menu) can (and should!) be translated.
2944 If there are translated versions of the documentation available
2948 \begin_layout Plain Layout
2949 As of March 2008, at least some of the documents have been translated into
2950 fourteen languages, with the Tutorial available in a few more.
2955 and the locale is set accordingly, these will be used automagically by
2957 LyX looks for translated versions as
2958 \begin_inset Flex CharStyle:Code
2961 \begin_layout Plain Layout
2962 LyXDir/doc/xx/DocName.lyx
2968 \begin_inset Flex CharStyle:Code
2971 \begin_layout Plain Layout
2977 is the code for the language currently in use.
2978 If there are no translated documents, the default English versions will
2980 Note that the translated versions must have the same filenames (
2981 \begin_inset Flex CharStyle:Code
2984 \begin_layout Plain Layout
2990 above) as the original.
2991 If you feel up to translating the documentation (an excellent way to proof-read
2992 the original documentation by the way!), there are a few things you should
2996 \begin_layout Itemize
2998 \begin_inset Flex CharStyle:Code
3001 \begin_layout Plain Layout
3007 , the guide to writing LyX documentation.
3008 Pay special attention to the translator's section.
3011 \begin_layout Itemize
3012 Check out the documentation translation web page at
3013 \begin_inset CommandInset href
3015 name "http://www.lyx.org/Translation"
3016 target "http://www.lyx.org/Translation"
3021 That way, you can find out which (if any) documents have already been translate
3022 d into your language.
3023 You can also find out who (if anyone) is organizing the effort to translate
3024 the documentation into your language.
3025 If no one is organizing the effort, please let us know that you're interested.
3028 \begin_layout Standard
3029 Once you get to actually translating, here's a few hints for you that may
3033 \begin_layout Itemize
3034 Join the documentation team! There is information on how to do that in
3035 \begin_inset Flex CharStyle:Code
3038 \begin_layout Plain Layout
3045 \begin_inset Flex CharStyle:MenuItem
3048 \begin_layout Plain Layout
3049 Help\SpecialChar \menuseparator
3059 ), which by the way is the first document you should translate.
3062 \begin_layout Itemize
3063 Learn the typographic conventions for the language you are translating to.
3064 Typography is an ancient art and over the centuries, a great variety of
3065 conventions have developed throughout different parts of the world.
3066 Also study the professional terminology amongst typographers in your country.
3067 Inventing your own terminology will only confuse the users.
3070 (Warning! Typography is addictive!)
3073 \begin_layout Itemize
3074 Make a copy of the document.
3075 This will be your working copy.
3076 You can use this as your personal translated help-file by placing it in
3078 \begin_inset Flex CharStyle:Code
3081 \begin_layout Plain Layout
3090 \begin_layout Itemize
3091 Sometimes the original document (from the LyX-team) will be updated.
3092 Use the source viewer at
3093 \begin_inset CommandInset href
3095 name "http://www.lyx.org/trac/timeline"
3096 target "http://www.lyx.org/trac/timeline"
3100 to see what has been changed.
3101 That way you can easily see which parts of the translated document need
3105 \begin_layout Standard
3106 If you ever find an error in the original document, fix it and notify the
3107 rest of the documentation team of the changes! (You didn't forget to join
3108 the documentation team, did you?)
3111 \begin_layout Standard
3112 \begin_inset Branch OutDated
3115 \begin_layout Section
3116 International Keyboard Support
3119 \begin_layout Standard
3122 [Editor's Note: The following section is by
3130 It needs to be fixed to conform to the new Documentation Style sheet and
3131 to make use of the new v1.0 features.
3132 The whole thing also needs to be merged with the section following it.-jw
3133 It may also be badly out of date.-rh (2008)]
3136 \begin_layout Subsection
3137 Defining Own Keymaps: Keymap File Format
3140 \begin_layout Standard
3141 Let's look at a keyboard definition file a little closer.
3142 It is a plain text file defining
3145 \begin_layout Itemize
3146 key-to-key or key-to-string translations
3149 \begin_layout Itemize
3153 \begin_layout Itemize
3154 dead keys exceptions
3157 \begin_layout Standard
3158 To define key-to-key or key-to-string translation, use this command:
3161 \begin_layout Quotation
3162 \begin_inset Flex CharStyle:Code
3165 \begin_layout Plain Layout
3174 \begin_inset Flex CharStyle:Code
3177 \begin_layout Plain Layout
3186 \begin_layout Standard
3188 \begin_inset Flex CharStyle:Code
3191 \begin_layout Plain Layout
3197 is the key to be translated and
3198 \begin_inset Flex CharStyle:Code
3201 \begin_layout Plain Layout
3207 is the string to be inserted into the document.
3208 To define dead keys, use:
3211 \begin_layout Quotation
3212 \begin_inset Flex CharStyle:Code
3215 \begin_layout Plain Layout
3224 \begin_inset Flex CharStyle:Code
3227 \begin_layout Plain Layout
3236 \begin_layout Standard
3238 \begin_inset Flex CharStyle:Code
3241 \begin_layout Plain Layout
3247 is a keyboard key and
3248 \begin_inset Flex CharStyle:Code
3251 \begin_layout Plain Layout
3258 The following dead keys are supported (shortcut name is in parentheses):
3261 \begin_layout Quotation
3265 \begin_inset space \hfill{}
3271 \begin_layout Quotation
3273 \begin_inset space \hfill{}
3279 \begin_layout Quotation
3281 \begin_inset space \hfill{}
3287 \begin_layout Quotation
3289 \begin_inset space \hfill{}
3295 \begin_layout Quotation
3297 \begin_inset space \hfill{}
3303 \begin_layout Quotation
3305 \begin_inset space \hfill{}
3312 \begin_layout Plain Layout
3324 \begin_layout Quotation
3326 \begin_inset space \hfill{}
3332 \begin_layout Quotation
3334 \begin_inset space \hfill{}
3341 \begin_layout Plain Layout
3353 \begin_layout Quotation
3355 \begin_inset space \hfill{}
3361 \begin_layout Quotation
3363 \begin_inset space \hfill{}
3369 \begin_layout Quotation
3371 \begin_inset space \hfill{}
3378 \begin_layout Plain Layout
3390 \begin_layout Quotation
3392 \begin_inset space \hfill{}
3399 \begin_layout Plain Layout
3411 \begin_layout Quotation
3413 \begin_inset space \hfill{}
3419 \begin_layout Quotation
3420 hungarian umlaut (hug)
3421 \begin_inset space \hfill{}
3427 \begin_layout Quotation
3429 \begin_inset space \hfill{}
3435 \begin_layout Quotation
3437 \begin_inset space \hfill{}
3444 \begin_layout Plain Layout
3456 \begin_layout Standard
3457 Since in many international keyboards there are exceptions to what some
3458 dead keys should do, you can define them using
3461 \begin_layout Quotation
3462 \begin_inset Flex CharStyle:Code
3465 \begin_layout Plain Layout
3473 deadkey key outstring
3476 \begin_layout Standard
3477 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3481 \begin_layout Quotation
3482 \begin_inset Flex CharStyle:Code
3485 \begin_layout Plain Layout
3498 \begin_layout Standard
3499 to make it work correctly.
3500 Also, you have to define as exceptions dead keys over i and j, to remove
3501 the dot from them before inserting an accent mark.
3502 I will change this when the time comes, but so far I haven't had time.
3505 \begin_layout Standard
3506 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3509 \begin_inset Flex CharStyle:Code
3512 \begin_layout Plain Layout
3518 have different meaning.
3520 \begin_inset Flex CharStyle:Code
3523 \begin_layout Plain Layout
3529 marks comments, quotes start and end LaTeX-style commands.
3530 To enter quote, you'll need to use
3531 \begin_inset Flex CharStyle:Code
3534 \begin_layout Plain Layout
3543 \begin_inset Flex CharStyle:Code
3546 \begin_layout Plain Layout
3553 \begin_inset Flex CharStyle:Code
3556 \begin_layout Plain Layout
3567 \begin_layout Standard
3568 If you make a keyboard description file that works for your language, please
3569 mail it to me, so I can include it in the next keymap distribution.
3572 \begin_layout Standard
3573 More keywords will be supported in keymap configuration file in future,
3577 \begin_layout Itemize
3578 \begin_inset Flex CharStyle:Code
3581 \begin_layout Plain Layout
3592 \begin_inset space \hfill{}
3596 \begin_inset Flex CharStyle:Code
3599 \begin_layout Plain Layout
3608 \begin_layout Itemize
3609 \begin_inset Flex CharStyle:Code
3612 \begin_layout Plain Layout
3623 \begin_inset space \hfill{}
3627 \begin_inset Flex CharStyle:Code
3630 \begin_layout Plain Layout
3636 an external keymap translation program
3639 \begin_layout Standard
3640 Also, it should look into
3641 \begin_inset Flex CharStyle:Code
3644 \begin_layout Plain Layout
3650 file for defaults, too (for example, a
3651 \begin_inset Flex CharStyle:Code
3654 \begin_layout Plain Layout
3662 option to include default keyboard).
3670 \begin_layout Section
3671 \begin_inset CommandInset label
3677 International Keymap Stuff
3680 \begin_layout Standard
3681 \begin_inset Note Note
3684 \begin_layout Plain Layout
3685 In doing the revisions on this document in March 2008, I did not look over
3686 this stuff, as I do not understand it.
3687 It would be good if someone else could do so.
3696 \begin_layout Standard
3697 The next two sections describe the
3698 \begin_inset Flex CharStyle:Code
3701 \begin_layout Plain Layout
3710 \begin_inset Flex CharStyle:Code
3713 \begin_layout Plain Layout
3721 file syntax in detail.
3722 These sections should help you design your own key map if the ones provided
3723 do not meet your needs.
3726 \begin_layout Subsection
3730 \begin_layout Standard
3734 \begin_inset Flex CharStyle:Code
3737 \begin_layout Plain Layout
3743 file maps keystrokes to characters or strings.
3744 As the name suggests, it sets a keyboard mapping.
3746 \begin_inset Flex CharStyle:Code
3749 \begin_layout Plain Layout
3760 \begin_inset Flex CharStyle:Code
3763 \begin_layout Plain Layout
3778 \begin_inset Flex CharStyle:Code
3781 \begin_layout Plain Layout
3794 \begin_inset Flex CharStyle:Code
3797 \begin_layout Plain Layout
3806 \begin_inset Flex CharStyle:Code
3809 \begin_layout Plain Layout
3817 are described in this section.
3820 \begin_layout Labeling
3821 \labelwidthstring 00.00.0000
3822 \begin_inset Flex CharStyle:Code
3825 \begin_layout Plain Layout
3833 Map a character to a string
3836 \begin_layout LyX-Code
3851 \begin_layout Standard
3884 the double-quote (")
3901 must be escaped with a preceding backslash (
3912 \begin_layout Standard
3914 \begin_inset Flex CharStyle:MenuItem
3917 \begin_layout Plain Layout
3925 statement to cause the symbol
3926 \begin_inset Flex CharStyle:MenuItem
3929 \begin_layout Plain Layout
3937 to be output for the keystroke
3938 \begin_inset Flex CharStyle:MenuItem
3941 \begin_layout Plain Layout
3952 \begin_layout LyX-Code
3958 \begin_layout Labeling
3959 \labelwidthstring 00.00.0000
3960 \begin_inset Flex CharStyle:Code
3963 \begin_layout Plain Layout
3971 Specify an accent character
3974 \begin_layout LyX-Code
3983 \begin_layout Standard
3984 This will make the cha
4022 This is the dead key
4026 \begin_layout Plain Layout
4033 refers to a key that does not produce a character by itself, but when followed
4034 with another key, produces the desired accent character.
4035 For example, a German characte
4037 r with an umlaut like
4047 can be produced in this manner.
4056 \begin_layout Standard
4069 and then another key not in
4086 followed by the other, not allowed key, as output.
4090 \begin_inset Flex CharStyle:MenuItem
4093 \begin_layout Plain Layout
4101 cancels a dead key, so if
4112 \begin_inset Flex CharStyle:MenuItem
4115 \begin_layout Plain Layout
4124 , the cursor will not go one position backwards but will instead cancel
4140 might have had on the next keystroke.
4144 \begin_layout Standard
4145 The following example specifies that the character ' is to be an acute accent,
4146 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4149 \begin_layout LyX-Code
4152 kmod ' acute aeiouAEIOU
4155 \begin_layout Labeling
4156 \labelwidthstring 00.00.0000
4157 \begin_inset Flex CharStyle:Code
4160 \begin_layout Plain Layout
4166 Specify an exception to the accent character
4169 \begin_layout LyX-Code
4178 \begin_layout Standard
4179 This defines an exce
4220 have been assigned a keystroke with a previous
4223 \begin_inset Flex CharStyle:Code
4226 \begin_layout Plain Layout
4250 must not belong in the
4297 If such a declaration does not exist in
4305 \begin_inset Flex CharStyle:Code
4308 \begin_layout Plain Layout
4342 \begin_inset Flex CharStyle:Code
4345 \begin_layout Plain Layout
4359 \begin_layout Standard
4360 The following command produces causes äi to be produced when you enter acute-i
4364 \begin_layout LyX-Code
4378 \begin_layout Labeling
4379 \labelwidthstring 00.00.0000
4380 \begin_inset Flex CharStyle:Code
4383 \begin_layout Plain Layout
4389 Combine two accent characters
4392 \begin_layout LyX-Code
4398 accent1 accent2 allowed
4401 \begin_layout Standard
4402 This one is getting pretty esoteric.
4403 It allows you to combine the effect
4459 \begin_inset Flex CharStyle:Code
4462 \begin_layout Plain Layout
4490 \begin_layout Standard
4491 Consider this example from the
4492 \begin_inset Flex CharStyle:Code
4495 \begin_layout Plain Layout
4506 \begin_layout LyX-Code
4509 kmod ; acute aeioyvhAEIOYVH
4513 kcomb acute umlaut iyIY
4516 \begin_layout Standard
4517 This allows you to press
4518 \begin_inset Flex CharStyle:MenuItem
4521 \begin_layout Plain Layout
4529 and get the effect of
4530 \begin_inset Flex CharStyle:Code
4533 \begin_layout Plain Layout
4552 in this case cancels the last dead key, so if you press
4553 \begin_inset Flex CharStyle:MenuItem
4556 \begin_layout Plain Layout
4565 \begin_inset Flex CharStyle:Code
4568 \begin_layout Plain Layout
4581 \begin_layout Subsection
4585 \begin_layout Standard
4587 \begin_inset Flex CharStyle:Code
4590 \begin_layout Plain Layout
4598 mapping is performed, a
4599 \begin_inset Flex CharStyle:Code
4602 \begin_layout Plain Layout
4612 file maps the strings that the symbols generate to characters in the current
4614 The LyX distribution currently includes at least the
4615 \begin_inset Flex CharStyle:Code
4618 \begin_layout Plain Layout
4627 \begin_inset Flex CharStyle:Code
4630 \begin_layout Plain Layout
4641 \begin_layout Standard
4643 \begin_inset Flex CharStyle:Code
4646 \begin_layout Plain Layout
4654 file is a sequence of declarations of the form
4657 \begin_layout LyX-Code
4670 \begin_layout Standard
4671 For example, in order to map
4672 \begin_inset Flex CharStyle:MenuItem
4675 \begin_layout Plain Layout
4685 to the corresponding character in the iso-8859-1 set (233), the following
4689 \begin_layout LyX-Code
4697 \begin_layout Standard
4699 \begin_inset Flex CharStyle:Code
4702 \begin_layout Plain Layout
4711 \begin_inset Flex CharStyle:Code
4714 \begin_layout Plain Layout
4732 the same character can apply to more than one string.
4734 \begin_inset Flex CharStyle:Code
4737 \begin_layout Plain Layout
4748 \begin_layout LyX-Code
4760 \begin_inset Newline newline
4776 \begin_layout Standard
4777 If LyX cannot find a mapping for the string produced by the keystroke or
4778 a deadkey sequence, it will check if it looks like an accented char and
4779 try to draw an accent over the character on screen.
4782 \begin_layout Subsection
4786 \begin_layout Standard
4787 There is a second way to add support for international characters through
4788 so-called dead-keys.
4789 A dead-key works in combination with a letter to produce an accented character.
4790 Here, we'll explain how to create a really simple dead-key to illustrate
4794 \begin_layout Standard
4795 Suppose you happen to need the circumflex character,
4796 \begin_inset Quotes eld
4800 \begin_inset Quotes erd
4805 \begin_inset Flex CharStyle:MenuItem
4808 \begin_layout Plain Layout
4815 \begin_inset space ~
4819 \begin_inset Flex CharStyle:MenuItem
4822 \begin_layout Plain Layout
4828 ] to the LyX command
4829 \begin_inset Flex CharStyle:Code
4832 \begin_layout Plain Layout
4839 \begin_inset Flex CharStyle:Code
4842 \begin_layout Plain Layout
4849 Now, whenever you type the
4850 \begin_inset Flex CharStyle:MenuItem
4853 \begin_layout Plain Layout
4859 -key followed by a letter, that letter will have a circumflex accent on
4861 For example, the sequence
4862 \begin_inset Quotes eld
4866 \begin_inset Flex CharStyle:MenuItem
4869 \begin_layout Plain Layout
4876 \begin_inset Quotes erd
4879 produces the letter:
4880 \begin_inset Quotes eld
4884 \begin_inset Quotes erd
4888 If you tried to type
4889 \begin_inset Quotes eld
4893 \begin_inset Flex CharStyle:MenuItem
4896 \begin_layout Plain Layout
4903 \begin_inset Quotes erd
4906 , however, LyX will complain with a beep, since a
4907 \begin_inset Quotes eld
4911 \begin_inset Flex CharStyle:MenuItem
4914 \begin_layout Plain Layout
4921 \begin_inset Quotes erd
4924 never takes a circumflex accent.
4926 \begin_inset Flex CharStyle:MenuItem
4929 \begin_layout Plain Layout
4935 after a dead-key produces the bare-accent.
4936 Please note this last point! If you bind a key to a dead-key, you'll need
4937 to rebind the character on that key to yet another key.
4939 \begin_inset Flex CharStyle:MenuItem
4942 \begin_layout Plain Layout
4948 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
4951 \begin_layout Standard
4952 One common way to bind dead-keys is to use
4953 \begin_inset Flex CharStyle:MenuItem
4956 \begin_layout Plain Layout
4963 \begin_inset Flex CharStyle:MenuItem
4966 \begin_layout Plain Layout
4973 \begin_inset Flex CharStyle:MenuItem
4976 \begin_layout Plain Layout
4982 in combination with an accent, like
4983 \begin_inset Quotes eld
4987 \begin_inset Flex CharStyle:MenuItem
4990 \begin_layout Plain Layout
4997 \begin_inset Quotes erd
5001 \begin_inset Quotes eld
5005 \begin_inset Flex CharStyle:MenuItem
5008 \begin_layout Plain Layout
5015 \begin_inset Quotes erd
5019 \begin_inset Quotes eld
5023 \begin_inset Flex CharStyle:MenuItem
5026 \begin_layout Plain Layout
5033 \begin_inset Quotes erd
5037 Another way involves using
5038 \begin_inset Flex CharStyle:Code
5041 \begin_layout Plain Layout
5048 \begin_inset Flex CharStyle:Code
5051 \begin_layout Plain Layout
5057 to set up the special
5058 \begin_inset Flex CharStyle:Code
5061 \begin_layout Plain Layout
5069 \begin_inset Flex CharStyle:Code
5072 \begin_layout Plain Layout
5078 acts in some ways just like
5079 \begin_inset Flex CharStyle:MenuItem
5082 \begin_layout Plain Layout
5088 and permits you to bind keys to accented characters.
5089 You can also turn keys into dead-keys by binding them to something like
5091 \begin_inset Flex CharStyle:Code
5094 \begin_layout Plain Layout
5100 and then binding this symbolic key to the corresponding LyX command.
5104 \begin_layout Plain Layout
5109 : This is exactly what I do in my
5110 \begin_inset Flex CharStyle:Code
5113 \begin_layout Plain Layout
5120 \begin_inset Flex CharStyle:Code
5123 \begin_layout Plain Layout
5131 \begin_inset Flex CharStyle:MenuItem
5134 \begin_layout Plain Layout
5136 \begin_inset space ~
5145 \begin_inset Flex CharStyle:Code
5148 \begin_layout Plain Layout
5154 and a bunch of these
5155 \begin_inset Quotes eld
5159 \begin_inset Flex CharStyle:Code
5162 \begin_layout Plain Layout
5169 \begin_inset Quotes erd
5172 symbolic keys bound such things as
5173 \begin_inset Flex CharStyle:MenuItem
5176 \begin_layout Plain Layout
5178 \begin_inset space ~
5187 \begin_inset Flex CharStyle:MenuItem
5190 \begin_layout Plain Layout
5192 \begin_inset space ~
5201 This is how I produce my accented characters.
5206 You can make just about anything into the
5207 \begin_inset Flex CharStyle:Code
5210 \begin_layout Plain Layout
5217 \begin_inset Flex CharStyle:MenuItem
5220 \begin_layout Plain Layout
5226 keys, a spare function key, etc.
5227 As for the LyX commands that produce accents, check the entry for
5228 \begin_inset Flex CharStyle:Code
5231 \begin_layout Plain Layout
5242 You'll find the complete list there.
5245 \begin_layout Subsection
5246 Saving your Language Configuration
5249 \begin_layout Standard
5250 You can edit your preferences so that your desired language environment
5251 is automatically configured when LyX starts up, via the
5252 \begin_inset Flex CharStyle:MenuItem
5255 \begin_layout Plain Layout
5256 Edit\SpecialChar \menuseparator
5265 \begin_layout Chapter
5266 Installing New Document Classes, Layouts, and Templates
5267 \begin_inset CommandInset label
5269 name "cha:Installing-New-Document"
5277 \begin_layout Plain Layout
5278 Installing New Document Classes
5286 \begin_layout Standard
5287 In this chapter, we describe the procedures for creating and installing
5288 new LyX layout and template files, as well as offer a refresher on correctly
5289 installing new LaTeX document classes.
5290 Some definitions: a document class is a LaTeX file (usually ending in
5291 \begin_inset Flex CharStyle:Code
5294 \begin_layout Plain Layout
5301 \begin_inset Flex CharStyle:Code
5304 \begin_layout Plain Layout
5310 ) that describes the format of a document such as an article, report, journal
5311 preprint, etc, and all the commands needed to realize that format.
5312 A layout file is a LyX file that corresponds to a LaTeX document class
5313 and that tells LyX how to
5314 \begin_inset Quotes eld
5318 \begin_inset Quotes erd
5321 things on the screen to make the display look something like the final
5323 More precisely, a layout file describes a
5324 \begin_inset Quotes eld
5328 \begin_inset Quotes erd
5331 which is the internal construct LyX uses to render the screen display.
5333 \begin_inset Quotes eld
5337 \begin_inset Quotes erd
5341 \begin_inset Quotes eld
5345 \begin_inset Quotes erd
5348 can be used somewhat interchangeably, but it is better to refer to the
5349 file as the layout, and the thing living in LyX's memory as the text class.
5350 A template file is simply a LyX document that contains a set of predefined
5351 entries for a given document class—entries that are generally required
5353 Templates are especially useful for things like journal manuscripts that
5354 are to be submitted electronically.
5357 \begin_layout Section
5358 Installing a new LaTeX package
5361 \begin_layout Standard
5362 Some installations may not include a LaTeX package that you would like to
5364 For example, you might need FoilTeX, a package for preparing slides or
5365 viewgraphs for overhead projectors.
5366 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5367 a user interface for that.
5368 For example on MiKTeX you start its program
5369 \begin_inset Quotes eld
5373 \begin_inset Quotes erd
5376 to get a list of available packages.
5377 To install one, right click on it or use the installing toolbar button.
5378 When the package you want to install is not in the list, but you have it
5380 \begin_inset Flex CharStyle:Code
5383 \begin_layout Plain Layout
5390 \begin_inset Flex CharStyle:Code
5393 \begin_layout Plain Layout
5399 -file, then copy these files to a subfolder of your LaTeX distribution,
5400 for example to the folder
5409 Then update the file name database of your LaTeX-distribution.
5410 For example on MiKTeX this is done by pressing the button
5413 \begin_inset space ~
5418 that you find in MiKTeX's
5419 \begin_inset Quotes eld
5423 \begin_inset Quotes erd
5427 In both cases you need afterwards to reconfigure LyX using the menu
5428 \begin_inset Flex CharStyle:MenuItem
5431 \begin_layout Plain Layout
5432 Tools\SpecialChar \menuseparator
5438 and then to restart LyX.
5441 \begin_layout Standard
5442 If your LaTeX distribution doesn't provide a user interface, then you can
5443 follow these steps by using a UNIX/Linux console.
5446 \begin_layout Enumerate
5447 Get the package from
5448 \begin_inset CommandInset href
5451 target "http://www.ctan.org/"
5458 \begin_layout Enumerate
5459 You can install this package in several different places.
5460 If you want it to be available for all users on your system, then you should
5461 install it in your `local' TeX tree; if you want (or need) it to be available
5462 just for you, then you can install it in your own `user' TeX tree.
5463 Where these should be created, if they do not already exist, depends upon
5464 the details of your system.
5465 To find out, look in the file
5466 \begin_inset Flex CharStyle:Code
5469 \begin_layout Plain Layout
5479 \begin_layout Plain Layout
5480 This usually lives in the directory
5481 \begin_inset Flex CharStyle:Code
5484 \begin_layout Plain Layout
5490 , though you can run
5491 \begin_inset Flex CharStyle:Code
5494 \begin_layout Plain Layout
5505 The location of the `local' TeX tree is defined by
5506 \begin_inset Flex CharStyle:Code
5509 \begin_layout Plain Layout
5515 ; this is usually somewhere like
5516 \begin_inset Flex CharStyle:Code
5519 \begin_layout Plain Layout
5520 /usr/local/share/texmf/
5526 The `user' TeX tree is defined by
5527 \begin_inset Flex CharStyle:Code
5530 \begin_layout Plain Layout
5537 \begin_inset Flex CharStyle:Code
5540 \begin_layout Plain Layout
5547 (If these variables are not predefined, you can define them.) You'll probably
5548 need root permissions to create or modify the `local' tree; but your `user'
5549 tree shouldn't have such limitations.
5552 \begin_layout Enumerate
5554 \begin_inset Flex CharStyle:Code
5557 \begin_layout Plain Layout
5564 \begin_inset Flex CharStyle:Code
5567 \begin_layout Plain Layout
5574 \begin_inset Flex CharStyle:Code
5577 \begin_layout Plain Layout
5584 \begin_inset space \thinspace{}
5588 \begin_inset Newline newline
5592 \begin_inset Flex CharStyle:Code
5595 \begin_layout Plain Layout
5596 TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
5602 \begin_inset Newline newline
5605 But, again, most of this will
5606 \begin_inset Quotes eld
5610 \begin_inset Quotes erd
5616 \begin_layout Enumerate
5621 \begin_layout Plain Layout
5622 We'll assume henceforth that you're defining `local' TeX tree.
5623 If you're defining a user tree, just adjust as necessary.
5629 You must follow the directory structure of your existing
5630 \begin_inset Flex CharStyle:Code
5633 \begin_layout Plain Layout
5639 directory, which will be found at
5640 \begin_inset Flex CharStyle:Code
5643 \begin_layout Plain Layout
5650 For example, latex packages should go under
5651 \begin_inset Flex CharStyle:Code
5654 \begin_layout Plain Layout
5655 $TEXMFLOCAL/tex/latex/
5663 \begin_layout Enumerate
5664 Install the package.
5665 For example, you would unpack the FoilTeX tarball and copy it to
5666 \begin_inset Flex CharStyle:Code
5669 \begin_layout Plain Layout
5670 $TEXMFLOCAL/tex/latex/foiltex
5677 \begin_inset Flex CharStyle:Code
5680 \begin_layout Plain Layout
5686 directory contains various files.
5689 \begin_layout Enumerate
5691 \begin_inset Flex CharStyle:Code
5694 \begin_layout Plain Layout
5702 \begin_inset Flex CharStyle:Code
5705 \begin_layout Plain Layout
5714 \begin_layout Standard
5715 Your package is now installed and available to LaTeX.
5716 To make it available to LyX, you need to create a Layout file, if one is
5717 not already available.
5718 (See the next section.) Once you have a layout file, you need only reconfigure
5720 \begin_inset Flex CharStyle:MenuItem
5723 \begin_layout Plain Layout
5724 Tools\SpecialChar \menuseparator
5730 ) and then restart LyX.
5731 You should then see your new package—for example
5732 \begin_inset Flex CharStyle:MenuItem
5735 \begin_layout Plain Layout
5742 \begin_inset Flex CharStyle:MenuItem
5745 \begin_layout Plain Layout
5746 Document\SpecialChar \menuseparator
5753 \begin_inset Flex CharStyle:MenuItem
5756 \begin_layout Plain Layout
5766 \begin_layout Section
5770 \begin_layout Standard
5771 This section describes how to write and install your own LyX layout files
5772 and walks through the
5773 \begin_inset Flex CharStyle:Code
5776 \begin_layout Plain Layout
5782 text class format as an example.
5784 \begin_inset Flex CharStyle:Code
5787 \begin_layout Plain Layout
5793 files describe what paragraph and character styles are available for a
5794 given document class and how LyX should display them.
5795 We try to provide a thorough description of the process here; however,
5796 there are so many different types of documents supported by LaTeX classes
5797 that we can't hope to cover every different possibility or problem you
5799 (The LyX users' list is frequented by people with lots of experience with
5800 layout design who are willing to share what they've learned.)
5803 \begin_layout Standard
5804 As you prepare to write a new layout, it is extremely helpful to look at
5805 the example layouts distributed with LyX.
5806 If you use a nice LaTeX document class that might be of interest for others,
5807 too, and have a nice corresponding LyX layout, feel free to contribute
5808 the stuff to us, so we may put it into the distribution.
5810 \begin_inset CommandInset href
5812 name "section on the LyX wiki"
5813 target "http://wiki.lyx.org/Layouts/Layouts"
5817 for this kind of material.
5820 \begin_layout Standard
5821 All the tags described in this chapter are case-insensitive; this means
5823 \begin_inset Flex CharStyle:Code
5826 \begin_layout Plain Layout
5833 \begin_inset Flex CharStyle:Code
5836 \begin_layout Plain Layout
5843 \begin_inset Flex CharStyle:Code
5846 \begin_layout Plain Layout
5852 are really the same command.
5853 The possible values are printed in brackets after the feature's name.
5854 The default value if a feature isn't specified inside a text class-description
5856 \begin_inset Flex CharStyle:Code
5859 \begin_layout Plain Layout
5868 If the argument has a data type like
5869 \begin_inset Quotes eld
5873 \begin_inset Quotes erd
5877 \begin_inset Quotes eld
5881 \begin_inset Quotes erd
5884 , the default is shown like this:
5885 \begin_inset Flex CharStyle:Code
5888 \begin_layout Plain Layout
5899 \begin_layout Subsection
5901 \begin_inset CommandInset label
5903 name "sub:Layout-modules"
5910 \begin_layout Standard
5911 Similar to layout files, and new with LyX 1.6, are layout
5916 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
5917 some modules—such as the endnotes module—provide support for just such
5919 In a sense, layout modules are similar to included files—files like
5920 \begin_inset Flex CharStyle:Code
5923 \begin_layout Plain Layout
5929 —in that modules are not specific to a given document layout but may be
5930 used with many different layouts.
5931 The difference is that using a layout module does not require editing the
5933 Rather, modules are selected in the
5934 \begin_inset Flex CharStyle:MenuItem
5937 \begin_layout Plain Layout
5938 Document\SpecialChar \menuseparator
5947 \begin_layout Standard
5948 Building modules is the easiest way to get started with layout editing,
5949 since it can be as simple as adding a single new paragraph or flex inset.
5950 But modules may, in principle, contain anything a layout file can contain.
5953 \begin_layout Standard
5954 A module must begin with a line like the following:
5957 \begin_layout LyX-Code
5960 DeclareLyXModule[endnotes.sty]{Endnotes}
5963 \begin_layout Standard
5964 The mandatory argument, in curly brackets, is the name of the module, as
5966 \begin_inset Flex CharStyle:MenuItem
5969 \begin_layout Plain Layout
5970 Document\SpecialChar \menuseparator
5977 The argument in square brackets is optional: It declares any LaTeX packages
5978 on which the module depends.
5979 Please note that only packages about which LyX knows should be listed in
5980 the square brackets.
5984 \begin_layout Plain Layout
5985 The list of such packages is documented only in the source code.
5990 LyX will not check for arbitrary packages.
5993 \begin_layout Standard
5994 The module declaration should then be followed by lines like the following:
5997 \begin_layout LyX-Code
6001 \begin_layout LyX-Code
6002 #Adds an endnote command, in addition to footnotes.
6006 \begin_layout LyX-Code
6007 #You will need to add
6009 theendnotes in TeX code where you
6012 \begin_layout LyX-Code
6013 #want the endnotes to appear.
6017 \begin_layout LyX-Code
6021 \begin_layout LyX-Code
6022 #Requires: somemodule | othermodule
6025 \begin_layout LyX-Code
6026 #Excludes: badmodule
6029 \begin_layout Standard
6030 The description is used in
6031 \begin_inset Flex CharStyle:MenuItem
6034 \begin_layout Plain Layout
6035 Document\SpecialChar \menuseparator
6041 to provide the user with information about what the module does.
6043 \begin_inset Flex CharStyle:Code
6046 \begin_layout Plain Layout
6052 line is used to identify other modules with which this one must be used;
6054 \begin_inset Flex CharStyle:Code
6057 \begin_layout Plain Layout
6063 line is used to identify modules with which this one may not be used.
6064 Both are optional, and, as shown, multiple modules should be separated
6065 with the pipe symbol: |.
6066 Note that the required modules are treated disjunctively:
6070 of the required modules must be used.
6075 excluded module may be used.
6076 Note that modules are identified here by their
6080 without the .module extension.
6082 \begin_inset Flex CharStyle:Code
6085 \begin_layout Plain Layout
6092 \begin_inset Flex CharStyle:Code
6095 \begin_layout Plain Layout
6104 \begin_layout Standard
6105 After creating a new module, you will need to reconfigure and then restart
6106 LyX for the module to appear in the menu.
6107 However, changes you make to the module will be seen immediately, if you
6109 \begin_inset Flex CharStyle:MenuItem
6112 \begin_layout Plain Layout
6113 Document\SpecialChar \menuseparator
6119 , highlight something, and then hit
6120 \begin_inset Quotes eld
6124 \begin_inset Quotes erd
6130 It is strongly recommended that you save your work before doing so
6135 it is strongly recommended that you not attempt to edit modules while simultaneo
6136 usly working on documents
6139 Though of course the developers strive to keep LyX stable in such situations,
6140 syntax errors and the like in your module file could cause strange behavior.
6143 \begin_layout Subsection
6144 Supporting new document classes
6147 \begin_layout Standard
6148 There are two situations you are likely to encounter when wanting to support
6149 a new LaTeX document class, involving LaTeX2e class (
6150 \begin_inset Flex CharStyle:Code
6153 \begin_layout Plain Layout
6160 \begin_inset Flex CharStyle:Code
6163 \begin_layout Plain Layout
6170 Supporting a style file is usually fairly easy.
6171 Supporting a new document class is a bit harder.
6174 \begin_layout Subsection
6176 \begin_inset Flex CharStyle:MenuItem
6179 \begin_layout Plain Layout
6188 \begin_layout Standard
6189 If your new document class is provided as a style file that is used in conjuncti
6190 on with an existing, supported document class—for the sake of the example,
6191 we'll assume that the style file is called
6192 \begin_inset Flex CharStyle:MenuItem
6195 \begin_layout Plain Layout
6201 and it is meant to be used with
6202 \begin_inset Flex CharStyle:MenuItem
6205 \begin_layout Plain Layout
6211 , which is a standard class—start by copying the existing class's layout
6212 file into your local directory:
6215 \begin_layout LyX-Code
6216 cp report.layout ~/.lyx/layouts/myclass.layout
6219 \begin_layout Standard
6221 \begin_inset Flex CharStyle:Code
6224 \begin_layout Plain Layout
6230 and change the line:
6233 \begin_layout LyX-Code
6236 DeclareLaTeXClass{report}
6239 \begin_layout Standard
6243 \begin_layout LyX-Code
6246 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6249 \begin_layout Standard
6253 \begin_layout LyX-Code
6255 \begin_inset Newline newline
6261 \begin_inset Newline newline
6267 \begin_layout Standard
6268 near the top of the file.
6271 \begin_layout Standard
6272 Start LyX and select
6273 \begin_inset Flex CharStyle:MenuItem
6276 \begin_layout Plain Layout
6277 Tools\SpecialChar \menuseparator
6284 Then restart LyX and try creating a new document.
6286 \begin_inset Flex CharStyle:MenuItem
6289 \begin_layout Plain Layout
6295 " as a document class option in the
6296 \begin_inset Flex CharStyle:MenuItem
6299 \begin_layout Plain Layout
6300 Document\SpecialChar \menuseparator
6307 It is likely that some of the sectioning commands and such in your new
6308 class will work differently from how they worked in the base class—
6309 \begin_inset Flex CharStyle:Code
6312 \begin_layout Plain Layout
6318 in this example—so you can fiddle around with the settings for the different
6319 sections if you wish.
6322 \begin_layout Subsection
6324 \begin_inset Flex CharStyle:MenuItem
6327 \begin_layout Plain Layout
6336 \begin_layout Standard
6337 There are two possibilities here.
6338 One is that the class file is itself based upon an existing document class.
6339 For example, many thesis classes are based upon
6340 \begin_inset Flex CharStyle:MenuItem
6343 \begin_layout Plain Layout
6350 To see whether yours is, look for a line like
6353 \begin_layout LyX-Code
6359 \begin_layout Standard
6361 If so, then you may proceed largely as in the previous section, though
6362 the DeclareLaTeXClass line will be different.
6363 If your new class is thesis, and it is based upon book, then the line should
6368 \begin_layout Plain Layout
6369 And it will be easiest if you save the file to
6370 \begin_inset Flex CharStyle:Code
6373 \begin_layout Plain Layout
6379 : LyX assumes that the document class has the same name as the layout file.
6388 \begin_layout LyX-Code
6391 DeclareLaTeXClass[thesis,book]{thesis}
6394 \begin_layout Standard
6395 If, on the other hand, the new class is not based upon an existing class,
6396 you will probably have to
6397 \begin_inset Quotes eld
6401 \begin_inset Quotes erd
6405 We strongly suggest copying an existing layout file which uses a similar
6406 LaTeX class and then modifying it, if you can do so.
6407 At least use an existing file as a starting point so you can find out what
6408 items you need to worry about.
6409 Again, the specifics are covered below.
6412 \begin_layout Section
6413 Declaring a new text class
6416 \begin_layout Standard
6417 When it's finally time to get your hands dirty and create or edit your own
6418 layout file, the following sections describe what you're up against.
6419 Our advice is to go slowly, save and test often, listen to soothing music,
6420 and enjoy one or two of your favorite adult beverages; more if you are
6421 getting particularly stuck.
6422 It's really not that hard, except that the multitude of options can become
6423 overwhelming if you try to do to much in one sitting.
6424 Go have another adult beverage, just for good measure.
6427 \begin_layout Standard
6431 \begin_layout Standard
6432 Lines in a layout file which begin with a
6433 \begin_inset Flex CharStyle:Code
6436 \begin_layout Plain Layout
6443 There is one exception to this rule: all layouts should begin with lines
6447 \begin_layout LyX-Code
6450 #% Do not delete the line below; configure depends on this
6453 \begin_layout LyX-Code
6458 DeclareLaTeXClass{article}
6461 \begin_layout Standard
6462 The second line is used when you configure LyX.
6463 The layout file is read by the LaTeX script
6464 \begin_inset Flex CharStyle:Code
6467 \begin_layout Plain Layout
6473 , in a special mode where
6474 \begin_inset Flex CharStyle:Code
6477 \begin_layout Plain Layout
6484 The first line is just a LaTeX comment, and the second one contains the
6485 declaration of the text class.
6486 If these lines appear in a file named
6487 \begin_inset Flex CharStyle:Code
6490 \begin_layout Plain Layout
6496 , then they define a text class of name
6497 \begin_inset Flex CharStyle:Code
6500 \begin_layout Plain Layout
6506 (the name of the layout file) which uses the LaTeX document class
6507 \begin_inset Flex CharStyle:Code
6510 \begin_layout Plain Layout
6516 (the default is to use the same name as the layout).
6518 \begin_inset Quotes eld
6522 \begin_inset Quotes erd
6525 that appears above is used as a description of the text class in the
6526 \begin_inset Flex CharStyle:MenuItem
6529 \begin_layout Plain Layout
6530 Document\SpecialChar \menuseparator
6539 \begin_layout Standard
6540 Let's assume that you wrote your own text class that uses the
6541 \begin_inset Flex CharStyle:Code
6544 \begin_layout Plain Layout
6550 document class, but where you changed the appearance of the section headings.
6551 If you put it in a file
6552 \begin_inset Flex CharStyle:Code
6555 \begin_layout Plain Layout
6561 , the header of this file should be:
6564 \begin_layout LyX-Code
6567 #% Do not delete the line below; configure depends on this
6570 \begin_layout LyX-Code
6575 DeclareLaTeXClass[article]{article (with my own headings)}
6578 \begin_layout Standard
6579 This declares a text class
6580 \begin_inset Flex CharStyle:Code
6583 \begin_layout Plain Layout
6589 , associated with the LaTeX document class
6590 \begin_inset Flex CharStyle:Code
6593 \begin_layout Plain Layout
6600 \begin_inset Quotes eld
6603 article (with my own headings)
6604 \begin_inset Quotes erd
6608 If your text class depends on several packages, you can declare it as:
6611 \begin_layout LyX-Code
6614 #% Do not delete the line below; configure depends on this
6617 \begin_layout LyX-Code
6622 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
6625 \begin_layout Standard
6626 This indicates that your text class uses the foo.sty package.
6627 Finally, it is also possible to declare classes for DocBook code.
6628 Typical declarations will look like
6631 \begin_layout LyX-Code
6634 #% Do not delete the line below; configure depends on this
6637 \begin_layout LyX-Code
6642 DeclareDocBookClass[article]{SGML (DocBook article)}
6645 \begin_layout Standard
6646 Note that these declarations can also be given an optional parameter declaring
6647 the name of the document class (but not a list).
6650 \begin_layout Standard
6651 So, to be as explicit as possible, the form of the layout declaration is:
6654 \begin_layout LyX-Code
6659 DeclareLaTeXClass[class,package.sty]{layout description}
6662 \begin_layout Standard
6663 The class need only be specified if the name of the LaTeX class file and
6664 the name of the layout file are different; if the name of the class file
6665 is not specified, then LyX will simply assume that it is the same as the
6666 name of the layout file.
6669 \begin_layout Standard
6670 When the text class has been modified to your taste, all you have to do
6671 is to copy it either to
6672 \begin_inset Flex CharStyle:Code
6675 \begin_layout Plain Layout
6682 \begin_inset Flex CharStyle:Code
6685 \begin_layout Plain Layout
6692 \begin_inset Flex CharStyle:MenuItem
6695 \begin_layout Plain Layout
6696 Tools\SpecialChar \menuseparator
6702 , exit LyX and restart it.
6703 Then your new text class should be available along with the others.
6706 \begin_layout Standard
6707 In versions of LyX prior to 1.6, you had to restart LyX to see any changes
6708 you made to your layout files.
6709 As a result, editing layout files could be very time consuming.
6710 Beginning with 1.6, however, you can force a reload of the layout currently
6711 in use by using the LyX function
6712 \begin_inset Flex CharStyle:MenuItem
6715 \begin_layout Plain Layout
6722 There is no default binding for this function—though, of course, you can
6723 bind it to a key yourself.
6724 If you want to use this function, then, you should simply enter it in the
6730 : This is very much an `advanced feature'.
6735 recommended that you save your work before using this function.
6740 recommended that you not attempt to edit your layout while simultaneously
6741 working on a document that you care about.
6742 Use a test document.
6743 Syntax errors and the like in your layout file could cause peculiar behavior.
6744 In particular, such errors could cause LyX to regard the current layout
6745 as invalid and to attempt to switch to some other layout.
6746 The LyX team strives to keep LyX stable in such situations, but safe is
6750 \begin_layout Subsection
6754 \begin_layout Standard
6755 The first non-comment line must contain the file format number:
6758 \begin_layout Description
6759 \begin_inset Flex CharStyle:Code
6762 \begin_layout Plain Layout
6769 \begin_inset Flex CharStyle:Code
6772 \begin_layout Plain Layout
6778 ] This tag was introduced with LyX 1.4.0 (layout files of LyX 1.3.x and earlier
6779 don't have an explicit file format).
6780 The file format that is documented here is format 14.
6783 \begin_layout Subsection
6784 General text class parameters
6787 \begin_layout Standard
6788 These are the general parameters which describe the form of the entire document:
6791 \begin_layout Description
6792 \begin_inset Flex CharStyle:Code
6795 \begin_layout Plain Layout
6801 Adds information to the document preamble.
6803 \begin_inset Quotes eld
6807 \begin_inset Flex CharStyle:Code
6810 \begin_layout Plain Layout
6817 \begin_inset Quotes erd
6823 \begin_layout Description
6824 \begin_inset Flex CharStyle:Code
6827 \begin_layout Plain Layout
6833 Describes various global options supported by the document class.
6835 \begin_inset space ~
6839 \begin_inset CommandInset ref
6841 reference "sub:ClassOptions"
6847 \begin_inset Quotes eld
6851 \begin_inset Flex CharStyle:Code
6854 \begin_layout Plain Layout
6861 \begin_inset Quotes erd
6867 \begin_layout Description
6868 \begin_inset Flex CharStyle:Code
6871 \begin_layout Plain Layout
6878 \begin_inset Flex CharStyle:Code
6881 \begin_layout Plain Layout
6890 \begin_inset Flex CharStyle:Code
6893 \begin_layout Plain Layout
6899 ] Whether the class should default to having one or two columns.
6900 Can be changed in the
6901 \begin_inset Flex CharStyle:MenuItem
6904 \begin_layout Plain Layout
6905 Document\SpecialChar \menuseparator
6914 \begin_layout Description
6915 \begin_inset Flex CharStyle:Code
6918 \begin_layout Plain Layout
6924 This sequence defines a new counter.
6926 \begin_inset space ~
6930 \begin_inset CommandInset ref
6932 reference "sub:Counters"
6938 \begin_inset Quotes eld
6942 \begin_inset Flex CharStyle:Code
6945 \begin_layout Plain Layout
6952 \begin_inset Quotes erd
6958 \begin_layout Description
6959 \begin_inset Flex CharStyle:Code
6962 \begin_layout Plain Layout
6968 Sets the default font used to display the document.
6970 \begin_inset space ~
6974 \begin_inset CommandInset ref
6976 reference "sub:Font-description"
6980 for how to declare fonts.
6982 \begin_inset Quotes eld
6986 \begin_inset Flex CharStyle:Code
6989 \begin_layout Plain Layout
6996 \begin_inset Quotes erd
7002 \begin_layout Description
7003 \begin_inset Flex CharStyle:Code
7006 \begin_layout Plain Layout
7013 \begin_inset Flex CharStyle:Code
7016 \begin_layout Plain Layout
7022 Specifies a module to be included by default with this document class,
7023 which should be specified by filename without the
7024 \begin_inset Flex CharStyle:Code
7027 \begin_layout Plain Layout
7034 The user can still remove the module, but it will be active at the outset.
7035 (This applies only when new files are created, or when this class is chosen
7036 for an existing document.)
7039 \begin_layout Description
7040 \begin_inset Flex CharStyle:Code
7043 \begin_layout Plain Layout
7050 \begin_inset Flex CharStyle:Code
7053 \begin_layout Plain Layout
7059 ] This is the style that will be assigned to new paragraphs, usually
7060 \begin_inset Flex CharStyle:MenuItem
7063 \begin_layout Plain Layout
7070 This will default to the first defined style if not given, but you are
7071 highly encouraged to use this directive.
7074 \begin_layout Description
7075 \begin_inset Flex CharStyle:Code
7078 \begin_layout Plain Layout
7085 \begin_inset Flex CharStyle:Code
7088 \begin_layout Plain Layout
7094 ] Indicates that the module in question—which should be specified by filename
7096 \begin_inset Flex CharStyle:Code
7099 \begin_layout Plain Layout
7105 extension—cannot be used with this document class.
7106 This might be used in a journal-specific layout file to prevent, say, the
7108 \begin_inset Flex CharStyle:Code
7111 \begin_layout Plain Layout
7117 module that numbers theorems by section.
7122 be used in a module.
7123 Modules have their own way of excluding other modules (see
7124 \begin_inset CommandInset ref
7126 reference "sub:Layout-modules"
7133 \begin_layout Description
7134 \begin_inset Flex CharStyle:Code
7137 \begin_layout Plain Layout
7143 Defines a new float.
7145 \begin_inset space ~
7149 \begin_inset CommandInset ref
7151 reference "sub:Floats"
7157 \begin_inset Quotes eld
7161 \begin_inset Flex CharStyle:Code
7164 \begin_layout Plain Layout
7171 \begin_inset Quotes erd
7177 \begin_layout Description
7178 \begin_inset Flex CharStyle:Code
7181 \begin_layout Plain Layout
7187 As its name implies, this command allows you to include another layout
7188 definition file within yours to avoid duplicating commands.
7189 Common examples are the standard layout files, for example,
7190 \begin_inset Flex CharStyle:Code
7193 \begin_layout Plain Layout
7199 , which contains most of the basic layouts.
7202 \begin_layout Description
7203 \begin_inset Flex CharStyle:Code
7206 \begin_layout Plain Layout
7212 This section (re-)defines the layout of an inset.
7213 It can be applied to an existing inset of to a new, user-defined inset,
7215 \begin_inset space \thinspace{}
7219 \begin_inset space \space{}
7222 a new character style.
7224 \begin_inset space ~
7228 \begin_inset CommandInset ref
7230 reference "sub:Flex-insets-and"
7234 for more information.
7236 \begin_inset Quotes eld
7240 \begin_inset Flex CharStyle:Code
7243 \begin_layout Plain Layout
7250 \begin_inset Quotes erd
7256 \begin_layout Description
7257 \begin_inset Flex CharStyle:Code
7260 \begin_layout Plain Layout
7266 A string that indicates the width of the left margin on the screen, for
7268 \begin_inset Quotes eld
7272 \begin_inset Quotes erd
7278 \begin_layout Description
7279 \begin_inset Flex CharStyle:Code
7282 \begin_layout Plain Layout
7288 This command deletes an existing float.
7289 This is particularly useful when you want to suppress a float that has
7290 be defined in an input file.
7293 \begin_layout Description
7294 \begin_inset Flex CharStyle:Code
7297 \begin_layout Plain Layout
7303 This command deletes an existing style.
7304 This is particularly useful when you want to suppress a style that has
7305 be defined in an input file.
7308 \begin_layout Description
7309 \begin_inset Flex CharStyle:Code
7312 \begin_layout Plain Layout
7318 A string indicating what sort of output documents using this class will
7320 At present, the options are: `docbook', `latex', and `literate'.
7323 \begin_layout Description
7324 \begin_inset Flex CharStyle:Code
7327 \begin_layout Plain Layout
7338 \begin_inset Flex CharStyle:Code
7341 \begin_layout Plain Layout
7352 \begin_inset Flex CharStyle:Code
7355 \begin_layout Plain Layout
7362 \begin_inset Flex CharStyle:Code
7365 \begin_layout Plain Layout
7371 ] The class default pagestyle.
7372 Can be changed in the
7373 \begin_inset Flex CharStyle:MenuItem
7376 \begin_layout Plain Layout
7377 Document\SpecialChar \menuseparator
7386 \begin_layout Description
7387 \begin_inset Flex CharStyle:Code
7390 \begin_layout Plain Layout
7396 Sets the preamble for the LaTeX document.
7397 Note that this will completely override any prior
7398 \begin_inset Flex CharStyle:Code
7401 \begin_layout Plain Layout
7408 \begin_inset Flex CharStyle:Code
7411 \begin_layout Plain Layout
7419 \begin_inset Quotes eld
7423 \begin_inset Flex CharStyle:Code
7426 \begin_layout Plain Layout
7433 \begin_inset Quotes erd
7439 \begin_layout Description
7440 \begin_inset Flex CharStyle:Code
7443 \begin_layout Plain Layout
7450 \begin_inset Flex CharStyle:Code
7453 \begin_layout Plain Layout
7460 \begin_inset Flex CharStyle:Code
7463 \begin_layout Plain Layout
7472 \begin_inset Flex CharStyle:Code
7475 \begin_layout Plain Layout
7481 ] Whether the class already provides the feature
7482 \begin_inset Flex CharStyle:Code
7485 \begin_layout Plain Layout
7492 A feature is in general the name of a package (
7493 \begin_inset Flex CharStyle:Code
7496 \begin_layout Plain Layout
7503 \begin_inset Flex CharStyle:Code
7506 \begin_layout Plain Layout
7512 , \SpecialChar \ldots{}
7514 \begin_inset Flex CharStyle:Code
7517 \begin_layout Plain Layout
7524 \begin_inset Flex CharStyle:Code
7527 \begin_layout Plain Layout
7533 ,\SpecialChar \ldots{}
7534 ); the complete list of supported features is unfortunately not documented
7535 outside the LyX source code—but see
7536 \begin_inset Flex CharStyle:Code
7539 \begin_layout Plain Layout
7545 if you're interested.
7547 \begin_inset Flex CharStyle:MenuItem
7550 \begin_layout Plain Layout
7551 Help\SpecialChar \menuseparator
7557 also gives an overview of the supported packages.
7560 \begin_layout Description
7561 \begin_inset Flex CharStyle:Code
7564 \begin_layout Plain Layout
7571 \begin_inset Flex CharStyle:Code
7574 \begin_layout Plain Layout
7580 ] Indicates that this layout provides the functionality of the module mentioned,
7581 which should be specified by the filename without the
7582 \begin_inset Flex CharStyle:Code
7585 \begin_layout Plain Layout
7592 This will typically be used if the layout includes the module directly,
7593 rather than using the
7594 \begin_inset Flex CharStyle:Code
7597 \begin_layout Plain Layout
7603 tag to indicate that it ought to be used.
7604 It could be used in a module that provided an alternate implementation
7605 of the same functionality.
7608 \begin_layout Description
7609 \begin_inset Flex CharStyle:Code
7612 \begin_layout Plain Layout
7619 \begin_inset Flex CharStyle:Code
7622 \begin_layout Plain Layout
7628 ] Whether the class requires the feature
7629 \begin_inset Flex CharStyle:Code
7632 \begin_layout Plain Layout
7639 Multiple features must be separated by commas.
7640 Note that you can only request supported features.
7643 \begin_layout Description
7644 \begin_inset Flex CharStyle:Code
7647 \begin_layout Plain Layout
7653 A string that indicates the width of the right margin on the screen, for
7655 \begin_inset Quotes eld
7659 \begin_inset Quotes erd
7665 \begin_layout Description
7666 \begin_inset Flex CharStyle:Code
7669 \begin_layout Plain Layout
7675 Sets which divisions get numbered.
7677 \begin_inset Flex CharStyle:Code
7680 \begin_layout Plain Layout
7689 \begin_layout Description
7690 \begin_inset Flex CharStyle:Code
7693 \begin_layout Plain Layout
7702 \begin_inset Flex CharStyle:Code
7705 \begin_layout Plain Layout
7716 \begin_inset Flex CharStyle:Code
7719 \begin_layout Plain Layout
7725 ] Whether the class-default should be printing on one or both sides of the
7727 Can be changed in the
7728 \begin_inset Flex CharStyle:MenuItem
7731 \begin_layout Plain Layout
7732 Document\SpecialChar \menuseparator
7741 \begin_layout Description
7742 \begin_inset Flex CharStyle:Code
7745 \begin_layout Plain Layout
7751 This sequence defines a new paragraph style.
7752 If the style already exists, it will redefine some of its parameters instead.
7754 \begin_inset space ~
7758 \begin_inset CommandInset ref
7760 reference "sub:Paragraph-Styles"
7766 \begin_inset Quotes eld
7770 \begin_inset Flex CharStyle:Code
7773 \begin_layout Plain Layout
7780 \begin_inset Quotes erd
7786 \begin_layout Description
7787 \begin_inset Flex CharStyle:Code
7790 \begin_layout Plain Layout
7797 \begin_inset Flex CharStyle:Code
7800 \begin_layout Plain Layout
7806 ] The name of the command or environment to be used with
7807 \begin_inset Flex CharStyle:Code
7810 \begin_layout Plain Layout
7819 \begin_layout Description
7820 \begin_inset Flex CharStyle:Code
7823 \begin_layout Plain Layout
7830 \begin_inset Flex CharStyle:Code
7833 \begin_layout Plain Layout
7842 \begin_inset Flex CharStyle:Code
7845 \begin_layout Plain Layout
7851 ] Indicates what kind of markup is used to define the title of a document.
7853 \begin_inset Flex CharStyle:Code
7856 \begin_layout Plain Layout
7862 means that the macro with name
7863 \begin_inset Flex CharStyle:Code
7866 \begin_layout Plain Layout
7872 will be inserted after the last layout which has
7873 \begin_inset Quotes eld
7877 \begin_inset Flex CharStyle:Code
7880 \begin_layout Plain Layout
7887 \begin_inset Quotes erd
7892 \begin_inset Flex CharStyle:Code
7895 \begin_layout Plain Layout
7901 corresponds to the case where the block of paragraphs which have
7902 \begin_inset Quotes eld
7906 \begin_inset Flex CharStyle:Code
7909 \begin_layout Plain Layout
7916 \begin_inset Quotes erd
7919 should be enclosed into the
7920 \begin_inset Flex CharStyle:Code
7923 \begin_layout Plain Layout
7932 \begin_layout Description
7933 \begin_inset Flex CharStyle:Code
7936 \begin_layout Plain Layout
7942 Sets which divisions are included in the table of contents.
7944 \begin_inset Flex CharStyle:Code
7947 \begin_layout Plain Layout
7956 \begin_layout Subsection
7957 \begin_inset Flex CharStyle:Code
7960 \begin_layout Plain Layout
7967 \begin_inset CommandInset label
7969 name "sub:ClassOptions"
7976 \begin_layout Standard
7978 \begin_inset Flex CharStyle:Code
7981 \begin_layout Plain Layout
7987 section can contain the following entries:
7990 \begin_layout Description
7991 \begin_inset Flex CharStyle:Code
7994 \begin_layout Plain Layout
8001 \begin_inset Flex CharStyle:Code
8004 \begin_layout Plain Layout
8010 ] The list of available font sizes for the document's main font, separated
8012 \begin_inset Quotes eld
8016 \begin_inset Flex CharStyle:Code
8019 \begin_layout Plain Layout
8026 \begin_inset Quotes erd
8032 \begin_layout Description
8033 \begin_inset Flex CharStyle:Code
8036 \begin_layout Plain Layout
8042 Used to set the DTD line with XML-based output classes.
8044 \begin_inset space \thinspace{}
8048 \begin_inset Quotes eld
8051 -//OASIS//DTD DocBook V4.2//EN
8052 \begin_inset Quotes erd
8058 \begin_layout Description
8059 \begin_inset Flex CharStyle:Code
8062 \begin_layout Plain Layout
8069 \begin_inset Flex CharStyle:Code
8072 \begin_layout Plain Layout
8073 string="empty|plain|headings|fancy"
8078 ] The list of available page styles, separated by
8079 \begin_inset Quotes eld
8083 \begin_inset Flex CharStyle:Code
8086 \begin_layout Plain Layout
8093 \begin_inset Quotes erd
8099 \begin_layout Description
8100 \begin_inset Flex CharStyle:Code
8103 \begin_layout Plain Layout
8110 \begin_inset Flex CharStyle:Code
8113 \begin_layout Plain Layout
8119 ] Some document class options, separated by a comma, that will be added
8120 to the optional part of the
8121 \begin_inset Flex CharStyle:Code
8124 \begin_layout Plain Layout
8135 \begin_layout Standard
8137 \begin_inset Flex CharStyle:Code
8140 \begin_layout Plain Layout
8146 section must end with
8147 \begin_inset Quotes eld
8151 \begin_inset Flex CharStyle:Code
8154 \begin_layout Plain Layout
8161 \begin_inset Quotes erd
8167 \begin_layout Subsection
8169 \begin_inset CommandInset label
8171 name "sub:Paragraph-Styles"
8178 \begin_layout Standard
8179 A paragraph style description looks like this:
8183 \begin_layout Plain Layout
8184 Note that this will either define a new layout or modify an existing one.
8192 \begin_layout LyX-Code
8199 \begin_layout LyX-Code
8203 \begin_layout LyX-Code
8207 \begin_layout Standard
8208 where the following commands are allowed:
8211 \begin_layout Description
8212 \begin_inset Flex CharStyle:Code
8215 \begin_layout Plain Layout
8222 \begin_inset Flex CharStyle:Code
8225 \begin_layout Plain Layout
8230 , left, right, center
8235 ] Paragraph alignment.
8238 \begin_layout Description
8239 \begin_inset Flex CharStyle:Code
8242 \begin_layout Plain Layout
8249 \begin_inset Flex CharStyle:Code
8252 \begin_layout Plain Layout
8257 , left, right, center
8262 ] A comma separated list of permitted alignments.
8263 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
8265 For example a right-aligned or centered enumeration isn't possible.)
8268 \begin_layout Description
8269 \begin_inset Flex CharStyle:Code
8272 \begin_layout Plain Layout
8279 \begin_inset Flex CharStyle:Code
8282 \begin_layout Plain Layout
8292 \begin_layout Plain Layout
8293 Note that a `float' here is a real number, such as: 1.5.
8298 The vertical space with which the last of a chain of paragraphs with this
8299 layout is separated from the following paragraph.
8300 If the next paragraph has another layout, the separations are not simply
8301 added, but the maximum is taken.
8304 \begin_layout Description
8305 \begin_inset Flex CharStyle:Code
8308 \begin_layout Plain Layout
8315 \begin_inset Flex CharStyle:Code
8318 \begin_layout Plain Layout
8324 The category for this style.
8325 This is used to group related styles in the Layout combobox on the toolbar.
8326 Any string can be used, but you may want to use existing categories with
8331 \begin_layout Description
8332 \begin_inset Flex CharStyle:Code
8335 \begin_layout Plain Layout
8341 Depth of XML command.
8342 Used only with XML-type formats.
8345 \begin_layout Description
8346 \begin_inset Flex CharStyle:Code
8349 \begin_layout Plain Layout
8356 \begin_inset CommandInset label
8358 name "des:CopyStyle"
8363 \begin_inset Flex CharStyle:Code
8366 \begin_layout Plain Layout
8372 Copies all the features of an existing style into the current one.
8376 \begin_layout Description
8377 \begin_inset Flex CharStyle:Code
8380 \begin_layout Plain Layout
8386 The name of a style whose preamble should be output
8391 This allows to ensure some ordering of the preamble snippets when macros
8392 definitions depend on one another.
8396 \begin_layout Plain Layout
8397 Note that, besides that functionality, there is no way to ensure any ordering
8399 The ordering that you see in a given version of LyX may change without
8400 warning in later versions.
8408 \begin_layout Description
8409 \begin_inset Flex CharStyle:Code
8412 \begin_layout Plain Layout
8419 \begin_inset Flex CharStyle:Code
8422 \begin_layout Plain Layout
8427 , Box, Filled_Box, Static
8432 ] The type of label that stands at the end of the paragraph (or sequence
8434 \begin_inset Flex CharStyle:Code
8437 \begin_layout Plain Layout
8444 \begin_inset Flex CharStyle:Code
8447 \begin_layout Plain Layout
8454 \begin_inset Flex CharStyle:Code
8457 \begin_layout Plain Layout
8464 \begin_inset Flex CharStyle:Code
8467 \begin_layout Plain Layout
8475 \begin_inset Flex CharStyle:Code
8478 \begin_layout Plain Layout
8485 \begin_inset Quotes eld
8489 \begin_inset Quotes erd
8493 \begin_inset Flex CharStyle:Code
8496 \begin_layout Plain Layout
8503 \begin_inset Flex CharStyle:Code
8506 \begin_layout Plain Layout
8507 \begin_inset space ~
8516 \begin_inset space ~
8519 black) square suitable for end of proof markers,
8520 \begin_inset Flex CharStyle:Code
8523 \begin_layout Plain Layout
8529 is an explicit text string.
8532 \begin_layout Description
8533 \begin_inset Flex CharStyle:Code
8536 \begin_layout Plain Layout
8543 \begin_inset Flex CharStyle:Code
8546 \begin_layout Plain Layout
8552 ] The string used for a label with a
8553 \begin_inset Flex CharStyle:Code
8556 \begin_layout Plain Layout
8563 \begin_inset Flex CharStyle:Code
8566 \begin_layout Plain Layout
8576 \begin_layout Description
8577 \begin_inset Flex CharStyle:Code
8580 \begin_layout Plain Layout
8587 \begin_inset Flex CharStyle:Code
8590 \begin_layout Plain Layout
8601 \begin_inset Flex CharStyle:Code
8604 \begin_layout Plain Layout
8613 \begin_layout Description
8614 \begin_inset Flex CharStyle:Code
8617 \begin_layout Plain Layout
8624 \begin_inset Flex CharStyle:Code
8627 \begin_layout Plain Layout
8637 ] With this parameter the
8638 \begin_inset Flex CharStyle:MenuItem
8641 \begin_layout Plain Layout
8648 \begin_inset Quotes eld
8651 Vertical space above
8652 \begin_inset Quotes erd
8656 \begin_inset Flex CharStyle:MenuItem
8659 \begin_layout Plain Layout
8660 Edit\SpecialChar \menuseparator
8662 \begin_inset space ~
8670 dialog can be set when initializing a paragraph with this style.
8674 \begin_layout Plain Layout
8677 Note from Jean-Marc:
8679 I'm not sure that this setting has much use, and it should probably be
8680 removed in later versions.
8688 \begin_layout Description
8689 \begin_inset Flex CharStyle:Code
8692 \begin_layout Plain Layout
8698 The font used for both the text body
8704 \begin_inset space ~
8708 \begin_inset CommandInset ref
8710 reference "sub:Font-description"
8715 Note that defining this font automatically defines the
8716 \begin_inset Flex CharStyle:Code
8719 \begin_layout Plain Layout
8726 So you should define this one first if you also want to define
8727 \begin_inset Flex CharStyle:Code
8730 \begin_layout Plain Layout
8739 \begin_layout Description
8740 \begin_inset Flex CharStyle:Code
8743 \begin_layout Plain Layout
8750 \begin_inset CommandInset label
8752 name "des:FreeSpacing"
8759 \begin_inset Flex CharStyle:Code
8762 \begin_layout Plain Layout
8773 \begin_inset Flex CharStyle:Code
8776 \begin_layout Plain Layout
8782 ] Usually LyX doesn't allow you to insert more than one space between words,
8783 since a space is considered as the separation between two words, not a
8784 character or symbol of its own.
8785 This is a very fine thing but sometimes annoying, for example, when typing
8786 program code or plain LaTeX code.
8788 \begin_inset Flex CharStyle:Code
8791 \begin_layout Plain Layout
8798 Note that LyX will create protected blanks for the additional blanks when
8799 in another mode than LaTeX-mode.
8802 \begin_layout Description
8803 \begin_inset Flex CharStyle:Code
8806 \begin_layout Plain Layout
8812 Language dependent information to be included in the LaTeX preamble when
8814 Note that this will completely override any prior
8815 \begin_inset Flex CharStyle:Code
8818 \begin_layout Plain Layout
8826 \begin_inset Quotes eld
8830 \begin_inset Flex CharStyle:Code
8833 \begin_layout Plain Layout
8840 \begin_inset Quotes erd
8844 The contents of this tag will occur once in the LaTeX preamble for each
8845 language used by the document.
8846 Each time, the following substitutions are made:
8850 \begin_layout Itemize
8851 \begin_inset Flex CharStyle:Code
8854 \begin_layout Plain Layout
8860 is replaced by the language name (as used by the babel package).
8863 \begin_layout Itemize
8865 \begin_inset Quotes eld
8869 \begin_inset Quotes erd
8873 \begin_inset Flex CharStyle:Code
8876 \begin_layout Plain Layout
8882 replaces its argument by the translation of the argument to the current
8886 \begin_layout Standard
8887 This preamble snippet will only be used if the document contains more than
8888 one language and the babel package is used.
8892 \begin_layout Description
8893 \begin_inset Flex CharStyle:Code
8896 \begin_layout Plain Layout
8903 \begin_inset Flex CharStyle:Code
8906 \begin_layout Plain Layout
8912 , but this preamble snippet occurs independently from the babel package,
8913 and only for the document language.
8915 \begin_inset Quotes eld
8919 \begin_inset Flex CharStyle:Code
8922 \begin_layout Plain Layout
8929 \begin_inset Quotes erd
8936 \begin_layout Standard
8937 If the style defines text that appears in the typeset document, it may use
8939 \begin_inset Flex CharStyle:Code
8942 \begin_layout Plain Layout
8949 \begin_inset Flex CharStyle:Code
8952 \begin_layout Plain Layout
8958 to support non-english and even multilanguage documents correctly.
8959 The following excerpt (from the
8960 \begin_inset Flex CharStyle:Code
8963 \begin_layout Plain Layout
8969 file) shows how this works:
8972 \begin_layout LyX-Code
8976 \begin_layout LyX-Code
8979 theoremstyle{remark}
8982 \begin_layout LyX-Code
8985 newtheorem{claim}[thm]{
8992 \begin_layout LyX-Code
8996 \begin_layout LyX-Code
9000 \begin_layout LyX-Code
9005 claimname}{_(Claim)}
9008 \begin_layout LyX-Code
9012 \begin_layout LyX-Code
9016 \begin_layout LyX-Code
9020 \begin_layout LyX-Code
9029 claimname}{_(Claim)}}
9032 \begin_layout LyX-Code
9036 \begin_layout Standard
9037 The key to correct translation of the user visible text is the definition
9039 \begin_inset Flex CharStyle:Code
9042 \begin_layout Plain Layout
9050 in the language preamble.
9051 This command holds the name of the theorem that will appear in the output.
9053 \begin_inset Flex CharStyle:Code
9056 \begin_layout Plain Layout
9062 then uses the commands offered by the babel package to redefine
9063 \begin_inset Flex CharStyle:Code
9066 \begin_layout Plain Layout
9074 for each used language in multilanguage documents.
9078 \begin_layout Description
9079 \begin_inset Flex CharStyle:Code
9082 \begin_layout Plain Layout
9088 [[FIXME]] (Used only with XML-type formats.)
9091 \begin_layout Description
9092 \begin_inset Flex CharStyle:Code
9095 \begin_layout Plain Layout
9102 \begin_inset Flex CharStyle:Code
9105 \begin_layout Plain Layout
9111 If 1, marks the layout as being part of a title block (see also the
9112 \begin_inset Flex CharStyle:Code
9115 \begin_layout Plain Layout
9122 \begin_inset Flex CharStyle:Code
9125 \begin_layout Plain Layout
9134 \begin_layout Description
9135 \begin_inset Flex CharStyle:Code
9138 \begin_layout Plain Layout
9145 \begin_inset Flex CharStyle:Code
9148 \begin_layout Plain Layout
9154 ] This provides extra space between paragraphs that have the same layout.
9155 If you put other layouts into an environment, each is separated with the
9157 \begin_inset Flex CharStyle:Code
9160 \begin_layout Plain Layout
9167 But the whole items of the environment are additionally separated with
9169 \begin_inset Flex CharStyle:Code
9172 \begin_layout Plain Layout
9184 \begin_layout Description
9185 \begin_inset Flex CharStyle:Code
9188 \begin_layout Plain Layout
9194 [[FIXME]] (Used only with XML-type formats.)
9197 \begin_layout Description
9198 \begin_inset Flex CharStyle:Code
9201 \begin_layout Plain Layout
9208 \begin_inset CommandInset label
9210 name "des:KeepEmpty"
9217 \begin_inset Flex CharStyle:Code
9220 \begin_layout Plain Layout
9231 \begin_inset Flex CharStyle:Code
9234 \begin_layout Plain Layout
9240 ] Usually LyX does not allow you to leave a paragraph empty, since it would
9241 lead to empty LaTeX output.
9242 There are some cases where this could be desirable however: in a letter
9243 template, the required fields can be provided as empty fields, so that
9244 people do not forget them; in some special classes, a layout can be used
9245 as some kind of break, which does not contain actual text.
9248 \begin_layout Description
9249 \begin_inset Flex CharStyle:Code
9252 \begin_layout Plain Layout
9258 [float=0] The vertical space between the label and the text body.
9259 Only used for labels that are above the text body (
9260 \begin_inset Flex CharStyle:Code
9263 \begin_layout Plain Layout
9270 \begin_inset Flex CharStyle:Code
9273 \begin_layout Plain Layout
9274 Centered_Top_Environment
9282 \begin_layout Description
9283 \begin_inset Flex CharStyle:Code
9286 \begin_layout Plain Layout
9293 \begin_inset Flex CharStyle:Code
9296 \begin_layout Plain Layout
9303 \begin_inset Newline newline
9306 The name of the counter for automatic numbering (see Section
9307 \begin_inset CommandInset ref
9309 reference "sub:Counters"
9314 This must be given if
9315 \begin_inset Flex CharStyle:Code
9318 \begin_layout Plain Layout
9325 \begin_inset Flex CharStyle:Code
9328 \begin_layout Plain Layout
9337 \begin_layout Description
9338 \begin_inset Flex CharStyle:Code
9341 \begin_layout Plain Layout
9347 The font used for the label.
9349 \begin_inset space ~
9353 \begin_inset CommandInset ref
9355 reference "sub:Font-description"
9362 \begin_layout Description
9363 \begin_inset Flex CharStyle:Code
9366 \begin_layout Plain Layout
9372 Text that indicates how far a label should be indented.
9375 \begin_layout Description
9376 \begin_inset Flex CharStyle:Code
9379 \begin_layout Plain Layout
9386 \begin_inset Flex CharStyle:Code
9389 \begin_layout Plain Layout
9395 ] The horizontal space between the label and the text body.
9396 Only used for labels that are not above the text body.
9399 \begin_layout Description
9400 \begin_inset Flex CharStyle:Code
9403 \begin_layout Plain Layout
9410 \begin_inset Flex CharStyle:Code
9413 \begin_layout Plain Layout
9419 ] The string used for a label with a
9420 \begin_inset Flex CharStyle:Code
9423 \begin_layout Plain Layout
9431 \begin_inset Flex CharStyle:Code
9434 \begin_layout Plain Layout
9440 is set, this string can be contain the special formatting commands described
9442 \begin_inset CommandInset ref
9444 reference "sub:Counters"
9452 \begin_layout Plain Layout
9453 For the sake of backwards compatibility, the string
9454 \begin_inset Flex CharStyle:Code
9457 \begin_layout Plain Layout
9467 will be replaced by the expanded
9468 \begin_inset Flex CharStyle:Code
9471 \begin_layout Plain Layout
9478 \begin_inset Flex CharStyle:Code
9481 \begin_layout Plain Layout
9490 This feature is now obsolete and should be replaced by the mechanisms of
9492 \begin_inset CommandInset ref
9494 reference "sub:Counters"
9506 \begin_layout Description
9507 \begin_inset Flex CharStyle:Code
9510 \begin_layout Plain Layout
9517 \begin_inset Flex CharStyle:Code
9520 \begin_layout Plain Layout
9526 ] This is used inside the appendix instead of
9527 \begin_inset Flex CharStyle:Code
9530 \begin_layout Plain Layout
9538 \begin_inset Flex CharStyle:Code
9541 \begin_layout Plain Layout
9548 \begin_inset Flex CharStyle:Code
9551 \begin_layout Plain Layout
9560 \begin_layout Description
9561 \begin_inset Flex CharStyle:Code
9564 \begin_layout Plain Layout
9570 [FIXME] (Used only with XML-type formats.)
9573 \begin_layout Description
9574 \begin_inset Flex CharStyle:Code
9577 \begin_layout Plain Layout
9584 \begin_inset Flex CharStyle:Code
9587 \begin_layout Plain Layout
9592 , Manual, Static, Top_Environment,
9593 \begin_inset Newline newline
9596 Centered_Top_Environment, Sensitive, Counter
9602 \begin_inset Newline newline
9606 \begin_inset Flex CharStyle:Code
9609 \begin_layout Plain Layout
9615 means the label is the very first word (up to the first real blank).
9619 \begin_layout Plain Layout
9620 Use protected spaces if you want more than one word as the label.
9626 \begin_inset Flex CharStyle:Code
9629 \begin_layout Plain Layout
9635 means it is defined in the layout (see
9636 \begin_inset Flex CharStyle:Code
9639 \begin_layout Plain Layout
9647 \begin_inset Flex CharStyle:Code
9650 \begin_layout Plain Layout
9657 \begin_inset Flex CharStyle:Code
9660 \begin_layout Plain Layout
9661 Centered_Top_Environment
9666 are special cases of
9667 \begin_inset Flex CharStyle:Code
9670 \begin_layout Plain Layout
9677 The label will be printed above the paragraph, but only at the top of an
9678 environment or the top of a chain of paragraphs with this layout.
9679 Usage is for example the
9680 \begin_inset Flex CharStyle:MenuItem
9683 \begin_layout Plain Layout
9690 \begin_inset Flex CharStyle:MenuItem
9693 \begin_layout Plain Layout
9700 This is also the case for
9701 \begin_inset Flex CharStyle:Code
9704 \begin_layout Plain Layout
9710 labels with latex type
9711 \begin_inset Flex CharStyle:Code
9714 \begin_layout Plain Layout
9720 , in order to make layouts for theorems work correctly.
9722 \begin_inset Flex CharStyle:Code
9725 \begin_layout Plain Layout
9731 is a special case for the caption-labels
9732 \begin_inset Quotes eld
9736 \begin_inset Quotes erd
9740 \begin_inset Quotes eld
9744 \begin_inset Quotes erd
9749 \begin_inset Flex CharStyle:Code
9752 \begin_layout Plain Layout
9758 means the (hardcoded) label string depends on the kind of float.
9760 \begin_inset Flex CharStyle:Code
9763 \begin_layout Plain Layout
9769 label type defines automatically numbered labels.
9771 \begin_inset CommandInset ref
9773 reference "sub:Counters"
9780 \begin_layout Description
9781 \begin_inset Flex CharStyle:Code
9784 \begin_layout Plain Layout
9790 The name of the corresponding LaTeX stuff.
9791 Either the environment or command name.
9794 \begin_layout Description
9795 \begin_inset Flex CharStyle:Code
9798 \begin_layout Plain Layout
9804 An optional parameter for the corresponding
9805 \begin_inset Flex CharStyle:Code
9808 \begin_layout Plain Layout
9815 This parameter cannot be changed from within LyX.
9818 \begin_layout Description
9819 \begin_inset Flex CharStyle:Code
9822 \begin_layout Plain Layout
9829 \begin_inset CommandInset label
9831 name "des:LatexType"
9836 \begin_inset Flex CharStyle:Code
9839 \begin_layout Plain Layout
9844 , Command, Environment, Item_Environment,
9850 \begin_inset Flex CharStyle:Code
9853 \begin_layout Plain Layout
9859 ] How the layout should be translated into LaTeX.
9861 \begin_inset Flex CharStyle:Code
9864 \begin_layout Plain Layout
9870 means nothing special.
9872 \begin_inset Flex CharStyle:Code
9875 \begin_layout Plain Layout
9882 \begin_inset Flex CharStyle:Code
9885 \begin_layout Plain Layout
9892 {\SpecialChar \ldots{}
9899 \begin_inset Flex CharStyle:Code
9902 \begin_layout Plain Layout
9909 \begin_inset Flex CharStyle:Code
9912 \begin_layout Plain Layout
9919 }\SpecialChar \ldots{}
9933 \begin_inset Flex CharStyle:Code
9936 \begin_layout Plain Layout
9943 \begin_inset Flex CharStyle:Code
9946 \begin_layout Plain Layout
9953 \begin_inset Flex CharStyle:Code
9956 \begin_layout Plain Layout
9964 is generated for each paragraph of this environment.
9966 \begin_inset Flex CharStyle:Code
9969 \begin_layout Plain Layout
9976 \begin_inset Flex CharStyle:Code
9979 \begin_layout Plain Layout
9986 \begin_inset Flex CharStyle:Code
9989 \begin_layout Plain Layout
9995 is passed as an argument to the environment.
9997 \begin_inset Flex CharStyle:Code
10000 \begin_layout Plain Layout
10006 can be defined in the
10007 \begin_inset Flex CharStyle:MenuItem
10010 \begin_layout Plain Layout
10015 ayout\SpecialChar \menuseparator
10027 \begin_inset Flex CharStyle:Code
10030 \begin_layout Plain Layout
10038 is perhaps a bit misleading, since these rules apply to SGML classes, too.
10039 Visit the SGML class files for specific examples.
10042 \begin_layout Standard
10043 Putting the last few things together, the LaTeX output will be either:
10046 \begin_layout LyX-Code
10049 latexname[latexparam]{\SpecialChar \ldots{}
10053 \begin_layout Standard
10057 \begin_layout LyX-Code
10060 begin{latexname}[latexparam] \SpecialChar \ldots{}
10066 \begin_layout Standard
10067 depending upon the LaTeX type.
10070 \begin_layout Description
10071 \begin_inset Flex CharStyle:Code
10074 \begin_layout Plain Layout
10081 \begin_inset Flex CharStyle:Code
10084 \begin_layout Plain Layout
10090 ] If you put layouts into environments, the leftmargins are not simply added,
10091 but added with a factor
10092 \begin_inset Formula $\frac{4}{depth+4}$
10096 Note that this parameter is also used when the margin is defined as
10097 \begin_inset Flex CharStyle:Code
10100 \begin_layout Plain Layout
10107 \begin_inset Flex CharStyle:Code
10110 \begin_layout Plain Layout
10117 Then it is added to the manual or dynamic margin.
10119 \begin_inset Newline newline
10122 The argument is passed as a string.
10124 \begin_inset Quotes eld
10128 \begin_inset Flex CharStyle:Code
10131 \begin_layout Plain Layout
10138 \begin_inset Quotes erd
10141 means that the paragraph is indented with the width of
10142 \begin_inset Quotes eld
10146 \begin_inset Flex CharStyle:Code
10149 \begin_layout Plain Layout
10156 \begin_inset Quotes erd
10159 in the normal font.
10160 You can get a negative width by prefixing the string with
10161 \begin_inset Quotes eld
10165 \begin_inset Flex CharStyle:Code
10168 \begin_layout Plain Layout
10175 \begin_inset Quotes erd
10179 This way was chosen so that the look is the same with each used screen
10184 \begin_layout Description
10185 \begin_inset Flex CharStyle:Code
10188 \begin_layout Plain Layout
10195 \begin_inset Flex CharStyle:Code
10198 \begin_layout Plain Layout
10203 , Manual, Dynamic, First_Dynamic, Right_Address_Box
10209 \begin_inset Newline newline
10212 The kind of margin that the layout has on the left side.
10214 \begin_inset Flex CharStyle:Code
10217 \begin_layout Plain Layout
10223 just means a fixed margin.
10225 \begin_inset Flex CharStyle:Code
10228 \begin_layout Plain Layout
10234 means that the left margin depends on the string entered in the
10235 \begin_inset Flex CharStyle:MenuItem
10238 \begin_layout Plain Layout
10239 Edit\SpecialChar \menuseparator
10241 \begin_inset space ~
10250 This is used to typeset nice lists without tabulators.
10252 \begin_inset Flex CharStyle:Code
10255 \begin_layout Plain Layout
10261 means that the margin depends on the size of the label.
10262 This is used for automatic enumerated headlines.
10263 It is obvious that the headline
10264 \begin_inset Quotes eld
10267 5.4.3.2.1 Very long headline
10268 \begin_inset Quotes erd
10271 must have a wider left margin (as wide as
10272 \begin_inset Quotes eld
10276 \begin_inset Quotes erd
10279 plus the space) than
10280 \begin_inset Quotes eld
10283 3.2 Very long headline
10284 \begin_inset Quotes erd
10288 \begin_inset Quotes eld
10292 \begin_inset Quotes erd
10295 are not able to do this.
10297 \begin_inset Flex CharStyle:Code
10300 \begin_layout Plain Layout
10306 is similar, but only the very first row of the paragraph is dynamic, while
10307 the others are static; this is used, for example, for descriptions.
10309 \begin_inset Flex CharStyle:Code
10312 \begin_layout Plain Layout
10318 means the margin is chosen in a way that the longest row of this paragraph
10319 fits to the right margin.
10320 This is used to typeset an address on the right edge of the page.
10323 \begin_layout Description
10324 \begin_inset Flex CharStyle:Code
10327 \begin_layout Plain Layout
10334 \begin_inset Flex CharStyle:Code
10337 \begin_layout Plain Layout
10346 \begin_inset Flex CharStyle:Code
10349 \begin_layout Plain Layout
10355 ] Whether fragile commands in this layout should be
10356 \begin_inset Flex CharStyle:Code
10359 \begin_layout Plain Layout
10372 whether this command should itself be protected.)
10375 \begin_layout Description
10376 \begin_inset Flex CharStyle:Code
10379 \begin_layout Plain Layout
10386 \begin_inset Flex CharStyle:Code
10389 \begin_layout Plain Layout
10396 \begin_inset Flex CharStyle:Code
10399 \begin_layout Plain Layout
10407 ] Whether newlines are translated into LaTeX newlines (
10408 \begin_inset Flex CharStyle:Code
10411 \begin_layout Plain Layout
10422 The translation can be switched off to allow more comfortable LaTeX editing
10426 \begin_layout Description
10427 \begin_inset Flex CharStyle:Code
10430 \begin_layout Plain Layout
10437 \begin_inset Flex CharStyle:Code
10440 \begin_layout Plain Layout
10447 \begin_inset Flex CharStyle:Code
10450 \begin_layout Plain Layout
10458 ] Whether the following Paragraph is allowed to indent its very first row.
10460 \begin_inset Flex CharStyle:Code
10463 \begin_layout Plain Layout
10469 means that it is not allowed to do so;
10470 \begin_inset Flex CharStyle:Code
10473 \begin_layout Plain Layout
10479 means it could do so if it wants to.
10482 \begin_layout Description
10483 \begin_inset Flex CharStyle:Code
10486 \begin_layout Plain Layout
10492 Name of a layout that has replaced this layout.
10493 This is used to rename a layout, while keeping backward compatibility.
10496 \begin_layout Description
10497 \begin_inset Flex CharStyle:Code
10500 \begin_layout Plain Layout
10507 \begin_inset Flex CharStyle:Code
10510 \begin_layout Plain Layout
10516 ] The number of optional arguments that can be used with this layout.
10517 This is useful for things like section headings, and only makes sense with
10521 \begin_layout Description
10522 \begin_inset Flex CharStyle:Code
10525 \begin_layout Plain Layout
10532 \begin_inset Flex CharStyle:Code
10535 \begin_layout Plain Layout
10541 ] The indent of the very first line of a paragraph.
10543 \begin_inset Flex CharStyle:Code
10546 \begin_layout Plain Layout
10552 will be fixed for a certain layout.
10553 The exception is Standard layout, since the indentation of a Standard layout
10554 paragraph can be prohibited with
10555 \begin_inset Flex CharStyle:Code
10558 \begin_layout Plain Layout
10565 Also, Standard layout paragraphs inside environments use the
10566 \begin_inset Flex CharStyle:Code
10569 \begin_layout Plain Layout
10575 of the environment, not their native one.
10576 For example, Standard paragraphs inside an enumeration are not indented.
10579 \begin_layout Description
10580 \begin_inset Flex CharStyle:Code
10583 \begin_layout Plain Layout
10590 \begin_inset Flex CharStyle:Code
10593 \begin_layout Plain Layout
10599 ] The vertical space between two paragraphs of this layout.
10602 \begin_layout Description
10603 \begin_inset Flex CharStyle:Code
10606 \begin_layout Plain Layout
10613 \begin_inset Flex CharStyle:Code
10616 \begin_layout Plain Layout
10622 ] LyX allows the user to choose either
10623 \begin_inset Quotes eld
10627 \begin_inset Quotes erd
10631 \begin_inset Quotes eld
10635 \begin_inset Quotes erd
10638 to typeset a document.
10640 \begin_inset Quotes eld
10644 \begin_inset Quotes erd
10647 is chosen, this value is completely ignored.
10649 \begin_inset Quotes eld
10653 \begin_inset Quotes erd
10656 is chosen, the parindent of a LaTeXtype
10657 \begin_inset Quotes eld
10661 \begin_inset Quotes erd
10664 layout is ignored and all paragraphs are separated by this parskip argument.
10665 The vertical space is calculated with
10666 \begin_inset Flex CharStyle:Code
10669 \begin_layout Plain Layout
10671 \begin_inset space ~
10680 \begin_inset Flex CharStyle:Code
10683 \begin_layout Plain Layout
10689 is the height of a row with the normal font.
10690 This way, the look stays the same with different screen fonts.
10693 \begin_layout Description
10694 \begin_inset Flex CharStyle:Code
10697 \begin_layout Plain Layout
10704 \begin_inset CommandInset label
10706 name "des:PathThru"
10713 \begin_inset Flex CharStyle:Code
10716 \begin_layout Plain Layout
10727 \begin_inset Flex CharStyle:Code
10730 \begin_layout Plain Layout
10736 ] Whether the contents of this paragraph should be output in raw form, meaning
10737 without special translations that LaTeX would require.
10740 \begin_layout Description
10741 \begin_inset Flex CharStyle:Code
10744 \begin_layout Plain Layout
10751 \begin_inset CommandInset label
10753 name "des:Preamble"
10757 Information to be included in the LaTeX preamble when this style is used.
10758 Used to define macros, load packages, etc., required by this particular
10761 \begin_inset Quotes eld
10765 \begin_inset Flex CharStyle:Code
10768 \begin_layout Plain Layout
10775 \begin_inset Quotes erd
10781 \begin_layout Description
10782 \begin_inset Flex CharStyle:Code
10785 \begin_layout Plain Layout
10792 \begin_inset Flex CharStyle:Code
10795 \begin_layout Plain Layout
10802 \begin_inset CommandInset label
10804 name "des:Requires"
10808 Whether the layout requires the feature
10809 \begin_inset Flex CharStyle:Code
10812 \begin_layout Plain Layout
10819 See the description of
10820 \begin_inset Flex CharStyle:Code
10823 \begin_layout Plain Layout
10830 \begin_inset CommandInset ref
10831 LatexCommand pageref
10832 reference "des:FreeSpacing"
10836 ) for information on `features'.
10840 \begin_layout Description
10841 \begin_inset Flex CharStyle:Code
10844 \begin_layout Plain Layout
10851 \begin_inset Flex CharStyle:Code
10854 \begin_layout Plain Layout
10861 \begin_inset Flex CharStyle:Code
10864 \begin_layout Plain Layout
10873 \begin_layout Description
10874 \begin_inset Flex CharStyle:Code
10877 \begin_layout Plain Layout
10884 \begin_inset Flex CharStyle:Code
10887 \begin_layout Plain Layout
10892 , onehalf, double, other
10901 ] This defines what the default spacing should be in the layout.
10903 \begin_inset Flex CharStyle:Code
10906 \begin_layout Plain Layout
10913 \begin_inset Flex CharStyle:Code
10916 \begin_layout Plain Layout
10923 \begin_inset Flex CharStyle:Code
10926 \begin_layout Plain Layout
10932 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
10933 If you specify the argument
10934 \begin_inset Flex CharStyle:Code
10937 \begin_layout Plain Layout
10943 , then you should also provide a numerical argument which will be the actual
10945 Note that, contrary to other parameters,
10946 \begin_inset Flex CharStyle:Code
10949 \begin_layout Plain Layout
10955 implies the generation of specific LaTeX code, using the package
10958 \begin_inset Flex CharStyle:Code
10961 \begin_layout Plain Layout
10970 \begin_layout Description
10971 \begin_inset Flex CharStyle:Code
10974 \begin_layout Plain Layout
10980 The font used for the text body .
10982 \begin_inset CommandInset ref
10984 reference "sub:Font-description"
10991 \begin_layout Description
10992 \begin_inset Flex CharStyle:Code
10995 \begin_layout Plain Layout
11003 The level of the style in the table of contents.
11004 This is used for automatic numbering of section headings.
11007 \begin_layout Description
11008 \begin_inset Flex CharStyle:Code
11011 \begin_layout Plain Layout
11018 \begin_inset Flex CharStyle:Code
11021 \begin_layout Plain Layout
11027 ] The vertical space with which the very first of a chain of paragraphs
11028 with this layout is separated from the previous paragraph.
11029 If the previous paragraph has another layout, the separations are not simply
11030 added, but the maximum is taken.
11033 \begin_layout Subsection
11035 \begin_inset CommandInset label
11044 \begin_layout Standard
11045 Since version 1.3.0 of LyX, it is has been both possible and necessary to
11046 define the floats (
11047 \begin_inset Flex CharStyle:MenuItem
11050 \begin_layout Plain Layout
11057 \begin_inset Flex CharStyle:MenuItem
11060 \begin_layout Plain Layout
11066 , \SpecialChar \ldots{}
11067 ) in the text class itself.
11068 Standard floats are included in the file
11069 \begin_inset Flex CharStyle:Code
11072 \begin_layout Plain Layout
11078 , so you may have to do no more than add
11081 \begin_layout LyX-Code
11082 Input stdfloats.inc
11085 \begin_layout Standard
11086 to your layout file.
11087 If you want to implement a text class that proposes some other float types
11088 (like the AGU class bundled with LyX), the information below will hopefully
11092 \begin_layout Description
11093 \begin_inset Flex CharStyle:Code
11096 \begin_layout Plain Layout
11103 \begin_inset Flex CharStyle:Code
11106 \begin_layout Plain Layout
11113 \begin_inset Quotes erd
11117 \begin_inset Quotes erd
11120 ] The file name extension of an auxiliary file for the list of figures (or
11122 LaTeX writes the captions to this file.
11125 \begin_layout Description
11126 \begin_inset Flex CharStyle:Code
11129 \begin_layout Plain Layout
11136 \begin_inset Flex CharStyle:Code
11139 \begin_layout Plain Layout
11146 \begin_inset Quotes erd
11150 \begin_inset Quotes erd
11153 ] The string that will be used in the menus and also for the caption.
11156 \begin_layout Description
11157 \begin_inset Flex CharStyle:Code
11160 \begin_layout Plain Layout
11167 \begin_inset Flex CharStyle:Code
11170 \begin_layout Plain Layout
11179 \begin_inset Flex CharStyle:Code
11182 \begin_layout Plain Layout
11189 \begin_inset Flex CharStyle:Code
11192 \begin_layout Plain Layout
11198 if the float is already defined by the LaTeX document class.
11200 \begin_inset Flex CharStyle:Code
11203 \begin_layout Plain Layout
11209 , the float will be defined using the LaTeX package
11210 \begin_inset Flex CharStyle:Code
11213 \begin_layout Plain Layout
11222 \begin_layout Description
11223 \begin_inset Flex CharStyle:Code
11226 \begin_layout Plain Layout
11233 \begin_inset Flex CharStyle:Code
11236 \begin_layout Plain Layout
11243 \begin_inset Quotes erd
11247 \begin_inset Quotes erd
11250 ] The heading used for the list of floats.
11253 \begin_layout Description
11254 \begin_inset Flex CharStyle:Code
11257 \begin_layout Plain Layout
11264 \begin_inset Flex CharStyle:Code
11267 \begin_layout Plain Layout
11274 \begin_inset Quotes erd
11278 \begin_inset Quotes erd
11281 ] This (optional) argument determines whether floats of this class will
11282 be numbered within some sectional unit of the document.
11283 For example, if within is equal to
11284 \begin_inset Flex CharStyle:Code
11287 \begin_layout Plain Layout
11293 , the floats will be numbered within chapters.
11297 \begin_layout Description
11298 \begin_inset Flex CharStyle:Code
11301 \begin_layout Plain Layout
11308 \begin_inset Flex CharStyle:Code
11311 \begin_layout Plain Layout
11318 \begin_inset Quotes erd
11322 \begin_inset Quotes erd
11325 ] The default placement for the given class of floats.
11326 The string should be as in standard LaTeX:
11327 \begin_inset Flex CharStyle:Code
11330 \begin_layout Plain Layout
11337 \begin_inset Flex CharStyle:Code
11340 \begin_layout Plain Layout
11347 \begin_inset Flex CharStyle:Code
11350 \begin_layout Plain Layout
11357 \begin_inset Flex CharStyle:Code
11360 \begin_layout Plain Layout
11366 for top, bottom, page, and here, respectively.
11370 \begin_layout Plain Layout
11371 Note that the order of these letters in the string is irrelevant, like in
11377 On top of that there is a new type,
11378 \begin_inset Flex CharStyle:Code
11381 \begin_layout Plain Layout
11387 , which does not really correspond to a float, since it means: put it
11388 \begin_inset Quotes eld
11392 \begin_inset Quotes erd
11396 Note however that the
11397 \begin_inset Flex CharStyle:Code
11400 \begin_layout Plain Layout
11406 specifier is special and, because of implementation details, cannot be
11407 used in non-built in float types.
11408 If you do not understand what this means, just use
11409 \begin_inset Quotes eld
11413 \begin_inset Flex CharStyle:Code
11416 \begin_layout Plain Layout
11423 \begin_inset Quotes erd
11429 \begin_layout Description
11430 \begin_inset Flex CharStyle:Code
11433 \begin_layout Plain Layout
11440 \begin_inset Flex CharStyle:Code
11443 \begin_layout Plain Layout
11450 \begin_inset Quotes erd
11454 \begin_inset Quotes erd
11457 ] The style used when defining the float using
11458 \begin_inset Flex CharStyle:Code
11461 \begin_layout Plain Layout
11472 \begin_layout Description
11473 \begin_inset Flex CharStyle:Code
11476 \begin_layout Plain Layout
11483 \begin_inset Flex CharStyle:Code
11486 \begin_layout Plain Layout
11493 \begin_inset Quotes erd
11497 \begin_inset Quotes erd
11501 \begin_inset Quotes eld
11505 \begin_inset Quotes erd
11508 of the new class of floats, like program or algorithm.
11509 After the appropriate
11510 \begin_inset Flex CharStyle:Code
11513 \begin_layout Plain Layout
11522 \begin_inset Flex CharStyle:Code
11525 \begin_layout Plain Layout
11534 \begin_inset Flex CharStyle:Code
11537 \begin_layout Plain Layout
11548 \begin_layout Standard
11549 Note that defining a float with type
11550 \begin_inset Flex CharStyle:Code
11553 \begin_layout Plain Layout
11561 automatically defines the corresponding counter with name
11562 \begin_inset Flex CharStyle:Code
11565 \begin_layout Plain Layout
11576 \begin_layout Subsection
11577 Flex insets and InsetLayout
11578 \begin_inset CommandInset label
11580 name "sub:Flex-insets-and"
11587 \begin_layout Standard
11588 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
11589 these are called Flex insets.
11593 \begin_layout Standard
11594 Flex insets come in three different kinds:
11597 \begin_layout Itemize
11599 \begin_inset Flex CharStyle:Code
11602 \begin_layout Plain Layout
11608 ): These define semantic markup corresponding to such LaTeX commands as
11610 \begin_inset Flex CharStyle:Code
11613 \begin_layout Plain Layout
11622 \begin_inset Flex CharStyle:Code
11625 \begin_layout Plain Layout
11636 \begin_layout Itemize
11638 \begin_inset Flex CharStyle:Code
11641 \begin_layout Plain Layout
11647 ): These can be used to define custom collapsible insets, similar to TeX
11648 code, footnote, and the like.
11649 An obvious example is an endnote inset, which is defined in the
11650 \begin_inset Flex CharStyle:Code
11653 \begin_layout Plain Layout
11662 \begin_layout Itemize
11664 \begin_inset Flex CharStyle:Code
11667 \begin_layout Plain Layout
11673 ): For use with DocBook classes.
11676 \begin_layout Standard
11677 Flex insets are defined using the
11678 \begin_inset Flex CharStyle:Code
11681 \begin_layout Plain Layout
11687 tag, which shall be explained in a moment.
11690 \begin_layout Standard
11692 \begin_inset Flex CharStyle:Code
11695 \begin_layout Plain Layout
11701 tag also serves another function: It can be used to customize the general
11702 layout of many different types of insets.
11704 \begin_inset Flex CharStyle:Code
11707 \begin_layout Plain Layout
11713 can be used to customize the layout parameters for footnotes, marginal
11714 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
11715 boxes, tables, algorithms, URLs, and optional arguments, as well as to
11716 define Flex insets.
11719 \begin_layout Standard
11721 \begin_inset Flex CharStyle:Code
11724 \begin_layout Plain Layout
11730 definition must begin with a line of the form:
11733 \begin_layout LyX-Code
11737 \begin_layout Standard
11739 \begin_inset Flex CharStyle:Code
11742 \begin_layout Plain Layout
11748 indicates the inset whose layout is being defined, and here there are two
11752 \begin_layout Enumerate
11753 The layout for a pre-existing inset is being modified.
11754 In this case, can be
11755 \begin_inset Flex CharStyle:Code
11758 \begin_layout Plain Layout
11764 any one of the following:
11765 \begin_inset Flex CharStyle:Code
11768 \begin_layout Plain Layout
11775 \begin_inset Flex CharStyle:Code
11778 \begin_layout Plain Layout
11785 \begin_inset Flex CharStyle:Code
11788 \begin_layout Plain Layout
11795 \begin_inset Flex CharStyle:Code
11798 \begin_layout Plain Layout
11805 \begin_inset Flex CharStyle:Code
11808 \begin_layout Plain Layout
11815 \begin_inset Flex CharStyle:Code
11818 \begin_layout Plain Layout
11825 \begin_inset Flex CharStyle:Code
11828 \begin_layout Plain Layout
11835 \begin_inset Flex CharStyle:Code
11838 \begin_layout Plain Layout
11845 \begin_inset Flex CharStyle:Code
11848 \begin_layout Plain Layout
11855 \begin_inset Flex CharStyle:Code
11858 \begin_layout Plain Layout
11865 \begin_inset Flex CharStyle:Code
11868 \begin_layout Plain Layout
11875 \begin_inset Flex CharStyle:Code
11878 \begin_layout Plain Layout
11885 \begin_inset Flex CharStyle:Code
11888 \begin_layout Plain Layout
11895 \begin_inset Flex CharStyle:Code
11898 \begin_layout Plain Layout
11905 \begin_inset Flex CharStyle:Code
11908 \begin_layout Plain Layout
11915 \begin_inset Flex CharStyle:Code
11918 \begin_layout Plain Layout
11925 \begin_inset Flex CharStyle:Code
11928 \begin_layout Plain Layout
11935 \begin_inset Flex CharStyle:Code
11938 \begin_layout Plain Layout
11945 \begin_inset Flex CharStyle:Code
11948 \begin_layout Plain Layout
11955 \begin_inset Flex CharStyle:Code
11958 \begin_layout Plain Layout
11968 \begin_layout Enumerate
11969 The layout for a Flex inset is being defined.
11971 \begin_inset Flex CharStyle:Code
11974 \begin_layout Plain Layout
11980 can be any valid identifier not used by a pre-existing inset.
11981 Note that the definition of a flex inset must
11986 \begin_inset Flex CharStyle:Code
11989 \begin_layout Plain Layout
11998 \begin_layout Standard
12000 \begin_inset Flex CharStyle:Code
12003 \begin_layout Plain Layout
12009 definition can contain the following entries:
12012 \begin_layout Description
12013 \begin_inset Flex CharStyle:Code
12016 \begin_layout Plain Layout
12022 The color for the inset's background.
12023 The valid colors are defined in
12024 \begin_inset Flex CharStyle:Code
12027 \begin_layout Plain Layout
12036 \begin_layout Description
12037 \begin_inset Flex CharStyle:Code
12040 \begin_layout Plain Layout
12046 As with paragraph styles (see page
12047 \begin_inset CommandInset ref
12049 reference "des:CopyStyle"
12056 \begin_layout Description
12057 \begin_inset Flex CharStyle:Code
12060 \begin_layout Plain Layout
12067 \begin_inset Flex CharStyle:Code
12070 \begin_layout Plain Layout
12079 \begin_inset Flex CharStyle:Code
12082 \begin_layout Plain Layout
12088 ] Indicates whether the user may employ the Paragraph Settings dialog to
12089 customize the paragraph.
12092 \begin_layout Description
12093 \begin_inset Flex CharStyle:Code
12096 \begin_layout Plain Layout
12103 \begin_inset Flex CharStyle:Code
12106 \begin_layout Plain Layout
12113 \begin_inset Flex CharStyle:Code
12116 \begin_layout Plain Layout
12123 \begin_inset Flex CharStyle:Code
12126 \begin_layout Plain Layout
12132 , describing the rendering style used for the inset's frame and buttons.
12133 Footnotes generally use
12134 \begin_inset Flex CharStyle:Code
12137 \begin_layout Plain Layout
12143 , ERT insets generally
12144 \begin_inset Flex CharStyle:Code
12147 \begin_layout Plain Layout
12153 , and character styles
12154 \begin_inset Flex CharStyle:Code
12157 \begin_layout Plain Layout
12166 \begin_layout Description
12167 \begin_inset Flex CharStyle:Code
12170 \begin_layout Plain Layout
12176 Required at the end of the InsetLayout declarations.
12179 \begin_layout Description
12180 \begin_inset Flex CharStyle:Code
12183 \begin_layout Plain Layout
12189 The font used for both the text body
12195 \begin_inset space ~
12199 \begin_inset CommandInset ref
12201 reference "sub:Font-description"
12206 Note that defining this font automatically defines the
12207 \begin_inset Flex CharStyle:Code
12210 \begin_layout Plain Layout
12216 to the same value, so define this first and define
12217 \begin_inset Flex CharStyle:Code
12220 \begin_layout Plain Layout
12226 later if you want them to be different.
12229 \begin_layout Description
12230 \begin_inset Flex CharStyle:Code
12233 \begin_layout Plain Layout
12240 \begin_inset Quotes eld
12244 \begin_inset Quotes erd
12247 language, leading to Left-to-Right (latin) output, e.
12248 \begin_inset space \thinspace{}
12252 \begin_inset space \space{}
12255 in TeX code or URL.
12259 \begin_layout Description
12260 \begin_inset Flex CharStyle:Code
12263 \begin_layout Plain Layout
12270 \begin_inset Flex CharStyle:Code
12273 \begin_layout Plain Layout
12282 \begin_inset Flex CharStyle:Code
12285 \begin_layout Plain Layout
12291 ] Indicates whether the PlainLayout should be used or, instead, the user
12292 can change the paragraph style used in the inset.
12295 \begin_layout Description
12296 \begin_inset Flex CharStyle:Code
12299 \begin_layout Plain Layout
12305 As with paragraph styles (see page
12306 \begin_inset CommandInset ref
12307 LatexCommand pageref
12308 reference "des:FreeSpacing"
12315 \begin_layout Description
12316 \begin_inset Flex CharStyle:Code
12319 \begin_layout Plain Layout
12326 \begin_inset Flex CharStyle:Code
12329 \begin_layout Plain Layout
12338 \begin_inset Flex CharStyle:Code
12341 \begin_layout Plain Layout
12347 ] Whether to include the contents of this inset in the strings generated
12348 for the `Outline' pane.
12349 One would not, for example, want the content of a footnote in a section
12350 header to be included in the TOC displayed in the outline, but one would
12351 normally want the content of a character style displayed.
12352 Default is false: not to include.
12355 \begin_layout Description
12356 \begin_inset Flex CharStyle:Code
12359 \begin_layout Plain Layout
12365 As with paragraph styles (see page
12366 \begin_inset CommandInset ref
12367 LatexCommand pageref
12368 reference "des:KeepEmpty"
12375 \begin_layout Description
12376 \begin_inset Flex CharStyle:Code
12379 \begin_layout Plain Layout
12385 The font used for the label.
12387 \begin_inset space ~
12391 \begin_inset CommandInset ref
12393 reference "sub:Font-description"
12398 Note that this definition can never appear before
12399 \begin_inset Flex CharStyle:Code
12402 \begin_layout Plain Layout
12408 , lest it be ineffective.
12411 \begin_layout Description
12412 \begin_inset Flex CharStyle:Code
12415 \begin_layout Plain Layout
12421 What will be displayed on the button or elsewhere as the inset label.
12422 Some inset types (TeX code and Branch) modify this label on the fly.
12425 \begin_layout Description
12426 \begin_inset Flex CharStyle:Code
12429 \begin_layout Plain Layout
12435 The name of the corresponding LaTeX stuff.
12436 Either the environment or command name.
12439 \begin_layout Description
12440 \begin_inset Flex CharStyle:Code
12443 \begin_layout Plain Layout
12449 The optional parameter for the corresponding
12450 \begin_inset Flex CharStyle:Code
12453 \begin_layout Plain Layout
12459 stuff, including possible bracket pairs like
12460 \begin_inset Flex CharStyle:Code
12463 \begin_layout Plain Layout
12470 This parameter cannot be changed from within LyX.
12473 \begin_layout Description
12474 \begin_inset Flex CharStyle:Code
12477 \begin_layout Plain Layout
12483 As with paragraph styles (see page
12484 \begin_inset CommandInset ref
12485 LatexCommand pageref
12486 reference "des:LatexType"
12493 \begin_layout Description
12494 \begin_inset Flex CharStyle:Code
12497 \begin_layout Plain Layout
12504 \begin_inset Flex CharStyle:Code
12507 \begin_layout Plain Layout
12514 \begin_inset Flex CharStyle:Code
12517 \begin_layout Plain Layout
12524 \begin_inset Flex CharStyle:Code
12527 \begin_layout Plain Layout
12534 \begin_inset Flex CharStyle:Code
12537 \begin_layout Plain Layout
12543 (indicating a dummy definition ending definitions of charstyles, etc).
12544 This entry is required in and is only meaningful for Flex insets.
12545 Among other things, it determines on which menu this inset will appear.
12548 \begin_layout Description
12549 \begin_inset Flex CharStyle:Code
12552 \begin_layout Plain Layout
12559 \begin_inset Flex CharStyle:Code
12562 \begin_layout Plain Layout
12571 \begin_inset Flex CharStyle:Code
12574 \begin_layout Plain Layout
12580 ] Whether multiple paragraphs are permitted in this inset.
12581 This will also set CustomPars to the same value and ForcePlain to the opposite
12583 These can be reset to other values, if they are used
12590 \begin_layout Description
12591 \begin_inset Flex CharStyle:Code
12594 \begin_layout Plain Layout
12601 \begin_inset Flex CharStyle:Code
12604 \begin_layout Plain Layout
12613 \begin_inset Flex CharStyle:Code
12616 \begin_layout Plain Layout
12622 ] Whether fragile commands in this layout should be
12623 \begin_inset Flex CharStyle:Code
12626 \begin_layout Plain Layout
12639 whether the command should itself be protected.)
12642 \begin_layout Description
12643 \begin_inset Flex CharStyle:Code
12646 \begin_layout Plain Layout
12653 \begin_inset Flex CharStyle:Code
12656 \begin_layout Plain Layout
12665 \begin_inset Flex CharStyle:Code
12668 \begin_layout Plain Layout
12674 ] As with paragraph styles (see page
12675 \begin_inset CommandInset ref
12677 reference "des:PathThru"
12684 \begin_layout Description
12685 \begin_inset Flex CharStyle:Code
12688 \begin_layout Plain Layout
12694 As with paragraph styles (see page
12695 \begin_inset CommandInset ref
12696 LatexCommand pageref
12697 reference "des:Preamble"
12704 \begin_layout Description
12705 \begin_inset Flex CharStyle:Code
12708 \begin_layout Plain Layout
12715 \begin_inset Flex CharStyle:Code
12718 \begin_layout Plain Layout
12724 ] As with paragraph styles (see page
12725 \begin_inset CommandInset ref
12726 LatexCommand pageref
12727 reference "des:Requires"
12734 \begin_layout Subsection
12736 \begin_inset CommandInset label
12738 name "sub:Counters"
12745 \begin_layout Standard
12746 Since version 1.3.0 of LyX, it is both possible and necessary to define the
12748 \begin_inset Flex CharStyle:MenuItem
12751 \begin_layout Plain Layout
12758 \begin_inset Flex CharStyle:MenuItem
12761 \begin_layout Plain Layout
12767 , \SpecialChar \ldots{}
12768 ) in the text class itself.
12769 The standard counters are defined in the file
12770 \begin_inset Flex CharStyle:Code
12773 \begin_layout Plain Layout
12779 , so you may have to do no more than add
12782 \begin_layout LyX-Code
12783 Input stdcounters.inc
12786 \begin_layout Standard
12787 to your layout file to get them to work.
12788 But if you want to define custom counters, then you can do so.
12789 The counter declaration must begin with:
12792 \begin_layout LyX-Code
12796 \begin_layout Standard
12797 where of course `name' is replaced by the name of the counter.
12798 And it must end with
12799 \begin_inset Quotes eld
12803 \begin_inset Flex CharStyle:Code
12806 \begin_layout Plain Layout
12813 \begin_inset Quotes erd
12817 The following parameters can also be used:
12820 \begin_layout Description
12821 \begin_inset Flex CharStyle:Code
12824 \begin_layout Plain Layout
12825 LabelString [string=""]
12830 when this is defined, this string defines how the counter is displayed.
12831 Setting this value sets
12832 \begin_inset Flex CharStyle:Code
12835 \begin_layout Plain Layout
12836 LabelStringAppendix
12842 The following special constructs can be used in the string:
12846 \begin_layout Itemize
12847 \begin_inset Flex CharStyle:Code
12850 \begin_layout Plain Layout
12858 will be replaced by the expansion of the
12859 \begin_inset Flex CharStyle:Code
12862 \begin_layout Plain Layout
12869 \begin_inset Flex CharStyle:Code
12872 \begin_layout Plain Layout
12873 LabelStringAppendix
12879 \begin_inset Flex CharStyle:Code
12882 \begin_layout Plain Layout
12892 \begin_layout Itemize
12893 counter values can be expressed using LaTeX-like macros
12894 \begin_inset Flex CharStyle:Code
12897 \begin_layout Plain Layout
12914 \begin_inset Flex CharStyle:Code
12917 \begin_layout Plain Layout
12929 \begin_layout Plain Layout
12939 Actually, the situation is a bit more complicated: any
12958 other than those described below will produce arabic numerals.
12959 It would not be surprising to see this change in the future.
12965 \begin_inset Flex CharStyle:Code
12968 \begin_layout Plain Layout
12974 : 1, 2, 3,\SpecialChar \ldots{}
12976 \begin_inset Flex CharStyle:Code
12979 \begin_layout Plain Layout
12985 for lower-case letters: a, b, c, \SpecialChar \ldots{}
12987 \begin_inset Flex CharStyle:Code
12990 \begin_layout Plain Layout
12996 for upper-case letters: A, B, C, \SpecialChar \ldots{}
12998 \begin_inset Flex CharStyle:Code
13001 \begin_layout Plain Layout
13007 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
13009 \begin_inset Flex CharStyle:Code
13012 \begin_layout Plain Layout
13018 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
13020 \begin_inset Flex CharStyle:Code
13023 \begin_layout Plain Layout
13029 for hebrew numerals.
13033 \begin_layout Standard
13034 If LabelString is not defined, a default value is constructed as follows:
13035 if the counter has a master counter
13036 \begin_inset Flex CharStyle:Code
13039 \begin_layout Plain Layout
13046 \begin_inset Flex CharStyle:Code
13049 \begin_layout Plain Layout
13056 \begin_inset Flex CharStyle:Code
13059 \begin_layout Plain Layout
13069 is used; otherwise the string
13070 \begin_inset Flex CharStyle:Code
13073 \begin_layout Plain Layout
13084 \begin_layout Description
13085 \begin_inset Flex CharStyle:Code
13088 \begin_layout Plain Layout
13089 LabelStringAppendix [string=""]
13095 \begin_inset Flex CharStyle:Code
13098 \begin_layout Plain Layout
13104 , but for use in the Appendix.
13107 \begin_layout Description
13108 \begin_inset Flex CharStyle:Code
13111 \begin_layout Plain Layout
13118 \begin_inset Flex CharStyle:Code
13121 \begin_layout Plain Layout
13128 \begin_inset Quotes erd
13132 \begin_inset Quotes erd
13135 ] If this is set to the name of another counter, the present counter will
13136 be reset every time the other one is increased.
13138 \begin_inset Flex CharStyle:Code
13141 \begin_layout Plain Layout
13148 \begin_inset Flex CharStyle:Code
13151 \begin_layout Plain Layout
13160 \begin_layout Subsection
13162 \begin_inset CommandInset label
13164 name "sub:Font-description"
13171 \begin_layout Standard
13172 A font description looks like this:
13175 \begin_layout LyX-Code
13185 \begin_layout LyX-Code
13189 \begin_layout LyX-Code
13193 \begin_layout Standard
13194 The following commands are available:
13197 \begin_layout Description
13198 \begin_inset Flex CharStyle:Code
13201 \begin_layout Plain Layout
13208 \begin_inset Flex CharStyle:Code
13211 \begin_layout Plain Layout
13220 \begin_inset Flex CharStyle:Code
13223 \begin_layout Plain Layout
13230 \begin_inset Flex CharStyle:Code
13233 \begin_layout Plain Layout
13240 \begin_inset Flex CharStyle:Code
13243 \begin_layout Plain Layout
13250 \begin_inset Flex CharStyle:Code
13253 \begin_layout Plain Layout
13260 \begin_inset Flex CharStyle:Code
13263 \begin_layout Plain Layout
13270 \begin_inset Flex CharStyle:Code
13273 \begin_layout Plain Layout
13280 \begin_inset Flex CharStyle:Code
13283 \begin_layout Plain Layout
13290 \begin_inset Flex CharStyle:Code
13293 \begin_layout Plain Layout
13302 \begin_layout Description
13303 \begin_inset Flex CharStyle:Code
13306 \begin_layout Plain Layout
13315 \begin_inset Flex CharStyle:Code
13318 \begin_layout Plain Layout
13329 \begin_inset Flex CharStyle:Code
13332 \begin_layout Plain Layout
13339 \begin_inset Flex CharStyle:Code
13342 \begin_layout Plain Layout
13351 \begin_layout Description
13352 \begin_inset Flex CharStyle:Code
13355 \begin_layout Plain Layout
13362 \begin_inset Flex CharStyle:Code
13365 \begin_layout Plain Layout
13371 ] Valid argument are:
13372 \begin_inset Flex CharStyle:Code
13375 \begin_layout Plain Layout
13382 \begin_inset Flex CharStyle:Code
13385 \begin_layout Plain Layout
13392 \begin_inset Flex CharStyle:Code
13395 \begin_layout Plain Layout
13402 \begin_inset Flex CharStyle:Code
13405 \begin_layout Plain Layout
13412 \begin_inset Flex CharStyle:Code
13415 \begin_layout Plain Layout
13422 \begin_inset Flex CharStyle:Code
13425 \begin_layout Plain Layout
13432 Each of these turns on or off the corresponding attribute.
13435 \begin_layout Description
13436 \begin_inset Flex CharStyle:Code
13439 \begin_layout Plain Layout
13448 \begin_inset Flex CharStyle:Code
13451 \begin_layout Plain Layout
13462 \begin_inset Flex CharStyle:Code
13465 \begin_layout Plain Layout
13474 \begin_layout Description
13475 \begin_inset Flex CharStyle:Code
13478 \begin_layout Plain Layout
13487 \begin_inset Flex CharStyle:Code
13490 \begin_layout Plain Layout
13501 \begin_inset Flex CharStyle:Code
13504 \begin_layout Plain Layout
13511 \begin_inset Flex CharStyle:Code
13514 \begin_layout Plain Layout
13521 \begin_inset Flex CharStyle:Code
13524 \begin_layout Plain Layout
13533 \begin_layout Description
13534 \begin_inset Flex CharStyle:Code
13537 \begin_layout Plain Layout
13544 \begin_inset Flex CharStyle:Code
13547 \begin_layout Plain Layout
13554 \begin_inset Flex CharStyle:Code
13557 \begin_layout Plain Layout
13564 \begin_inset Flex CharStyle:Code
13567 \begin_layout Plain Layout
13576 \begin_inset Flex CharStyle:Code
13579 \begin_layout Plain Layout
13586 \begin_inset Flex CharStyle:Code
13589 \begin_layout Plain Layout
13596 \begin_inset Flex CharStyle:Code
13599 \begin_layout Plain Layout
13606 \begin_inset Flex CharStyle:Code
13609 \begin_layout Plain Layout
13616 \begin_inset Flex CharStyle:Code
13619 \begin_layout Plain Layout
13628 \begin_layout Subsection
13629 Upgrading old layout files
13632 \begin_layout Standard
13633 The file format of layout files changes from time to time, so old layout
13634 files need to be converted.
13635 This process has been automated since LyX 1.4.0: If LyX reads an old format
13636 layout file it will call the conversion tool
13637 \begin_inset Flex CharStyle:Code
13640 \begin_layout Plain Layout
13641 LyXDir/scripts/layout2layout.py
13646 and convert it to a temporary file in current format.
13647 The original file is left untouched.
13648 If you want to convert the layout file permanently, just call the converter
13652 \begin_layout LyX-Code
13653 python $LyXDir/scripts/layout2layout.py myclass.layout myclassnew.layout
13656 \begin_layout Standard
13657 (You need to replace
13658 \begin_inset Flex CharStyle:Code
13661 \begin_layout Plain Layout
13667 with the name of your LyX system directory, unless you happen to have defined
13668 such an environment variable.) Then copy
13669 \begin_inset Flex CharStyle:Code
13672 \begin_layout Plain Layout
13679 \begin_inset Flex CharStyle:Code
13682 \begin_layout Plain Layout
13691 \begin_layout Standard
13692 The automatic conversion only handles syntax changes.
13693 It cannot handle the case where the contents of included files was changed,
13694 so these will have to be converted separately.
13697 \begin_layout Section
13699 \begin_inset CommandInset label
13701 name "sec:Creating-Templates"
13708 \begin_layout Standard
13709 Templates are created just like usual documents.
13710 The only difference is that usual documents contain all possible settings,
13711 including the font scheme and the paper size.
13712 Usually a user doesn't want a template to overwrite his defaults in these
13714 For that reason, the designer of a template should remove the corresponding
13716 \begin_inset Flex CharStyle:Code
13719 \begin_layout Plain Layout
13728 \begin_inset Flex CharStyle:Code
13731 \begin_layout Plain Layout
13739 from the template LyX file.
13740 This can be done with any simple text-editor, for example
13741 \begin_inset Flex CharStyle:Code
13744 \begin_layout Plain Layout
13751 \begin_inset Flex CharStyle:Code
13754 \begin_layout Plain Layout
13764 \begin_layout Standard
13765 Put the edited template files you create in
13766 \begin_inset Flex CharStyle:Code
13769 \begin_layout Plain Layout
13775 , copy the ones you use from the global template directory in
13776 \begin_inset Flex CharStyle:Code
13779 \begin_layout Plain Layout
13785 to the same place, and redefine the template path in the
13786 \begin_inset Flex CharStyle:MenuItem
13789 \begin_layout Plain Layout
13790 Tools\SpecialChar \menuseparator
13791 Preferences\SpecialChar \menuseparator
13800 \begin_layout Standard
13801 Note that there is a template which has a particular meaning:
13802 \begin_inset Flex CharStyle:Code
13805 \begin_layout Plain Layout
13812 This template is loaded every time you create a new document with
13813 \begin_inset Flex CharStyle:MenuItem
13816 \begin_layout Plain Layout
13817 File\SpecialChar \menuseparator
13823 in order to provide useful defaults.
13824 To create this template from inside LyX, all you have to do is to open
13825 a document with the correct settings, and use the
13826 \begin_inset Flex CharStyle:MenuItem
13829 \begin_layout Plain Layout
13830 Save as Document Defaults
13838 \begin_layout Chapter
13839 Including External Material
13842 \begin_layout Standard
13843 \begin_inset Box Shadowbox
13852 height_special "totalheight"
13855 \begin_layout Plain Layout
13856 WARNING: This portion of the documentation has not been updated for some
13858 We certainly hope that it is still accurate, but there are no guarantees.
13866 \begin_layout Standard
13867 The use of material from sources external to LyX is covered in detail in
13873 This part of the manual covers what needs to happen behind the scenes for
13874 new sorts of material to be included.
13877 \begin_layout Section
13881 \begin_layout Standard
13882 The external material feature is based on the concept of a
13887 A template is a specification of how LyX should interface with a certain
13889 As bundled, LyX comes with predefined templates for Xfig figures, various
13890 raster format images, chess diagrams, and LilyPond music notation.
13891 You can check the actual list by using the menu
13892 \begin_inset Flex CharStyle:MenuItem
13895 \begin_layout Plain Layout
13896 Insert\SpecialChar \menuseparator
13897 File\SpecialChar \menuseparator
13904 Furthermore, it is possible to roll your own template to support a specific
13906 Later we'll describe in more detail what is involved, and hopefully you
13907 will submit all the templates you create so we can include them in a later
13911 \begin_layout Standard
13912 Another basic idea of the external material feature is to distinguish between
13913 the original file that serves as a base for final material and the produced
13914 file that is included in your exported or printed document.
13915 For example, consider the case of a figure produced with
13916 \begin_inset Flex CharStyle:Code
13919 \begin_layout Plain Layout
13926 The Xfig application itself works on an original file with the
13927 \begin_inset Flex CharStyle:Code
13930 \begin_layout Plain Layout
13937 Within Xfig, you create and change your figure, and when you are done,
13939 \begin_inset Flex CharStyle:Code
13942 \begin_layout Plain Layout
13949 When you want to include the figure in your document, you invoke
13950 \begin_inset Flex CharStyle:Code
13953 \begin_layout Plain Layout
13959 in order to create a PostScript file that can readily be included in your
13962 \begin_inset Flex CharStyle:Code
13965 \begin_layout Plain Layout
13971 file is the original file, and the PostScript file is the produced file.
13974 \begin_layout Standard
13975 This distinction is important in order to allow updating of the material
13976 while you are in the process of writing the document.
13977 Furthermore, it provides us with the flexibility that is needed to support
13978 multiple export formats.
13979 For instance, in the case of a plain text file, it is not exactly an award-winn
13980 ing idea to include the figure as raw PostScript.
13981 Instead, you'd either prefer to just include a reference to the figure
13982 or try to invoke some graphics to ASCII converter to make the final result
13983 look similar to the real graphics.
13984 The external material management allows you to do this, because it is parametri
13985 zed on the different export formats that LyX supports.
13988 \begin_layout Standard
13989 Besides supporting the production of different products according to the
13990 exported format, it supports tight integration with editing and viewing
13992 In the case of an Xfig figure, you are able to invoke Xfig on the original
13993 file with a single click from within the external material dialog in LyX,
13994 and also preview the produced PostScript file with Ghostview with another
13996 No more fiddling around with the command line and/or file browsers to locate
13997 and manipulate the original or produced files.
13998 In this way, you are finally able to take full advantage of the many different
13999 applications that are relevant to use when you write your documents, and
14000 ultimately be more productive.
14003 \begin_layout Section
14004 The external template configuration file
14007 \begin_layout Standard
14008 It is relatively easy to add custom external template definitions to LyX.
14009 However, be aware that doing this in an careless manner most probably
14013 introduce an easily exploitable security hole.
14014 So before you do this, please read the discussion about security in section
14016 \begin_inset CommandInset ref
14018 reference "sec:Security-discussion"
14025 \begin_layout Standard
14026 Having said that, we encourage you to submit any interesting templates that
14031 \begin_layout Standard
14032 The external templates are defined in the
14033 \begin_inset Flex CharStyle:Code
14036 \begin_layout Plain Layout
14037 LyXDir/lib/external_templates
14043 You can place your own version in
14044 \begin_inset Flex CharStyle:Code
14047 \begin_layout Plain Layout
14048 UserDir/external_templates
14056 \begin_layout Standard
14057 A typical template looks like this:
14060 \begin_layout LyX-Code
14064 \begin_layout LyX-Code
14065 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
14068 \begin_layout LyX-Code
14072 \begin_layout LyX-Code
14076 \begin_layout LyX-Code
14080 \begin_layout LyX-Code
14084 \begin_layout LyX-Code
14088 \begin_layout LyX-Code
14089 AutomaticProduction true
14092 \begin_layout LyX-Code
14096 \begin_layout LyX-Code
14100 \begin_layout LyX-Code
14104 \begin_layout LyX-Code
14105 TransformCommand Rotate RotationLatexCommand
14108 \begin_layout LyX-Code
14109 TransformCommand Resize ResizeLatexCommand
14112 \begin_layout LyX-Code
14113 Product "$$RotateFront$$ResizeFront
14116 \begin_layout LyX-Code
14121 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
14124 \begin_layout LyX-Code
14125 $$ResizeBack$$RotateBack"
14128 \begin_layout LyX-Code
14132 \begin_layout LyX-Code
14133 UpdateResult "$$AbsPath$$Basename.pstex_t"
14136 \begin_layout LyX-Code
14137 Requirement "graphicx"
14140 \begin_layout LyX-Code
14141 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
14144 \begin_layout LyX-Code
14145 ReferencedFile latex "$$AbsPath$$Basename.eps"
14148 \begin_layout LyX-Code
14149 ReferencedFile dvi "$$AbsPath$$Basename.eps"
14152 \begin_layout LyX-Code
14156 \begin_layout LyX-Code
14160 \begin_layout LyX-Code
14161 TransformCommand Rotate RotationLatexCommand
14164 \begin_layout LyX-Code
14165 TransformCommand Resize ResizeLatexCommand
14168 \begin_layout LyX-Code
14169 Product "$$RotateFront$$ResizeFront
14172 \begin_layout LyX-Code
14177 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
14180 \begin_layout LyX-Code
14181 $$ResizeBack$$RotateBack"
14184 \begin_layout LyX-Code
14185 UpdateFormat pdftex
14188 \begin_layout LyX-Code
14189 UpdateResult "$$AbsPath$$Basename.pdftex_t"
14192 \begin_layout LyX-Code
14193 Requirement "graphicx"
14196 \begin_layout LyX-Code
14197 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
14200 \begin_layout LyX-Code
14201 ReferencedFile latex "$$AbsPath$$Basename.pdf"
14204 \begin_layout LyX-Code
14208 \begin_layout LyX-Code
14212 \begin_layout LyX-Code
14213 Product "$$Contents(
14215 "$$AbsPath$$Basename.asc
14220 \begin_layout LyX-Code
14221 UpdateFormat asciixfig
14224 \begin_layout LyX-Code
14225 UpdateResult "$$AbsPath$$Basename.asc"
14228 \begin_layout LyX-Code
14232 \begin_layout LyX-Code
14236 \begin_layout LyX-Code
14237 Product "<graphic fileref=
14239 "$$AbsOrRelPathMaster$$Basename.eps
14244 \begin_layout LyX-Code
14248 \begin_layout LyX-Code
14252 \begin_layout LyX-Code
14253 UpdateResult "$$AbsPath$$Basename.eps"
14256 \begin_layout LyX-Code
14257 ReferencedFile docbook "$$AbsPath$$Basename.eps"
14260 \begin_layout LyX-Code
14261 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
14264 \begin_layout LyX-Code
14268 \begin_layout LyX-Code
14269 Product "[XFig: $$FName]"
14272 \begin_layout LyX-Code
14276 \begin_layout LyX-Code
14280 \begin_layout Standard
14281 As you can see, the template is enclosed in
14282 \begin_inset Flex CharStyle:Code
14285 \begin_layout Plain Layout
14291 \SpecialChar \ldots{}
14293 \begin_inset Flex CharStyle:Code
14296 \begin_layout Plain Layout
14303 It contains a header specifying some general settings and, for each supported
14304 primary document file format, a section
14305 \begin_inset Flex CharStyle:Code
14308 \begin_layout Plain Layout
14314 \SpecialChar \ldots{}
14316 \begin_inset Flex CharStyle:Code
14319 \begin_layout Plain Layout
14328 \begin_layout Subsection
14329 The template header
14332 \begin_layout Description
14333 \begin_inset Flex CharStyle:Code
14336 \begin_layout Plain Layout
14337 AutomaticProduction
14338 \begin_inset space ~
14346 Whether the file represented by the template must be generated by LyX.
14347 This command must occur exactly once.
14350 \begin_layout Description
14351 \begin_inset Flex CharStyle:Code
14354 \begin_layout Plain Layout
14356 \begin_inset space ~
14364 A glob pattern that is used in the file dialog to filter out the desired
14366 If there is more than one possible file extension (e.
14367 \begin_inset space \thinspace{}
14371 \begin_inset space \space{}
14375 \begin_inset Flex CharStyle:Code
14378 \begin_layout Plain Layout
14385 \begin_inset Flex CharStyle:Code
14388 \begin_layout Plain Layout
14394 ), use something like
14395 \begin_inset Flex CharStyle:Code
14398 \begin_layout Plain Layout
14405 This command must occur exactly once.
14408 \begin_layout Description
14409 \begin_inset Flex CharStyle:Code
14412 \begin_layout Plain Layout
14414 \begin_inset space ~
14422 The text that is displayed on the button.
14423 This command must occur exactly once.
14426 \begin_layout Description
14427 \begin_inset Flex CharStyle:Code
14430 \begin_layout Plain Layout
14432 \begin_inset space ~
14436 \begin_inset space ~
14444 The help text that is used in the External dialog.
14445 Provide enough information to explain to the user just what the template
14446 can provide him with.
14447 This command must occur exactly once.
14450 \begin_layout Description
14451 \begin_inset Flex CharStyle:Code
14454 \begin_layout Plain Layout
14456 \begin_inset space ~
14464 The file format of the original file.
14465 This must be the name of a format that is known to LyX (see section
14466 \begin_inset CommandInset ref
14468 reference "sec:Formats"
14474 \begin_inset Quotes eld
14478 \begin_inset Flex CharStyle:Code
14481 \begin_layout Plain Layout
14488 \begin_inset Quotes erd
14491 if the template can handle original files of more than one format.
14492 LyX will attempt to interrogate the file itself in order to deduce its
14493 format in this case.
14494 This command must occur exactly once.
14497 \begin_layout Description
14498 \begin_inset Flex CharStyle:Code
14501 \begin_layout Plain Layout
14503 \begin_inset space ~
14511 A unique name for the template.
14512 It must not contain substitution macros (see below).
14515 \begin_layout Description
14516 \begin_inset Flex CharStyle:Code
14519 \begin_layout Plain Layout
14521 \begin_inset space ~
14524 Rotate|Resize|Clip|Extra
14529 This command specifies which transformations are supported by this template.
14530 It may occur zero or more times.
14531 This command enables the corresponding tabs in the external dialog.
14533 \begin_inset Flex CharStyle:Code
14536 \begin_layout Plain Layout
14542 command must have either a corresponding
14543 \begin_inset Flex CharStyle:Code
14546 \begin_layout Plain Layout
14553 \begin_inset Flex CharStyle:Code
14556 \begin_layout Plain Layout
14563 \begin_inset Flex CharStyle:Code
14566 \begin_layout Plain Layout
14573 Otherwise the transformation will not be supported by that format.
14576 \begin_layout Subsection
14580 \begin_layout Description
14581 \begin_inset Flex CharStyle:Code
14584 \begin_layout Plain Layout
14586 \begin_inset space ~
14589 LaTeX|PDFLaTeX|PlainText|DocBook
14594 The primary document file format that this format definition is for.
14595 Not every template has a sensible representation in all document file formats.
14596 Please define nevertheless a
14597 \begin_inset Flex CharStyle:Code
14600 \begin_layout Plain Layout
14606 section for all formats.
14607 Use a dummy text when no representation is available.
14608 Then you can at least see a reference to the external material in the exported
14612 \begin_layout Description
14613 \begin_inset Flex CharStyle:Code
14616 \begin_layout Plain Layout
14618 \begin_inset space ~
14622 \begin_inset space ~
14630 This command defines an additional macro
14631 \begin_inset Flex CharStyle:Code
14634 \begin_layout Plain Layout
14640 for substitution in
14641 \begin_inset Flex CharStyle:Code
14644 \begin_layout Plain Layout
14652 \begin_inset Flex CharStyle:Code
14655 \begin_layout Plain Layout
14661 itself may contain substitution macros.
14662 The advantage over using
14663 \begin_inset Flex CharStyle:Code
14666 \begin_layout Plain Layout
14673 \begin_inset Flex CharStyle:Code
14676 \begin_layout Plain Layout
14682 is that the substituted value of
14683 \begin_inset Flex CharStyle:Code
14686 \begin_layout Plain Layout
14692 is sanitized so that it is a valid optional argument in the document format.
14693 This command may occur zero or more times.
14696 \begin_layout Description
14697 \begin_inset Flex CharStyle:Code
14700 \begin_layout Plain Layout
14702 \begin_inset space ~
14710 The text that is inserted in the exported document.
14711 This is actually the most important command and can be quite complex.
14712 This command must occur exactly once.
14715 \begin_layout Description
14716 \begin_inset Flex CharStyle:Code
14719 \begin_layout Plain Layout
14721 \begin_inset space ~
14729 This command specifies a preamble snippet that will be included in the
14731 It has to be defined using
14732 \begin_inset Flex CharStyle:Code
14735 \begin_layout Plain Layout
14741 \SpecialChar \ldots{}
14743 \begin_inset Flex CharStyle:Code
14746 \begin_layout Plain Layout
14753 This command may occur zero or more times.
14756 \begin_layout Description
14757 \begin_inset Flex CharStyle:Code
14760 \begin_layout Plain Layout
14762 \begin_inset space ~
14766 \begin_inset space ~
14774 This command denotes files that are created by the conversion process and
14775 are needed for a particular export format.
14776 If the filename is relative, it is interpreted relative to the master document.
14777 This command may be given zero or more times.
14780 \begin_layout Description
14781 \begin_inset Flex CharStyle:Code
14784 \begin_layout Plain Layout
14786 \begin_inset space ~
14794 The name of a required LaTeX package.
14795 The package is included via
14796 \begin_inset Flex CharStyle:Code
14799 \begin_layout Plain Layout
14807 in the LaTeX preamble.
14808 This command may occur zero or more times.
14811 \begin_layout Description
14812 \begin_inset Flex CharStyle:Code
14815 \begin_layout Plain Layout
14817 \begin_inset space ~
14821 \begin_inset space ~
14824 RotationLatexCommand
14829 This command specifies that the built in LaTeX command should be used for
14831 This command may occur once or not at all.
14834 \begin_layout Description
14835 \begin_inset Flex CharStyle:Code
14838 \begin_layout Plain Layout
14840 \begin_inset space ~
14844 \begin_inset space ~
14852 This command specifies that the built in LaTeX command should be used for
14854 This command may occur once or not at all.
14857 \begin_layout Description
14858 \begin_inset Flex CharStyle:Code
14861 \begin_layout Plain Layout
14863 \begin_inset space ~
14867 \begin_inset space ~
14870 RotationLatexOption
14875 This command specifies that rotation is done via an optional argument.
14876 This command may occur once or not at all.
14879 \begin_layout Description
14880 \begin_inset Flex CharStyle:Code
14883 \begin_layout Plain Layout
14885 \begin_inset space ~
14889 \begin_inset space ~
14897 This command specifies that resizing is done via an optional argument.
14898 This command may occur once or not at all.
14901 \begin_layout Description
14902 \begin_inset Flex CharStyle:Code
14905 \begin_layout Plain Layout
14907 \begin_inset space ~
14911 \begin_inset space ~
14919 This command specifies that clipping is done via an optional argument.
14920 This command may occur once or not at all.
14923 \begin_layout Description
14924 \begin_inset Flex CharStyle:Code
14927 \begin_layout Plain Layout
14929 \begin_inset space ~
14933 \begin_inset space ~
14941 This command specifies that an extra optional argument is used.
14942 This command may occur once or not at all.
14945 \begin_layout Description
14946 \begin_inset Flex CharStyle:Code
14949 \begin_layout Plain Layout
14951 \begin_inset space ~
14959 The file format of the converted file.
14960 This must be the name of a format that is known to LyX (see the
14961 \begin_inset Flex CharStyle:MenuItem
14964 \begin_layout Plain Layout
14969 ools\SpecialChar \menuseparator
14974 references:Conversion
14980 This command must occur exactly once.
14983 \begin_layout Description
14984 \begin_inset Flex CharStyle:Code
14987 \begin_layout Plain Layout
14989 \begin_inset space ~
14997 The file name of the converted file.
14998 The file name must be absolute.
14999 This command must occur exactly once.
15002 \begin_layout Subsection
15003 Preamble definitions
15006 \begin_layout Standard
15007 The external template configuration file may contain additional preamble
15008 definitions enclosed by
15009 \begin_inset Flex CharStyle:Code
15012 \begin_layout Plain Layout
15018 \SpecialChar \ldots{}
15020 \begin_inset Flex CharStyle:Code
15023 \begin_layout Plain Layout
15030 They can be used by the templates in the
15031 \begin_inset Flex CharStyle:Code
15034 \begin_layout Plain Layout
15043 \begin_layout Section
15044 The substitution mechanism
15047 \begin_layout Standard
15048 When the external material facility invokes an external program, it is done
15049 on the basis of a command defined in the template configuration file.
15050 These commands can contain various macros that are expanded before execution.
15051 Execution always take place in the directory of the containing document.
15054 \begin_layout Standard
15055 Also, whenever external material is to be displayed, the name will be produced
15056 by the substitution mechanism, and most other commands in the template
15057 definition support substitution as well.
15060 \begin_layout Standard
15061 The available macros are the following:
15064 \begin_layout Description
15065 \begin_inset Flex CharStyle:Code
15068 \begin_layout Plain Layout
15069 $$AbsOrRelPathMaster
15074 The file path, absolute or relative to the master LyX document.
15077 \begin_layout Description
15078 \begin_inset Flex CharStyle:Code
15081 \begin_layout Plain Layout
15082 $$AbsOrRelPathParent
15087 The file path, absolute or relative to the LyX document.
15090 \begin_layout Description
15091 \begin_inset Flex CharStyle:Code
15094 \begin_layout Plain Layout
15100 The absolute file path.
15103 \begin_layout Description
15104 \begin_inset Flex CharStyle:Code
15107 \begin_layout Plain Layout
15113 The filename without path and without the extension.
15116 \begin_layout Description
15117 \begin_inset Flex CharStyle:Code
15120 \begin_layout Plain Layout
15122 \begin_inset Quotes eld
15126 \begin_inset Quotes erd
15134 This macro will expand to the contents of the file with the name
15135 \begin_inset Flex CharStyle:Code
15138 \begin_layout Plain Layout
15147 \begin_layout Description
15148 \begin_inset Flex CharStyle:Code
15151 \begin_layout Plain Layout
15157 The file extension (including the dot).
15160 \begin_layout Description
15161 \begin_inset Flex CharStyle:Code
15164 \begin_layout Plain Layout
15170 The filename of the file specified in the external material dialog.
15171 This is either an absolute name, or it is relative to the LyX document.
15174 \begin_layout Description
15175 \begin_inset Flex CharStyle:Code
15178 \begin_layout Plain Layout
15185 \begin_inset Flex CharStyle:Code
15188 \begin_layout Plain Layout
15194 (absolute name or relative to the LyX document).
15197 \begin_layout Description
15198 \begin_inset Flex CharStyle:Code
15201 \begin_layout Plain Layout
15207 The file path, relative to the master LyX document.
15210 \begin_layout Description
15211 \begin_inset Flex CharStyle:Code
15214 \begin_layout Plain Layout
15220 The file path, relative to the LyX document.
15223 \begin_layout Description
15224 \begin_inset Flex CharStyle:Code
15227 \begin_layout Plain Layout
15233 This macro will expand to the absolute path of the system directory.
15234 This is typically used to point to the various helper scripts that are
15238 \begin_layout Description
15239 \begin_inset Flex CharStyle:Code
15242 \begin_layout Plain Layout
15248 A name and full path to a temporary file which will be automatically deleted
15249 whenever the containing document is closed, or the external material insertion
15253 \begin_layout Standard
15254 All path macros contain a trailing directory separator, so you can construct
15256 \begin_inset space \thinspace{}
15260 \begin_inset space \space{}
15263 the absolute filename with
15264 \begin_inset Flex CharStyle:Code
15267 \begin_layout Plain Layout
15268 $$AbsPath$$Basename$$Extension
15276 \begin_layout Standard
15277 The macros above are substituted in all commands unless otherwise noted.
15279 \begin_inset Flex CharStyle:Code
15282 \begin_layout Plain Layout
15288 supports additionally the following substitutions if they are enabled by
15290 \begin_inset Flex CharStyle:Code
15293 \begin_layout Plain Layout
15300 \begin_inset Flex CharStyle:Code
15303 \begin_layout Plain Layout
15312 \begin_layout Description
15313 \begin_inset Flex CharStyle:Code
15316 \begin_layout Plain Layout
15322 The front part of the resize command.
15325 \begin_layout Description
15326 \begin_inset Flex CharStyle:Code
15329 \begin_layout Plain Layout
15335 The back part of the resize command.
15338 \begin_layout Description
15339 \begin_inset Flex CharStyle:Code
15342 \begin_layout Plain Layout
15348 The front part of the rotation command.
15351 \begin_layout Description
15352 \begin_inset Flex CharStyle:Code
15355 \begin_layout Plain Layout
15361 The back part of the rotation command.
15364 \begin_layout Standard
15365 The value string of the
15366 \begin_inset Flex CharStyle:Code
15369 \begin_layout Plain Layout
15375 command supports additionally the following substitutions if they are enabled
15377 \begin_inset Flex CharStyle:Code
15380 \begin_layout Plain Layout
15387 \begin_inset Flex CharStyle:Code
15390 \begin_layout Plain Layout
15399 \begin_layout Description
15400 \begin_inset Flex CharStyle:Code
15403 \begin_layout Plain Layout
15412 \begin_layout Description
15413 \begin_inset Flex CharStyle:Code
15416 \begin_layout Plain Layout
15425 \begin_layout Description
15426 \begin_inset Flex CharStyle:Code
15429 \begin_layout Plain Layout
15438 \begin_layout Description
15439 \begin_inset Flex CharStyle:Code
15442 \begin_layout Plain Layout
15448 The rotation option.
15451 \begin_layout Standard
15452 You may ask why there are so many path macros.
15453 There are mainly two reasons:
15456 \begin_layout Enumerate
15457 Relative and absolute file names should remain relative or absolute, respectivel
15459 Users may have reasons to prefer either form.
15460 Relative names are useful for portable documents that should work on different
15461 machines, for example.
15462 Absolute names may be required by some programs.
15465 \begin_layout Enumerate
15466 LaTeX treats relative file names differently than LyX and other programs
15467 in nested included files.
15468 For LyX, a relative file name is always relative to the document that contains
15470 For LaTeX, it is always relative to the master document.
15471 These two definitions are identical if you have only one document, but
15472 differ if you have a master document that includes part documents.
15473 That means that relative filenames must be transformed when presented to
15475 Fortunately LyX does this automatically for you if you choose the right
15479 \begin_layout Standard
15480 So which path macro should be used in new template definitions? The rule
15484 \begin_layout Itemize
15486 \begin_inset Flex CharStyle:Code
15489 \begin_layout Plain Layout
15495 if an absolute path is required.
15498 \begin_layout Itemize
15500 \begin_inset Flex CharStyle:Code
15503 \begin_layout Plain Layout
15504 $$AbsOrRelPathMaster
15509 if the substituted string is some kind of LaTeX input.
15512 \begin_layout Itemize
15514 \begin_inset Flex CharStyle:Code
15517 \begin_layout Plain Layout
15518 $$AbsOrRelPathParent
15523 in order to preserve the user's choice.
15526 \begin_layout Standard
15527 There are special cases where this rule does not work and e.
15528 \begin_inset space \thinspace{}
15532 \begin_inset space \space{}
15535 relative names are needed, but normally it will work just fine.
15536 One example for such a case is the command
15537 \begin_inset Flex CharStyle:Code
15540 \begin_layout Plain Layout
15541 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
15546 in the XFig template above: We can't use the absolute name because the
15548 \begin_inset Flex CharStyle:Code
15551 \begin_layout Plain Layout
15557 files needs the relative name in order to rewrite the file content.
15560 \begin_layout Section
15561 \begin_inset CommandInset label
15563 name "sec:Security-discussion"
15567 Security discussion
15570 \begin_layout Standard
15571 \begin_inset Box Shadowbox
15580 height_special "totalheight"
15583 \begin_layout Plain Layout
15584 WARNING: This section is definitely outdated.
15592 \begin_layout Standard
15593 The external material feature interfaces with a lot of external programs
15594 and does so automatically, so we have to consider the security implications
15596 In particular, since you have the option of including your own filenames
15597 and/or parameter strings and those are expanded into a command, it seems
15598 that it would be possible to create a malicious document which executes
15599 arbitrary commands when a user views or prints the document.
15600 This is something we definitely want to avoid.
15603 \begin_layout Standard
15604 However, since the external program commands are specified in the template
15605 configuration file only, there are no security issues if LyX is properly
15606 configured with safe templates only.
15607 This is so because the external programs are invoked with the
15608 \begin_inset Flex CharStyle:Code
15611 \begin_layout Plain Layout
15617 -system call rather than the
15618 \begin_inset Flex CharStyle:Code
15621 \begin_layout Plain Layout
15627 system-call, so it's not possible to execute arbitrary commands from the
15628 filename or parameter section via the shell.
15631 \begin_layout Standard
15632 This also implies that you are restricted in what command strings you can
15633 use in the external material templates.
15634 In particular, pipes and redirection are not readily available.
15635 This has to be so if LyX should remain safe.
15636 If you want to use some of the shell features, you should write a safe
15637 script to do this in a controlled manner, and then invoke the script from
15638 the command string.
15640 \begin_inset Flex CharStyle:Code
15643 \begin_layout Plain Layout
15649 directory of the LyX installation, you can find a safe wrapper script
15650 \begin_inset Flex CharStyle:Code
15653 \begin_layout Plain Layout
15654 general_command_wrapper.py
15659 that supports redirection of input and output.
15660 That can serve as an example for how to write safe template scripts.
15661 For a more advanced example that uses
15662 \begin_inset Flex CharStyle:Code
15665 \begin_layout Plain Layout
15671 and friends, take a look at the
15672 \begin_inset Flex CharStyle:Code
15675 \begin_layout Plain Layout
15684 \begin_layout Standard
15685 It is possible to design a template that interacts directly with the shell,
15686 but since this would allow a malicious user to execute arbitrary commands
15687 by writing clever filenames and/or parameters, we generally recommend that
15688 you only use safe scripts that work with the
15689 \begin_inset Flex CharStyle:Code
15692 \begin_layout Plain Layout
15698 system call in a controlled manner.
15699 Of course, for use in a controlled environment, it can be tempting to just
15700 fall back to use ordinary shell scripts.
15701 If you do so, be aware that you
15705 provide an easily exploitable security hole in your system.
15706 Of course it stands to reason that such unsafe templates will never be
15707 included in the standard LyX distribution, although we do encourage people
15708 to submit new templates in the open source tradition.
15709 But LyX as shipped from the official distribution channels will never have
15713 \begin_layout Standard
15714 Including external material provides a lot of power, and you have to be
15715 careful not to introduce security hazards with this power.
15716 A subtle error in a single line in an innocent looking script can open
15717 the door to huge security problems.
15718 So if you do not fully understand the issues, we recommend that you consult
15719 a knowledgeable security professional or the LyX development team if you
15720 have any questions about whether a given template is safe or not.
15721 And do this before you use it in an uncontrolled environment.