1 #LyX 2.0.0svn created this file. For more info see http://www.lyx.org/
7 % DO NOT ALTER THIS PREAMBLE!!!
9 % This preamble is designed to ensure that this document prints
10 % out as advertised. If you mess with this preamble,
11 % parts of this document may not print out as expected. If you
12 % have problems LaTeXing this file, please contact
13 % the documentation team
14 % email: lyx-docs@lists.lyx.org
16 \usepackage{ifpdf} % part of the hyperref bundle
17 \ifpdf % if pdflatex is used
19 % set fonts for nicer pdf view
20 \IfFileExists{lmodern.sty}
21 {\usepackage{lmodern}}{}
23 \fi % end if pdflatex is used
25 % the pages of the TOC is numbered roman
26 % and a pdf-bookmark for the TOC is added
27 \let\myTOC\tableofcontents
28 \renewcommand\tableofcontents{%
30 \pdfbookmark[1]{\contentsname}{}
34 % redefine the \LyX macro for PDF bookmarks
35 \def\LyX{\texorpdfstring{%
36 L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
39 % used for multi-column text
43 \options fleqn,liststotoc,bibtotoc,idxtotoc,BCOR7.5mm,titlepage,tablecaptionabove
44 \use_default_options false
50 InsetLayout CharStyle:MenuItem
59 \newcommand*{\menuitem}[1]{{\sffamily #1}}
67 \font_typewriter default
68 \font_default_family default
76 \default_output_format default
77 \bibtex_command default
78 \index_command default
82 \pdf_title "LyX Configuration Manual"
83 \pdf_author "LyX Team"
84 \pdf_subject "LyX-documentation Customization"
85 \pdf_keywords "LyX, documentation, customization"
87 \pdf_bookmarksnumbered true
88 \pdf_bookmarksopen true
89 \pdf_bookmarksopenlevel 1
94 \pdf_pdfusetitle false
95 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true,pdfstartview=XYZ, plainpages=false, pdfpagelabels"
104 \paperorientation portrait
117 \paragraph_separation indent
118 \paragraph_indentation default
119 \quotes_language english
122 \paperpagestyle headings
123 \tracking_changes false
124 \output_changes false
130 Customizing LyX: Features for the Advanced User
138 \begin_layout Plain Layout
140 If you have comments or error corrections, please send them to the LyX Documenta
142 \begin_inset CommandInset href
144 target "lyx-docs@lists.lyx.org"
151 \begin_inset Quotes eld
155 \begin_inset Quotes erd
158 in the subject header, and please cc the current maintainer of this file,
159 Richard Heck <rgheck@comcast.net>.
165 \begin_inset Newline newline
169 \begin_inset Newline newline
175 \begin_layout Standard
176 \begin_inset CommandInset toc
177 LatexCommand tableofcontents
184 \begin_layout Standard
185 \begin_inset Note Note
188 \begin_layout Plain Layout
189 Please use change tracking when modifying this document.
190 This makes it easier for our translators to recognize things that have
191 been changed, and it helps the maintainer keep up-to-date with what's been
200 \begin_layout Chapter
204 \begin_layout Standard
205 This manual covers the customization features present in LyX.
206 In it, we discuss issues like keyboard shortcuts, screen previewing options,
207 printer options, sending commands to LyX via the LyX Server, internationalizati
208 on, installing new LaTeX classes and LyX layouts, etc.
209 We can't possibly hope to touch on everything you can change—our developers
210 add new features faster than we can document them—but we will explain the
211 most common customizations and hopefully point you in the right direction
212 for some of the more obscure ones.
215 \begin_layout Standard
216 \begin_inset Branch OutDated
219 \begin_layout Standard
220 Information from previous versions of this document that now seems to be
221 outdated is contained in the OutDated branch of this document.
222 By default, this information will not appear in the LaTeX output.
230 \begin_layout Chapter
231 LyX configuration files
234 \begin_layout Standard
235 This chapter aims to help you to find your way through the LyX configuration
237 Before continuing to read this chapter, you should find out where your
238 LyX library and user directories are by using
239 \begin_inset Flex CharStyle:MenuItem
242 \begin_layout Plain Layout
243 Help\SpecialChar \menuseparator
254 The library directory is the place where LyX places its system-wide configurati
255 on files; the user directory is where you can place your modified versions.
256 We will call the former
257 \begin_inset Flex CharStyle:Code
260 \begin_layout Plain Layout
267 \begin_inset Flex CharStyle:MenuItem
270 \begin_layout Plain Layout
276 in the remainder of this document.
280 \begin_layout Section
282 \begin_inset Flex CharStyle:Code
285 \begin_layout Plain Layout
294 \begin_layout Standard
295 \begin_inset Flex CharStyle:Code
298 \begin_layout Plain Layout
304 and its sub-directories contain a number of files and that can be used
305 to customize LyX's behavior.
306 You can change many of these files from within LyX itself through the
307 \begin_inset Flex CharStyle:MenuItem
310 \begin_layout Plain Layout
311 Tools\SpecialChar \menuseparator
318 Most customization that you will want to do in LyX is possible through
320 However, many other inner aspects of LyX can be customized by modifying
322 \begin_inset Flex CharStyle:Code
325 \begin_layout Plain Layout
332 These files fall in different categories, described in the following subsection
336 \begin_layout Subsection
337 Automatically generated files
340 \begin_layout Standard
341 The files, which are to be found in
342 \begin_inset Flex CharStyle:MenuItem
345 \begin_layout Plain Layout
351 , are generated when you configure LyX.
352 They contain various default values that are guessed by inspection.
353 In general, it is not a good idea to modify them, since they might be overwritt
357 \begin_layout Labeling
358 \labelwidthstring 00.00.0000
359 \begin_inset Flex CharStyle:Code
362 \begin_layout Plain Layout
368 contains defaults for various commands.
371 \begin_layout Labeling
372 \labelwidthstring 00.00.0000
373 \begin_inset Flex CharStyle:Code
376 \begin_layout Plain Layout
382 contains the list of packages that have been recognized by LyX.
383 It is currently unused by the LyX program itself, but the information extracted
384 , and more, is made available with
385 \begin_inset Flex CharStyle:MenuItem
388 \begin_layout Plain Layout
389 Help\SpecialChar \menuseparator
402 \begin_layout Labeling
403 \labelwidthstring 00.00.0000
404 \begin_inset Flex CharStyle:Code
407 \begin_layout Plain Layout
413 the list of text classes that have been found in your
414 \begin_inset Flex CharStyle:Code
417 \begin_layout Plain Layout
423 directories, along with the associated LaTeX document class and their descripti
427 \begin_layout Labeling
428 \labelwidthstring 00.00.0000
429 \begin_inset Flex CharStyle:Code
432 \begin_layout Plain Layout
438 the list of layout modules found in your
439 \begin_inset Flex CharStyle:Code
442 \begin_layout Plain Layout
451 \begin_layout Labeling
452 \labelwidthstring 00.00.0000
453 \begin_inset Flex CharStyle:Code
456 \begin_layout Plain Layout
462 lists of various sorts of LaTeX-related files found on your system
465 \begin_layout Labeling
466 \labelwidthstring 00.00.0000
467 \begin_inset Flex CharStyle:Code
470 \begin_layout Plain Layout
476 is automatically generated during configuration from the file
477 \begin_inset Flex CharStyle:Code
480 \begin_layout Plain Layout
487 It contains information on your LaTeX configuration.
490 \begin_layout Subsection
494 \begin_layout Standard
495 These directories are duplicated between
496 \begin_inset Flex CharStyle:Code
499 \begin_layout Plain Layout
506 \begin_inset Flex CharStyle:Code
509 \begin_layout Plain Layout
516 If a particular files exists in both places, the one in
517 \begin_inset Flex CharStyle:Code
520 \begin_layout Plain Layout
529 \begin_layout Labeling
530 \labelwidthstring 00.00.0000
531 \begin_inset Flex CharStyle:Code
534 \begin_layout Plain Layout
540 this directory contains files with the extension
541 \begin_inset Flex CharStyle:Code
544 \begin_layout Plain Layout
550 that define the keybindings used in LyX.
551 If there exists an internationalized version of the bind file named
552 \begin_inset Flex CharStyle:Code
555 \begin_layout Plain Layout
561 , that will be used first.
564 \begin_layout Labeling
565 \labelwidthstring 00.00.0000
566 \begin_inset Flex CharStyle:Code
569 \begin_layout Plain Layout
575 contains graphics files that can be included in documents.
579 \begin_layout Labeling
580 \labelwidthstring 00.00.0000
581 \begin_inset Flex CharStyle:Code
584 \begin_layout Plain Layout
590 contains LyX documentation files (including the one you are currently reading).
592 \begin_inset Flex CharStyle:Code
595 \begin_layout Plain Layout
601 deserves special attention, as noted above.
602 The internationalized help docs are in subdirectories
603 \begin_inset Flex CharStyle:Code
606 \begin_layout Plain Layout
613 \begin_inset Quotes eld
617 \begin_inset Quotes erd
620 is the ISO language code.
626 \begin_inset CommandInset ref
628 reference "cha:Internationalizing-LyX"
635 \begin_layout Labeling
636 \labelwidthstring 00.00.0000
637 \begin_inset Flex CharStyle:Code
640 \begin_layout Plain Layout
646 contains example files that explain how to use some features.
647 In the file browser, press the
648 \begin_inset Flex CharStyle:MenuItem
651 \begin_layout Plain Layout
660 \begin_layout Labeling
661 \labelwidthstring 00.00.0000
662 \begin_inset Flex CharStyle:Code
665 \begin_layout Plain Layout
671 contains image files that are used by the
672 \begin_inset Flex CharStyle:MenuItem
675 \begin_layout Plain Layout
682 In addition, it also contains the individual icons used in the toolbar
683 and the banners that can be shown when LyX is launched.
686 \begin_layout Labeling
687 \labelwidthstring 00.00.0000
688 \begin_inset Flex CharStyle:Code
691 \begin_layout Plain Layout
697 contains keyboard keymapping files.
703 \begin_inset CommandInset ref
705 reference "sec:International-Keymap-Stuff"
712 \begin_layout Labeling
713 \labelwidthstring 00.00.0000
714 \begin_inset Flex CharStyle:Code
717 \begin_layout Plain Layout
723 contains the text class and module files described in Chapter
728 \begin_inset CommandInset ref
730 reference "cha:Installing-New-Document"
737 \begin_layout Labeling
738 \labelwidthstring 00.00.0000
739 \begin_inset Flex CharStyle:Code
742 \begin_layout Plain Layout
749 \begin_inset Flex CharStyle:Code
752 \begin_layout Plain Layout
758 Python scripts used to convert between LyX versions.
759 These can be run from the command line if, say, you want to batch-convert
763 \begin_layout Labeling
764 \labelwidthstring 00.00.0000
765 \begin_inset Flex CharStyle:Code
768 \begin_layout Plain Layout
774 contains some files that demonstrate the capabilities of the
775 \begin_inset Flex CharStyle:MenuItem
778 \begin_layout Plain Layout
789 Also contains some scripts used by LyX itself.
792 \begin_layout Labeling
793 \labelwidthstring 00.00.0000
794 \begin_inset Flex CharStyle:Code
797 \begin_layout Plain Layout
803 contains the standard LyX template files described in Chapter
808 \begin_inset CommandInset ref
810 reference "sec:Creating-Templates"
817 \begin_layout Labeling
818 \labelwidthstring 00.00.0000
819 \begin_inset Flex CharStyle:Code
822 \begin_layout Plain Layout
828 contains files with the extension
829 \begin_inset Flex CharStyle:Code
832 \begin_layout Plain Layout
838 that define the user interface to LyX.
839 That is, the files define which items appear in which menus and the items
840 appearing on the toolbar.
843 \begin_layout Subsection
844 Files you don't want to modify
847 \begin_layout Standard
848 These files are used internally by LyX and you generally do not need to
849 modify them unless you are a developer.
852 \begin_layout Labeling
853 \labelwidthstring 00.00.0000
854 \begin_inset Flex CharStyle:Code
857 \begin_layout Plain Layout
863 this file contains the list of LyX developers.
864 The contents are displayed with the menu entry
865 \begin_inset Flex CharStyle:MenuItem
868 \begin_layout Plain Layout
869 Help\SpecialChar \menuseparator
882 \begin_layout Labeling
883 \labelwidthstring 00.00.0000
884 \begin_inset Flex CharStyle:Code
887 \begin_layout Plain Layout
893 this is a LaTeX script used during the configuration process.
897 \begin_layout Labeling
898 \labelwidthstring 00.00.0000
899 \begin_inset Flex CharStyle:Code
902 \begin_layout Plain Layout
908 this is the script that is used to re-configure LyX.
909 It creates configuration files in the directory it was run from.
912 \begin_layout Subsection
913 Other files needing a line or two...
916 \begin_layout Labeling
917 \labelwidthstring 00.00.0000
918 \begin_inset Flex CharStyle:Code
921 \begin_layout Plain Layout
927 this contains tables describing how different character encodings can be
931 \begin_layout Labeling
932 \labelwidthstring 00.00.0000
933 \begin_inset Flex CharStyle:Code
936 \begin_layout Plain Layout
942 this file contains the templates available to the new
943 \begin_inset Flex CharStyle:MenuItem
946 \begin_layout Plain Layout
959 \begin_layout Labeling
960 \labelwidthstring 00.00.0000
961 \begin_inset Flex CharStyle:Code
964 \begin_layout Plain Layout
970 this file contains a list of all the languages currently supported by LyX.
973 \begin_layout Section
974 Your local configuration directory
977 \begin_layout Standard
978 Even if you are using LyX as an unprivileged user, you might want to change
979 LyX configuration for your own use.
981 \begin_inset Flex CharStyle:Code
984 \begin_layout Plain Layout
990 directory contains all your personal configuration files.
991 This is the directory described as
992 \begin_inset Quotes eld
996 \begin_inset Quotes erd
1000 \begin_inset Flex CharStyle:MenuItem
1003 \begin_layout Plain Layout
1004 Help\SpecialChar \menuseparator
1006 \begin_inset space ~
1015 This directory is used as a mirror of
1016 \begin_inset Flex CharStyle:Code
1019 \begin_layout Plain Layout
1025 , which means that every file in
1026 \begin_inset Flex CharStyle:Code
1029 \begin_layout Plain Layout
1035 is a replacement for the corresponding file in
1036 \begin_inset Flex CharStyle:Code
1039 \begin_layout Plain Layout
1046 Any configuration file described in the above sections can be placed either
1047 in the system-wide directory, in which case it will affect all users, or
1048 in your local directory for your own use.
1051 \begin_layout Standard
1052 To make things clearer, let's provide a few examples:
1055 \begin_layout Itemize
1056 The preferences set in the
1057 \begin_inset Flex CharStyle:MenuItem
1060 \begin_layout Plain Layout
1061 Tools\SpecialChar \menuseparator
1067 dialog are saved to a file
1068 \begin_inset Flex CharStyle:Code
1071 \begin_layout Plain Layout
1078 \begin_inset Flex CharStyle:Code
1081 \begin_layout Plain Layout
1090 \begin_layout Itemize
1091 When you reconfigure using
1092 \begin_inset Flex CharStyle:MenuItem
1095 \begin_layout Plain Layout
1096 Tools\SpecialChar \menuseparator
1103 \begin_inset Flex CharStyle:Code
1106 \begin_layout Plain Layout
1112 script, and the resulting files are written in your local configuration
1114 This means that any additional text class file that you might have added
1116 \begin_inset Flex CharStyle:Code
1119 \begin_layout Plain Layout
1125 will be added to the list of classes in the
1126 \begin_inset Flex CharStyle:MenuItem
1129 \begin_layout Plain Layout
1130 Document\SpecialChar \menuseparator
1139 \begin_layout Itemize
1140 If you get some updated documentation from LyX ftp site and cannot install
1141 it because you do not have sysadmin rights on your system, you can just
1143 \begin_inset Flex CharStyle:Code
1146 \begin_layout Plain Layout
1152 and the items in the
1153 \begin_inset Flex CharStyle:MenuItem
1156 \begin_layout Plain Layout
1162 menu will open them!
1165 \begin_layout Section
1166 Running LyX with multiple configurations
1169 \begin_layout Standard
1170 The configuration freedom of the local configuration directory may not suffice
1171 if you want to have more than one configuration at your disposal.
1172 For example, you may want to be use different key bindings or printer settings
1174 You can achieve this by having several such directories.
1175 You then specify which directory to use at run-time.
1178 \begin_layout Standard
1179 Invoking LyX with the command line switch
1180 \begin_inset Flex CharStyle:Code
1183 \begin_layout Plain Layout
1193 instructs the program to read the configuration from that directory, and
1194 not from the default directory.
1195 (You can determine the default directory by running LyX without the
1196 \begin_inset Flex CharStyle:Code
1199 \begin_layout Plain Layout
1205 switch.) If the specified directory does not exist, LyX offers to create
1206 it for you, just like it does for the default directory on the first time
1207 you run the program.
1208 You can modify the configuration options in this additional user directory
1209 exactly as you would for the default directory.
1210 These directories are completely independent (but read on).
1211 Note that setting the environment variable
1212 \begin_inset Flex CharStyle:Code
1215 \begin_layout Plain Layout
1221 to some value has exactly the same effect.
1224 \begin_layout Standard
1225 Having several configurations also requires more maintenance: if you want
1226 to add a new layout to
1227 \begin_inset Flex CharStyle:Code
1230 \begin_layout Plain Layout
1236 which you want available from all your configurations, you must add it
1237 to each directory separately.
1238 You can avoid this with the following trick: after LyX creates the additional
1239 directory, most of the subdirectories (see above) are empty.
1240 If you want the new configuration to mirror an existing one, replace the
1241 empty subdirectory with a symbolic link to the matching subdirectory in
1242 the existing configuration.
1244 \begin_inset Flex CharStyle:Code
1247 \begin_layout Plain Layout
1253 subdirectory, however, since it contains a file written by the configuration
1254 script (also accessible through
1255 \begin_inset Flex CharStyle:MenuItem
1258 \begin_layout Plain Layout
1259 Tools\SpecialChar \menuseparator
1265 ) which is configuration-specific.
1268 \begin_layout Chapter
1269 The Preferences dialog
1272 \begin_layout Standard
1273 All options of the preferences dialog are described in the Appendix
1275 The Preferences Dialog
1282 For some options you might find here more details.
1285 \begin_layout Section
1287 \begin_inset CommandInset label
1296 \begin_layout Standard
1297 The first step is to define your file formats if they are not already defined.
1299 \begin_inset Flex CharStyle:MenuItem
1302 \begin_layout Plain Layout
1303 Tools\SpecialChar \menuseparator
1311 \begin_inset Flex CharStyle:MenuItem
1314 \begin_layout Plain Layout
1315 File Handling\SpecialChar \menuseparator
1322 \begin_inset Flex CharStyle:MenuItem
1325 \begin_layout Plain Layout
1326 New\SpecialChar \ldots{}
1332 button to define your new format.
1334 \begin_inset Flex CharStyle:MenuItem
1337 \begin_layout Plain Layout
1343 field contains the name used to identify the format in the GUI.
1345 \begin_inset Flex CharStyle:MenuItem
1348 \begin_layout Plain Layout
1354 is used to identify the format internally.
1355 You will also need to enter a file extension.
1356 These are all required.
1358 \begin_inset Flex CharStyle:MenuItem
1361 \begin_layout Plain Layout
1367 field is used to provide a keyboard shortcut on the menus.
1368 (For example, pressing
1369 \begin_inset Flex CharStyle:MenuItem
1372 \begin_layout Plain Layout
1379 \begin_inset Flex CharStyle:MenuItem
1382 \begin_layout Plain Layout
1383 View\SpecialChar \menuseparator
1392 \begin_layout Standard
1394 \begin_inset Flex CharStyle:MenuItem
1397 \begin_layout Plain Layout
1404 \begin_inset Flex CharStyle:MenuItem
1407 \begin_layout Plain Layout
1414 For example, you might want to use
1415 \begin_inset Flex CharStyle:MenuItem
1418 \begin_layout Plain Layout
1424 to view PostScript files.
1425 You can enter the command needed to start the program in the corresponding
1427 In defining this command, you can use the four variables listed in the
1429 The viewer is launched when you view an image in LyX or use the
1430 \begin_inset Flex CharStyle:MenuItem
1433 \begin_layout Plain Layout
1440 The editor is for example launched when you right-click on an image and
1442 \begin_inset Flex CharStyle:MenuItem
1445 \begin_layout Plain Layout
1451 in the appearing context menu.
1454 \begin_layout Standard
1456 \begin_inset Flex CharStyle:MenuItem
1459 \begin_layout Plain Layout
1465 option tells LyX that a format is suitable for document export.
1466 If this is set and if a suitable conversion route exists (see sec.
1467 \begin_inset space \thinspace{}
1471 \begin_inset CommandInset ref
1473 reference "sec:Converters"
1477 ), the format will appear in the
1478 \begin_inset Flex CharStyle:MenuItem
1481 \begin_layout Plain Layout
1482 File\SpecialChar \menuseparator
1489 The format will also appear in the
1490 \begin_inset Flex CharStyle:MenuItem
1493 \begin_layout Plain Layout
1499 menu if a viewer is specified for the format.
1500 Pure image formats, such as
1501 \begin_inset Flex CharStyle:Code
1504 \begin_layout Plain Layout
1510 , should not use this option.
1511 Formats that can both represent vector graphics and documents like
1512 \begin_inset Flex CharStyle:Code
1515 \begin_layout Plain Layout
1524 \begin_layout Standard
1526 \begin_inset Flex CharStyle:MenuItem
1529 \begin_layout Plain Layout
1530 Vector graphics format
1535 tells LyX that a format can contain vector graphics.
1536 This information is used to determine the target format of included graphics
1538 \begin_inset Flex CharStyle:MenuItem
1541 \begin_layout Plain Layout
1548 Included graphics may need to be converted to either
1549 \begin_inset Flex CharStyle:MenuItem
1552 \begin_layout Plain Layout
1559 \begin_inset Flex CharStyle:MenuItem
1562 \begin_layout Plain Layout
1569 \begin_inset Flex CharStyle:MenuItem
1572 \begin_layout Plain Layout
1579 \begin_inset Flex CharStyle:MenuItem
1582 \begin_layout Plain Layout
1588 cannot handle other image formats.
1589 If an included graphic is not already in
1590 \begin_inset Flex CharStyle:MenuItem
1593 \begin_layout Plain Layout
1600 \begin_inset Flex CharStyle:MenuItem
1603 \begin_layout Plain Layout
1610 \begin_inset Flex CharStyle:MenuItem
1613 \begin_layout Plain Layout
1619 format, it is converted to
1620 \begin_inset Flex CharStyle:MenuItem
1623 \begin_layout Plain Layout
1629 if the vector format option is set, and otherwise to
1630 \begin_inset Flex CharStyle:MenuItem
1633 \begin_layout Plain Layout
1642 \begin_layout Section
1646 \begin_layout Standard
1647 Since all conversions from one format to another take place in LyX's temporary
1648 directory, it is sometimes necessary to modify a file before copying it
1649 to the temporary directory in order that the conversion may be performed.
1653 \begin_layout Plain Layout
1654 For example, the file may refer to other files—images, for example—using
1655 relative file names, and these may become invalid when the file is copied
1656 to the temporary directory.
1661 This is done by a Copier: It copies a file to (or from) the temporary directory
1662 and may modify it in the process.
1665 \begin_layout Standard
1666 The definitions of the copiers may use four variables:
1669 \begin_layout Labeling
1670 \labelwidthstring 00.00.0000
1671 \begin_inset Flex CharStyle:Code
1674 \begin_layout Plain Layout
1680 The LyX system directory (e.
1681 \begin_inset space \thinspace{}
1685 \begin_inset space \space{}
1689 \begin_inset Flex CharStyle:MenuItem
1692 \begin_layout Plain Layout
1701 \begin_layout Labeling
1702 \labelwidthstring 00.00.0000
1703 \begin_inset Flex CharStyle:Code
1706 \begin_layout Plain Layout
1715 \begin_layout Labeling
1716 \labelwidthstring 00.00.0000
1717 \begin_inset Flex CharStyle:Code
1720 \begin_layout Plain Layout
1729 \begin_layout Labeling
1730 \labelwidthstring 00.00.0000
1731 \begin_inset Flex CharStyle:Code
1734 \begin_layout Plain Layout
1743 \begin_layout Standard
1744 The latter should be the filename as it would be used in a LaTeX's
1751 It is relevant only when exporting files suitable for such inclusion.
1754 \begin_layout Standard
1755 Copiers can be used to do almost anything with output files.
1756 For example, suppose you want generated pdf files to be copied to a special
1758 \begin_inset Flex CharStyle:Code
1761 \begin_layout Plain Layout
1768 Then you could write a shell script such as this one:
1771 \begin_layout Standard
1772 \begin_inset listings
1776 \begin_layout Plain Layout
1781 \begin_layout Plain Layout
1786 \begin_layout Plain Layout
1788 TOFILE=`basename $2`
1791 \begin_layout Plain Layout
1793 cp $FROMFILE /home/you/pdf/$TOFILE
1798 Save it in your local LyX directory—say,
1799 \begin_inset Flex CharStyle:Code
1802 \begin_layout Plain Layout
1803 /home/you/.lyx/scripts/pdfcopier.sh
1808 —and make it executable, if you need to do so on your platform.
1810 \begin_inset Flex CharStyle:MenuItem
1813 \begin_layout Plain Layout
1814 Tools\SpecialChar \menuseparator
1820 dialog, select under
1821 \begin_inset Flex CharStyle:MenuItem
1824 \begin_layout Plain Layout
1825 File Handling\SpecialChar \menuseparator
1832 \begin_inset Flex CharStyle:MenuItem
1835 \begin_layout Plain Layout
1841 format—or one of the other pdf formats—and enter
1842 \begin_inset Flex CharStyle:Code
1845 \begin_layout Plain Layout
1846 pdfcopier.sh $$i $$o
1852 \begin_inset Flex CharStyle:MenuItem
1855 \begin_layout Plain Layout
1865 \begin_layout Standard
1866 Copiers are used by LyX in various of its own conversions.
1867 For example, if appropriate programs are found, LyX will automatically
1868 install copiers for the
1869 \begin_inset Flex CharStyle:MenuItem
1872 \begin_layout Plain Layout
1879 \begin_inset Flex CharStyle:MenuItem
1882 \begin_layout Plain Layout
1884 \begin_inset space ~
1893 When these formats are exported, the copier sees that not just the main
1894 HTML file but various associated files (style files, images, etc.) are also
1896 All these files are written to a subdirectory of the directory in which
1897 the original LyX file was found.
1901 \begin_layout Plain Layout
1902 This copier can be customized.
1904 \begin_inset Quotes eld
1908 \begin_inset Quotes erd
1911 argument takes a comma-separated list of extensions to be copied; if it
1912 is omitted, all files will be copied.
1914 \begin_inset Quotes eld
1918 \begin_inset Quotes erd
1921 argument determines the extension added to the generated directory.
1923 \begin_inset Quotes eld
1927 \begin_inset Flex CharStyle:MenuItem
1930 \begin_layout Plain Layout
1937 \begin_inset Quotes erd
1940 , so HTML generated from
1941 \begin_inset Flex CharStyle:MenuItem
1944 \begin_layout Plain Layout
1945 /path/to/filename.lyx
1951 \begin_inset Flex CharStyle:MenuItem
1954 \begin_layout Plain Layout
1955 /path/to/filename.html.LyXconv
1969 \begin_layout Section
1971 \begin_inset CommandInset label
1973 name "sec:Converters"
1980 \begin_layout Standard
1981 You can define your own Converters to convert files between different formats.
1983 \begin_inset Flex CharStyle:MenuItem
1986 \begin_layout Plain Layout
1987 Tools\SpecialChar \menuseparator
1988 Preferences\SpecialChar \menuseparator
1989 File Handling\SpecialChar \menuseparator
1998 \begin_layout Standard
1999 To define a new converter, select the
2000 \begin_inset Flex CharStyle:MenuItem
2003 \begin_layout Plain Layout
2005 \begin_inset space ~
2014 \begin_inset Flex CharStyle:MenuItem
2017 \begin_layout Plain Layout
2019 \begin_inset space ~
2027 from the drop-down lists, enter the command needed for the conversion,
2029 \begin_inset Flex CharStyle:MenuItem
2032 \begin_layout Plain Layout
2039 Several variables can be used in the definition of converters:
2042 \begin_layout Labeling
2043 \labelwidthstring 00.00.0000
2044 \begin_inset Flex CharStyle:Code
2047 \begin_layout Plain Layout
2053 The LyX system directory
2056 \begin_layout Labeling
2057 \labelwidthstring 00.00.0000
2058 \begin_inset Flex CharStyle:Code
2061 \begin_layout Plain Layout
2070 \begin_layout Labeling
2071 \labelwidthstring 00.00.0000
2072 \begin_inset Flex CharStyle:Code
2075 \begin_layout Plain Layout
2084 \begin_layout Labeling
2085 \labelwidthstring 00.00.0000
2086 \begin_inset Flex CharStyle:Code
2089 \begin_layout Plain Layout
2095 The base filename of the input file (i.
2096 \begin_inset space \thinspace{}
2099 g., without the extension)
2102 \begin_layout Labeling
2103 \labelwidthstring 00.00.0000
2104 \begin_inset Flex CharStyle:Code
2107 \begin_layout Plain Layout
2113 The path to the input file
2116 \begin_layout Labeling
2117 \labelwidthstring 00.00.0000
2118 \begin_inset Flex CharStyle:Code
2121 \begin_layout Plain Layout
2127 The path to the original input file (this is different from $$p when a
2128 chain of converters is called).
2131 \begin_layout Standard
2133 \begin_inset Flex CharStyle:MenuItem
2136 \begin_layout Plain Layout
2138 \begin_inset space ~
2146 field you can enter the following flags, separated by commas:
2149 \begin_layout Labeling
2150 \labelwidthstring 00.00.0000
2151 \begin_inset Flex CharStyle:Code
2154 \begin_layout Plain Layout
2160 This converter runs some form of LaTeX.
2161 This will make LyX's LaTeX error logs available.
2164 \begin_layout Labeling
2165 \labelwidthstring 00.00.0000
2166 \begin_inset Flex CharStyle:Code
2169 \begin_layout Plain Layout
2176 \begin_inset Flex CharStyle:MenuItem
2179 \begin_layout Plain Layout
2185 file for the conversion.
2188 \begin_layout Labeling
2189 \labelwidthstring 00.00.0000
2190 \begin_inset Flex CharStyle:Code
2193 \begin_layout Plain Layout
2202 \begin_layout Standard
2203 The following three flags are not really flags at all because they take
2205 \begin_inset Flex CharStyle:MenuItem
2208 \begin_layout Plain Layout
2210 \begin_inset space ~
2214 \begin_inset space ~
2225 \begin_layout Labeling
2226 \labelwidthstring 00.00.0000
2227 \begin_inset Flex CharStyle:Code
2230 \begin_layout Plain Layout
2236 If set, the converter's standard error will be redirected to a file
2237 \begin_inset Flex CharStyle:Code
2240 \begin_layout Plain Layout
2246 , and the script given as argument will be run as:
2247 \begin_inset Flex CharStyle:Code
2250 \begin_layout Plain Layout
2251 script < infile.out > infile.log
2257 The argument may contain
2258 \begin_inset Flex CharStyle:Code
2261 \begin_layout Plain Layout
2270 \begin_layout Labeling
2271 \labelwidthstring 00.00.0000
2272 \begin_inset Flex CharStyle:Code
2275 \begin_layout Plain Layout
2281 The name of the directory in which the converter will dump the generated
2283 LyX will not create this directory, and it does not copy anything into
2284 it, though it will copy this directory to the destination.
2285 The argument may contain
2286 \begin_inset Flex CharStyle:Code
2289 \begin_layout Plain Layout
2295 , which will be replaced by the base name of the input and output files,
2296 respectively, when the directory is copied.
2297 \begin_inset Newline newline
2300 Note that resultdir and usetempdir make no sense together.
2301 The latter will be ignored if the former is given.
2304 \begin_layout Labeling
2305 \labelwidthstring 00.00.0000
2306 \begin_inset Flex CharStyle:Code
2309 \begin_layout Plain Layout
2315 Determines the output file name and may, contain
2316 \begin_inset Flex CharStyle:Code
2319 \begin_layout Plain Layout
2326 Sensible only with resultdir and optional even then; if not given, it defaults
2330 \begin_layout Standard
2331 None of these last three are presently used in any of the converters that
2332 are installed with LyX.
2336 \begin_layout Standard
2337 You do not have to define converters for all formats between which you want
2339 For example, you will note that there is no `LyX to PostScript' converter,
2340 but LyX will export PostScript.
2341 It does so by first creating a LaTeX file (no converter needs to be defined
2342 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2343 and finally converting the resulting DVI file to PostScript.
2344 LyX finds such `chains' of converters automatically, and it will always
2345 choose the shortest possible chain.
2346 You can, though, still define multiple conversion methods between file
2348 For example, the standard LyX configuration provides three ways to convert
2349 LaTeX to PDF: Directly, using
2350 \begin_inset Flex CharStyle:MenuItem
2353 \begin_layout Plain Layout
2359 ; via (DVI and) PostScript, using
2360 \begin_inset Flex CharStyle:MenuItem
2363 \begin_layout Plain Layout
2370 \begin_inset Flex CharStyle:MenuItem
2373 \begin_layout Plain Layout
2380 To define such alternate chains, you must define multiple target `file
2381 formats', as described in section
2382 \begin_inset CommandInset ref
2384 reference "sec:Formats"
2389 For example, in the standard configuration, the formats named
2390 \begin_inset Flex CharStyle:MenuItem
2393 \begin_layout Plain Layout
2400 \begin_inset Flex CharStyle:MenuItem
2403 \begin_layout Plain Layout
2410 \begin_inset Flex CharStyle:MenuItem
2413 \begin_layout Plain Layout
2419 are defined, all of which share the extension
2420 \begin_inset Flex CharStyle:MenuItem
2423 \begin_layout Plain Layout
2429 , and which correspond to the conversion methods just mentioned.
2432 \begin_layout Chapter
2433 Internationalizing LyX
2434 \begin_inset CommandInset label
2436 name "cha:Internationalizing-LyX"
2443 \begin_layout Standard
2444 LyX supports using a translated interface.
2445 Last time we checked, LyX provided text in thirty languages.
2446 The language of choice is called your
2451 (For further reading on locale settings, see also the documentation for
2452 locale that comes with your operating system.
2453 For Linux, the manual page for
2454 \begin_inset Flex CharStyle:Code
2457 \begin_layout Plain Layout
2463 could be a good place to start).
2466 \begin_layout Standard
2467 Notice that these translations will work, but do contain a few flaws.
2468 In particular, all dialogs have been designed with the English text in
2469 mind, which means that some of the translated text will be too large to
2470 fit within the space allocated.
2471 This is only a display problem and will not cause any harm.
2472 Also, you will find that some of the translations do not define shortcut
2473 keys for everything.
2474 Sometimes, there are simply not enough free letters to do it.
2475 Other times, the translator just hasn't got around to doing it yet.
2476 Our localization team, which you may wish to join,
2480 \begin_layout Plain Layout
2481 If you are a fluent speaker of a language other than English, joining these
2482 teams is a great way to give back to the LyX community!
2487 will of course try to fix these shortcomings in future versions of LyX.
2490 \begin_layout Section
2494 \begin_layout Subsection
2495 Translating the graphical user interface (text messages).
2498 \begin_layout Standard
2500 \begin_inset Flex CharStyle:Code
2503 \begin_layout Plain Layout
2509 library to handle the internationalization of the interface.
2510 To have LyX speak your favorite language in all menus and dialogs, you
2512 \begin_inset Flex CharStyle:Code
2515 \begin_layout Plain Layout
2521 -file for that language.
2522 When this is available, you'll have to generate a
2523 \begin_inset Flex CharStyle:Code
2526 \begin_layout Plain Layout
2532 -file from it and install the
2533 \begin_inset Flex CharStyle:Code
2536 \begin_layout Plain Layout
2543 The process of doing all of this is explained in the documentation for
2545 \begin_inset Flex CharStyle:Code
2548 \begin_layout Plain Layout
2555 It is possible to do this just for yourself, but if you're going to do
2556 it, you might as well share the results of your labors with the rest of
2558 Send a message to the LyX developers' list for more information about how
2562 \begin_layout Standard
2563 In short, this is what you should do (xx denotes the language code):
2566 \begin_layout Itemize
2567 Check out the LyX source code.
2569 \begin_inset CommandInset href
2571 name "information on the web"
2572 target "http://www.lyx.org/devel/cvs.php"
2579 \begin_layout Itemize
2581 \begin_inset Flex CharStyle:Code
2584 \begin_layout Plain Layout
2590 to the folder of the
2591 \begin_inset Flex CharStyle:Code
2594 \begin_layout Plain Layout
2602 \begin_inset Flex CharStyle:Code
2605 \begin_layout Plain Layout
2613 \begin_inset Flex CharStyle:Code
2616 \begin_layout Plain Layout
2622 doesn't exist anywhere, it can be remade with the console command
2623 \begin_inset Flex CharStyle:Code
2626 \begin_layout Plain Layout
2632 in that directory, or you can use an existing po-file for some other language
2636 \begin_layout Itemize
2638 \begin_inset Flex CharStyle:Code
2641 \begin_layout Plain Layout
2651 \begin_layout Plain Layout
2652 This is just a text file, so it can be edited in any text editor.
2653 But there are also specialized programs that support such editing, such
2658 (for all platforms) or
2667 contains a `mode' for editing
2668 \begin_inset Flex CharStyle:Code
2671 \begin_layout Plain Layout
2682 For some menu- and widget-labels, there are also shortcut keys that should
2684 Those keys are marked after a `|', and should be translated according to
2685 the words and phrases of the language.
2686 You should also fill also out the information at the beginning of the new
2688 \begin_inset Flex CharStyle:Code
2691 \begin_layout Plain Layout
2697 -file with your email-address, etc., so people know where to reach you with
2698 suggestions and entertaining flames.
2701 \begin_layout Standard
2702 If you are just doing this on your own, then:
2705 \begin_layout Itemize
2707 \begin_inset Flex CharStyle:Code
2710 \begin_layout Plain Layout
2717 This can be done with
2718 \begin_inset Flex CharStyle:Code
2721 \begin_layout Plain Layout
2722 msgfmt -o xx.mo < xx.po
2730 \begin_layout Itemize
2732 \begin_inset Flex CharStyle:Code
2735 \begin_layout Plain Layout
2741 -file to your locale-tree, at the correct directory for application messages
2746 xx, and under the name
2747 \begin_inset Flex CharStyle:Code
2750 \begin_layout Plain Layout
2757 \begin_inset space \thinspace{}
2761 \begin_inset space \space{}
2765 \begin_inset Flex CharStyle:Code
2768 \begin_layout Plain Layout
2769 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2779 \begin_layout Standard
2780 As said, however, it would be best if the new
2781 \begin_inset Flex CharStyle:Code
2784 \begin_layout Plain Layout
2790 -file could be added to the LyX distribution, so others can use it.
2791 Adding it involves making additional changes to LyX.
2792 So send an email to the developers' mailing list if you're interested in
2796 \begin_layout Subsubsection
2800 \begin_layout Standard
2801 Sometimes it turns out that one English message needs to be translated into
2802 different messages in the target language.
2803 One example is the message
2804 \begin_inset Flex CharStyle:Code
2807 \begin_layout Plain Layout
2813 which has the German translation
2821 , depending upon exactly what the English
2822 \begin_inset Quotes eld
2826 \begin_inset Quotes erd
2831 \begin_inset Flex CharStyle:Code
2834 \begin_layout Plain Layout
2840 does not handle such ambiguous translations.
2841 Therefore you have to add some context information to the message: Instead
2843 \begin_inset Flex CharStyle:Code
2846 \begin_layout Plain Layout
2853 \begin_inset Flex CharStyle:Code
2856 \begin_layout Plain Layout
2857 To[[as in 'From format x to format y']]
2863 \begin_inset Flex CharStyle:Code
2866 \begin_layout Plain Layout
2867 To[[as in 'From page x to page y']].
2872 Now the two occurrences of
2873 \begin_inset Flex CharStyle:Code
2876 \begin_layout Plain Layout
2883 \begin_inset Flex CharStyle:Code
2886 \begin_layout Plain Layout
2892 and can be translated correctly to
2903 \begin_layout Standard
2904 Of course the context information needs to be stripped off the original
2905 message when no translation is used.
2906 Therefore you have to put it in double square brackets at the end of the
2907 message (see the example above).
2908 The translation mechanism of LyX ensures that everything in double square
2909 brackets at the end of messages is removed before displaying the message.
2912 \begin_layout Subsection
2913 Translating the documentation.
2916 \begin_layout Standard
2917 The online documentation (in the
2918 \begin_inset Flex CharStyle:MenuItem
2921 \begin_layout Plain Layout
2927 -menu) can (and should!) be translated.
2928 If there are translated versions of the documentation available
2932 \begin_layout Plain Layout
2933 As of March 2008, at least some of the documents have been translated into
2934 fourteen languages, with the Tutorial available in a few more.
2939 and the locale is set accordingly, these will be used automagically by
2941 LyX looks for translated versions as
2942 \begin_inset Flex CharStyle:Code
2945 \begin_layout Plain Layout
2946 LyXDir/doc/xx/DocName.lyx
2952 \begin_inset Flex CharStyle:Code
2955 \begin_layout Plain Layout
2961 is the code for the language currently in use.
2962 If there are no translated documents, the default English versions will
2964 Note that the translated versions must have the same filenames (
2965 \begin_inset Flex CharStyle:Code
2968 \begin_layout Plain Layout
2974 above) as the original.
2975 If you feel up to translating the documentation (an excellent way to proof-read
2976 the original documentation by the way!), there are a few things you should
2980 \begin_layout Itemize
2981 Check out the documentation translation web page at
2982 \begin_inset CommandInset href
2984 name "http://www.lyx.org/Translation"
2985 target "http://www.lyx.org/Translation"
2990 That way, you can find out which (if any) documents have already been translate
2991 d into your language.
2992 You can also find out who (if anyone) is organizing the effort to translate
2993 the documentation into your language.
2994 If no one is organizing the effort, please let us know that you're interested.
2997 \begin_layout Standard
2998 Once you get to actually translating, here's a few hints for you that may
3002 \begin_layout Itemize
3003 Join the documentation team! There is information on how to do that in
3004 \begin_inset Flex CharStyle:Code
3007 \begin_layout Plain Layout
3014 \begin_inset Flex CharStyle:MenuItem
3017 \begin_layout Plain Layout
3018 Help\SpecialChar \menuseparator
3024 ), which by the way is the first document you should translate.
3027 \begin_layout Itemize
3028 Learn the typographic conventions for the language you are translating to.
3029 Typography is an ancient art and over the centuries, a great variety of
3030 conventions have developed throughout different parts of the world.
3031 Also study the professional terminology amongst typographers in your country.
3032 Inventing your own terminology will only confuse the users.
3035 (Warning! Typography is addictive!)
3038 \begin_layout Itemize
3039 Make a copy of the document.
3040 This will be your working copy.
3041 You can use this as your personal translated help-file by placing it in
3043 \begin_inset Flex CharStyle:Code
3046 \begin_layout Plain Layout
3055 \begin_layout Itemize
3056 Sometimes the original document (from the LyX-team) will be updated.
3057 Use the source viewer at
3058 \begin_inset CommandInset href
3060 name "http://www.lyx.org/trac/timeline"
3061 target "http://www.lyx.org/trac/timeline"
3065 to see what has been changed.
3066 That way you can easily see which parts of the translated document need
3070 \begin_layout Standard
3071 If you ever find an error in the original document, fix it and notify the
3072 rest of the documentation team of the changes! (You didn't forget to join
3073 the documentation team, did you?)
3076 \begin_layout Standard
3077 \begin_inset Branch OutDated
3080 \begin_layout Section
3081 International Keyboard Support
3084 \begin_layout Standard
3087 [Editor's Note: The following section is by
3095 It needs to be fixed to conform to the new Documentation Style sheet and
3096 to make use of the new v1.0 features.
3097 The whole thing also needs to be merged with the section following it.-jw
3098 It may also be badly out of date.-rh (2008)]
3101 \begin_layout Subsection
3102 Defining Own Keymaps: Keymap File Format
3105 \begin_layout Standard
3106 Let's look at a keyboard definition file a little closer.
3107 It is a plain text file defining
3110 \begin_layout Itemize
3111 key-to-key or key-to-string translations
3114 \begin_layout Itemize
3118 \begin_layout Itemize
3119 dead keys exceptions
3122 \begin_layout Standard
3123 To define key-to-key or key-to-string translation, use this command:
3126 \begin_layout Quotation
3127 \begin_inset Flex CharStyle:Code
3130 \begin_layout Plain Layout
3139 \begin_inset Flex CharStyle:Code
3142 \begin_layout Plain Layout
3151 \begin_layout Standard
3153 \begin_inset Flex CharStyle:Code
3156 \begin_layout Plain Layout
3162 is the key to be translated and
3163 \begin_inset Flex CharStyle:Code
3166 \begin_layout Plain Layout
3172 is the string to be inserted into the document.
3173 To define dead keys, use:
3176 \begin_layout Quotation
3177 \begin_inset Flex CharStyle:Code
3180 \begin_layout Plain Layout
3189 \begin_inset Flex CharStyle:Code
3192 \begin_layout Plain Layout
3201 \begin_layout Standard
3203 \begin_inset Flex CharStyle:Code
3206 \begin_layout Plain Layout
3212 is a keyboard key and
3213 \begin_inset Flex CharStyle:Code
3216 \begin_layout Plain Layout
3223 The following dead keys are supported (shortcut name is in parentheses):
3226 \begin_layout Quotation
3230 \begin_inset space \hfill{}
3236 \begin_layout Quotation
3238 \begin_inset space \hfill{}
3244 \begin_layout Quotation
3246 \begin_inset space \hfill{}
3252 \begin_layout Quotation
3254 \begin_inset space \hfill{}
3260 \begin_layout Quotation
3262 \begin_inset space \hfill{}
3268 \begin_layout Quotation
3270 \begin_inset space \hfill{}
3277 \begin_layout Plain Layout
3289 \begin_layout Quotation
3291 \begin_inset space \hfill{}
3297 \begin_layout Quotation
3299 \begin_inset space \hfill{}
3306 \begin_layout Plain Layout
3318 \begin_layout Quotation
3320 \begin_inset space \hfill{}
3326 \begin_layout Quotation
3328 \begin_inset space \hfill{}
3334 \begin_layout Quotation
3336 \begin_inset space \hfill{}
3343 \begin_layout Plain Layout
3355 \begin_layout Quotation
3357 \begin_inset space \hfill{}
3364 \begin_layout Plain Layout
3376 \begin_layout Quotation
3378 \begin_inset space \hfill{}
3384 \begin_layout Quotation
3385 hungarian umlaut (hug)
3386 \begin_inset space \hfill{}
3392 \begin_layout Quotation
3394 \begin_inset space \hfill{}
3400 \begin_layout Quotation
3402 \begin_inset space \hfill{}
3409 \begin_layout Plain Layout
3421 \begin_layout Standard
3422 Since in many international keyboards there are exceptions to what some
3423 dead keys should do, you can define them using
3426 \begin_layout Quotation
3427 \begin_inset Flex CharStyle:Code
3430 \begin_layout Plain Layout
3438 deadkey key outstring
3441 \begin_layout Standard
3442 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3446 \begin_layout Quotation
3447 \begin_inset Flex CharStyle:Code
3450 \begin_layout Plain Layout
3463 \begin_layout Standard
3464 to make it work correctly.
3465 Also, you have to define as exceptions dead keys over i and j, to remove
3466 the dot from them before inserting an accent mark.
3467 I will change this when the time comes, but so far I haven't had time.
3470 \begin_layout Standard
3471 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3474 \begin_inset Flex CharStyle:Code
3477 \begin_layout Plain Layout
3483 have different meaning.
3485 \begin_inset Flex CharStyle:Code
3488 \begin_layout Plain Layout
3494 marks comments, quotes start and end LaTeX-style commands.
3495 To enter quote, you'll need to use
3496 \begin_inset Flex CharStyle:Code
3499 \begin_layout Plain Layout
3508 \begin_inset Flex CharStyle:Code
3511 \begin_layout Plain Layout
3518 \begin_inset Flex CharStyle:Code
3521 \begin_layout Plain Layout
3532 \begin_layout Standard
3533 If you make a keyboard description file that works for your language, please
3534 mail it to me, so I can include it in the next keymap distribution.
3537 \begin_layout Standard
3538 More keywords will be supported in keymap configuration file in future,
3542 \begin_layout Itemize
3543 \begin_inset Flex CharStyle:Code
3546 \begin_layout Plain Layout
3557 \begin_inset space \hfill{}
3561 \begin_inset Flex CharStyle:Code
3564 \begin_layout Plain Layout
3573 \begin_layout Itemize
3574 \begin_inset Flex CharStyle:Code
3577 \begin_layout Plain Layout
3588 \begin_inset space \hfill{}
3592 \begin_inset Flex CharStyle:Code
3595 \begin_layout Plain Layout
3601 an external keymap translation program
3604 \begin_layout Standard
3605 Also, it should look into
3606 \begin_inset Flex CharStyle:Code
3609 \begin_layout Plain Layout
3615 file for defaults, too (for example, a
3616 \begin_inset Flex CharStyle:Code
3619 \begin_layout Plain Layout
3627 option to include default keyboard).
3635 \begin_layout Section
3636 International Keymap Stuff
3637 \begin_inset CommandInset label
3639 name "sec:International-Keymap-Stuff"
3646 \begin_layout Standard
3647 \begin_inset Note Note
3650 \begin_layout Plain Layout
3651 In doing the revisions on this document in March 2008, I did not look over
3652 this stuff, as I do not understand it.
3653 It would be good if someone else could do so.
3662 \begin_layout Standard
3663 The next two sections describe the
3664 \begin_inset Flex CharStyle:Code
3667 \begin_layout Plain Layout
3676 \begin_inset Flex CharStyle:Code
3679 \begin_layout Plain Layout
3687 file syntax in detail.
3688 These sections should help you design your own key map if the ones provided
3689 do not meet your needs.
3692 \begin_layout Subsection
3696 \begin_layout Standard
3700 \begin_inset Flex CharStyle:Code
3703 \begin_layout Plain Layout
3709 file maps keystrokes to characters or strings.
3710 As the name suggests, it sets a keyboard mapping.
3712 \begin_inset Flex CharStyle:Code
3715 \begin_layout Plain Layout
3726 \begin_inset Flex CharStyle:Code
3729 \begin_layout Plain Layout
3744 \begin_inset Flex CharStyle:Code
3747 \begin_layout Plain Layout
3760 \begin_inset Flex CharStyle:Code
3763 \begin_layout Plain Layout
3772 \begin_inset Flex CharStyle:Code
3775 \begin_layout Plain Layout
3783 are described in this section.
3786 \begin_layout Labeling
3787 \labelwidthstring 00.00.0000
3788 \begin_inset Flex CharStyle:Code
3791 \begin_layout Plain Layout
3799 Map a character to a string
3802 \begin_layout LyX-Code
3817 \begin_layout Standard
3850 the double-quote (")
3867 must be escaped with a preceding backslash (
3878 \begin_layout Standard
3880 \begin_inset Flex CharStyle:MenuItem
3883 \begin_layout Plain Layout
3891 statement to cause the symbol
3892 \begin_inset Flex CharStyle:MenuItem
3895 \begin_layout Plain Layout
3903 to be output for the keystroke
3904 \begin_inset Flex CharStyle:MenuItem
3907 \begin_layout Plain Layout
3918 \begin_layout LyX-Code
3924 \begin_layout Labeling
3925 \labelwidthstring 00.00.0000
3926 \begin_inset Flex CharStyle:Code
3929 \begin_layout Plain Layout
3937 Specify an accent character
3940 \begin_layout LyX-Code
3949 \begin_layout Standard
3950 This will make the cha
3988 This is the dead key
3992 \begin_layout Plain Layout
3999 refers to a key that does not produce a character by itself, but when followed
4000 with another key, produces the desired accent character.
4001 For example, a German characte
4003 r with an umlaut like
4013 can be produced in this manner.
4022 \begin_layout Standard
4035 and then another key not in
4052 followed by the other, not allowed key, as output.
4056 \begin_inset Flex CharStyle:MenuItem
4059 \begin_layout Plain Layout
4067 cancels a dead key, so if
4078 \begin_inset Flex CharStyle:MenuItem
4081 \begin_layout Plain Layout
4090 , the cursor will not go one position backwards but will instead cancel
4106 might have had on the next keystroke.
4110 \begin_layout Standard
4111 The following example specifies that the character ' is to be an acute accent,
4112 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4115 \begin_layout LyX-Code
4118 kmod ' acute aeiouAEIOU
4121 \begin_layout Labeling
4122 \labelwidthstring 00.00.0000
4123 \begin_inset Flex CharStyle:Code
4126 \begin_layout Plain Layout
4132 Specify an exception to the accent character
4135 \begin_layout LyX-Code
4144 \begin_layout Standard
4145 This defines an exce
4186 have been assigned a keystroke with a previous
4189 \begin_inset Flex CharStyle:Code
4192 \begin_layout Plain Layout
4216 must not belong in the
4263 If such a declaration does not exist in
4271 \begin_inset Flex CharStyle:Code
4274 \begin_layout Plain Layout
4308 \begin_inset Flex CharStyle:Code
4311 \begin_layout Plain Layout
4325 \begin_layout Standard
4326 The following command produces causes äi to be produced when you enter acute-i
4330 \begin_layout LyX-Code
4344 \begin_layout Labeling
4345 \labelwidthstring 00.00.0000
4346 \begin_inset Flex CharStyle:Code
4349 \begin_layout Plain Layout
4355 Combine two accent characters
4358 \begin_layout LyX-Code
4364 accent1 accent2 allowed
4367 \begin_layout Standard
4368 This one is getting pretty esoteric.
4369 It allows you to combine the effect
4425 \begin_inset Flex CharStyle:Code
4428 \begin_layout Plain Layout
4456 \begin_layout Standard
4457 Consider this example from the
4458 \begin_inset Flex CharStyle:Code
4461 \begin_layout Plain Layout
4472 \begin_layout LyX-Code
4475 kmod ; acute aeioyvhAEIOYVH
4479 kcomb acute umlaut iyIY
4482 \begin_layout Standard
4483 This allows you to press
4484 \begin_inset Flex CharStyle:MenuItem
4487 \begin_layout Plain Layout
4495 and get the effect of
4496 \begin_inset Flex CharStyle:Code
4499 \begin_layout Plain Layout
4518 in this case cancels the last dead key, so if you press
4519 \begin_inset Flex CharStyle:MenuItem
4522 \begin_layout Plain Layout
4531 \begin_inset Flex CharStyle:Code
4534 \begin_layout Plain Layout
4547 \begin_layout Subsection
4551 \begin_layout Standard
4553 \begin_inset Flex CharStyle:Code
4556 \begin_layout Plain Layout
4564 mapping is performed, a
4565 \begin_inset Flex CharStyle:Code
4568 \begin_layout Plain Layout
4578 file maps the strings that the symbols generate to characters in the current
4580 The LyX distribution currently includes at least the
4581 \begin_inset Flex CharStyle:Code
4584 \begin_layout Plain Layout
4593 \begin_inset Flex CharStyle:Code
4596 \begin_layout Plain Layout
4607 \begin_layout Standard
4609 \begin_inset Flex CharStyle:Code
4612 \begin_layout Plain Layout
4620 file is a sequence of declarations of the form
4623 \begin_layout LyX-Code
4636 \begin_layout Standard
4637 For example, in order to map
4638 \begin_inset Flex CharStyle:MenuItem
4641 \begin_layout Plain Layout
4651 to the corresponding character in the iso-8859-1 set (233), the following
4655 \begin_layout LyX-Code
4663 \begin_layout Standard
4665 \begin_inset Flex CharStyle:Code
4668 \begin_layout Plain Layout
4677 \begin_inset Flex CharStyle:Code
4680 \begin_layout Plain Layout
4698 the same character can apply to more than one string.
4700 \begin_inset Flex CharStyle:Code
4703 \begin_layout Plain Layout
4714 \begin_layout LyX-Code
4726 \begin_inset Newline newline
4742 \begin_layout Standard
4743 If LyX cannot find a mapping for the string produced by the keystroke or
4744 a deadkey sequence, it will check if it looks like an accented char and
4745 try to draw an accent over the character on screen.
4748 \begin_layout Subsection
4752 \begin_layout Standard
4753 There is a second way to add support for international characters through
4754 so-called dead-keys.
4755 A dead-key works in combination with a letter to produce an accented character.
4756 Here, we'll explain how to create a really simple dead-key to illustrate
4760 \begin_layout Standard
4761 Suppose you happen to need the circumflex character,
4762 \begin_inset Quotes eld
4766 \begin_inset Quotes erd
4771 \begin_inset Flex CharStyle:MenuItem
4774 \begin_layout Plain Layout
4781 \begin_inset space ~
4785 \begin_inset Flex CharStyle:MenuItem
4788 \begin_layout Plain Layout
4794 ] to the LyX command
4795 \begin_inset Flex CharStyle:Code
4798 \begin_layout Plain Layout
4805 \begin_inset Flex CharStyle:Code
4808 \begin_layout Plain Layout
4815 Now, whenever you type the
4816 \begin_inset Flex CharStyle:MenuItem
4819 \begin_layout Plain Layout
4825 -key followed by a letter, that letter will have a circumflex accent on
4827 For example, the sequence
4828 \begin_inset Quotes eld
4832 \begin_inset Flex CharStyle:MenuItem
4835 \begin_layout Plain Layout
4842 \begin_inset Quotes erd
4845 produces the letter:
4846 \begin_inset Quotes eld
4850 \begin_inset Quotes erd
4854 If you tried to type
4855 \begin_inset Quotes eld
4859 \begin_inset Flex CharStyle:MenuItem
4862 \begin_layout Plain Layout
4869 \begin_inset Quotes erd
4872 , however, LyX will complain with a beep, since a
4873 \begin_inset Quotes eld
4877 \begin_inset Flex CharStyle:MenuItem
4880 \begin_layout Plain Layout
4887 \begin_inset Quotes erd
4890 never takes a circumflex accent.
4892 \begin_inset Flex CharStyle:MenuItem
4895 \begin_layout Plain Layout
4901 after a dead-key produces the bare-accent.
4902 Please note this last point! If you bind a key to a dead-key, you'll need
4903 to rebind the character on that key to yet another key.
4905 \begin_inset Flex CharStyle:MenuItem
4908 \begin_layout Plain Layout
4914 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
4917 \begin_layout Standard
4918 One common way to bind dead-keys is to use
4919 \begin_inset Flex CharStyle:MenuItem
4922 \begin_layout Plain Layout
4929 \begin_inset Flex CharStyle:MenuItem
4932 \begin_layout Plain Layout
4939 \begin_inset Flex CharStyle:MenuItem
4942 \begin_layout Plain Layout
4948 in combination with an accent, like
4949 \begin_inset Quotes eld
4953 \begin_inset Flex CharStyle:MenuItem
4956 \begin_layout Plain Layout
4963 \begin_inset Quotes erd
4967 \begin_inset Quotes eld
4971 \begin_inset Flex CharStyle:MenuItem
4974 \begin_layout Plain Layout
4981 \begin_inset Quotes erd
4985 \begin_inset Quotes eld
4989 \begin_inset Flex CharStyle:MenuItem
4992 \begin_layout Plain Layout
4999 \begin_inset Quotes erd
5003 Another way involves using
5004 \begin_inset Flex CharStyle:Code
5007 \begin_layout Plain Layout
5014 \begin_inset Flex CharStyle:Code
5017 \begin_layout Plain Layout
5023 to set up the special
5024 \begin_inset Flex CharStyle:Code
5027 \begin_layout Plain Layout
5035 \begin_inset Flex CharStyle:Code
5038 \begin_layout Plain Layout
5044 acts in some ways just like
5045 \begin_inset Flex CharStyle:MenuItem
5048 \begin_layout Plain Layout
5054 and permits you to bind keys to accented characters.
5055 You can also turn keys into dead-keys by binding them to something like
5057 \begin_inset Flex CharStyle:Code
5060 \begin_layout Plain Layout
5066 and then binding this symbolic key to the corresponding LyX command.
5070 \begin_layout Plain Layout
5075 : This is exactly what I do in my
5076 \begin_inset Flex CharStyle:Code
5079 \begin_layout Plain Layout
5086 \begin_inset Flex CharStyle:Code
5089 \begin_layout Plain Layout
5097 \begin_inset Flex CharStyle:MenuItem
5100 \begin_layout Plain Layout
5102 \begin_inset space ~
5111 \begin_inset Flex CharStyle:Code
5114 \begin_layout Plain Layout
5120 and a bunch of these
5121 \begin_inset Quotes eld
5125 \begin_inset Flex CharStyle:Code
5128 \begin_layout Plain Layout
5135 \begin_inset Quotes erd
5138 symbolic keys bound such things as
5139 \begin_inset Flex CharStyle:MenuItem
5142 \begin_layout Plain Layout
5144 \begin_inset space ~
5153 \begin_inset Flex CharStyle:MenuItem
5156 \begin_layout Plain Layout
5158 \begin_inset space ~
5167 This is how I produce my accented characters.
5172 You can make just about anything into the
5173 \begin_inset Flex CharStyle:Code
5176 \begin_layout Plain Layout
5183 \begin_inset Flex CharStyle:MenuItem
5186 \begin_layout Plain Layout
5192 keys, a spare function key, etc.
5193 As for the LyX commands that produce accents, check the entry for
5194 \begin_inset Flex CharStyle:Code
5197 \begin_layout Plain Layout
5208 You'll find the complete list there.
5211 \begin_layout Subsection
5212 Saving your Language Configuration
5215 \begin_layout Standard
5216 You can edit your preferences so that your desired language environment
5217 is automatically configured when LyX starts up, via the
5218 \begin_inset Flex CharStyle:MenuItem
5221 \begin_layout Plain Layout
5222 Edit\SpecialChar \menuseparator
5231 \begin_layout Chapter
5232 Installing New Document Classes, Layouts, and Templates
5233 \begin_inset CommandInset label
5235 name "cha:Installing-New-Document"
5243 \begin_layout Plain Layout
5244 Installing New Document Classes
5252 \begin_layout Standard
5253 In this chapter, we describe the procedures for creating and installing
5254 new LyX layout and template files, as well as offer a refresher on correctly
5255 installing new LaTeX document classes.
5259 \begin_layout Standard
5260 First, let us a say a few words about how one ought to think about the relation
5261 between LyX and LaTeX.
5262 The thing to understand is that, in a certain sense, LyX doesn't know anything
5264 Indeed, from LyX's point of view, LaTeX is just one of several
5265 \begin_inset Quotes eld
5269 \begin_inset Quotes erd
5272 in which it is capable of producing output.
5273 Other such formats are DocBook, plaintext, and XHTML.
5274 LaTeX is, of course, a particularly important format, but very little of
5275 the information LyX has about LaTeX is actually contained in the program
5280 \begin_layout Plain Layout
5281 Some commands are sufficiently complex that they are
5282 \begin_inset Quotes eld
5286 \begin_inset Quotes erd
5290 But the developers generally regard this as a Bad Thing.
5295 Rather, that information, even for the standard classes like
5296 \begin_inset Flex CharStyle:Code
5299 \begin_layout Plain Layout
5305 , is contained in layout files.
5308 \begin_layout Standard
5309 You can think of the layout file for a given document class as a translation
5310 manual between LyX constructs---paragraphs with their corresponding styles,
5311 certain sorts of insets, etc---and the corresponding LaTeX constructs.
5312 Almost everything LyX knows about
5313 \begin_inset Flex CharStyle:Code
5316 \begin_layout Plain Layout
5322 , for example, is contained in the file
5323 \begin_inset Flex CharStyle:Code
5326 \begin_layout Plain Layout
5333 For this reason, anyone intending to write layout files should plan to
5334 study the existing files.
5335 A good place to start is with
5336 \begin_inset Flex CharStyle:Code
5339 \begin_layout Plain Layout
5345 , which just gets `included' in
5346 \begin_inset Flex CharStyle:Code
5349 \begin_layout Plain Layout
5356 \begin_inset Flex CharStyle:Code
5359 \begin_layout Plain Layout
5365 , and many of the other layout files for document classes.
5366 This file is where sections and the like are defined:
5367 \begin_inset Flex CharStyle:Code
5370 \begin_layout Plain Layout
5376 tells LyX how paragraphs that are marked with the Section, Subsection,
5377 etc, styles can be translated into corresponding LaTeX commands.
5379 \begin_inset Flex CharStyle:Code
5382 \begin_layout Plain Layout
5388 file basically just includes several of these
5389 \begin_inset Flex CharStyle:Code
5392 \begin_layout Plain Layout
5401 \begin_layout Standard
5402 Defining the LyX--LaTeX correspondence is not, however, the only thing layout
5404 Their other job is to define how the LyX constructs themselves will appear
5406 The fact that layout files have these two jobs is often a source of confusion,
5407 because they are completely separate.
5408 Telling LyX how to translate a certain paragraph style into LaTeX does
5409 not tell LyX how to display it; conversely, telling LyX how to display
5410 a certain paragraph style does not tell LyX how to translate it into LaTeX,
5411 let alone tell LaTeX how to display it.
5412 So, in general, when you define a new LyX construct, you must always do
5413 two quite separate things: (i)
5414 \begin_inset space ~
5417 tell LyX how to translate it into LaTeX, and (ii)
5418 \begin_inset space ~
5421 tell LyX how to display it.
5424 \begin_layout Standard
5425 Much the same is true, of course, as regards LyX's other backend formats,
5426 though XHTML is in some ways different, because in that case LyX
5430 able, to some extent, anyway, to use information about how it should display
5431 a paragraph on the screen to output information (in the form of CSS) about
5432 how the paragrpah should be displayed in a browser.
5433 Even in this case, however, the distinction between what LyX does internally
5434 and how things are rendered externally remains in force, and the two can
5435 be controlled separately.
5438 \begin_layout Standard
5439 Some definitions: a document class is a LaTeX file (usually ending in
5440 \begin_inset Flex CharStyle:Code
5443 \begin_layout Plain Layout
5450 \begin_inset Flex CharStyle:Code
5453 \begin_layout Plain Layout
5459 ) that describes the format of a document such as an article, report, journal
5460 preprint, etc, and all the commands needed to realize that format.
5461 A layout file is a LyX file that corresponds to a LaTeX document class
5462 and that tells LyX how to
5463 \begin_inset Quotes eld
5467 \begin_inset Quotes erd
5470 things on the screen to make the display look something like the final
5472 More precisely, a layout file describes a
5473 \begin_inset Quotes eld
5477 \begin_inset Quotes erd
5480 which is the internal construct LyX uses to render the screen display.
5482 \begin_inset Quotes eld
5486 \begin_inset Quotes erd
5490 \begin_inset Quotes eld
5494 \begin_inset Quotes erd
5497 can be used somewhat interchangeably, but it is better to refer to the
5498 file as the layout, and the thing living in LyX's memory as the text class.
5499 A template file is simply a LyX document that contains a set of predefined
5500 entries for a given document class—entries that are generally required
5502 Templates are especially useful for things like journal manuscripts that
5503 are to be submitted electronically.
5506 \begin_layout Section
5507 Installing a new LaTeX package
5510 \begin_layout Standard
5511 Some installations may not include a LaTeX package that you would like to
5513 For example, you might need FoilTeX, a package for preparing slides for
5514 overhead projectors.
5515 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5516 a user interface for installing such packages.
5517 For example, with MiKTeX, you start the program
5518 \begin_inset Quotes eld
5522 \begin_inset Quotes erd
5525 to get a list of available packages.
5526 To install one, right click on it or use the toolbar button to install
5531 \begin_layout Standard
5532 If your LaTeX distribution doesn't provide such a user interface, or if
5533 the file is not available through the package browser, then you can follow
5537 \begin_layout Enumerate
5538 Get the package from
5539 \begin_inset CommandInset href
5542 target "http://www.ctan.org/"
5549 \begin_layout Enumerate
5550 You can install the package in several different places.
5551 If you want it to be available for all users on your system, then you should
5552 install it in your `local' TeX tree; if you want (or need) it to be available
5553 just for you, then you can install it in your own `user' TeX tree.
5554 Where these should be created, if they do not already exist, depends upon
5555 the details of your system.
5556 To find out where they are, look in the file
5557 \begin_inset Flex CharStyle:Code
5560 \begin_layout Plain Layout
5570 \begin_layout Plain Layout
5571 This usually lives in the directory
5572 \begin_inset Flex CharStyle:Code
5575 \begin_layout Plain Layout
5581 , though you can run
5582 \begin_inset Flex CharStyle:Code
5585 \begin_layout Plain Layout
5596 The location of the `local' TeX tree is defined by the
5597 \begin_inset Flex CharStyle:Code
5600 \begin_layout Plain Layout
5606 variable; this is usually somewhere like
5607 \begin_inset Flex CharStyle:Code
5610 \begin_layout Plain Layout
5611 /usr/local/share/texmf/
5617 The `user' TeX tree is defined by
5618 \begin_inset Flex CharStyle:Code
5621 \begin_layout Plain Layout
5628 \begin_inset Flex CharStyle:Code
5631 \begin_layout Plain Layout
5638 (If these variables are not predefined, you can define them.) You'll probably
5639 need root permissions to create or modify the `local' tree; but your `user'
5640 tree shouldn't have such limitations.
5643 \begin_layout Enumerate
5645 \begin_inset Flex CharStyle:Code
5648 \begin_layout Plain Layout
5655 \begin_inset Flex CharStyle:Code
5658 \begin_layout Plain Layout
5665 \begin_inset Flex CharStyle:Code
5668 \begin_layout Plain Layout
5675 \begin_inset space \thinspace{}
5679 \begin_inset Newline newline
5683 \begin_inset Flex CharStyle:Code
5686 \begin_layout Plain Layout
5687 TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
5693 \begin_inset Newline newline
5696 But, again, most of this will
5697 \begin_inset Quotes eld
5701 \begin_inset Quotes erd
5707 \begin_layout Enumerate
5708 Your local and user trees must have the same sort of directory structure
5709 as your main existing
5710 \begin_inset Flex CharStyle:Code
5713 \begin_layout Plain Layout
5719 directory, which will be found at
5720 \begin_inset Flex CharStyle:Code
5723 \begin_layout Plain Layout
5730 \begin_inset Flex CharStyle:Code
5733 \begin_layout Plain Layout
5739 .) For example, latex packages should go under
5740 \begin_inset Flex CharStyle:Code
5743 \begin_layout Plain Layout
5744 $TEXMFLOCAL/tex/latex/
5750 \begin_inset Flex CharStyle:Code
5753 \begin_layout Plain Layout
5754 $TEXMFHOME/tex/latex/
5762 \begin_layout Enumerate
5763 Once your tree is properly set up, you can install the package into an appropria
5765 For example, you might install the FoilTeX files into
5766 \begin_inset Flex CharStyle:Code
5769 \begin_layout Plain Layout
5770 $TEXMFLOCAL/tex/latex/foiltex
5777 \begin_inset Flex CharStyle:Code
5780 \begin_layout Plain Layout
5786 directory contains various files.
5789 \begin_layout Enumerate
5790 Finally, you must update the database TeX uses to find files.
5791 On MiKTeX, this is done by pressing the button
5794 \begin_inset space ~
5799 that you find in MiKTeX's
5800 \begin_inset Quotes eld
5804 \begin_inset Quotes erd
5809 \begin_inset Flex CharStyle:Code
5812 \begin_layout Plain Layout
5813 $TEXMFLOCAL/tex/latex/
5819 Under TeXLive and the like, you should run
5820 \begin_inset Flex CharStyle:Code
5823 \begin_layout Plain Layout
5829 from a terminal, with root permissions if necessary.
5833 \begin_layout Standard
5834 Your package is now installed and available to LaTeX.
5835 You can verify this from a terminal by typing `
5836 \begin_inset Flex CharStyle:Code
5839 \begin_layout Plain Layout
5840 kpsewhich yourfile.ext
5846 To make LyX aware of it, however, you will need to reconfigure (
5847 \begin_inset Flex CharStyle:MenuItem
5850 \begin_layout Plain Layout
5851 Tools\SpecialChar \menuseparator
5857 ) and then restart LyX.
5858 If the new package was a document class, such as FoilTeX again, you will
5860 \begin_inset Flex CharStyle:MenuItem
5863 \begin_layout Plain Layout
5870 \begin_inset Flex CharStyle:MenuItem
5873 \begin_layout Plain Layout
5874 Document\SpecialChar \menuseparator
5875 Settings\SpecialChar \menuseparator
5885 \begin_layout Standard
5886 Unless, of course, no layout file is available for your new document class.
5887 That is the topic of the next section.
5890 \begin_layout Section
5894 \begin_layout Standard
5895 This section describes how to write and install your own LyX layout files
5896 and walks through the
5897 \begin_inset Flex CharStyle:Code
5900 \begin_layout Plain Layout
5906 text class as an example.
5908 \begin_inset Flex CharStyle:Code
5911 \begin_layout Plain Layout
5917 files describe what paragraph and character styles are available for a
5918 given document class, how LyX should display them, and how they should
5919 be translated into LaTeX, DocBook, or whatever output format is being used.
5923 \begin_layout Standard
5924 We shall try to provide a thorough description of the process of writing
5926 However, there are so many different types of documents supported by LaTeX,
5927 DocBook, and so forth, that we can't hope to cover every different possibility
5928 or problem you might encounter.
5929 The LyX users' list is frequented by people with lots of experience with
5930 layout design who are willing to share what they've learned, so please
5931 feel free to ask questions there.
5934 \begin_layout Standard
5935 As you prepare to write a new layout, it is extremely helpful to look at
5936 the layouts distributed with LyX.
5937 If you use a nice LaTeX document class that might also be of interest for
5938 others and so write a corresponding LyX layout, you should consider posting
5940 \begin_inset CommandInset href
5942 name "section on the LyX wiki"
5943 target "http://wiki.lyx.org/Layouts/Layouts"
5947 or even to the LyX developers' list, so that it might be included in LyX
5952 \begin_layout Plain Layout
5953 Note that LyX is licensed under the General Public License, so any material
5954 that is contribued to LyX must be similarly licensed.
5962 \begin_layout Standard
5963 All the tags described here are case-insensitive; this means that
5964 \begin_inset Flex CharStyle:Code
5967 \begin_layout Plain Layout
5974 \begin_inset Flex CharStyle:Code
5977 \begin_layout Plain Layout
5984 \begin_inset Flex CharStyle:Code
5987 \begin_layout Plain Layout
5993 are really the same command.
5994 The possible values are printed in brackets after the feature's name.
5995 The default value if a feature isn't specified inside a text class-description
5997 \begin_inset Flex CharStyle:Code
6000 \begin_layout Plain Layout
6009 If the argument has a data type like
6010 \begin_inset Quotes eld
6014 \begin_inset Quotes erd
6018 \begin_inset Quotes eld
6022 \begin_inset Quotes erd
6025 , the default is shown like this:
6026 \begin_inset Flex CharStyle:Code
6029 \begin_layout Plain Layout
6040 \begin_layout Subsection
6042 \begin_inset CommandInset label
6044 name "sub:Layout-modules"
6051 \begin_layout Standard
6052 We have spoken to this point about `layout files'.
6053 But there are different sorts of files that contain layout information.
6054 Layout files, strictly so called, have the
6055 \begin_inset Flex CharStyle:Code
6058 \begin_layout Plain Layout
6064 extension and provide LyX with information about document classes.
6065 As of LyX 1.6, however, layout informtion can also be contained in layout
6071 \begin_inset Flex CharStyle:Code
6074 \begin_layout Plain Layout
6081 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
6082 some modules—such as the endnotes module—specifcally provide support for
6084 In a sense, layout modules are similar to included
6088 \begin_layout Plain Layout
6089 These can have any extension, but by convention have the
6090 \begin_inset Flex CharStyle:Code
6093 \begin_layout Plain Layout
6105 \begin_inset Flex CharStyle:Code
6108 \begin_layout Plain Layout
6114 —in that modules are not specific to a given document class but may be used
6115 with many different classes.
6116 The difference is that using an included file with
6117 \begin_inset Flex CharStyle:Code
6120 \begin_layout Plain Layout
6126 , say, requires editing that file.
6127 Modules, by contrast, are selected in the
6128 \begin_inset Flex CharStyle:MenuItem
6131 \begin_layout Plain Layout
6132 Document\SpecialChar \menuseparator
6141 \begin_layout Standard
6142 Building modules is the easiest way to get started with layout editing,
6143 since it can be as simple as adding a single new paragraph style or flex
6145 But modules may, in principle, contain anything a layout file can contain.
6148 \begin_layout Standard
6149 A module must begin with a line like the following:
6152 \begin_layout LyX-Code
6155 DeclareLyXModule[endnotes.sty]{Endnotes}
6158 \begin_layout Standard
6159 The mandatory argument, in curly brackets, is the name of the module, as
6161 \begin_inset Flex CharStyle:MenuItem
6164 \begin_layout Plain Layout
6165 Document\SpecialChar \menuseparator
6172 The argument in square brackets is optional: It declares any LaTeX packages
6173 on which the module depends.
6174 Please note that only packages about which LyX knows should be listed in
6175 the square brackets.
6179 \begin_layout Plain Layout
6180 The list of such packages is documented only in the source code.
6185 LyX will not check for arbitrary packages.
6186 It is also possible to use the form
6187 \begin_inset Flex CharStyle:MenuItem
6190 \begin_layout Plain Layout
6196 , which declares that the module can only be used when there exists a conversion
6197 chain between the formats `
6198 \begin_inset Flex CharStyle:Code
6201 \begin_layout Plain Layout
6208 \begin_inset Flex CharStyle:Code
6211 \begin_layout Plain Layout
6220 \begin_layout Standard
6221 The module declaration should then be followed by lines like the following:
6224 \begin_layout LyX-Code
6228 \begin_layout LyX-Code
6229 #Adds an endnote command, in addition to footnotes.
6233 \begin_layout LyX-Code
6234 #You will need to add
6236 theendnotes in TeX code where you
6239 \begin_layout LyX-Code
6240 #want the endnotes to appear.
6244 \begin_layout LyX-Code
6248 \begin_layout LyX-Code
6249 #Requires: somemodule | othermodule
6252 \begin_layout LyX-Code
6253 #Excludes: badmodule
6256 \begin_layout Standard
6257 The description is used in
6258 \begin_inset Flex CharStyle:MenuItem
6261 \begin_layout Plain Layout
6262 Document\SpecialChar \menuseparator
6268 to provide the user with information about what the module does.
6270 \begin_inset Flex CharStyle:Code
6273 \begin_layout Plain Layout
6279 line is used to identify other modules with which this one must be used;
6281 \begin_inset Flex CharStyle:Code
6284 \begin_layout Plain Layout
6290 line is used to identify modules with which this one may not be used.
6291 Both are optional, and, as shown, multiple modules should be separated
6292 with the pipe symbol: |.
6293 Note that the required modules are treated disjunctively:
6297 of the required modules must be used.
6302 excluded module may be used.
6303 Note that modules are identified here by their
6308 \begin_inset Flex CharStyle:Code
6311 \begin_layout Plain Layout
6319 \begin_inset Flex CharStyle:Code
6322 \begin_layout Plain Layout
6329 \begin_inset Flex CharStyle:Code
6332 \begin_layout Plain Layout
6341 \begin_layout Standard
6342 After creating a new module, you will need to reconfigure and then restart
6343 LyX for the module to appear in the menu.
6344 However, changes you make to the module will be seen immediately, if you
6346 \begin_inset Flex CharStyle:MenuItem
6349 \begin_layout Plain Layout
6350 Document\SpecialChar \menuseparator
6356 , highlight something, and then hit
6357 \begin_inset Quotes eld
6361 \begin_inset Quotes erd
6367 It is strongly recommended that you save your work before doing so
6372 it is strongly recommended that you not attempt to edit modules while simultaneo
6373 usly working on actual documents
6376 Though of course the developers strive to keep LyX stable in such situations,
6377 syntax errors and the like in your module file could cause strange behavior.
6380 \begin_layout Subsection
6381 Supporting new document classes
6384 \begin_layout Standard
6385 There are two situations you are likely to encounter when wanting to support
6386 a new LaTeX document class, involving LaTeX2e class (
6387 \begin_inset Flex CharStyle:Code
6390 \begin_layout Plain Layout
6397 \begin_inset Flex CharStyle:Code
6400 \begin_layout Plain Layout
6407 Supporting a style file is usually fairly easy.
6408 Supporting a new document class is a bit harder.
6411 \begin_layout Subsection
6413 \begin_inset Flex CharStyle:MenuItem
6416 \begin_layout Plain Layout
6425 \begin_layout Standard
6426 The easier case is the one in which your new document class is provided
6427 as a style file that is to be used in conjunction with an already supported
6429 Gor the sake of the example, we'll assume that the style file is called
6431 \begin_inset Flex CharStyle:MenuItem
6434 \begin_layout Plain Layout
6440 and it is meant to be used with
6441 \begin_inset Flex CharStyle:MenuItem
6444 \begin_layout Plain Layout
6450 , which is a standard class.
6454 \begin_layout Standard
6455 Start by copying the existing class's layout file into your local directory:
6458 \begin_layout LyX-Code
6459 cp report.layout ~/.lyx/layouts/myclass.layout
6462 \begin_layout Standard
6464 \begin_inset Flex CharStyle:Code
6467 \begin_layout Plain Layout
6473 and change the line:
6476 \begin_layout LyX-Code
6479 DeclareLaTeXClass{report}
6482 \begin_layout Standard
6486 \begin_layout LyX-Code
6489 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6492 \begin_layout Standard
6496 \begin_layout LyX-Code
6498 \begin_inset Newline newline
6504 \begin_inset Newline newline
6510 \begin_layout Standard
6511 near the top of the file.
6514 \begin_layout Standard
6515 Start LyX and select
6516 \begin_inset Flex CharStyle:MenuItem
6519 \begin_layout Plain Layout
6520 Tools\SpecialChar \menuseparator
6527 Then restart LyX and try creating a new document.
6529 \begin_inset Flex CharStyle:MenuItem
6532 \begin_layout Plain Layout
6538 " as a document class option in the
6539 \begin_inset Flex CharStyle:MenuItem
6542 \begin_layout Plain Layout
6543 Document\SpecialChar \menuseparator
6550 It is likely that some of the sectioning commands and such in your new
6551 class will work differently from how they worked in the base class—
6552 \begin_inset Flex CharStyle:Code
6555 \begin_layout Plain Layout
6561 in this example—so you can fiddle around with the settings for the different
6562 sections if you wish.
6563 Your new package may also provide commands or environments not present
6565 In this case, you will want to add these to the layout file.
6567 \begin_inset CommandInset ref
6569 reference "sec:TextClass"
6573 for information on how to do so.
6576 \begin_layout Standard
6578 \begin_inset Flex CharStyle:MenuItem
6581 \begin_layout Plain Layout
6587 can be used with several different document classes, and even if it cannot,
6588 you might find it easiest just to user a module that you can load with
6590 The simplest possible such module would be:
6593 \begin_layout LyX-Code
6596 DeclareLyXModule{My Class}
6599 \begin_layout LyX-Code
6603 \begin_layout LyX-Code
6604 #Support for myclass.sty.
6607 \begin_layout LyX-Code
6609 \begin_inset Newline newline
6615 \begin_layout LyX-Code
6617 \begin_inset Newline newline
6623 \begin_layout LyX-Code
6625 \begin_inset Newline newline
6631 \begin_inset Newline newline
6637 \begin_layout Standard
6638 A more complex module might modify the behavior of some existing constructs
6639 or define some new ones.
6641 \begin_inset CommandInset ref
6643 reference "sec:TextClass"
6650 \begin_layout Subsection
6652 \begin_inset Flex CharStyle:MenuItem
6655 \begin_layout Plain Layout
6664 \begin_layout Standard
6665 There are two possibilities here.
6666 One is that the class file is itself based upon an existing document class.
6667 For example, many thesis classes are based upon
6668 \begin_inset Flex CharStyle:MenuItem
6671 \begin_layout Plain Layout
6678 To see whether yours is, look for a line like
6681 \begin_layout LyX-Code
6687 \begin_layout Standard
6689 If so, then you may proceed largely as in the previous section, though
6691 \begin_inset Flex CharStyle:Code
6694 \begin_layout Plain Layout
6700 line will be different.
6701 If your new class is
6702 \begin_inset Flex CharStyle:Code
6705 \begin_layout Plain Layout
6711 , and it is based upon
6712 \begin_inset Flex CharStyle:Code
6715 \begin_layout Plain Layout
6721 , then the line should read:
6725 \begin_layout Plain Layout
6726 And it will be easiest if you save the file to
6727 \begin_inset Flex CharStyle:Code
6730 \begin_layout Plain Layout
6736 : LyX assumes that the document class has the same name as the layout file.
6745 \begin_layout LyX-Code
6748 DeclareLaTeXClass[thesis,book]{thesis}
6751 \begin_layout Standard
6752 If, on the other hand, the new class is not based upon an existing class,
6753 you will probably have to
6754 \begin_inset Quotes eld
6758 \begin_inset Quotes erd
6762 We strongly suggest copying an existing layout file which uses a similar
6763 LaTeX class and then modifying it, if you can do so.
6764 At least use an existing file as a starting point so you can find out what
6765 items you need to worry about.
6766 Again, the specifics are covered below.
6769 \begin_layout Section
6770 \begin_inset CommandInset label
6772 name "sec:TextClass"
6776 Declaring a new text class
6779 \begin_layout Standard
6780 When it's finally time to get your hands dirty and create or edit your own
6781 layout file, the following sections describe what you're up against.
6782 Our advice is to go slowly, save and test often, listen to soothing music,
6783 and enjoy one or two of your favorite adult beverages; more if you are
6784 getting particularly stuck.
6785 It's really not that hard, except that the multitude of options can become
6786 overwhelming if you try to do too much in one sitting.
6787 Go have another adult beverage, just for good measure.
6790 \begin_layout Standard
6794 \begin_layout Standard
6795 Lines in a layout file which begin with
6796 \begin_inset Flex CharStyle:Code
6799 \begin_layout Plain Layout
6806 There is one exception to this rule.
6808 \begin_inset Flex CharStyle:Code
6811 \begin_layout Plain Layout
6817 files should begin with a line like:
6820 \begin_layout LyX-Code
6823 #% Do not delete the line below; configure depends on this
6826 \begin_layout LyX-Code
6831 DeclareLaTeXClass{article}
6834 \begin_layout Standard
6835 The second line is used when you configure LyX.
6836 The layout file is read by the LaTeX script
6837 \begin_inset Flex CharStyle:Code
6840 \begin_layout Plain Layout
6846 , in a special mode where
6847 \begin_inset Flex CharStyle:Code
6850 \begin_layout Plain Layout
6857 The first line is just a LaTeX comment, and the second one contains the
6858 declaration of the text class.
6859 If these lines appear in a file named
6860 \begin_inset Flex CharStyle:Code
6863 \begin_layout Plain Layout
6869 , then they define a text class of name
6870 \begin_inset Flex CharStyle:Code
6873 \begin_layout Plain Layout
6879 (the name of the layout file) which uses the LaTeX document class
6880 \begin_inset Flex CharStyle:Code
6883 \begin_layout Plain Layout
6889 (the default is to use the same name as the layout).
6891 \begin_inset Quotes eld
6895 \begin_inset Quotes erd
6898 that appears above is used as a description of the text class in the
6899 \begin_inset Flex CharStyle:MenuItem
6902 \begin_layout Plain Layout
6903 Document\SpecialChar \menuseparator
6912 \begin_layout Standard
6913 Let's assume that you wrote your own text class that uses the
6914 \begin_inset Flex CharStyle:Code
6917 \begin_layout Plain Layout
6923 document class, but where you changed the appearance of the section headings.
6924 If you put it in a file
6925 \begin_inset Flex CharStyle:Code
6928 \begin_layout Plain Layout
6934 , the header of this file should be:
6937 \begin_layout LyX-Code
6940 #% Do not delete the line below; configure depends on this
6943 \begin_layout LyX-Code
6948 DeclareLaTeXClass[article]{article (with my own headings)}
6951 \begin_layout Standard
6952 This declares a text class
6953 \begin_inset Flex CharStyle:Code
6956 \begin_layout Plain Layout
6962 , associated with the LaTeX document class
6963 \begin_inset Flex CharStyle:Code
6966 \begin_layout Plain Layout
6973 \begin_inset Quotes eld
6976 article (with my own headings)
6977 \begin_inset Quotes erd
6981 If your text class depends on several packages, you can declare it as:
6984 \begin_layout LyX-Code
6987 #% Do not delete the line below; configure depends on this
6990 \begin_layout LyX-Code
6995 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
6998 \begin_layout Standard
6999 This indicates that your text class uses the
7000 \begin_inset Flex CharStyle:Code
7003 \begin_layout Plain Layout
7010 Finally, it is also possible to declare classes for DocBook code.
7011 Typical declarations will look like:
7014 \begin_layout LyX-Code
7017 #% Do not delete the line below; configure depends on this
7020 \begin_layout LyX-Code
7025 DeclareDocBookClass[article]{SGML (DocBook article)}
7028 \begin_layout Standard
7029 Note that these declarations can also be given an optional parameter declaring
7030 the name of the document class (but not a list).
7033 \begin_layout Standard
7034 So, to be as explicit as possible, the form of the layout declaration is:
7037 \begin_layout LyX-Code
7042 DeclareLaTeXClass[class,package.sty]{layout description}
7045 \begin_layout Standard
7046 The class need only be specified if the name of the LaTeX class file and
7047 the name of the layout file are different; if the name of the class file
7048 is not specified, then LyX will simply assume that it is the same as the
7049 name of the layout file.
7052 \begin_layout Standard
7053 When the text class has been modified to your taste, all you have to do
7054 is to copy it either to
7055 \begin_inset Flex CharStyle:Code
7058 \begin_layout Plain Layout
7065 \begin_inset Flex CharStyle:Code
7068 \begin_layout Plain Layout
7075 \begin_inset Flex CharStyle:MenuItem
7078 \begin_layout Plain Layout
7079 Tools\SpecialChar \menuseparator
7085 , exit LyX and restart.
7086 Then your new text class should be available along with the others.
7089 \begin_layout Standard
7090 Once the layout file is installed, you can edit it and see your changes
7091 without having to reconfigure or to restart LyX.
7092 In versions of LyX prior to 1.6, this was not true.
7093 As a result, editing layout files was very time consuming.
7094 Beginning with 1.6, however, you can force a reload of the layout currently
7095 in use by using the LyX function
7096 \begin_inset Flex CharStyle:MenuItem
7099 \begin_layout Plain Layout
7106 There is no default binding for this function—though, of course, you can
7107 bind it to a key yourself.
7108 But you use this function simply by entering it in the mini-buffer.
7112 \begin_layout Standard
7117 : This is very much an `advanced feature'.
7122 recommended that you save your work before using this function.
7127 recommended that you not attempt to edit layout information while simultaneousl
7128 y working on a document that you care about.
7129 Use a test document.
7130 Syntax errors and the like in your layout file could cause peculiar behavior.
7131 In particular, such errors could cause LyX to regard the current layout
7132 as invalid and to attempt to switch to some other layout.
7133 The LyX team strives to keep LyX stable in such situations, but safe is
7138 \begin_layout Plain Layout
7139 And while we're giving advice, make regular backups.
7140 And be nice to your mother.
7148 \begin_layout Subsection
7152 \begin_layout Standard
7153 The first non-comment line of any layout file, included file, or module
7158 contain the file format number:
7161 \begin_layout Description
7162 \begin_inset Flex CharStyle:Code
7165 \begin_layout Plain Layout
7172 \begin_inset Flex CharStyle:Code
7175 \begin_layout Plain Layout
7181 ] The format of the layout file.
7184 \begin_layout Standard
7185 This tag was introduced with LyX 1.4.0.
7186 Layout files from LyX 1.3.x and earlier don't have an explicit file format
7187 and are considered to be of format 1.
7188 The format for the present version of LyX is format NNN.
7189 \begin_inset Note Note
7192 \begin_layout Plain Layout
7198 But LyX is capable of reading earlier formats, too, just as it is capable
7199 of reading files produced by earlier versions of LyX.
7202 \begin_layout Subsection
7203 General text class parameters
7206 \begin_layout Standard
7207 These are the general parameters which describe the form of the entire document:
7210 \begin_layout Description
7211 \begin_inset Flex CharStyle:Code
7214 \begin_layout Plain Layout
7220 Adds information to the document preamble.
7222 \begin_inset Quotes eld
7226 \begin_inset Flex CharStyle:Code
7229 \begin_layout Plain Layout
7236 \begin_inset Quotes erd
7242 \begin_layout Description
7243 \begin_inset Flex CharStyle:Code
7246 \begin_layout Plain Layout
7252 Describes various global options supported by the document class.
7254 \begin_inset space ~
7258 \begin_inset CommandInset ref
7260 reference "sub:ClassOptions"
7266 \begin_inset Quotes eld
7270 \begin_inset Flex CharStyle:Code
7273 \begin_layout Plain Layout
7280 \begin_inset Quotes erd
7286 \begin_layout Description
7287 \begin_inset Flex CharStyle:Code
7290 \begin_layout Plain Layout
7297 \begin_inset Flex CharStyle:Code
7300 \begin_layout Plain Layout
7309 \begin_inset Flex CharStyle:Code
7312 \begin_layout Plain Layout
7318 ] Whether the class should
7322 to having one or two columns.
7323 Can be changed in the
7324 \begin_inset Flex CharStyle:MenuItem
7327 \begin_layout Plain Layout
7328 Document\SpecialChar \menuseparator
7337 \begin_layout Description
7338 \begin_inset Flex CharStyle:Code
7341 \begin_layout Plain Layout
7348 \begin_inset Flex CharStyle:Code
7351 \begin_layout Plain Layout
7357 ] This sequence defines the properties for a counter.
7358 If the counter does not yet exist, it is created; if it does exist, it
7361 \begin_inset Quotes eld
7365 \begin_inset Flex CharStyle:Code
7368 \begin_layout Plain Layout
7375 \begin_inset Quotes erd
7379 \begin_inset Newline newline
7383 \begin_inset space ~
7387 \begin_inset CommandInset ref
7389 reference "sub:Counters"
7393 for details on counters.
7396 \begin_layout Description
7397 \begin_inset Flex CharStyle:Code
7400 \begin_layout Plain Layout
7406 Sets the default font used to display the document.
7408 \begin_inset space ~
7412 \begin_inset CommandInset ref
7414 reference "sub:Font-description"
7418 for how to declare fonts.
7420 \begin_inset Quotes eld
7424 \begin_inset Flex CharStyle:Code
7427 \begin_layout Plain Layout
7434 \begin_inset Quotes erd
7440 \begin_layout Description
7441 \begin_inset Flex CharStyle:Code
7444 \begin_layout Plain Layout
7451 \begin_inset Flex CharStyle:Code
7454 \begin_layout Plain Layout
7460 Specifies a module to be included by default with this document class.
7461 The module should be specified by filename without the
7462 \begin_inset Flex CharStyle:Code
7465 \begin_layout Plain Layout
7472 The user can still remove the module, but it will be active at the outset.
7473 (This applies only when new files are created, or when this class is chosen
7474 for an existing document.)
7477 \begin_layout Description
7478 \begin_inset Flex CharStyle:Code
7481 \begin_layout Plain Layout
7488 \begin_inset Flex CharStyle:Code
7491 \begin_layout Plain Layout
7497 ] This is the style that will be assigned to new paragraphs, usually
7498 \begin_inset Flex CharStyle:MenuItem
7501 \begin_layout Plain Layout
7508 This will default to the first defined style if not given, but you are
7509 encouraged to use this directive.
7512 \begin_layout Description
7513 \begin_inset Flex CharStyle:Code
7516 \begin_layout Plain Layout
7523 \begin_inset Flex CharStyle:Code
7526 \begin_layout Plain Layout
7532 ] This tag indicates that the module in question—which should be specified
7533 by filename without the
7534 \begin_inset Flex CharStyle:Code
7537 \begin_layout Plain Layout
7543 extension—cannot be used with this document class.
7544 This might be used in a journal-specific layout file to prevent, say, the
7546 \begin_inset Flex CharStyle:Code
7549 \begin_layout Plain Layout
7555 module that numbers theorems by section.
7560 be used in a module.
7561 Modules have their own way of excluding other modules (see
7562 \begin_inset CommandInset ref
7564 reference "sub:Layout-modules"
7571 \begin_layout Description
7572 \begin_inset Flex CharStyle:Code
7575 \begin_layout Plain Layout
7581 Defines a new float.
7583 \begin_inset space ~
7587 \begin_inset CommandInset ref
7589 reference "sub:Floats"
7595 \begin_inset Quotes eld
7599 \begin_inset Flex CharStyle:Code
7602 \begin_layout Plain Layout
7609 \begin_inset Quotes erd
7615 \begin_layout Description
7616 \begin_inset Flex CharStyle:Code
7619 \begin_layout Plain Layout
7626 \begin_inset Flex CharStyle:Code
7629 \begin_layout Plain Layout
7635 ] Modifies the properties of the given counter.
7636 If the counter does not exist, the section is ignored.
7638 \begin_inset Quotes eld
7642 \begin_inset Flex CharStyle:Code
7645 \begin_layout Plain Layout
7652 \begin_inset Quotes erd
7656 \begin_inset Newline newline
7660 \begin_inset space ~
7664 \begin_inset CommandInset ref
7666 reference "sub:Counters"
7670 for details on counters.
7673 \begin_layout Description
7674 \begin_inset Flex CharStyle:Code
7677 \begin_layout Plain Layout
7684 \begin_inset Flex CharStyle:Code
7687 \begin_layout Plain Layout
7693 ] Modifies the properties of the given paragraph style.
7694 If the style does not exist, the section is ignored.
7696 \begin_inset Quotes eld
7700 \begin_inset Flex CharStyle:Code
7703 \begin_layout Plain Layout
7710 \begin_inset Quotes erd
7716 \begin_layout Description
7717 \begin_inset Flex CharStyle:Code
7720 \begin_layout Plain Layout
7726 As its name implies, this command allows you to include another layout
7727 definition file within yours to avoid duplicating commands.
7728 Common examples are the standard layout files, for example,
7729 \begin_inset Flex CharStyle:Code
7732 \begin_layout Plain Layout
7738 , which contains most of the basic layouts.
7741 \begin_layout Description
7742 \begin_inset Flex CharStyle:Code
7745 \begin_layout Plain Layout
7751 This section (re-)defines the layout of an inset.
7752 It can be applied to an existing inset or to a new, user-defined inset,
7753 e.g., a new character style.
7755 \begin_inset Quotes eld
7759 \begin_inset Flex CharStyle:Code
7762 \begin_layout Plain Layout
7769 \begin_inset Quotes erd
7773 \begin_inset Newline newline
7777 \begin_inset space ~
7781 \begin_inset CommandInset ref
7783 reference "sub:Flex-insets-and"
7787 for more information.
7791 \begin_layout Description
7792 \begin_inset Flex CharStyle:Code
7795 \begin_layout Plain Layout
7802 \begin_inset Flex CharStyle:Code
7805 \begin_layout Plain Layout
7811 ] A string that indicates the width of the left margin on the screen, for
7813 \begin_inset Quotes eld
7817 \begin_inset Quotes erd
7821 (Note that this is not a `length', like
7822 \begin_inset Quotes eld
7826 \begin_inset Quotes erd
7832 \begin_layout Description
7833 \begin_inset Flex CharStyle:Code
7836 \begin_layout Plain Layout
7842 This command deletes an existing float.
7843 This is particularly useful when you want to suppress a float that has
7844 been defined in an input file.
7847 \begin_layout Description
7848 \begin_inset Flex CharStyle:Code
7851 \begin_layout Plain Layout
7857 This command deletes an existing style.
7858 This is particularly useful when you want to suppress a style that has
7859 be defined in an input file.
7862 \begin_layout Description
7863 \begin_inset Flex CharStyle:Code
7866 \begin_layout Plain Layout
7872 A string indicating the file format (as defined in the Preferences dialog)
7873 produced by this class.
7874 It is mainly useful when
7875 \begin_inset Flex CharStyle:Code
7878 \begin_layout Plain Layout
7884 is `literate' and one wants to define a new type of literate document.
7885 This string is reset to `docbook', `latex', or `literate' when the correspondin
7887 \begin_inset Flex CharStyle:Code
7890 \begin_layout Plain Layout
7896 parameter is encountered.
7899 \begin_layout Description
7900 \begin_inset Flex CharStyle:Code
7903 \begin_layout Plain Layout
7909 A string indicating what sort of output documents using this class will
7911 At present, the options are: `docbook', `latex', and `literate'.
7914 \begin_layout Description
7915 \begin_inset Flex CharStyle:Code
7918 \begin_layout Plain Layout
7929 \begin_inset Flex CharStyle:Code
7932 \begin_layout Plain Layout
7943 \begin_inset Flex CharStyle:Code
7946 \begin_layout Plain Layout
7953 \begin_inset Flex CharStyle:Code
7956 \begin_layout Plain Layout
7962 ] The default pagestyle.
7963 Can be changed in the
7964 \begin_inset Flex CharStyle:MenuItem
7967 \begin_layout Plain Layout
7968 Document\SpecialChar \menuseparator
7977 \begin_layout Description
7978 \begin_inset Flex CharStyle:Code
7981 \begin_layout Plain Layout
7987 Sets the preamble for the LaTeX document.
7988 Note that this will completely override any prior
7989 \begin_inset Flex CharStyle:Code
7992 \begin_layout Plain Layout
7999 \begin_inset Flex CharStyle:Code
8002 \begin_layout Plain Layout
8010 \begin_inset Flex CharStyle:Code
8013 \begin_layout Plain Layout
8019 if you just want to add material to the preamble.) Must end with
8020 \begin_inset Quotes eld
8024 \begin_inset Flex CharStyle:Code
8027 \begin_layout Plain Layout
8034 \begin_inset Quotes erd
8040 \begin_layout Description
8041 \begin_inset Flex CharStyle:Code
8044 \begin_layout Plain Layout
8051 \begin_inset Flex CharStyle:Code
8054 \begin_layout Plain Layout
8061 \begin_inset Flex CharStyle:Code
8064 \begin_layout Plain Layout
8073 \begin_inset Flex CharStyle:Code
8076 \begin_layout Plain Layout
8082 ] Whether the class already provides the feature
8083 \begin_inset Flex CharStyle:Code
8086 \begin_layout Plain Layout
8093 A feature is in general the name of a package (
8094 \begin_inset Flex CharStyle:Code
8097 \begin_layout Plain Layout
8104 \begin_inset Flex CharStyle:Code
8107 \begin_layout Plain Layout
8113 , \SpecialChar \ldots{}
8115 \begin_inset Flex CharStyle:Code
8118 \begin_layout Plain Layout
8125 \begin_inset Flex CharStyle:Code
8128 \begin_layout Plain Layout
8134 ,\SpecialChar \ldots{}
8135 ); the complete list of supported features is unfortunately not documented
8136 outside the LyX source code—but see
8137 \begin_inset Flex CharStyle:Code
8140 \begin_layout Plain Layout
8146 if you're interested.
8148 \begin_inset Flex CharStyle:MenuItem
8151 \begin_layout Plain Layout
8152 Help\SpecialChar \menuseparator
8158 also gives an overview of the supported packages.
8161 \begin_layout Description
8162 \begin_inset Flex CharStyle:Code
8165 \begin_layout Plain Layout
8172 \begin_inset Flex CharStyle:Code
8175 \begin_layout Plain Layout
8181 ] Indicates that this layout provides the functionality of the module mentioned,
8182 which should be specified by the filename without the
8183 \begin_inset Flex CharStyle:Code
8186 \begin_layout Plain Layout
8193 This will typically be used if the layout includes the module directly,
8194 rather than using the
8195 \begin_inset Flex CharStyle:Code
8198 \begin_layout Plain Layout
8204 tag to indicate that it ought to be used.
8205 It could also be used in a module that provided an alternate implementation
8206 of the same functionality.
8209 \begin_layout Description
8210 \begin_inset Flex CharStyle:Code
8213 \begin_layout Plain Layout
8220 \begin_inset Flex CharStyle:Code
8223 \begin_layout Plain Layout
8229 ] Whether the class requires the feature
8230 \begin_inset Flex CharStyle:Code
8233 \begin_layout Plain Layout
8240 Multiple features must be separated by commas.
8241 Note that you can only request supported features.
8243 \begin_inset Flex CharStyle:Code
8246 \begin_layout Plain Layout
8252 for a list of these.)
8255 \begin_layout Description
8256 \begin_inset Flex CharStyle:Code
8259 \begin_layout Plain Layout
8265 A string that indicates the width of the right margin on the screen, for
8267 \begin_inset Quotes eld
8271 \begin_inset Quotes erd
8277 \begin_layout Description
8278 \begin_inset Flex CharStyle:Code
8281 \begin_layout Plain Layout
8287 Sets which divisions get numbered.
8289 \begin_inset Flex CharStyle:Code
8292 \begin_layout Plain Layout
8301 \begin_layout Description
8302 \begin_inset Flex CharStyle:Code
8305 \begin_layout Plain Layout
8314 \begin_inset Flex CharStyle:Code
8317 \begin_layout Plain Layout
8328 \begin_inset Flex CharStyle:Code
8331 \begin_layout Plain Layout
8337 ] Whether the class-default should be printing on one or both sides of the
8339 Can be changed in the
8340 \begin_inset Flex CharStyle:MenuItem
8343 \begin_layout Plain Layout
8344 Document\SpecialChar \menuseparator
8353 \begin_layout Description
8354 \begin_inset Flex CharStyle:Code
8357 \begin_layout Plain Layout
8363 This sequence defines a paragraph style.
8364 If the style does not yet exist, it is created; if it does exist, its parameter
8367 \begin_inset Quotes eld
8371 \begin_inset Flex CharStyle:Code
8374 \begin_layout Plain Layout
8381 \begin_inset Quotes erd
8385 \begin_inset Newline newline
8389 \begin_inset space ~
8393 \begin_inset CommandInset ref
8395 reference "sub:Paragraph-Styles"
8399 for details on paragraph styles.
8402 \begin_layout Description
8403 \begin_inset Flex CharStyle:Code
8406 \begin_layout Plain Layout
8413 \begin_inset Flex CharStyle:Code
8416 \begin_layout Plain Layout
8422 ] The name of the command or environment to be used with
8423 \begin_inset Flex CharStyle:Code
8426 \begin_layout Plain Layout
8435 \begin_layout Description
8436 \begin_inset Flex CharStyle:Code
8439 \begin_layout Plain Layout
8446 \begin_inset Flex CharStyle:Code
8449 \begin_layout Plain Layout
8458 \begin_inset Flex CharStyle:Code
8461 \begin_layout Plain Layout
8467 ] Indicates what kind of markup is used to define the title of a document.
8469 \begin_inset Flex CharStyle:Code
8472 \begin_layout Plain Layout
8478 means that the macro with name
8479 \begin_inset Flex CharStyle:Code
8482 \begin_layout Plain Layout
8488 will be inserted after the last layout which has
8489 \begin_inset Quotes eld
8493 \begin_inset Flex CharStyle:Code
8496 \begin_layout Plain Layout
8503 \begin_inset Quotes erd
8508 \begin_inset Flex CharStyle:Code
8511 \begin_layout Plain Layout
8517 corresponds to the case where the block of paragraphs which have
8518 \begin_inset Quotes eld
8522 \begin_inset Flex CharStyle:Code
8525 \begin_layout Plain Layout
8532 \begin_inset Quotes erd
8535 should be enclosed into the
8536 \begin_inset Flex CharStyle:Code
8539 \begin_layout Plain Layout
8548 \begin_layout Description
8549 \begin_inset Flex CharStyle:Code
8552 \begin_layout Plain Layout
8558 Sets which divisions are included in the table of contents.
8560 \begin_inset Flex CharStyle:Code
8563 \begin_layout Plain Layout
8572 \begin_layout Subsection
8573 \begin_inset Flex CharStyle:Code
8576 \begin_layout Plain Layout
8583 \begin_inset CommandInset label
8585 name "sub:ClassOptions"
8592 \begin_layout Standard
8594 \begin_inset Flex CharStyle:Code
8597 \begin_layout Plain Layout
8603 section can contain the following entries:
8606 \begin_layout Description
8607 \begin_inset Flex CharStyle:Code
8610 \begin_layout Plain Layout
8617 \begin_inset Flex CharStyle:Code
8620 \begin_layout Plain Layout
8626 ] The list of available font sizes for the document's main font, separated
8628 \begin_inset Quotes eld
8632 \begin_inset Flex CharStyle:Code
8635 \begin_layout Plain Layout
8642 \begin_inset Quotes erd
8648 \begin_layout Description
8649 \begin_inset Flex CharStyle:Code
8652 \begin_layout Plain Layout
8658 Used to set the DTD line with XML-based output classes.
8660 \begin_inset space \thinspace{}
8664 \begin_inset Quotes eld
8667 -//OASIS//DTD DocBook V4.2//EN
8668 \begin_inset Quotes erd
8674 \begin_layout Description
8675 \begin_inset Flex CharStyle:Code
8678 \begin_layout Plain Layout
8685 \begin_inset Flex CharStyle:Code
8688 \begin_layout Plain Layout
8689 string="empty|plain|headings|fancy"
8694 ] The list of available page styles, separated by
8695 \begin_inset Quotes eld
8699 \begin_inset Flex CharStyle:Code
8702 \begin_layout Plain Layout
8709 \begin_inset Quotes erd
8715 \begin_layout Description
8716 \begin_inset Flex CharStyle:Code
8719 \begin_layout Plain Layout
8726 \begin_inset Flex CharStyle:Code
8729 \begin_layout Plain Layout
8735 ] Some document class options, separated by a comma, that will be added
8736 to the optional part of the
8737 \begin_inset Flex CharStyle:Code
8740 \begin_layout Plain Layout
8751 \begin_layout Standard
8753 \begin_inset Flex CharStyle:Code
8756 \begin_layout Plain Layout
8762 section must end with
8763 \begin_inset Quotes eld
8767 \begin_inset Flex CharStyle:Code
8770 \begin_layout Plain Layout
8777 \begin_inset Quotes erd
8783 \begin_layout Subsection
8785 \begin_inset CommandInset label
8787 name "sub:Paragraph-Styles"
8794 \begin_layout Standard
8795 A paragraph style description looks like this:
8799 \begin_layout Plain Layout
8800 Note that this will either define a new layout or modify an existing one.
8808 \begin_layout LyX-Code
8815 \begin_layout LyX-Code
8819 \begin_layout LyX-Code
8823 \begin_layout Standard
8824 where the following commands are allowed:
8827 \begin_layout Description
8828 \begin_inset Flex CharStyle:Code
8831 \begin_layout Plain Layout
8838 \begin_inset Flex CharStyle:Code
8841 \begin_layout Plain Layout
8846 , left, right, center
8851 ] Paragraph alignment.
8854 \begin_layout Description
8855 \begin_inset Flex CharStyle:Code
8858 \begin_layout Plain Layout
8865 \begin_inset Flex CharStyle:Code
8868 \begin_layout Plain Layout
8873 , left, right, center
8878 ] A comma separated list of permitted alignments.
8879 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
8881 For example a right-aligned or centered enumeration isn't possible.)
8884 \begin_layout Description
8885 \begin_inset Flex CharStyle:Code
8888 \begin_layout Plain Layout
8894 Language dependent information to be included in the LaTeX preamble when
8896 Note that this will completely override any prior
8897 \begin_inset Flex CharStyle:Code
8900 \begin_layout Plain Layout
8908 \begin_inset Quotes eld
8912 \begin_inset Flex CharStyle:Code
8915 \begin_layout Plain Layout
8922 \begin_inset Quotes erd
8926 The contents of this tag will occur once in the LaTeX preamble for each
8927 language used by the document.
8928 Each time, the following substitutions are made:
8932 \begin_layout Itemize
8933 \begin_inset Flex CharStyle:Code
8936 \begin_layout Plain Layout
8942 is replaced by the language name (as used by the babel package).
8945 \begin_layout Itemize
8947 \begin_inset Quotes eld
8951 \begin_inset Quotes erd
8955 \begin_inset Flex CharStyle:Code
8958 \begin_layout Plain Layout
8964 replaces its argument by the translation of the argument to the current
8968 \begin_layout Standard
8969 This preamble snippet will only be used if the document contains more than
8970 one language and the babel package is used.
8974 \begin_layout Description
8975 \begin_inset Flex CharStyle:Code
8978 \begin_layout Plain Layout
8985 \begin_inset Flex CharStyle:Code
8988 \begin_layout Plain Layout
8998 \begin_layout Plain Layout
8999 Note that a `float' here is a real number, such as: 1.5.
9004 The vertical space with which the last of a chain of paragraphs with this
9005 layout is separated from the following paragraph.
9006 If the next paragraph has another layout, the separations are not simply
9007 added, but the maximum is taken.
9010 \begin_layout Description
9011 \begin_inset Flex CharStyle:Code
9014 \begin_layout Plain Layout
9021 \begin_inset Flex CharStyle:Code
9024 \begin_layout Plain Layout
9030 The category for this style.
9031 This is used to group related styles in the Layout combobox on the toolbar.
9032 Any string can be used, but you may want to use existing categories with
9037 \begin_layout Description
9038 \begin_inset Flex CharStyle:Code
9041 \begin_layout Plain Layout
9047 Depth of XML command.
9048 Used only with XML-type formats.
9051 \begin_layout Description
9052 \begin_inset Flex CharStyle:Code
9055 \begin_layout Plain Layout
9062 \begin_inset CommandInset label
9064 name "des:CopyStyle"
9069 \begin_inset Flex CharStyle:Code
9072 \begin_layout Plain Layout
9078 Copies all the features of an existing style into the current one.
9082 \begin_layout Description
9083 \begin_inset Flex CharStyle:Code
9086 \begin_layout Plain Layout
9092 The name of a style whose preamble should be output
9097 This allows to ensure some ordering of the preamble snippets when macros
9098 definitions depend on one another.
9102 \begin_layout Plain Layout
9103 Note that, besides that functionality, there is no way to ensure any ordering
9105 The ordering that you see in a given version of LyX may change without
9106 warning in later versions.
9114 \begin_layout Description
9115 \begin_inset Flex CharStyle:Code
9118 \begin_layout Plain Layout
9125 \begin_inset Flex CharStyle:Code
9128 \begin_layout Plain Layout
9133 , Box, Filled_Box, Static
9138 ] The type of label that stands at the end of the paragraph (or sequence
9140 \begin_inset Flex CharStyle:Code
9143 \begin_layout Plain Layout
9150 \begin_inset Flex CharStyle:Code
9153 \begin_layout Plain Layout
9160 \begin_inset Flex CharStyle:Code
9163 \begin_layout Plain Layout
9170 \begin_inset Flex CharStyle:Code
9173 \begin_layout Plain Layout
9181 \begin_inset Flex CharStyle:Code
9184 \begin_layout Plain Layout
9191 \begin_inset Quotes eld
9195 \begin_inset Quotes erd
9199 \begin_inset Flex CharStyle:Code
9202 \begin_layout Plain Layout
9209 \begin_inset Flex CharStyle:Code
9212 \begin_layout Plain Layout
9213 \begin_inset space ~
9222 \begin_inset space ~
9225 black) square suitable for end of proof markers,
9226 \begin_inset Flex CharStyle:Code
9229 \begin_layout Plain Layout
9235 is an explicit text string.
9238 \begin_layout Description
9239 \begin_inset Flex CharStyle:Code
9242 \begin_layout Plain Layout
9249 \begin_inset Flex CharStyle:Code
9252 \begin_layout Plain Layout
9258 ] The string used for a label with a
9259 \begin_inset Flex CharStyle:Code
9262 \begin_layout Plain Layout
9269 \begin_inset Flex CharStyle:Code
9272 \begin_layout Plain Layout
9282 \begin_layout Description
9283 \begin_inset Flex CharStyle:Code
9286 \begin_layout Plain Layout
9293 \begin_inset Flex CharStyle:Code
9296 \begin_layout Plain Layout
9307 \begin_inset Flex CharStyle:Code
9310 \begin_layout Plain Layout
9319 \begin_layout Description
9320 \begin_inset Flex CharStyle:Code
9323 \begin_layout Plain Layout
9330 \begin_inset Flex CharStyle:Code
9333 \begin_layout Plain Layout
9343 ] With this parameter the
9344 \begin_inset Flex CharStyle:MenuItem
9347 \begin_layout Plain Layout
9354 \begin_inset Quotes eld
9357 Vertical space above
9358 \begin_inset Quotes erd
9362 \begin_inset Flex CharStyle:MenuItem
9365 \begin_layout Plain Layout
9366 Edit\SpecialChar \menuseparator
9368 \begin_inset space ~
9376 dialog can be set when initializing a paragraph with this style.
9380 \begin_layout Plain Layout
9383 Note from Jean-Marc:
9385 I'm not sure that this setting has much use, and it should probably be
9386 removed in later versions.
9394 \begin_layout Description
9395 \begin_inset Flex CharStyle:Code
9398 \begin_layout Plain Layout
9404 The font used for both the text body
9410 \begin_inset space ~
9414 \begin_inset CommandInset ref
9416 reference "sub:Font-description"
9421 Note that defining this font automatically defines the
9422 \begin_inset Flex CharStyle:Code
9425 \begin_layout Plain Layout
9432 So you should define this one first if you also want to define
9433 \begin_inset Flex CharStyle:Code
9436 \begin_layout Plain Layout
9445 \begin_layout Description
9446 \begin_inset Flex CharStyle:Code
9449 \begin_layout Plain Layout
9456 \begin_inset CommandInset label
9458 name "des:FreeSpacing"
9465 \begin_inset Flex CharStyle:Code
9468 \begin_layout Plain Layout
9479 \begin_inset Flex CharStyle:Code
9482 \begin_layout Plain Layout
9488 ] Usually LyX doesn't allow you to insert more than one space between words,
9489 since a space is considered as the separation between two words, not a
9490 character or symbol of its own.
9491 This is a very fine thing but sometimes annoying, for example, when typing
9492 program code or plain LaTeX code.
9494 \begin_inset Flex CharStyle:Code
9497 \begin_layout Plain Layout
9504 Note that LyX will create protected blanks for the additional blanks when
9505 in another mode than LaTeX-mode.
9508 \begin_layout Description
9509 \begin_inset Flex CharStyle:Code
9512 \begin_layout Plain Layout
9518 [[FIXME]] (Used only with XML-type formats.)
9521 \begin_layout Description
9522 \begin_inset Flex CharStyle:Code
9525 \begin_layout Plain Layout
9532 \begin_inset Flex CharStyle:Code
9535 \begin_layout Plain Layout
9541 If 1, marks the layout as being part of a title block (see also the
9542 \begin_inset Flex CharStyle:Code
9545 \begin_layout Plain Layout
9552 \begin_inset Flex CharStyle:Code
9555 \begin_layout Plain Layout
9564 \begin_layout Description
9565 \begin_inset Flex CharStyle:Code
9568 \begin_layout Plain Layout
9575 \begin_inset Flex CharStyle:Code
9578 \begin_layout Plain Layout
9584 ] This provides extra space between paragraphs that have the same layout.
9585 If you put other layouts into an environment, each is separated with the
9587 \begin_inset Flex CharStyle:Code
9590 \begin_layout Plain Layout
9597 But the whole items of the environment are additionally separated with
9599 \begin_inset Flex CharStyle:Code
9602 \begin_layout Plain Layout
9614 \begin_layout Description
9615 \begin_inset Flex CharStyle:Code
9618 \begin_layout Plain Layout
9624 [[FIXME]] (Used only with XML-type formats.)
9627 \begin_layout Description
9628 \begin_inset Flex CharStyle:Code
9631 \begin_layout Plain Layout
9638 \begin_inset CommandInset label
9640 name "des:KeepEmpty"
9647 \begin_inset Flex CharStyle:Code
9650 \begin_layout Plain Layout
9661 \begin_inset Flex CharStyle:Code
9664 \begin_layout Plain Layout
9670 ] Usually LyX does not allow you to leave a paragraph empty, since it would
9671 lead to empty LaTeX output.
9672 There are some cases where this could be desirable however: in a letter
9673 template, the required fields can be provided as empty fields, so that
9674 people do not forget them; in some special classes, a layout can be used
9675 as some kind of break, which does not contain actual text.
9678 \begin_layout Description
9679 \begin_inset Flex CharStyle:Code
9682 \begin_layout Plain Layout
9688 [float=0] The vertical space between the label and the text body.
9689 Only used for labels that are above the text body (
9690 \begin_inset Flex CharStyle:Code
9693 \begin_layout Plain Layout
9700 \begin_inset Flex CharStyle:Code
9703 \begin_layout Plain Layout
9704 Centered_Top_Environment
9712 \begin_layout Description
9713 \begin_inset Flex CharStyle:Code
9716 \begin_layout Plain Layout
9723 \begin_inset Flex CharStyle:Code
9726 \begin_layout Plain Layout
9733 \begin_inset Newline newline
9736 The name of the counter for automatic numbering.
9738 \begin_inset Newline newline
9746 \begin_inset Flex CharStyle:Code
9749 \begin_layout Plain Layout
9756 \begin_inset Flex CharStyle:Code
9759 \begin_layout Plain Layout
9766 In that case, the counter will be stepped each time the layout appears.
9768 \begin_inset Newline newline
9776 \begin_inset Flex CharStyle:Code
9779 \begin_layout Plain Layout
9786 \begin_inset Flex CharStyle:Code
9789 \begin_layout Plain Layout
9795 , though this case is a bit complicated.
9797 \begin_inset Quotes eld
9801 \begin_inset Flex CharStyle:Code
9804 \begin_layout Plain Layout
9811 \begin_inset Quotes erd
9815 Then the actual counters used are
9816 \begin_inset Flex CharStyle:Code
9819 \begin_layout Plain Layout
9826 \begin_inset Flex CharStyle:Code
9829 \begin_layout Plain Layout
9836 \begin_inset Flex CharStyle:Code
9839 \begin_layout Plain Layout
9846 \begin_inset Flex CharStyle:Code
9849 \begin_layout Plain Layout
9856 These counters must all be declared separately.
9857 \begin_inset Newline newline
9861 \begin_inset CommandInset ref
9863 reference "sub:Counters"
9867 for details on counters.
9870 \begin_layout Description
9871 \begin_inset Flex CharStyle:Code
9874 \begin_layout Plain Layout
9880 The font used for the label.
9882 \begin_inset space ~
9886 \begin_inset CommandInset ref
9888 reference "sub:Font-description"
9895 \begin_layout Description
9896 \begin_inset Flex CharStyle:Code
9899 \begin_layout Plain Layout
9905 Text that indicates how far a label should be indented.
9908 \begin_layout Description
9909 \begin_inset Flex CharStyle:Code
9912 \begin_layout Plain Layout
9919 \begin_inset Flex CharStyle:Code
9922 \begin_layout Plain Layout
9928 ] The horizontal space between the label and the text body.
9929 Only used for labels that are not above the text body.
9932 \begin_layout Description
9933 \begin_inset Flex CharStyle:Code
9936 \begin_layout Plain Layout
9943 \begin_inset Flex CharStyle:Code
9946 \begin_layout Plain Layout
9952 ] The string used for a label with a
9953 \begin_inset Flex CharStyle:Code
9956 \begin_layout Plain Layout
9964 \begin_inset Flex CharStyle:Code
9967 \begin_layout Plain Layout
9973 is set, this string can be contain the special formatting commands described
9975 \begin_inset CommandInset ref
9977 reference "sub:Counters"
9985 \begin_layout Plain Layout
9986 For the sake of backwards compatibility, the string
9987 \begin_inset Flex CharStyle:Code
9990 \begin_layout Plain Layout
10000 will be replaced by the expanded
10001 \begin_inset Flex CharStyle:Code
10004 \begin_layout Plain Layout
10011 \begin_inset Flex CharStyle:Code
10014 \begin_layout Plain Layout
10023 This feature is now obsolete and should be replaced by the mechanisms of
10025 \begin_inset CommandInset ref
10027 reference "sub:Counters"
10039 \begin_layout Description
10040 \begin_inset Flex CharStyle:Code
10043 \begin_layout Plain Layout
10044 LabelStringAppendix
10050 \begin_inset Flex CharStyle:Code
10053 \begin_layout Plain Layout
10059 ] This is used inside the appendix instead of
10060 \begin_inset Flex CharStyle:Code
10063 \begin_layout Plain Layout
10071 \begin_inset Flex CharStyle:Code
10074 \begin_layout Plain Layout
10081 \begin_inset Flex CharStyle:Code
10084 \begin_layout Plain Layout
10085 LabelStringAppendix
10093 \begin_layout Description
10094 \begin_inset Flex CharStyle:Code
10097 \begin_layout Plain Layout
10103 [FIXME] (Used only with XML-type formats.)
10106 \begin_layout Description
10107 \begin_inset Flex CharStyle:Code
10110 \begin_layout Plain Layout
10117 \begin_inset Flex CharStyle:Code
10120 \begin_layout Plain Layout
10125 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
10126 Enumerate, Itemize, Bibliography
10135 \begin_layout Itemize
10136 \begin_inset Flex CharStyle:Code
10139 \begin_layout Plain Layout
10145 means the label is the very first word (up to the first real blank).
10146 Use protected spaces (like
10147 \begin_inset space ~
10150 that one) if you want more than one word as the label.
10154 \begin_layout Itemize
10155 \begin_inset Flex CharStyle:Code
10158 \begin_layout Plain Layout
10164 means the label is simply whatever
10165 \begin_inset Flex CharStyle:Code
10168 \begin_layout Plain Layout
10175 Note that this really is `static'.
10178 \begin_layout Itemize
10179 \begin_inset Flex CharStyle:Code
10182 \begin_layout Plain Layout
10189 \begin_inset Flex CharStyle:Code
10192 \begin_layout Plain Layout
10193 Centered_Top_Environment
10198 are special cases of
10199 \begin_inset Flex CharStyle:Code
10202 \begin_layout Plain Layout
10209 The label will be printed above the paragraph, but only at the top of an
10210 environment or the top of a chain of paragraphs with this layout.
10211 This might be used with the
10212 \begin_inset Flex CharStyle:MenuItem
10215 \begin_layout Plain Layout
10221 layout, for example.
10224 \begin_layout Itemize
10225 \begin_inset Flex CharStyle:Code
10228 \begin_layout Plain Layout
10234 is a special case for the caption-labels
10235 \begin_inset Quotes eld
10239 \begin_inset Quotes erd
10243 \begin_inset Quotes eld
10247 \begin_inset Quotes erd
10252 \begin_inset Flex CharStyle:Code
10255 \begin_layout Plain Layout
10261 means the (hardcoded) label string depends on the kind of float: It is
10262 hardcoded to be `FloatType N', where N is the value of the counter associated
10266 \begin_layout Itemize
10268 \begin_inset Flex CharStyle:Code
10271 \begin_layout Plain Layout
10277 label type defines automatically numbered labels.
10279 \begin_inset Flex CharStyle:Code
10282 \begin_layout Plain Layout
10288 will be expanded to resolve any counter references it contains: For example,
10290 \begin_inset Quotes eld
10294 \begin_inset Flex CharStyle:Code
10297 \begin_layout Plain Layout
10308 \begin_inset Quotes erd
10313 \begin_inset CommandInset ref
10315 reference "sub:Counters"
10319 for more information on counters.
10322 \begin_layout Itemize
10323 \begin_inset Flex CharStyle:Code
10326 \begin_layout Plain Layout
10332 produces the usual sort of enumeration labels.
10333 At present, it is hardcoded to use Arabic numerals, lowercase letters,
10334 small Roman numerals, and uppercase letters for the four possible depths.
10337 \begin_layout Itemize
10338 \begin_inset Flex CharStyle:Code
10341 \begin_layout Plain Layout
10347 produces various bullets at the different levels.
10348 It is also hardcoded.
10351 \begin_layout Itemize
10352 \begin_inset Flex CharStyle:Code
10355 \begin_layout Plain Layout
10361 is used internally by LyX and should be used only with
10362 \begin_inset Flex CharStyle:Code
10365 \begin_layout Plain Layout
10366 LatexType BibEnvironment
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
10395 , but this preamble snippet occurs independently from the babel package,
10396 and only for the document language.
10398 \begin_inset Quotes eld
10402 \begin_inset Flex CharStyle:Code
10405 \begin_layout Plain Layout
10412 \begin_inset Quotes erd
10419 \begin_layout Standard
10420 If the style defines text that appears in the typeset document, it may use
10422 \begin_inset Flex CharStyle:Code
10425 \begin_layout Plain Layout
10432 \begin_inset Flex CharStyle:Code
10435 \begin_layout Plain Layout
10441 to support non-english and even multilanguage documents correctly.
10442 The following excerpt (from the
10443 \begin_inset Flex CharStyle:Code
10446 \begin_layout Plain Layout
10452 file) shows how this works:
10455 \begin_layout LyX-Code
10459 \begin_layout LyX-Code
10462 theoremstyle{remark}
10465 \begin_layout LyX-Code
10468 newtheorem{claim}[thm]{
10475 \begin_layout LyX-Code
10479 \begin_layout LyX-Code
10483 \begin_layout LyX-Code
10488 claimname}{_(Claim)}
10491 \begin_layout LyX-Code
10495 \begin_layout LyX-Code
10499 \begin_layout LyX-Code
10503 \begin_layout LyX-Code
10512 claimname}{_(Claim)}}
10515 \begin_layout LyX-Code
10519 \begin_layout Standard
10520 The key to correct translation of the user visible text is the definition
10522 \begin_inset Flex CharStyle:Code
10525 \begin_layout Plain Layout
10533 in the language preamble.
10534 This command holds the name of the theorem that will appear in the output.
10536 \begin_inset Flex CharStyle:Code
10539 \begin_layout Plain Layout
10545 then uses the commands offered by the babel package to redefine
10546 \begin_inset Flex CharStyle:Code
10549 \begin_layout Plain Layout
10557 for each used language in multilanguage documents.
10561 \begin_layout Description
10562 \begin_inset Flex CharStyle:Code
10565 \begin_layout Plain Layout
10571 The name of the corresponding LaTeX stuff.
10572 Either the environment or command name.
10575 \begin_layout Description
10576 \begin_inset Flex CharStyle:Code
10579 \begin_layout Plain Layout
10585 An optional parameter for the corresponding
10586 \begin_inset Flex CharStyle:Code
10589 \begin_layout Plain Layout
10596 This parameter cannot be changed from within LyX.
10599 \begin_layout Description
10600 \begin_inset Flex CharStyle:Code
10603 \begin_layout Plain Layout
10610 \begin_inset CommandInset label
10612 name "des:LatexType"
10617 \begin_inset Flex CharStyle:Code
10620 \begin_layout Plain Layout
10625 , Command, Environment, Item_Environment,
10631 \begin_inset Flex CharStyle:Code
10634 \begin_layout Plain Layout
10635 List_Environment, Bib_Environment
10640 ] How the layout should be translated into LaTeX.
10644 \begin_layout Plain Layout
10645 \begin_inset Flex CharStyle:Code
10648 \begin_layout Plain Layout
10654 is perhaps a bit misleading, since these rules apply to SGML classes, too.
10655 Visit the SGML class files for specific examples.
10664 \begin_layout Itemize
10665 \begin_inset Flex CharStyle:Code
10668 \begin_layout Plain Layout
10674 means nothing special.
10678 \begin_layout Itemize
10679 \begin_inset Flex CharStyle:Code
10682 \begin_layout Plain Layout
10689 \begin_inset Flex CharStyle:Code
10692 \begin_layout Plain Layout
10699 {\SpecialChar \ldots{}
10708 \begin_layout Itemize
10709 \begin_inset Flex CharStyle:Code
10712 \begin_layout Plain Layout
10719 \begin_inset Flex CharStyle:Code
10722 \begin_layout Plain Layout
10729 }\SpecialChar \ldots{}
10745 \begin_layout Itemize
10746 \begin_inset Flex CharStyle:Code
10749 \begin_layout Plain Layout
10756 \begin_inset Flex CharStyle:Code
10759 \begin_layout Plain Layout
10766 \begin_inset Flex CharStyle:Code
10769 \begin_layout Plain Layout
10777 is generated for each paragraph of this environment.
10781 \begin_layout Itemize
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 Flex CharStyle:Code
10805 \begin_layout Plain Layout
10811 is passed as an argument to the environment.
10813 \begin_inset Flex CharStyle:Code
10816 \begin_layout Plain Layout
10822 can be defined in the
10823 \begin_inset Flex CharStyle:MenuItem
10826 \begin_layout Plain Layout
10831 ayout\SpecialChar \menuseparator
10845 \begin_layout Standard
10846 Putting the last few things together, the LaTeX output will be either:
10849 \begin_layout LyX-Code
10852 latexname[latexparam]{\SpecialChar \ldots{}
10856 \begin_layout Standard
10860 \begin_layout LyX-Code
10863 begin{latexname}[latexparam] \SpecialChar \ldots{}
10869 \begin_layout Standard
10870 depending upon the LaTeX type.
10874 \begin_layout Description
10875 \begin_inset Flex CharStyle:Code
10878 \begin_layout Plain Layout
10885 \begin_inset Flex CharStyle:Code
10888 \begin_layout Plain Layout
10894 ] If you put layouts into environments, the leftmargins are not simply added,
10895 but added with a factor
10896 \begin_inset Formula $\frac{4}{depth+4}$
10900 Note that this parameter is also used when the margin is defined as
10901 \begin_inset Flex CharStyle:Code
10904 \begin_layout Plain Layout
10911 \begin_inset Flex CharStyle:Code
10914 \begin_layout Plain Layout
10921 Then it is added to the manual or dynamic margin.
10923 \begin_inset Newline newline
10926 The argument is passed as a string.
10928 \begin_inset Quotes eld
10932 \begin_inset Flex CharStyle:Code
10935 \begin_layout Plain Layout
10942 \begin_inset Quotes erd
10945 means that the paragraph is indented with the width of
10946 \begin_inset Quotes eld
10950 \begin_inset Flex CharStyle:Code
10953 \begin_layout Plain Layout
10960 \begin_inset Quotes erd
10963 in the normal font.
10964 You can get a negative width by prefixing the string with
10965 \begin_inset Quotes eld
10969 \begin_inset Flex CharStyle:Code
10972 \begin_layout Plain Layout
10979 \begin_inset Quotes erd
10983 This way was chosen so that the look is the same with each used screen
10988 \begin_layout Description
10989 \begin_inset Flex CharStyle:Code
10992 \begin_layout Plain Layout
10999 \begin_inset Flex CharStyle:Code
11002 \begin_layout Plain Layout
11007 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11013 \begin_inset Newline newline
11016 The kind of margin that the layout has on the left side.
11018 \begin_inset Flex CharStyle:Code
11021 \begin_layout Plain Layout
11027 just means a fixed margin.
11029 \begin_inset Flex CharStyle:Code
11032 \begin_layout Plain Layout
11038 means that the left margin depends on the string entered in the
11039 \begin_inset Flex CharStyle:MenuItem
11042 \begin_layout Plain Layout
11043 Edit\SpecialChar \menuseparator
11045 \begin_inset space ~
11054 This is used to typeset nice lists without tabulators.
11056 \begin_inset Flex CharStyle:Code
11059 \begin_layout Plain Layout
11065 means that the margin depends on the size of the label.
11066 This is used for automatic enumerated headlines.
11067 It is obvious that the headline
11068 \begin_inset Quotes eld
11071 5.4.3.2.1 Very long headline
11072 \begin_inset Quotes erd
11075 must have a wider left margin (as wide as
11076 \begin_inset Quotes eld
11080 \begin_inset Quotes erd
11083 plus the space) than
11084 \begin_inset Quotes eld
11087 3.2 Very long headline
11088 \begin_inset Quotes erd
11092 \begin_inset Quotes eld
11096 \begin_inset Quotes erd
11099 are not able to do this.
11101 \begin_inset Flex CharStyle:Code
11104 \begin_layout Plain Layout
11110 is similar, but only the very first row of the paragraph is dynamic, while
11111 the others are static; this is used, for example, for descriptions.
11113 \begin_inset Flex CharStyle:Code
11116 \begin_layout Plain Layout
11122 means the margin is chosen in a way that the longest row of this paragraph
11123 fits to the right margin.
11124 This is used to typeset an address on the right edge of the page.
11127 \begin_layout Description
11128 \begin_inset Flex CharStyle:Code
11131 \begin_layout Plain Layout
11138 \begin_inset Flex CharStyle:Code
11141 \begin_layout Plain Layout
11150 \begin_inset Flex CharStyle:Code
11153 \begin_layout Plain Layout
11159 ] Whether fragile commands in this layout should be
11160 \begin_inset Flex CharStyle:Code
11163 \begin_layout Plain Layout
11176 whether this command should itself be protected.)
11179 \begin_layout Description
11180 \begin_inset Flex CharStyle:Code
11183 \begin_layout Plain Layout
11190 \begin_inset Flex CharStyle:Code
11193 \begin_layout Plain Layout
11200 \begin_inset Flex CharStyle:Code
11203 \begin_layout Plain Layout
11211 ] Whether newlines are translated into LaTeX newlines (
11212 \begin_inset Flex CharStyle:Code
11215 \begin_layout Plain Layout
11226 The translation can be switched off to allow more comfortable LaTeX editing
11230 \begin_layout Description
11231 \begin_inset Flex CharStyle:Code
11234 \begin_layout Plain Layout
11241 \begin_inset Flex CharStyle:Code
11244 \begin_layout Plain Layout
11251 \begin_inset Flex CharStyle:Code
11254 \begin_layout Plain Layout
11262 ] Whether the following Paragraph is allowed to indent its very first row.
11264 \begin_inset Flex CharStyle:Code
11267 \begin_layout Plain Layout
11273 means that it is not allowed to do so;
11274 \begin_inset Flex CharStyle:Code
11277 \begin_layout Plain Layout
11283 means it could do so if it wants to.
11286 \begin_layout Description
11287 \begin_inset Flex CharStyle:Code
11290 \begin_layout Plain Layout
11296 Name of a layout that has replaced this layout.
11297 This is used to rename a layout, while keeping backward compatibility.
11300 \begin_layout Description
11301 \begin_inset Flex CharStyle:Code
11304 \begin_layout Plain Layout
11311 \begin_inset Flex CharStyle:Code
11314 \begin_layout Plain Layout
11320 ] The number of optional arguments that can be used with this layout.
11321 This is useful for things like section headings, and only makes sense with
11325 \begin_layout Description
11326 \begin_inset Flex CharStyle:Code
11329 \begin_layout Plain Layout
11336 \begin_inset Flex CharStyle:Code
11339 \begin_layout Plain Layout
11345 ] The indent of the very first line of a paragraph.
11347 \begin_inset Flex CharStyle:Code
11350 \begin_layout Plain Layout
11356 will be fixed for a certain layout.
11357 The exception is Standard layout, since the indentation of a Standard layout
11358 paragraph can be prohibited with
11359 \begin_inset Flex CharStyle:Code
11362 \begin_layout Plain Layout
11369 Also, Standard layout paragraphs inside environments use the
11370 \begin_inset Flex CharStyle:Code
11373 \begin_layout Plain Layout
11379 of the environment, not their native one.
11380 For example, Standard paragraphs inside an enumeration are not indented.
11383 \begin_layout Description
11384 \begin_inset Flex CharStyle:Code
11387 \begin_layout Plain Layout
11394 \begin_inset Flex CharStyle:Code
11397 \begin_layout Plain Layout
11403 ] The vertical space between two paragraphs of this layout.
11406 \begin_layout Description
11407 \begin_inset Flex CharStyle:Code
11410 \begin_layout Plain Layout
11417 \begin_inset Flex CharStyle:Code
11420 \begin_layout Plain Layout
11426 ] LyX allows the user to choose either
11427 \begin_inset Quotes eld
11431 \begin_inset Quotes erd
11435 \begin_inset Quotes eld
11439 \begin_inset Quotes erd
11442 to typeset a document.
11444 \begin_inset Quotes eld
11448 \begin_inset Quotes erd
11451 is chosen, this value is completely ignored.
11453 \begin_inset Quotes eld
11457 \begin_inset Quotes erd
11460 is chosen, the parindent of a LaTeXtype
11461 \begin_inset Quotes eld
11465 \begin_inset Quotes erd
11468 layout is ignored and all paragraphs are separated by this parskip argument.
11469 The vertical space is calculated with
11470 \begin_inset Flex CharStyle:Code
11473 \begin_layout Plain Layout
11475 \begin_inset space ~
11484 \begin_inset Flex CharStyle:Code
11487 \begin_layout Plain Layout
11493 is the height of a row with the normal font.
11494 This way, the look stays the same with different screen fonts.
11497 \begin_layout Description
11498 \begin_inset Flex CharStyle:Code
11501 \begin_layout Plain Layout
11508 \begin_inset CommandInset label
11510 name "des:PathThru"
11517 \begin_inset Flex CharStyle:Code
11520 \begin_layout Plain Layout
11531 \begin_inset Flex CharStyle:Code
11534 \begin_layout Plain Layout
11540 ] Whether the contents of this paragraph should be output in raw form, meaning
11541 without special translations that LaTeX would require.
11544 \begin_layout Description
11545 \begin_inset Flex CharStyle:Code
11548 \begin_layout Plain Layout
11555 \begin_inset CommandInset label
11557 name "des:Preamble"
11561 Information to be included in the LaTeX preamble when this style is used.
11562 Used to define macros, load packages, etc., required by this particular
11565 \begin_inset Quotes eld
11569 \begin_inset Flex CharStyle:Code
11572 \begin_layout Plain Layout
11579 \begin_inset Quotes erd
11585 \begin_layout Description
11586 \begin_inset Flex CharStyle:Code
11589 \begin_layout Plain Layout
11596 \begin_inset Flex CharStyle:Code
11599 \begin_layout Plain Layout
11606 \begin_inset CommandInset label
11608 name "des:Requires"
11612 Whether the layout requires the feature
11613 \begin_inset Flex CharStyle:Code
11616 \begin_layout Plain Layout
11623 See the description of
11624 \begin_inset Flex CharStyle:Code
11627 \begin_layout Plain Layout
11634 \begin_inset CommandInset ref
11635 LatexCommand pageref
11636 reference "des:FreeSpacing"
11640 ) for information on `features'.
11644 \begin_layout Description
11645 \begin_inset Flex CharStyle:Code
11648 \begin_layout Plain Layout
11655 \begin_inset Flex CharStyle:Code
11658 \begin_layout Plain Layout
11665 \begin_inset Flex CharStyle:Code
11668 \begin_layout Plain Layout
11677 \begin_layout Description
11678 \begin_inset Flex CharStyle:Code
11681 \begin_layout Plain Layout
11688 \begin_inset Flex CharStyle:Code
11691 \begin_layout Plain Layout
11696 , onehalf, double, other
11705 ] This defines what the default spacing should be in the layout.
11707 \begin_inset Flex CharStyle:Code
11710 \begin_layout Plain Layout
11717 \begin_inset Flex CharStyle:Code
11720 \begin_layout Plain Layout
11727 \begin_inset Flex CharStyle:Code
11730 \begin_layout Plain Layout
11736 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
11737 If you specify the argument
11738 \begin_inset Flex CharStyle:Code
11741 \begin_layout Plain Layout
11747 , then you should also provide a numerical argument which will be the actual
11749 Note that, contrary to other parameters,
11750 \begin_inset Flex CharStyle:Code
11753 \begin_layout Plain Layout
11759 implies the generation of specific LaTeX code, using the package
11762 \begin_inset Flex CharStyle:Code
11765 \begin_layout Plain Layout
11774 \begin_layout Description
11775 \begin_inset Flex CharStyle:Code
11778 \begin_layout Plain Layout
11784 The font used for the text body .
11786 \begin_inset CommandInset ref
11788 reference "sub:Font-description"
11795 \begin_layout Description
11796 \begin_inset Flex CharStyle:Code
11799 \begin_layout Plain Layout
11807 The level of the style in the table of contents.
11808 This is used for automatic numbering of section headings.
11811 \begin_layout Description
11812 \begin_inset Flex CharStyle:Code
11815 \begin_layout Plain Layout
11822 \begin_inset Flex CharStyle:Code
11825 \begin_layout Plain Layout
11831 ] The vertical space with which the very first of a chain of paragraphs
11832 with this layout is separated from the previous paragraph.
11833 If the previous paragraph has another layout, the separations are not simply
11834 added, but the maximum is taken.
11837 \begin_layout Subsection
11839 \begin_inset CommandInset label
11848 \begin_layout Standard
11849 Since version 1.3.0 of LyX, it is has been both possible and necessary to
11850 define the floats (
11851 \begin_inset Flex CharStyle:MenuItem
11854 \begin_layout Plain Layout
11861 \begin_inset Flex CharStyle:MenuItem
11864 \begin_layout Plain Layout
11870 , \SpecialChar \ldots{}
11871 ) in the text class itself.
11872 Standard floats are included in the file
11873 \begin_inset Flex CharStyle:Code
11876 \begin_layout Plain Layout
11882 , so you may have to do no more than add
11885 \begin_layout LyX-Code
11886 Input stdfloats.inc
11889 \begin_layout Standard
11890 to your layout file.
11891 If you want to implement a text class that proposes some other float types
11892 (like the AGU class bundled with LyX), the information below will hopefully
11896 \begin_layout Description
11897 \begin_inset Flex CharStyle:Code
11900 \begin_layout Plain Layout
11907 \begin_inset Flex CharStyle:Code
11910 \begin_layout Plain Layout
11917 \begin_inset Quotes erd
11921 \begin_inset Quotes erd
11924 ] The file name extension of an auxiliary file for the list of figures (or
11926 LaTeX writes the captions to this file.
11929 \begin_layout Description
11930 \begin_inset Flex CharStyle:Code
11933 \begin_layout Plain Layout
11940 \begin_inset Flex CharStyle:Code
11943 \begin_layout Plain Layout
11950 \begin_inset Quotes erd
11954 \begin_inset Quotes erd
11957 ] The string that will be used in the menus and also for the caption.
11958 This is translated to the current language if babel is used.
11961 \begin_layout Description
11962 \begin_inset Flex CharStyle:Code
11965 \begin_layout Plain Layout
11972 \begin_inset Flex CharStyle:Code
11975 \begin_layout Plain Layout
11984 \begin_inset Flex CharStyle:Code
11987 \begin_layout Plain Layout
11994 \begin_inset Flex CharStyle:Code
11997 \begin_layout Plain Layout
12003 if the float is already defined by the LaTeX document class.
12005 \begin_inset Flex CharStyle:Code
12008 \begin_layout Plain Layout
12014 , the float will be defined using the LaTeX package
12015 \begin_inset Flex CharStyle:Code
12018 \begin_layout Plain Layout
12027 \begin_layout Description
12028 \begin_inset Flex CharStyle:Code
12031 \begin_layout Plain Layout
12038 \begin_inset Flex CharStyle:Code
12041 \begin_layout Plain Layout
12048 \begin_inset Quotes erd
12052 \begin_inset Quotes erd
12055 ] The heading used for the list of floats.
12056 This is translated to the document language.
12059 \begin_layout Description
12060 \begin_inset Flex CharStyle:Code
12063 \begin_layout Plain Layout
12070 \begin_inset Flex CharStyle:Code
12073 \begin_layout Plain Layout
12080 \begin_inset Quotes erd
12084 \begin_inset Quotes erd
12087 ] This (optional) argument determines whether floats of this class will
12088 be numbered within some sectional unit of the document.
12089 For example, if within is equal to
12090 \begin_inset Flex CharStyle:Code
12093 \begin_layout Plain Layout
12099 , the floats will be numbered within chapters.
12103 \begin_layout Description
12104 \begin_inset Flex CharStyle:Code
12107 \begin_layout Plain Layout
12114 \begin_inset Flex CharStyle:Code
12117 \begin_layout Plain Layout
12124 \begin_inset Quotes erd
12128 \begin_inset Quotes erd
12131 ] The default placement for the given class of floats.
12132 The string should be as in standard LaTeX:
12133 \begin_inset Flex CharStyle:Code
12136 \begin_layout Plain Layout
12143 \begin_inset Flex CharStyle:Code
12146 \begin_layout Plain Layout
12153 \begin_inset Flex CharStyle:Code
12156 \begin_layout Plain Layout
12163 \begin_inset Flex CharStyle:Code
12166 \begin_layout Plain Layout
12172 for top, bottom, page, and here, respectively.
12176 \begin_layout Plain Layout
12177 Note that the order of these letters in the string is irrelevant, like in
12183 On top of that there is a new type,
12184 \begin_inset Flex CharStyle:Code
12187 \begin_layout Plain Layout
12193 , which does not really correspond to a float, since it means: put it
12194 \begin_inset Quotes eld
12198 \begin_inset Quotes erd
12202 Note however that the
12203 \begin_inset Flex CharStyle:Code
12206 \begin_layout Plain Layout
12212 specifier is special and, because of implementation details, cannot be
12213 used in non-built in float types.
12214 If you do not understand what this means, just use
12215 \begin_inset Quotes eld
12219 \begin_inset Flex CharStyle:Code
12222 \begin_layout Plain Layout
12229 \begin_inset Quotes erd
12235 \begin_layout Description
12236 \begin_inset Flex CharStyle:Code
12239 \begin_layout Plain Layout
12246 \begin_inset Flex CharStyle:Code
12249 \begin_layout Plain Layout
12256 \begin_inset Quotes erd
12260 \begin_inset Quotes erd
12263 ] The style used when defining the float using
12264 \begin_inset Flex CharStyle:Code
12267 \begin_layout Plain Layout
12278 \begin_layout Description
12279 \begin_inset Flex CharStyle:Code
12282 \begin_layout Plain Layout
12289 \begin_inset Flex CharStyle:Code
12292 \begin_layout Plain Layout
12299 \begin_inset Quotes erd
12303 \begin_inset Quotes erd
12307 \begin_inset Quotes eld
12311 \begin_inset Quotes erd
12314 of the new class of floats, like program or algorithm.
12315 After the appropriate
12316 \begin_inset Flex CharStyle:Code
12319 \begin_layout Plain Layout
12328 \begin_inset Flex CharStyle:Code
12331 \begin_layout Plain Layout
12340 \begin_inset Flex CharStyle:Code
12343 \begin_layout Plain Layout
12354 \begin_layout Standard
12355 Note that defining a float with type
12356 \begin_inset Flex CharStyle:Code
12359 \begin_layout Plain Layout
12367 automatically defines the corresponding counter with name
12368 \begin_inset Flex CharStyle:Code
12371 \begin_layout Plain Layout
12382 \begin_layout Subsection
12383 Flex insets and InsetLayout
12384 \begin_inset CommandInset label
12386 name "sub:Flex-insets-and"
12393 \begin_layout Standard
12394 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
12395 these are called Flex insets.
12399 \begin_layout Standard
12400 Flex insets come in three different kinds:
12403 \begin_layout Itemize
12405 \begin_inset Flex CharStyle:Code
12408 \begin_layout Plain Layout
12414 ): These define semantic markup corresponding to such LaTeX commands as
12416 \begin_inset Flex CharStyle:Code
12419 \begin_layout Plain Layout
12428 \begin_inset Flex CharStyle:Code
12431 \begin_layout Plain Layout
12442 \begin_layout Itemize
12444 \begin_inset Flex CharStyle:Code
12447 \begin_layout Plain Layout
12453 ): These can be used to define custom collapsible insets, similar to TeX
12454 code, footnote, and the like.
12455 An obvious example is an endnote inset, which is defined in the
12456 \begin_inset Flex CharStyle:Code
12459 \begin_layout Plain Layout
12468 \begin_layout Itemize
12470 \begin_inset Flex CharStyle:Code
12473 \begin_layout Plain Layout
12479 ): For use with DocBook classes.
12482 \begin_layout Standard
12483 Flex insets are defined using the
12484 \begin_inset Flex CharStyle:Code
12487 \begin_layout Plain Layout
12493 tag, which shall be explained in a moment.
12496 \begin_layout Standard
12498 \begin_inset Flex CharStyle:Code
12501 \begin_layout Plain Layout
12507 tag also serves another function: It can be used to customize the general
12508 layout of many different types of insets.
12510 \begin_inset Flex CharStyle:Code
12513 \begin_layout Plain Layout
12519 can be used to customize the layout parameters for footnotes, marginal
12520 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
12521 boxes, tables, algorithms, URLs, and optional arguments, as well as to
12522 define Flex insets.
12525 \begin_layout Standard
12527 \begin_inset Flex CharStyle:Code
12530 \begin_layout Plain Layout
12536 definition must begin with a line of the form:
12539 \begin_layout LyX-Code
12543 \begin_layout Standard
12545 \begin_inset Flex CharStyle:Code
12548 \begin_layout Plain Layout
12554 indicates the inset whose layout is being defined, and here there are two
12558 \begin_layout Enumerate
12559 The layout for a pre-existing inset is being modified.
12560 In this case, can be
12561 \begin_inset Flex CharStyle:Code
12564 \begin_layout Plain Layout
12570 any one of the following:
12571 \begin_inset Flex CharStyle:Code
12574 \begin_layout Plain Layout
12581 \begin_inset Flex CharStyle:Code
12584 \begin_layout Plain Layout
12591 \begin_inset Flex CharStyle:Code
12594 \begin_layout Plain Layout
12601 \begin_inset Flex CharStyle:Code
12604 \begin_layout Plain Layout
12611 \begin_inset Flex CharStyle:Code
12614 \begin_layout Plain Layout
12621 \begin_inset Flex CharStyle:Code
12624 \begin_layout Plain Layout
12631 \begin_inset Flex CharStyle:Code
12634 \begin_layout Plain Layout
12641 \begin_inset Flex CharStyle:Code
12644 \begin_layout Plain Layout
12651 \begin_inset Flex CharStyle:Code
12654 \begin_layout Plain Layout
12661 \begin_inset Flex CharStyle:Code
12664 \begin_layout Plain Layout
12671 \begin_inset Flex CharStyle:Code
12674 \begin_layout Plain Layout
12681 \begin_inset Flex CharStyle:Code
12684 \begin_layout Plain Layout
12691 \begin_inset Flex CharStyle:Code
12694 \begin_layout Plain Layout
12701 \begin_inset Flex CharStyle:Code
12704 \begin_layout Plain Layout
12711 \begin_inset Flex CharStyle:Code
12714 \begin_layout Plain Layout
12721 \begin_inset Flex CharStyle:Code
12724 \begin_layout Plain Layout
12731 \begin_inset Flex CharStyle:Code
12734 \begin_layout Plain Layout
12741 \begin_inset Flex CharStyle:Code
12744 \begin_layout Plain Layout
12751 \begin_inset Flex CharStyle:Code
12754 \begin_layout Plain Layout
12761 \begin_inset Flex CharStyle:Code
12764 \begin_layout Plain Layout
12773 \begin_layout Enumerate
12774 The layout for a Flex inset is being defined.
12776 \begin_inset Flex CharStyle:Code
12779 \begin_layout Plain Layout
12785 can be any valid identifier not used by a pre-existing inset.
12786 Note that the definition of a flex inset must
12791 \begin_inset Flex CharStyle:Code
12794 \begin_layout Plain Layout
12803 \begin_layout Standard
12805 \begin_inset Flex CharStyle:Code
12808 \begin_layout Plain Layout
12814 definition can contain the following entries:
12817 \begin_layout Description
12818 \begin_inset Flex CharStyle:Code
12821 \begin_layout Plain Layout
12827 The color for the inset's background.
12828 The valid colors are defined in
12829 \begin_inset Flex CharStyle:Code
12832 \begin_layout Plain Layout
12841 \begin_layout Description
12842 \begin_inset Flex CharStyle:Code
12845 \begin_layout Plain Layout
12851 As with paragraph styles (see page
12852 \begin_inset CommandInset ref
12854 reference "des:CopyStyle"
12861 \begin_layout Description
12862 \begin_inset Flex CharStyle:Code
12865 \begin_layout Plain Layout
12872 \begin_inset Flex CharStyle:Code
12875 \begin_layout Plain Layout
12884 \begin_inset Flex CharStyle:Code
12887 \begin_layout Plain Layout
12893 ] Indicates whether the user may employ the Paragraph Settings dialog to
12894 customize the paragraph.
12897 \begin_layout Description
12898 \begin_inset Flex CharStyle:Code
12901 \begin_layout Plain Layout
12908 \begin_inset Flex CharStyle:Code
12911 \begin_layout Plain Layout
12918 \begin_inset Flex CharStyle:Code
12921 \begin_layout Plain Layout
12928 \begin_inset Flex CharStyle:Code
12931 \begin_layout Plain Layout
12937 , describing the rendering style used for the inset's frame and buttons.
12938 Footnotes generally use
12939 \begin_inset Flex CharStyle:Code
12942 \begin_layout Plain Layout
12948 , ERT insets generally
12949 \begin_inset Flex CharStyle:Code
12952 \begin_layout Plain Layout
12958 , and character styles
12959 \begin_inset Flex CharStyle:Code
12962 \begin_layout Plain Layout
12971 \begin_layout Description
12972 \begin_inset Flex CharStyle:Code
12975 \begin_layout Plain Layout
12981 Required at the end of the InsetLayout declarations.
12984 \begin_layout Description
12985 \begin_inset Flex CharStyle:Code
12988 \begin_layout Plain Layout
12994 The font used for both the text body
13000 \begin_inset space ~
13004 \begin_inset CommandInset ref
13006 reference "sub:Font-description"
13011 Note that defining this font automatically defines the
13012 \begin_inset Flex CharStyle:Code
13015 \begin_layout Plain Layout
13021 to the same value, so define this first and define
13022 \begin_inset Flex CharStyle:Code
13025 \begin_layout Plain Layout
13031 later if you want them to be different.
13034 \begin_layout Description
13035 \begin_inset Flex CharStyle:Code
13038 \begin_layout Plain Layout
13045 \begin_inset Quotes eld
13049 \begin_inset Quotes erd
13052 language, leading to Left-to-Right (latin) output, e.
13053 \begin_inset space \thinspace{}
13057 \begin_inset space \space{}
13060 in TeX code or URL.
13064 \begin_layout Description
13065 \begin_inset Flex CharStyle:Code
13068 \begin_layout Plain Layout
13075 \begin_inset Flex CharStyle:Code
13078 \begin_layout Plain Layout
13087 \begin_inset Flex CharStyle:Code
13090 \begin_layout Plain Layout
13096 ] Indicates whether the PlainLayout should be used or, instead, the user
13097 can change the paragraph style used in the inset.
13100 \begin_layout Description
13101 \begin_inset Flex CharStyle:Code
13104 \begin_layout Plain Layout
13110 As with paragraph styles (see page
13111 \begin_inset CommandInset ref
13112 LatexCommand pageref
13113 reference "des:FreeSpacing"
13120 \begin_layout Description
13121 \begin_inset Flex CharStyle:Code
13124 \begin_layout Plain Layout
13131 \begin_inset Flex CharStyle:Code
13134 \begin_layout Plain Layout
13143 \begin_inset Flex CharStyle:Code
13146 \begin_layout Plain Layout
13152 ] Whether to include the contents of this inset in the strings generated
13153 for the `Outline' pane.
13154 One would not, for example, want the content of a footnote in a section
13155 header to be included in the TOC displayed in the outline, but one would
13156 normally want the content of a character style displayed.
13157 Default is false: not to include.
13160 \begin_layout Description
13161 \begin_inset Flex CharStyle:Code
13164 \begin_layout Plain Layout
13170 As with paragraph styles (see page
13171 \begin_inset CommandInset ref
13172 LatexCommand pageref
13173 reference "des:KeepEmpty"
13180 \begin_layout Description
13181 \begin_inset Flex CharStyle:Code
13184 \begin_layout Plain Layout
13190 The font used for the label.
13192 \begin_inset space ~
13196 \begin_inset CommandInset ref
13198 reference "sub:Font-description"
13203 Note that this definition can never appear before
13204 \begin_inset Flex CharStyle:Code
13207 \begin_layout Plain Layout
13213 , lest it be ineffective.
13216 \begin_layout Description
13217 \begin_inset Flex CharStyle:Code
13220 \begin_layout Plain Layout
13226 What will be displayed on the button or elsewhere as the inset label.
13227 Some inset types (TeX code and Branch) modify this label on the fly.
13230 \begin_layout Description
13231 \begin_inset Flex CharStyle:Code
13234 \begin_layout Plain Layout
13240 The name of the corresponding LaTeX stuff.
13241 Either the environment or command name.
13244 \begin_layout Description
13245 \begin_inset Flex CharStyle:Code
13248 \begin_layout Plain Layout
13254 The optional parameter for the corresponding
13255 \begin_inset Flex CharStyle:Code
13258 \begin_layout Plain Layout
13264 stuff, including possible bracket pairs like
13265 \begin_inset Flex CharStyle:Code
13268 \begin_layout Plain Layout
13275 This parameter cannot be changed from within LyX.
13278 \begin_layout Description
13279 \begin_inset Flex CharStyle:Code
13282 \begin_layout Plain Layout
13288 As with paragraph styles (see page
13289 \begin_inset CommandInset ref
13290 LatexCommand pageref
13291 reference "des:LatexType"
13298 \begin_layout Description
13299 \begin_inset Flex CharStyle:Code
13302 \begin_layout Plain Layout
13309 \begin_inset Flex CharStyle:Code
13312 \begin_layout Plain Layout
13319 \begin_inset Flex CharStyle:Code
13322 \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
13348 (indicating a dummy definition ending definitions of charstyles, etc).
13349 This entry is required in and is only meaningful for Flex insets.
13350 Among other things, it determines on which menu this inset will appear.
13353 \begin_layout Description
13354 \begin_inset Flex CharStyle:Code
13357 \begin_layout Plain Layout
13364 \begin_inset Flex CharStyle:Code
13367 \begin_layout Plain Layout
13376 \begin_inset Flex CharStyle:Code
13379 \begin_layout Plain Layout
13385 ] Whether multiple paragraphs are permitted in this inset.
13386 This will also set CustomPars to the same value and ForcePlain to the opposite
13388 These can be reset to other values, if they are used
13395 \begin_layout Description
13396 \begin_inset Flex CharStyle:Code
13399 \begin_layout Plain Layout
13406 \begin_inset Flex CharStyle:Code
13409 \begin_layout Plain Layout
13418 \begin_inset Flex CharStyle:Code
13421 \begin_layout Plain Layout
13427 ] Whether fragile commands in this layout should be
13428 \begin_inset Flex CharStyle:Code
13431 \begin_layout Plain Layout
13444 whether the command should itself be protected.)
13447 \begin_layout Description
13448 \begin_inset Flex CharStyle:Code
13451 \begin_layout Plain Layout
13458 \begin_inset Flex CharStyle:Code
13461 \begin_layout Plain Layout
13470 \begin_inset Flex CharStyle:Code
13473 \begin_layout Plain Layout
13479 ] As with paragraph styles (see page
13480 \begin_inset CommandInset ref
13482 reference "des:PathThru"
13489 \begin_layout Description
13490 \begin_inset Flex CharStyle:Code
13493 \begin_layout Plain Layout
13499 As with paragraph styles (see page
13500 \begin_inset CommandInset ref
13501 LatexCommand pageref
13502 reference "des:Preamble"
13509 \begin_layout Description
13510 \begin_inset Flex CharStyle:Code
13513 \begin_layout Plain Layout
13520 \begin_inset Flex CharStyle:Code
13523 \begin_layout Plain Layout
13529 ] As with paragraph styles (see page
13530 \begin_inset CommandInset ref
13531 LatexCommand pageref
13532 reference "des:Requires"
13539 \begin_layout Subsection
13541 \begin_inset CommandInset label
13543 name "sub:Counters"
13550 \begin_layout Standard
13551 Since version 1.3.0 of LyX, it is both possible and necessary to define the
13553 \begin_inset Flex CharStyle:MenuItem
13556 \begin_layout Plain Layout
13563 \begin_inset Flex CharStyle:MenuItem
13566 \begin_layout Plain Layout
13572 , \SpecialChar \ldots{}
13573 ) in the text class itself.
13574 The standard counters are defined in the file
13575 \begin_inset Flex CharStyle:Code
13578 \begin_layout Plain Layout
13584 , so you may have to do no more than add
13587 \begin_layout LyX-Code
13588 Input stdcounters.inc
13591 \begin_layout Standard
13592 to your layout file to get them to work.
13593 But if you want to define custom counters, then you can do so.
13594 The counter declaration must begin with:
13597 \begin_layout LyX-Code
13598 Counter CounterName
13601 \begin_layout Standard
13603 \begin_inset Flex CharStyle:Code
13606 \begin_layout Plain Layout
13612 ' is replaced by the name of the counter.
13613 And it must end with
13614 \begin_inset Quotes eld
13618 \begin_inset Flex CharStyle:Code
13621 \begin_layout Plain Layout
13628 \begin_inset Quotes erd
13632 The following parameters can also be used:
13635 \begin_layout Description
13636 \begin_inset Flex CharStyle:Code
13639 \begin_layout Plain Layout
13640 LabelString [string=""]
13645 when this is defined, this string defines how the counter is displayed.
13646 Setting this value sets
13647 \begin_inset Flex CharStyle:Code
13650 \begin_layout Plain Layout
13651 LabelStringAppendix
13657 The following special constructs can be used in the string:
13661 \begin_layout Itemize
13662 \begin_inset Flex CharStyle:Code
13665 \begin_layout Plain Layout
13673 will be replaced by the expansion of the
13674 \begin_inset Flex CharStyle:Code
13677 \begin_layout Plain Layout
13684 \begin_inset Flex CharStyle:Code
13687 \begin_layout Plain Layout
13688 LabelStringAppendix
13694 \begin_inset Flex CharStyle:Code
13697 \begin_layout Plain Layout
13707 \begin_layout Itemize
13708 counter values can be expressed using LaTeX-like macros
13709 \begin_inset Flex CharStyle:Code
13712 \begin_layout Plain Layout
13729 \begin_inset Flex CharStyle:Code
13732 \begin_layout Plain Layout
13744 \begin_layout Plain Layout
13754 Actually, the situation is a bit more complicated: any
13773 other than those described below will produce arabic numerals.
13774 It would not be surprising to see this change in the future.
13780 \begin_inset Flex CharStyle:Code
13783 \begin_layout Plain Layout
13789 : 1, 2, 3,\SpecialChar \ldots{}
13791 \begin_inset Flex CharStyle:Code
13794 \begin_layout Plain Layout
13800 for lower-case letters: a, b, c, \SpecialChar \ldots{}
13802 \begin_inset Flex CharStyle:Code
13805 \begin_layout Plain Layout
13811 for upper-case letters: A, B, C, \SpecialChar \ldots{}
13813 \begin_inset Flex CharStyle:Code
13816 \begin_layout Plain Layout
13822 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
13824 \begin_inset Flex CharStyle:Code
13827 \begin_layout Plain Layout
13833 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
13835 \begin_inset Flex CharStyle:Code
13838 \begin_layout Plain Layout
13844 for hebrew numerals.
13848 \begin_layout Standard
13849 If LabelString is not defined, a default value is constructed as follows:
13850 if the counter has a master counter
13851 \begin_inset Flex CharStyle:Code
13854 \begin_layout Plain Layout
13861 \begin_inset Flex CharStyle:Code
13864 \begin_layout Plain Layout
13871 \begin_inset Flex CharStyle:Code
13874 \begin_layout Plain Layout
13884 is used; otherwise the string
13885 \begin_inset Flex CharStyle:Code
13888 \begin_layout Plain Layout
13899 \begin_layout Description
13900 \begin_inset Flex CharStyle:Code
13903 \begin_layout Plain Layout
13904 LabelStringAppendix [string=""]
13910 \begin_inset Flex CharStyle:Code
13913 \begin_layout Plain Layout
13919 , but for use in the Appendix.
13922 \begin_layout Description
13923 \begin_inset Flex CharStyle:Code
13926 \begin_layout Plain Layout
13933 \begin_inset Flex CharStyle:Code
13936 \begin_layout Plain Layout
13943 \begin_inset Quotes erd
13947 \begin_inset Quotes erd
13950 ] If this is set to the name of another counter, the present counter will
13951 be reset every time the other one is increased.
13953 \begin_inset Flex CharStyle:Code
13956 \begin_layout Plain Layout
13963 \begin_inset Flex CharStyle:Code
13966 \begin_layout Plain Layout
13975 \begin_layout Subsection
13977 \begin_inset CommandInset label
13979 name "sub:Font-description"
13986 \begin_layout Standard
13987 A font description looks like this:
13990 \begin_layout LyX-Code
14000 \begin_layout LyX-Code
14004 \begin_layout LyX-Code
14008 \begin_layout Standard
14009 The following commands are available:
14012 \begin_layout Description
14013 \begin_inset Flex CharStyle:Code
14016 \begin_layout Plain Layout
14023 \begin_inset Flex CharStyle:Code
14026 \begin_layout Plain Layout
14035 \begin_inset Flex CharStyle:Code
14038 \begin_layout Plain Layout
14045 \begin_inset Flex CharStyle:Code
14048 \begin_layout Plain Layout
14055 \begin_inset Flex CharStyle:Code
14058 \begin_layout Plain Layout
14065 \begin_inset Flex CharStyle:Code
14068 \begin_layout Plain Layout
14075 \begin_inset Flex CharStyle:Code
14078 \begin_layout Plain Layout
14085 \begin_inset Flex CharStyle:Code
14088 \begin_layout Plain Layout
14095 \begin_inset Flex CharStyle:Code
14098 \begin_layout Plain Layout
14105 \begin_inset Flex CharStyle:Code
14108 \begin_layout Plain Layout
14117 \begin_layout Description
14118 \begin_inset Flex CharStyle:Code
14121 \begin_layout Plain Layout
14130 \begin_inset Flex CharStyle:Code
14133 \begin_layout Plain Layout
14144 \begin_inset Flex CharStyle:Code
14147 \begin_layout Plain Layout
14154 \begin_inset Flex CharStyle:Code
14157 \begin_layout Plain Layout
14166 \begin_layout Description
14167 \begin_inset Flex CharStyle:Code
14170 \begin_layout Plain Layout
14177 \begin_inset Flex CharStyle:Code
14180 \begin_layout Plain Layout
14186 ] Valid arguments are:
14187 \begin_inset Flex CharStyle:Code
14190 \begin_layout Plain Layout
14197 \begin_inset Flex CharStyle:Code
14200 \begin_layout Plain Layout
14207 \begin_inset Flex CharStyle:Code
14210 \begin_layout Plain Layout
14217 \begin_inset Flex CharStyle:Code
14220 \begin_layout Plain Layout
14227 \begin_inset Flex CharStyle:Code
14230 \begin_layout Plain Layout
14237 \begin_inset Flex CharStyle:Code
14240 \begin_layout Plain Layout
14247 Each of these turns on or off the corresponding attribute.
14249 \begin_inset Flex CharStyle:Code
14252 \begin_layout Plain Layout
14258 turns on emphasis, and
14259 \begin_inset Flex CharStyle:Code
14262 \begin_layout Plain Layout
14270 \begin_inset Newline newline
14273 If the latter seems puzzling, remember that the font settings for the present
14274 context are generally inherited from the surrounding context.
14276 \begin_inset Flex CharStyle:Code
14279 \begin_layout Plain Layout
14285 would turn off the emphasis that was anyway in effect, say, in a theorem
14289 \begin_layout Description
14290 \begin_inset Flex CharStyle:Code
14293 \begin_layout Plain Layout
14302 \begin_inset Flex CharStyle:Code
14305 \begin_layout Plain Layout
14316 \begin_inset Flex CharStyle:Code
14319 \begin_layout Plain Layout
14328 \begin_layout Description
14329 \begin_inset Flex CharStyle:Code
14332 \begin_layout Plain Layout
14341 \begin_inset Flex CharStyle:Code
14344 \begin_layout Plain Layout
14355 \begin_inset Flex CharStyle:Code
14358 \begin_layout Plain Layout
14365 \begin_inset Flex CharStyle:Code
14368 \begin_layout Plain Layout
14375 \begin_inset Flex CharStyle:Code
14378 \begin_layout Plain Layout
14387 \begin_layout Description
14388 \begin_inset Flex CharStyle:Code
14391 \begin_layout Plain Layout
14398 \begin_inset Flex CharStyle:Code
14401 \begin_layout Plain Layout
14408 \begin_inset Flex CharStyle:Code
14411 \begin_layout Plain Layout
14418 \begin_inset Flex CharStyle:Code
14421 \begin_layout Plain Layout
14430 \begin_inset Flex CharStyle:Code
14433 \begin_layout Plain Layout
14440 \begin_inset Flex CharStyle:Code
14443 \begin_layout Plain Layout
14450 \begin_inset Flex CharStyle:Code
14453 \begin_layout Plain Layout
14460 \begin_inset Flex CharStyle:Code
14463 \begin_layout Plain Layout
14470 \begin_inset Flex CharStyle:Code
14473 \begin_layout Plain Layout
14482 \begin_layout Subsection
14483 Upgrading old layout files
14486 \begin_layout Standard
14487 The file format of layout files changes from time to time, so old layout
14488 files need to be converted.
14489 This process has been automated since LyX 1.4.0: If LyX reads an old format
14490 layout file it will call the conversion tool
14491 \begin_inset Flex CharStyle:Code
14494 \begin_layout Plain Layout
14495 LyXDir/scripts/layout2layout.py
14500 and convert it to a temporary file in current format.
14501 The original file is left untouched.
14502 If you want to convert the layout file permanently, just call the converter
14506 \begin_layout LyX-Code
14507 python $LyXDir/scripts/layout2layout.py myclass.layout myclassnew.layout
14510 \begin_layout Standard
14511 (You need to replace
14512 \begin_inset Flex CharStyle:Code
14515 \begin_layout Plain Layout
14521 with the name of your LyX system directory, unless you happen to have defined
14522 such an environment variable.) Then copy
14523 \begin_inset Flex CharStyle:Code
14526 \begin_layout Plain Layout
14533 \begin_inset Flex CharStyle:Code
14536 \begin_layout Plain Layout
14545 \begin_layout Standard
14546 The automatic conversion only handles syntax changes.
14547 It cannot handle the case where the contents of included files was changed,
14548 so these will have to be converted separately.
14551 \begin_layout Section
14553 \begin_inset CommandInset label
14555 name "sec:Creating-Templates"
14562 \begin_layout Standard
14563 Templates are created just like usual documents.
14564 The only difference is that usual documents contain all possible settings,
14565 including the font scheme and the paper size.
14566 Usually a user doesn't want a template to overwrite his defaults in these
14568 For that reason, the designer of a template should remove the corresponding
14570 \begin_inset Flex CharStyle:Code
14573 \begin_layout Plain Layout
14582 \begin_inset Flex CharStyle:Code
14585 \begin_layout Plain Layout
14593 from the template LyX file.
14594 This can be done with any simple text-editor, for example
14595 \begin_inset Flex CharStyle:Code
14598 \begin_layout Plain Layout
14605 \begin_inset Flex CharStyle:Code
14608 \begin_layout Plain Layout
14618 \begin_layout Standard
14619 Put the edited template files you create in
14620 \begin_inset Flex CharStyle:Code
14623 \begin_layout Plain Layout
14629 , copy the ones you use from the global template directory in
14630 \begin_inset Flex CharStyle:Code
14633 \begin_layout Plain Layout
14639 to the same place, and redefine the template path in the
14640 \begin_inset Flex CharStyle:MenuItem
14643 \begin_layout Plain Layout
14644 Tools\SpecialChar \menuseparator
14645 Preferences\SpecialChar \menuseparator
14654 \begin_layout Standard
14655 Note that there is a template which has a particular meaning:
14656 \begin_inset Flex CharStyle:Code
14659 \begin_layout Plain Layout
14666 This template is loaded every time you create a new document with
14667 \begin_inset Flex CharStyle:MenuItem
14670 \begin_layout Plain Layout
14671 File\SpecialChar \menuseparator
14677 in order to provide useful defaults.
14678 To create this template from inside LyX, all you have to do is to open
14679 a document with the correct settings, and use the
14680 \begin_inset Flex CharStyle:MenuItem
14683 \begin_layout Plain Layout
14684 Save as Document Defaults
14692 \begin_layout Chapter
14693 Including External Material
14696 \begin_layout Standard
14697 \begin_inset Box Shadowbox
14706 height_special "totalheight"
14709 \begin_layout Plain Layout
14710 WARNING: This portion of the documentation has not been updated for some
14712 We certainly hope that it is still accurate, but there are no guarantees.
14720 \begin_layout Standard
14721 The use of material from sources external to LyX is covered in detail in
14727 This part of the manual covers what needs to happen behind the scenes for
14728 new sorts of material to be included.
14731 \begin_layout Section
14735 \begin_layout Standard
14736 The external material feature is based on the concept of a
14741 A template is a specification of how LyX should interface with a certain
14743 As bundled, LyX comes with predefined templates for Xfig figures, various
14744 raster format images, chess diagrams, and LilyPond music notation.
14745 You can check the actual list by using the menu
14746 \begin_inset Flex CharStyle:MenuItem
14749 \begin_layout Plain Layout
14750 Insert\SpecialChar \menuseparator
14751 File\SpecialChar \menuseparator
14758 Furthermore, it is possible to roll your own template to support a specific
14760 Later we'll describe in more detail what is involved, and hopefully you
14761 will submit all the templates you create so we can include them in a later
14765 \begin_layout Standard
14766 Another basic idea of the external material feature is to distinguish between
14767 the original file that serves as a base for final material and the produced
14768 file that is included in your exported or printed document.
14769 For example, consider the case of a figure produced with
14770 \begin_inset Flex CharStyle:Code
14773 \begin_layout Plain Layout
14780 The Xfig application itself works on an original file with the
14781 \begin_inset Flex CharStyle:Code
14784 \begin_layout Plain Layout
14791 Within Xfig, you create and change your figure, and when you are done,
14793 \begin_inset Flex CharStyle:Code
14796 \begin_layout Plain Layout
14803 When you want to include the figure in your document, you invoke
14804 \begin_inset Flex CharStyle:Code
14807 \begin_layout Plain Layout
14813 in order to create a PostScript file that can readily be included in your
14816 \begin_inset Flex CharStyle:Code
14819 \begin_layout Plain Layout
14825 file is the original file, and the PostScript file is the produced file.
14828 \begin_layout Standard
14829 This distinction is important in order to allow updating of the material
14830 while you are in the process of writing the document.
14831 Furthermore, it provides us with the flexibility that is needed to support
14832 multiple export formats.
14833 For instance, in the case of a plain text file, it is not exactly an award-winn
14834 ing idea to include the figure as raw PostScript.
14835 Instead, you'd either prefer to just include a reference to the figure
14836 or try to invoke some graphics to ASCII converter to make the final result
14837 look similar to the real graphics.
14838 The external material management allows you to do this, because it is parametri
14839 zed on the different export formats that LyX supports.
14842 \begin_layout Standard
14843 Besides supporting the production of different products according to the
14844 exported format, it supports tight integration with editing and viewing
14846 In the case of an Xfig figure, you are able to invoke Xfig on the original
14847 file with a single click from within the external material dialog in LyX,
14848 and also preview the produced PostScript file with Ghostview with another
14850 No more fiddling around with the command line and/or file browsers to locate
14851 and manipulate the original or produced files.
14852 In this way, you are finally able to take full advantage of the many different
14853 applications that are relevant to use when you write your documents, and
14854 ultimately be more productive.
14857 \begin_layout Section
14858 The external template configuration file
14861 \begin_layout Standard
14862 It is relatively easy to add custom external template definitions to LyX.
14863 However, be aware that doing this in an careless manner most probably
14867 introduce an easily exploitable security hole.
14868 So before you do this, please read the discussion about security in section
14870 \begin_inset CommandInset ref
14872 reference "sec:Security-discussion"
14879 \begin_layout Standard
14880 Having said that, we encourage you to submit any interesting templates that
14885 \begin_layout Standard
14886 The external templates are defined in the
14887 \begin_inset Flex CharStyle:Code
14890 \begin_layout Plain Layout
14891 LyXDir/lib/external_templates
14897 You can place your own version in
14898 \begin_inset Flex CharStyle:Code
14901 \begin_layout Plain Layout
14902 UserDir/external_templates
14910 \begin_layout Standard
14911 A typical template looks like this:
14914 \begin_layout LyX-Code
14918 \begin_layout LyX-Code
14919 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
14922 \begin_layout LyX-Code
14926 \begin_layout LyX-Code
14930 \begin_layout LyX-Code
14934 \begin_layout LyX-Code
14938 \begin_layout LyX-Code
14942 \begin_layout LyX-Code
14943 AutomaticProduction true
14946 \begin_layout LyX-Code
14950 \begin_layout LyX-Code
14954 \begin_layout LyX-Code
14958 \begin_layout LyX-Code
14959 TransformCommand Rotate RotationLatexCommand
14962 \begin_layout LyX-Code
14963 TransformCommand Resize ResizeLatexCommand
14966 \begin_layout LyX-Code
14967 Product "$$RotateFront$$ResizeFront
14970 \begin_layout LyX-Code
14975 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
14978 \begin_layout LyX-Code
14979 $$ResizeBack$$RotateBack"
14982 \begin_layout LyX-Code
14986 \begin_layout LyX-Code
14987 UpdateResult "$$AbsPath$$Basename.pstex_t"
14990 \begin_layout LyX-Code
14991 Requirement "graphicx"
14994 \begin_layout LyX-Code
14995 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
14998 \begin_layout LyX-Code
14999 ReferencedFile latex "$$AbsPath$$Basename.eps"
15002 \begin_layout LyX-Code
15003 ReferencedFile dvi "$$AbsPath$$Basename.eps"
15006 \begin_layout LyX-Code
15010 \begin_layout LyX-Code
15014 \begin_layout LyX-Code
15015 TransformCommand Rotate RotationLatexCommand
15018 \begin_layout LyX-Code
15019 TransformCommand Resize ResizeLatexCommand
15022 \begin_layout LyX-Code
15023 Product "$$RotateFront$$ResizeFront
15026 \begin_layout LyX-Code
15031 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
15034 \begin_layout LyX-Code
15035 $$ResizeBack$$RotateBack"
15038 \begin_layout LyX-Code
15039 UpdateFormat pdftex
15042 \begin_layout LyX-Code
15043 UpdateResult "$$AbsPath$$Basename.pdftex_t"
15046 \begin_layout LyX-Code
15047 Requirement "graphicx"
15050 \begin_layout LyX-Code
15051 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
15054 \begin_layout LyX-Code
15055 ReferencedFile latex "$$AbsPath$$Basename.pdf"
15058 \begin_layout LyX-Code
15062 \begin_layout LyX-Code
15066 \begin_layout LyX-Code
15067 Product "$$Contents(
15069 "$$AbsPath$$Basename.asc
15074 \begin_layout LyX-Code
15075 UpdateFormat asciixfig
15078 \begin_layout LyX-Code
15079 UpdateResult "$$AbsPath$$Basename.asc"
15082 \begin_layout LyX-Code
15086 \begin_layout LyX-Code
15090 \begin_layout LyX-Code
15091 Product "<graphic fileref=
15093 "$$AbsOrRelPathMaster$$Basename.eps
15098 \begin_layout LyX-Code
15102 \begin_layout LyX-Code
15106 \begin_layout LyX-Code
15107 UpdateResult "$$AbsPath$$Basename.eps"
15110 \begin_layout LyX-Code
15111 ReferencedFile docbook "$$AbsPath$$Basename.eps"
15114 \begin_layout LyX-Code
15115 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
15118 \begin_layout LyX-Code
15122 \begin_layout LyX-Code
15123 Product "[XFig: $$FName]"
15126 \begin_layout LyX-Code
15130 \begin_layout LyX-Code
15134 \begin_layout Standard
15135 As you can see, the template is enclosed in
15136 \begin_inset Flex CharStyle:Code
15139 \begin_layout Plain Layout
15145 \SpecialChar \ldots{}
15147 \begin_inset Flex CharStyle:Code
15150 \begin_layout Plain Layout
15157 It contains a header specifying some general settings and, for each supported
15158 primary document file format, a section
15159 \begin_inset Flex CharStyle:Code
15162 \begin_layout Plain Layout
15168 \SpecialChar \ldots{}
15170 \begin_inset Flex CharStyle:Code
15173 \begin_layout Plain Layout
15182 \begin_layout Subsection
15183 The template header
15186 \begin_layout Description
15187 \begin_inset Flex CharStyle:Code
15190 \begin_layout Plain Layout
15191 AutomaticProduction
15192 \begin_inset space ~
15200 Whether the file represented by the template must be generated by LyX.
15201 This command must occur exactly once.
15204 \begin_layout Description
15205 \begin_inset Flex CharStyle:Code
15208 \begin_layout Plain Layout
15210 \begin_inset space ~
15218 A glob pattern that is used in the file dialog to filter out the desired
15220 If there is more than one possible file extension (e.
15221 \begin_inset space \thinspace{}
15225 \begin_inset space \space{}
15229 \begin_inset Flex CharStyle:Code
15232 \begin_layout Plain Layout
15239 \begin_inset Flex CharStyle:Code
15242 \begin_layout Plain Layout
15248 ), use something like
15249 \begin_inset Flex CharStyle:Code
15252 \begin_layout Plain Layout
15259 This command must occur exactly once.
15262 \begin_layout Description
15263 \begin_inset Flex CharStyle:Code
15266 \begin_layout Plain Layout
15268 \begin_inset space ~
15276 The text that is displayed on the button.
15277 This command must occur exactly once.
15280 \begin_layout Description
15281 \begin_inset Flex CharStyle:Code
15284 \begin_layout Plain Layout
15286 \begin_inset space ~
15290 \begin_inset space ~
15298 The help text that is used in the External dialog.
15299 Provide enough information to explain to the user just what the template
15300 can provide him with.
15301 This command must occur exactly once.
15304 \begin_layout Description
15305 \begin_inset Flex CharStyle:Code
15308 \begin_layout Plain Layout
15310 \begin_inset space ~
15318 The file format of the original file.
15319 This must be the name of a format that is known to LyX (see section
15320 \begin_inset CommandInset ref
15322 reference "sec:Formats"
15328 \begin_inset Quotes eld
15332 \begin_inset Flex CharStyle:Code
15335 \begin_layout Plain Layout
15342 \begin_inset Quotes erd
15345 if the template can handle original files of more than one format.
15346 LyX will attempt to interrogate the file itself in order to deduce its
15347 format in this case.
15348 This command must occur exactly once.
15351 \begin_layout Description
15352 \begin_inset Flex CharStyle:Code
15355 \begin_layout Plain Layout
15357 \begin_inset space ~
15365 A unique name for the template.
15366 It must not contain substitution macros (see below).
15369 \begin_layout Description
15370 \begin_inset Flex CharStyle:Code
15373 \begin_layout Plain Layout
15375 \begin_inset space ~
15378 Rotate|Resize|Clip|Extra
15383 This command specifies which transformations are supported by this template.
15384 It may occur zero or more times.
15385 This command enables the corresponding tabs in the external dialog.
15387 \begin_inset Flex CharStyle:Code
15390 \begin_layout Plain Layout
15396 command must have either a corresponding
15397 \begin_inset Flex CharStyle:Code
15400 \begin_layout Plain Layout
15407 \begin_inset Flex CharStyle:Code
15410 \begin_layout Plain Layout
15417 \begin_inset Flex CharStyle:Code
15420 \begin_layout Plain Layout
15427 Otherwise the transformation will not be supported by that format.
15430 \begin_layout Subsection
15434 \begin_layout Description
15435 \begin_inset Flex CharStyle:Code
15438 \begin_layout Plain Layout
15440 \begin_inset space ~
15443 LaTeX|PDFLaTeX|PlainText|DocBook
15448 The primary document file format that this format definition is for.
15449 Not every template has a sensible representation in all document file formats.
15450 Please define nevertheless a
15451 \begin_inset Flex CharStyle:Code
15454 \begin_layout Plain Layout
15460 section for all formats.
15461 Use a dummy text when no representation is available.
15462 Then you can at least see a reference to the external material in the exported
15466 \begin_layout Description
15467 \begin_inset Flex CharStyle:Code
15470 \begin_layout Plain Layout
15472 \begin_inset space ~
15476 \begin_inset space ~
15484 This command defines an additional macro
15485 \begin_inset Flex CharStyle:Code
15488 \begin_layout Plain Layout
15494 for substitution in
15495 \begin_inset Flex CharStyle:Code
15498 \begin_layout Plain Layout
15506 \begin_inset Flex CharStyle:Code
15509 \begin_layout Plain Layout
15515 itself may contain substitution macros.
15516 The advantage over using
15517 \begin_inset Flex CharStyle:Code
15520 \begin_layout Plain Layout
15527 \begin_inset Flex CharStyle:Code
15530 \begin_layout Plain Layout
15536 is that the substituted value of
15537 \begin_inset Flex CharStyle:Code
15540 \begin_layout Plain Layout
15546 is sanitized so that it is a valid optional argument in the document format.
15547 This command may occur zero or more times.
15550 \begin_layout Description
15551 \begin_inset Flex CharStyle:Code
15554 \begin_layout Plain Layout
15556 \begin_inset space ~
15564 The text that is inserted in the exported document.
15565 This is actually the most important command and can be quite complex.
15566 This command must occur exactly once.
15569 \begin_layout Description
15570 \begin_inset Flex CharStyle:Code
15573 \begin_layout Plain Layout
15575 \begin_inset space ~
15583 This command specifies a preamble snippet that will be included in the
15585 It has to be defined using
15586 \begin_inset Flex CharStyle:Code
15589 \begin_layout Plain Layout
15595 \SpecialChar \ldots{}
15597 \begin_inset Flex CharStyle:Code
15600 \begin_layout Plain Layout
15607 This command may occur zero or more times.
15610 \begin_layout Description
15611 \begin_inset Flex CharStyle:Code
15614 \begin_layout Plain Layout
15616 \begin_inset space ~
15620 \begin_inset space ~
15628 This command denotes files that are created by the conversion process and
15629 are needed for a particular export format.
15630 If the filename is relative, it is interpreted relative to the master document.
15631 This command may be given zero or more times.
15634 \begin_layout Description
15635 \begin_inset Flex CharStyle:Code
15638 \begin_layout Plain Layout
15640 \begin_inset space ~
15648 The name of a required LaTeX package.
15649 The package is included via
15650 \begin_inset Flex CharStyle:Code
15653 \begin_layout Plain Layout
15661 in the LaTeX preamble.
15662 This command may occur zero or more times.
15665 \begin_layout Description
15666 \begin_inset Flex CharStyle:Code
15669 \begin_layout Plain Layout
15671 \begin_inset space ~
15675 \begin_inset space ~
15678 RotationLatexCommand
15683 This command specifies that the built in LaTeX command should be used for
15685 This command may occur once or not at all.
15688 \begin_layout Description
15689 \begin_inset Flex CharStyle:Code
15692 \begin_layout Plain Layout
15694 \begin_inset space ~
15698 \begin_inset space ~
15706 This command specifies that the built in LaTeX command should be used for
15708 This command may occur once or not at all.
15711 \begin_layout Description
15712 \begin_inset Flex CharStyle:Code
15715 \begin_layout Plain Layout
15717 \begin_inset space ~
15721 \begin_inset space ~
15724 RotationLatexOption
15729 This command specifies that rotation is done via an optional argument.
15730 This command may occur once or not at all.
15733 \begin_layout Description
15734 \begin_inset Flex CharStyle:Code
15737 \begin_layout Plain Layout
15739 \begin_inset space ~
15743 \begin_inset space ~
15751 This command specifies that resizing is done via an optional argument.
15752 This command may occur once or not at all.
15755 \begin_layout Description
15756 \begin_inset Flex CharStyle:Code
15759 \begin_layout Plain Layout
15761 \begin_inset space ~
15765 \begin_inset space ~
15773 This command specifies that clipping is done via an optional argument.
15774 This command may occur once or not at all.
15777 \begin_layout Description
15778 \begin_inset Flex CharStyle:Code
15781 \begin_layout Plain Layout
15783 \begin_inset space ~
15787 \begin_inset space ~
15795 This command specifies that an extra optional argument is used.
15796 This command may occur once or not at all.
15799 \begin_layout Description
15800 \begin_inset Flex CharStyle:Code
15803 \begin_layout Plain Layout
15805 \begin_inset space ~
15813 The file format of the converted file.
15814 This must be the name of a format that is known to LyX (see the
15815 \begin_inset Flex CharStyle:MenuItem
15818 \begin_layout Plain Layout
15823 ools\SpecialChar \menuseparator
15828 references:Conversion
15834 This command must occur exactly once.
15837 \begin_layout Description
15838 \begin_inset Flex CharStyle:Code
15841 \begin_layout Plain Layout
15843 \begin_inset space ~
15851 The file name of the converted file.
15852 The file name must be absolute.
15853 This command must occur exactly once.
15856 \begin_layout Subsection
15857 Preamble definitions
15860 \begin_layout Standard
15861 The external template configuration file may contain additional preamble
15862 definitions enclosed by
15863 \begin_inset Flex CharStyle:Code
15866 \begin_layout Plain Layout
15872 \SpecialChar \ldots{}
15874 \begin_inset Flex CharStyle:Code
15877 \begin_layout Plain Layout
15884 They can be used by the templates in the
15885 \begin_inset Flex CharStyle:Code
15888 \begin_layout Plain Layout
15897 \begin_layout Section
15898 The substitution mechanism
15901 \begin_layout Standard
15902 When the external material facility invokes an external program, it is done
15903 on the basis of a command defined in the template configuration file.
15904 These commands can contain various macros that are expanded before execution.
15905 Execution always take place in the directory of the containing document.
15908 \begin_layout Standard
15909 Also, whenever external material is to be displayed, the name will be produced
15910 by the substitution mechanism, and most other commands in the template
15911 definition support substitution as well.
15914 \begin_layout Standard
15915 The available macros are the following:
15918 \begin_layout Description
15919 \begin_inset Flex CharStyle:Code
15922 \begin_layout Plain Layout
15923 $$AbsOrRelPathMaster
15928 The file path, absolute or relative to the master LyX document.
15931 \begin_layout Description
15932 \begin_inset Flex CharStyle:Code
15935 \begin_layout Plain Layout
15936 $$AbsOrRelPathParent
15941 The file path, absolute or relative to the LyX document.
15944 \begin_layout Description
15945 \begin_inset Flex CharStyle:Code
15948 \begin_layout Plain Layout
15954 The absolute file path.
15957 \begin_layout Description
15958 \begin_inset Flex CharStyle:Code
15961 \begin_layout Plain Layout
15967 The filename without path and without the extension.
15970 \begin_layout Description
15971 \begin_inset Flex CharStyle:Code
15974 \begin_layout Plain Layout
15976 \begin_inset Quotes eld
15980 \begin_inset Quotes erd
15988 This macro will expand to the contents of the file with the name
15989 \begin_inset Flex CharStyle:Code
15992 \begin_layout Plain Layout
16001 \begin_layout Description
16002 \begin_inset Flex CharStyle:Code
16005 \begin_layout Plain Layout
16011 The file extension (including the dot).
16014 \begin_layout Description
16015 \begin_inset Flex CharStyle:Code
16018 \begin_layout Plain Layout
16024 The filename of the file specified in the external material dialog.
16025 This is either an absolute name, or it is relative to the LyX document.
16028 \begin_layout Description
16029 \begin_inset Flex CharStyle:Code
16032 \begin_layout Plain Layout
16039 \begin_inset Flex CharStyle:Code
16042 \begin_layout Plain Layout
16048 (absolute name or relative to the LyX document).
16051 \begin_layout Description
16052 \begin_inset Flex CharStyle:Code
16055 \begin_layout Plain Layout
16061 The file path, relative to the master LyX document.
16064 \begin_layout Description
16065 \begin_inset Flex CharStyle:Code
16068 \begin_layout Plain Layout
16074 The file path, relative to the LyX document.
16077 \begin_layout Description
16078 \begin_inset Flex CharStyle:Code
16081 \begin_layout Plain Layout
16087 This macro will expand to the absolute path of the system directory.
16088 This is typically used to point to the various helper scripts that are
16092 \begin_layout Description
16093 \begin_inset Flex CharStyle:Code
16096 \begin_layout Plain Layout
16102 A name and full path to a temporary file which will be automatically deleted
16103 whenever the containing document is closed, or the external material insertion
16107 \begin_layout Standard
16108 All path macros contain a trailing directory separator, so you can construct
16110 \begin_inset space \thinspace{}
16114 \begin_inset space \space{}
16117 the absolute filename with
16118 \begin_inset Flex CharStyle:Code
16121 \begin_layout Plain Layout
16122 $$AbsPath$$Basename$$Extension
16130 \begin_layout Standard
16131 The macros above are substituted in all commands unless otherwise noted.
16133 \begin_inset Flex CharStyle:Code
16136 \begin_layout Plain Layout
16142 supports additionally the following substitutions if they are enabled by
16144 \begin_inset Flex CharStyle:Code
16147 \begin_layout Plain Layout
16154 \begin_inset Flex CharStyle:Code
16157 \begin_layout Plain Layout
16166 \begin_layout Description
16167 \begin_inset Flex CharStyle:Code
16170 \begin_layout Plain Layout
16176 The front part of the resize command.
16179 \begin_layout Description
16180 \begin_inset Flex CharStyle:Code
16183 \begin_layout Plain Layout
16189 The back part of the resize command.
16192 \begin_layout Description
16193 \begin_inset Flex CharStyle:Code
16196 \begin_layout Plain Layout
16202 The front part of the rotation command.
16205 \begin_layout Description
16206 \begin_inset Flex CharStyle:Code
16209 \begin_layout Plain Layout
16215 The back part of the rotation command.
16218 \begin_layout Standard
16219 The value string of the
16220 \begin_inset Flex CharStyle:Code
16223 \begin_layout Plain Layout
16229 command supports additionally the following substitutions if they are enabled
16231 \begin_inset Flex CharStyle:Code
16234 \begin_layout Plain Layout
16241 \begin_inset Flex CharStyle:Code
16244 \begin_layout Plain Layout
16253 \begin_layout Description
16254 \begin_inset Flex CharStyle:Code
16257 \begin_layout Plain Layout
16266 \begin_layout Description
16267 \begin_inset Flex CharStyle:Code
16270 \begin_layout Plain Layout
16279 \begin_layout Description
16280 \begin_inset Flex CharStyle:Code
16283 \begin_layout Plain Layout
16292 \begin_layout Description
16293 \begin_inset Flex CharStyle:Code
16296 \begin_layout Plain Layout
16302 The rotation option.
16305 \begin_layout Standard
16306 You may ask why there are so many path macros.
16307 There are mainly two reasons:
16310 \begin_layout Enumerate
16311 Relative and absolute file names should remain relative or absolute, respectivel
16313 Users may have reasons to prefer either form.
16314 Relative names are useful for portable documents that should work on different
16315 machines, for example.
16316 Absolute names may be required by some programs.
16319 \begin_layout Enumerate
16320 LaTeX treats relative file names differently than LyX and other programs
16321 in nested included files.
16322 For LyX, a relative file name is always relative to the document that contains
16324 For LaTeX, it is always relative to the master document.
16325 These two definitions are identical if you have only one document, but
16326 differ if you have a master document that includes part documents.
16327 That means that relative filenames must be transformed when presented to
16329 Fortunately LyX does this automatically for you if you choose the right
16333 \begin_layout Standard
16334 So which path macro should be used in new template definitions? The rule
16338 \begin_layout Itemize
16340 \begin_inset Flex CharStyle:Code
16343 \begin_layout Plain Layout
16349 if an absolute path is required.
16352 \begin_layout Itemize
16354 \begin_inset Flex CharStyle:Code
16357 \begin_layout Plain Layout
16358 $$AbsOrRelPathMaster
16363 if the substituted string is some kind of LaTeX input.
16366 \begin_layout Itemize
16368 \begin_inset Flex CharStyle:Code
16371 \begin_layout Plain Layout
16372 $$AbsOrRelPathParent
16377 in order to preserve the user's choice.
16380 \begin_layout Standard
16381 There are special cases where this rule does not work and e.
16382 \begin_inset space \thinspace{}
16386 \begin_inset space \space{}
16389 relative names are needed, but normally it will work just fine.
16390 One example for such a case is the command
16391 \begin_inset Flex CharStyle:Code
16394 \begin_layout Plain Layout
16395 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
16400 in the XFig template above: We can't use the absolute name because the
16402 \begin_inset Flex CharStyle:Code
16405 \begin_layout Plain Layout
16411 files needs the relative name in order to rewrite the file content.
16414 \begin_layout Section
16415 Security discussion
16416 \begin_inset CommandInset label
16418 name "sec:Security-discussion"
16425 \begin_layout Standard
16426 The external material feature interfaces with a lot of external programs
16427 and does so automatically, so we have to consider the security implications
16429 In particular, since you have the option of including your own filenames
16430 and/or parameter strings and those are expanded into a command, it seems
16431 that it would be possible to create a malicious document which executes
16432 arbitrary commands when a user views or prints the document.
16433 This is something we definitely want to avoid.
16436 \begin_layout Standard
16437 However, since the external program commands are specified in the template
16438 configuration file only, there are no security issues if LyX is properly
16439 configured with safe templates only.
16440 This is so because the external programs are invoked with the
16441 \begin_inset Flex CharStyle:Code
16444 \begin_layout Plain Layout
16450 -system call rather than the
16451 \begin_inset Flex CharStyle:Code
16454 \begin_layout Plain Layout
16460 system-call, so it's not possible to execute arbitrary commands from the
16461 filename or parameter section via the shell.
16464 \begin_layout Standard
16465 This also implies that you are restricted in what command strings you can
16466 use in the external material templates.
16467 In particular, pipes and redirection are not readily available.
16468 This has to be so if LyX should remain safe.
16469 If you want to use some of the shell features, you should write a safe
16470 script to do this in a controlled manner, and then invoke the script from
16471 the command string.
16475 \begin_layout Standard
16476 It is possible to design a template that interacts directly with the shell,
16477 but since this would allow a malicious user to execute arbitrary commands
16478 by writing clever filenames and/or parameters, we generally recommend that
16479 you only use safe scripts that work with the
16480 \begin_inset Flex CharStyle:Code
16483 \begin_layout Plain Layout
16489 system call in a controlled manner.
16490 Of course, for use in a controlled environment, it can be tempting to just
16491 fall back to use ordinary shell scripts.
16492 If you do so, be aware that you
16496 provide an easily exploitable security hole in your system.
16497 Of course it stands to reason that such unsafe templates will never be
16498 included in the standard LyX distribution, although we do encourage people
16499 to submit new templates in the open source tradition.
16500 But LyX as shipped from the official distribution channels will never have
16504 \begin_layout Standard
16505 Including external material provides a lot of power, and you have to be
16506 careful not to introduce security hazards with this power.
16507 A subtle error in a single line in an innocent looking script can open
16508 the door to huge security problems.
16509 So if you do not fully understand the issues, we recommend that you consult
16510 a knowledgeable security professional or the LyX development team if you
16511 have any questions about whether a given template is safe or not.
16512 And do this before you use it in an uncontrolled environment.