1 #LyX 2.0.0svn created this file. For more info see http://www.lyx.org/
7 % DO NOT ALTER THIS PREAMBLE!!!
9 % This preamble is designed to ensure that the User's Guide prints
10 % out as advertised. If you mess with this preamble,
11 % parts of the User's Guide may not print out as expected. If you
12 % have problems LaTeXing this file, please contact
13 % the documentation team
14 % email: lyx-docs@lists.lyx.org
16 \usepackage{ifpdf} % part of the hyperref bundle
17 \ifpdf % if pdflatex is used
19 % set fonts for nicer pdf view
20 \IfFileExists{lmodern.sty}
21 {\usepackage{lmodern}}{}
23 \fi % end if pdflatex is used
25 % the pages of the TOC is numbered roman
26 % and a pdf-bookmark for the TOC is added
27 \let\myTOC\tableofcontents
28 \renewcommand\tableofcontents{%
30 \pdfbookmark[1]{\contentsname}{}
34 % redefine the \LyX macro for PDF bookmarks
35 \def\LyX{\texorpdfstring{%
36 L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
39 % used for multi-column text
43 \options fleqn,liststotoc,bibtotoc,idxtotoc,BCOR7.5mm,titlepage,tablecaptionabove
44 \use_default_options false
50 InsetLayout CharStyle:MenuItem
59 \newcommand*{\menuitem}[1]{{\sffamily #1}}
67 \font_typewriter default
68 \font_default_family default
78 \pdf_title "LyX Configuration Manual"
79 \pdf_author "LyX Team"
80 \pdf_subject "LyX-documentation Customization"
81 \pdf_keywords "LyX, documentation, customization"
83 \pdf_bookmarksnumbered true
84 \pdf_bookmarksopen true
85 \pdf_bookmarksopenlevel 1
90 \pdf_pdfusetitle false
91 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true,pdfstartview=XYZ, plainpages=false, pdfpagelabels"
98 \paperorientation portrait
105 \paragraph_separation indent
107 \quotes_language english
110 \paperpagestyle headings
111 \tracking_changes false
112 \output_changes false
120 Customizing LyX: Features for the Advanced User
128 \begin_layout Plain Layout
130 If you have comments or error corrections, please send them to the LyX Documenta
132 \begin_inset CommandInset href
134 target "lyx-docs@lists.lyx.org"
141 \begin_inset Quotes eld
145 \begin_inset Quotes erd
148 in the subject header, and please cc the current maintainer of this file,
149 Richard Heck <rgheck@comcast.net>.
155 \begin_inset Newline newline
159 \begin_inset Newline newline
165 \begin_layout Standard
166 \begin_inset CommandInset toc
167 LatexCommand tableofcontents
174 \begin_layout Chapter
178 \begin_layout Standard
179 This manual covers the customization features present in LyX.
180 In it, we discuss issues like keyboard shortcuts, screen previewing options,
181 printer options, sending commands to LyX via the LyX Server, internationalizati
182 on, installing new LaTeX classes and LyX layouts, etc.
183 We can't possibly hope to touch on everything you can change—our developers
184 add new features faster than we can document them—but we will explain the
185 most common customizations and hopefully point you in the right direction
186 for some of the more obscure ones.
189 \begin_layout Standard
190 \begin_inset Branch OutDated
193 \begin_layout Standard
194 Information from previous versions of this document that now seems to be
195 outdated is contained in the OutDated branch of this document.
196 By default, this information will not appear in the LaTeX output.
204 \begin_layout Chapter
205 LyX configuration files
208 \begin_layout Standard
209 This chapter aims to help you to find your way through the LyX configuration
211 Before continuing to read this chapter, you should find out where your
212 LyX library and user directories are by using
213 \begin_inset Flex CharStyle:MenuItem
216 \begin_layout Plain Layout
217 Help\SpecialChar \menuseparator
228 The library directory is the place where LyX places its system-wide configurati
229 on files; the user directory is where you can place your modified versions.
230 We will call the former
231 \begin_inset Flex CharStyle:Code
234 \begin_layout Plain Layout
241 \begin_inset Flex CharStyle:MenuItem
244 \begin_layout Plain Layout
250 in the remainder of this document.
254 \begin_layout Section
256 \begin_inset Flex CharStyle:Code
259 \begin_layout Plain Layout
268 \begin_layout Standard
269 \begin_inset Flex CharStyle:Code
272 \begin_layout Plain Layout
278 and its sub-directories contain a number of files and that can be used
279 to customize LyX's behavior.
280 You can change many of these files from within LyX itself through the
281 \begin_inset Flex CharStyle:MenuItem
284 \begin_layout Plain Layout
285 Tools\SpecialChar \menuseparator
292 Most customization that you will want to do in LyX is possible through
294 However, many other inner aspects of LyX can be customized by modifying
296 \begin_inset Flex CharStyle:Code
299 \begin_layout Plain Layout
306 These files fall in different categories, described in the following subsection
310 \begin_layout Subsection
311 Automatically generated files
314 \begin_layout Standard
315 The files, which are to be found in
316 \begin_inset Flex CharStyle:MenuItem
319 \begin_layout Plain Layout
325 , are generated when you configure LyX.
326 They contain various default values that are guessed by inspection.
327 In general, it is not a good idea to modify them, since they might be overwritt
331 \begin_layout Labeling
332 \labelwidthstring 00.00.0000
333 \begin_inset Flex CharStyle:Code
336 \begin_layout Plain Layout
342 contains defaults for various commands.
345 \begin_layout Labeling
346 \labelwidthstring 00.00.0000
347 \begin_inset Flex CharStyle:Code
350 \begin_layout Plain Layout
356 contains the list of packages that have been recognized by LyX.
357 It is currently unused by the LyX program itself, but the information extracted
358 , and more, is made available with
359 \begin_inset Flex CharStyle:MenuItem
362 \begin_layout Plain Layout
363 Help\SpecialChar \menuseparator
376 \begin_layout Labeling
377 \labelwidthstring 00.00.0000
378 \begin_inset Flex CharStyle:Code
381 \begin_layout Plain Layout
387 the list of text classes that have been found in your
388 \begin_inset Flex CharStyle:Code
391 \begin_layout Plain Layout
397 directories, along with the associated LaTeX document class and their descripti
401 \begin_layout Labeling
402 \labelwidthstring 00.00.0000
403 \begin_inset Flex CharStyle:Code
406 \begin_layout Plain Layout
412 the list of layout modules found in your
413 \begin_inset Flex CharStyle:Code
416 \begin_layout Plain Layout
425 \begin_layout Labeling
426 \labelwidthstring 00.00.0000
427 \begin_inset Flex CharStyle:Code
430 \begin_layout Plain Layout
436 lists of various sorts of LaTeX-related files found on your system
439 \begin_layout Labeling
440 \labelwidthstring 00.00.0000
441 \begin_inset Flex CharStyle:Code
444 \begin_layout Plain Layout
450 is automatically generated during configuration from the file
451 \begin_inset Flex CharStyle:Code
454 \begin_layout Plain Layout
461 It contains information on your LaTeX configuration.
464 \begin_layout Subsection
468 \begin_layout Standard
469 These directories are duplicated between
470 \begin_inset Flex CharStyle:Code
473 \begin_layout Plain Layout
480 \begin_inset Flex CharStyle:Code
483 \begin_layout Plain Layout
490 If a particular files exists in both places, the one in
491 \begin_inset Flex CharStyle:Code
494 \begin_layout Plain Layout
503 \begin_layout Labeling
504 \labelwidthstring 00.00.0000
505 \begin_inset Flex CharStyle:Code
508 \begin_layout Plain Layout
514 this directory contains files with the extension
515 \begin_inset Flex CharStyle:Code
518 \begin_layout Plain Layout
524 that define the keybindings used in LyX.
525 If there exists an internationalized version of the bind file named
526 \begin_inset Flex CharStyle:Code
529 \begin_layout Plain Layout
535 , that will be used first.
538 \begin_layout Labeling
539 \labelwidthstring 00.00.0000
540 \begin_inset Flex CharStyle:Code
543 \begin_layout Plain Layout
549 contains graphics files that can be included in documents.
553 \begin_layout Labeling
554 \labelwidthstring 00.00.0000
555 \begin_inset Flex CharStyle:Code
558 \begin_layout Plain Layout
564 contains LyX documentation files (including the one you are currently reading).
566 \begin_inset Flex CharStyle:Code
569 \begin_layout Plain Layout
575 deserves special attention, as noted above.
576 The internationalized help docs are in subdirectories
577 \begin_inset Flex CharStyle:Code
580 \begin_layout Plain Layout
587 \begin_inset Quotes eld
591 \begin_inset Quotes erd
594 is the ISO language code.
600 \begin_inset CommandInset ref
602 reference "chap:i18n"
609 \begin_layout Labeling
610 \labelwidthstring 00.00.0000
611 \begin_inset Flex CharStyle:Code
614 \begin_layout Plain Layout
620 contains example files that explain how to use some features.
621 In the file browser, press the
622 \begin_inset Flex CharStyle:MenuItem
625 \begin_layout Plain Layout
634 \begin_layout Labeling
635 \labelwidthstring 00.00.0000
636 \begin_inset Flex CharStyle:Code
639 \begin_layout Plain Layout
645 contains image files that are used by the
646 \begin_inset Flex CharStyle:MenuItem
649 \begin_layout Plain Layout
656 In addition, it also contains the individual icons used in the toolbar
657 and the banners that can be shown when LyX is launched.
660 \begin_layout Labeling
661 \labelwidthstring 00.00.0000
662 \begin_inset Flex CharStyle:Code
665 \begin_layout Plain Layout
671 contains keyboard keymapping files.
677 \begin_inset CommandInset ref
679 reference "sec:keymap"
686 \begin_layout Labeling
687 \labelwidthstring 00.00.0000
688 \begin_inset Flex CharStyle:Code
691 \begin_layout Plain Layout
697 contains the text class and module files described in Chapter
702 \begin_inset CommandInset ref
704 reference "chap:textclass"
711 \begin_layout Labeling
712 \labelwidthstring 00.00.0000
713 \begin_inset Flex CharStyle:Code
716 \begin_layout Plain Layout
723 \begin_inset Flex CharStyle:Code
726 \begin_layout Plain Layout
732 Python scripts used to convert between LyX versions.
733 These can be run from the command line if, say, you want to batch-convert
737 \begin_layout Labeling
738 \labelwidthstring 00.00.0000
739 \begin_inset Flex CharStyle:Code
742 \begin_layout Plain Layout
748 contains some files that demonstrate the capabilities of the
749 \begin_inset Flex CharStyle:MenuItem
752 \begin_layout Plain Layout
763 Also contains some scripts used by LyX itself.
766 \begin_layout Labeling
767 \labelwidthstring 00.00.0000
768 \begin_inset Flex CharStyle:Code
771 \begin_layout Plain Layout
777 contains the standard LyX template files described in Chapter
782 \begin_inset CommandInset ref
784 reference "sec:templates"
791 \begin_layout Labeling
792 \labelwidthstring 00.00.0000
793 \begin_inset Flex CharStyle:Code
796 \begin_layout Plain Layout
802 contains files with the extension
803 \begin_inset Flex CharStyle:Code
806 \begin_layout Plain Layout
812 that define the user interface to LyX.
813 That is, the files define which items appear in which menus and the items
814 appearing on the toolbar.
817 \begin_layout Subsection
818 Files you don't want to modify
821 \begin_layout Standard
822 These files are used internally by LyX and you generally do not need to
823 modify them unless you are a developer.
826 \begin_layout Labeling
827 \labelwidthstring 00.00.0000
828 \begin_inset Flex CharStyle:Code
831 \begin_layout Plain Layout
837 this file contains the list of LyX developers.
838 The contents are displayed with the menu entry
839 \begin_inset Flex CharStyle:MenuItem
842 \begin_layout Plain Layout
843 Help\SpecialChar \menuseparator
856 \begin_layout Labeling
857 \labelwidthstring 00.00.0000
858 \begin_inset Flex CharStyle:Code
861 \begin_layout Plain Layout
867 this is a LaTeX script used during the configuration process.
871 \begin_layout Labeling
872 \labelwidthstring 00.00.0000
873 \begin_inset Flex CharStyle:Code
876 \begin_layout Plain Layout
882 this is the script that is used to re-configure LyX.
883 It creates configuration files in the directory it was run from.
886 \begin_layout Subsection
887 Other files needing a line or two...
890 \begin_layout Labeling
891 \labelwidthstring 00.00.0000
892 \begin_inset Flex CharStyle:Code
895 \begin_layout Plain Layout
901 this contains tables describing how different character encodings can be
905 \begin_layout Labeling
906 \labelwidthstring 00.00.0000
907 \begin_inset Flex CharStyle:Code
910 \begin_layout Plain Layout
916 this file contains the templates available to the new
917 \begin_inset Flex CharStyle:MenuItem
920 \begin_layout Plain Layout
933 \begin_layout Labeling
934 \labelwidthstring 00.00.0000
935 \begin_inset Flex CharStyle:Code
938 \begin_layout Plain Layout
944 this file contains a list of all the languages currently supported by LyX.
947 \begin_layout Section
948 Your local configuration directory
951 \begin_layout Standard
952 Even if you are using LyX as an unprivileged user, you might want to change
953 LyX configuration for your own use.
955 \begin_inset Flex CharStyle:Code
958 \begin_layout Plain Layout
964 directory contains all your personal configuration files.
965 This is the directory described as
966 \begin_inset Quotes eld
970 \begin_inset Quotes erd
974 \begin_inset Flex CharStyle:MenuItem
977 \begin_layout Plain Layout
978 Help\SpecialChar \menuseparator
989 This directory is used as a mirror of
990 \begin_inset Flex CharStyle:Code
993 \begin_layout Plain Layout
999 , which means that every file in
1000 \begin_inset Flex CharStyle:Code
1003 \begin_layout Plain Layout
1009 is a replacement for the corresponding file in
1010 \begin_inset Flex CharStyle:Code
1013 \begin_layout Plain Layout
1020 Any configuration file described in the above sections can be placed either
1021 in the system-wide directory, in which case it will affect all users, or
1022 in your local directory for your own use.
1025 \begin_layout Standard
1026 To make things clearer, let's provide a few examples:
1029 \begin_layout Itemize
1030 The preferences set in the
1031 \begin_inset Flex CharStyle:MenuItem
1034 \begin_layout Plain Layout
1035 Tools\SpecialChar \menuseparator
1041 dialog are saved to a file
1042 \begin_inset Flex CharStyle:Code
1045 \begin_layout Plain Layout
1052 \begin_inset Flex CharStyle:Code
1055 \begin_layout Plain Layout
1064 \begin_layout Itemize
1065 When you reconfigure using
1066 \begin_inset Flex CharStyle:MenuItem
1069 \begin_layout Plain Layout
1070 Tools\SpecialChar \menuseparator
1077 \begin_inset Flex CharStyle:Code
1080 \begin_layout Plain Layout
1086 script, and the resulting files are written in your local configuration
1088 This means that any additional text class file that you might have added
1090 \begin_inset Flex CharStyle:Code
1093 \begin_layout Plain Layout
1099 will be added to the list of classes in the
1100 \begin_inset Flex CharStyle:MenuItem
1103 \begin_layout Plain Layout
1104 Document\SpecialChar \menuseparator
1113 \begin_layout Itemize
1114 If you get some updated documentation from LyX ftp site and cannot install
1115 it because you do not have sysadmin rights on your system, you can just
1117 \begin_inset Flex CharStyle:Code
1120 \begin_layout Plain Layout
1126 and the items in the
1127 \begin_inset Flex CharStyle:MenuItem
1130 \begin_layout Plain Layout
1136 menu will open them!
1139 \begin_layout Section
1140 Running LyX with multiple configurations
1143 \begin_layout Standard
1144 The configuration freedom of the local configuration directory may not suffice
1145 if you want to have more than one configuration at your disposal.
1146 For example, you may want to be use different key bindings or printer settings
1148 You can achieve this by having several such directories.
1149 You then specify which directory to use at run-time.
1152 \begin_layout Standard
1153 Invoking LyX with the command line switch
1154 \begin_inset Flex CharStyle:Code
1157 \begin_layout Plain Layout
1167 instructs the program to read the configuration from that directory, and
1168 not from the default directory.
1169 (You can determine the default directory by running LyX without the
1170 \begin_inset Flex CharStyle:Code
1173 \begin_layout Plain Layout
1179 switch.) If the specified directory does not exist, LyX offers to create
1180 it for you, just like it does for the default directory on the first time
1181 you run the program.
1182 You can modify the configuration options in this additional user directory
1183 exactly as you would for the default directory.
1184 These directories are completely independent (but read on).
1185 Note that setting the environment variable
1186 \begin_inset Flex CharStyle:Code
1189 \begin_layout Plain Layout
1195 to some value has exactly the same effect.
1198 \begin_layout Standard
1199 Having several configurations also requires more maintenance: if you want
1200 to add a new layout to
1201 \begin_inset Flex CharStyle:Code
1204 \begin_layout Plain Layout
1210 which you want available from all your configurations, you must add it
1211 to each directory separately.
1212 You can avoid this with the following trick: after LyX creates the additional
1213 directory, most of the subdirectories (see above) are empty.
1214 If you want the new configuration to mirror an existing one, replace the
1215 empty subdirectory with a symbolic link to the matching subdirectory in
1216 the existing configuration.
1218 \begin_inset Flex CharStyle:Code
1221 \begin_layout Plain Layout
1227 subdirectory, however, since it contains a file written by the configuration
1228 script (also accessible through
1229 \begin_inset Flex CharStyle:MenuItem
1232 \begin_layout Plain Layout
1233 Tools\SpecialChar \menuseparator
1239 ) which is configuration-specific.
1242 \begin_layout Chapter
1243 The Preferences dialog
1246 \begin_layout Standard
1247 All options of the preferences dialog are described in the Appendix
1249 The Preferences Dialog
1256 For some options you might find here more details.
1259 \begin_layout Section
1260 Using the dialog for the first time
1263 \begin_layout Standard
1265 \begin_inset Flex CharStyle:Code
1268 \begin_layout Plain Layout
1274 file will contain only changes that you have made to the default behavior,
1275 some of which is hard-coded into LyX and some of which is contained in
1277 \begin_inset Flex CharStyle:Code
1280 \begin_layout Plain Layout
1281 LyXDir/lyxrc.defaults
1287 Note that in both files lines beginning with a
1288 \begin_inset Quotes eld
1292 \begin_inset Quotes erd
1295 are just comments and are not interpreted.
1296 However, only system administrators should edit
1297 \begin_inset Flex CharStyle:Code
1300 \begin_layout Plain Layout
1301 LyXDir/lyxrc.defaults
1307 Users should use the
1308 \begin_inset Flex CharStyle:MenuItem
1311 \begin_layout Plain Layout
1312 Tools\SpecialChar \menuseparator
1318 dialog to create and modify their own
1319 \begin_inset Flex CharStyle:Code
1322 \begin_layout Plain Layout
1331 \begin_layout Standard
1333 \begin_inset Flex CharStyle:MenuItem
1336 \begin_layout Plain Layout
1337 Tools\SpecialChar \menuseparator
1343 dialog will be largely self-explanatory.
1344 Most things in the dialog have associated `tool tips': hover your mouse
1345 pointer over something for more information.
1346 Before we highlight a few of the more important commands below, however,
1347 a word of warning: Applying some of your changes (e.
1348 \begin_inset space \thinspace{}
1352 \begin_inset space \space{}
1355 screen fonts) will have an instant effect.
1357 \begin_inset space \thinspace{}
1361 \begin_inset space \space{}
1364 changing the bind file) will not.
1365 If nothing appears to have changed, just
1366 \begin_inset Flex CharStyle:MenuItem
1369 \begin_layout Plain Layout
1375 the changes and restart LyX.
1378 \begin_layout Section
1382 \begin_layout Standard
1383 LyX has a powerful mechanism to convert to and from any file format using
1388 \begin_layout Subsection
1389 \begin_inset CommandInset label
1398 \begin_layout Standard
1399 The first step is to define your file formats if they are not already defined.
1401 \begin_inset Flex CharStyle:MenuItem
1404 \begin_layout Plain Layout
1405 Tools\SpecialChar \menuseparator
1413 \begin_inset Flex CharStyle:MenuItem
1416 \begin_layout Plain Layout
1417 File Handling\SpecialChar \menuseparator
1424 \begin_inset Flex CharStyle:MenuItem
1427 \begin_layout Plain Layout
1428 New\SpecialChar \ldots{}
1434 button to define your new format.
1436 \begin_inset Flex CharStyle:MenuItem
1439 \begin_layout Plain Layout
1445 field contains the named used to identify the format in the GUI.
1447 \begin_inset Flex CharStyle:MenuItem
1450 \begin_layout Plain Layout
1456 is used to identify the format internally.
1457 You will also need to enter a file extension.
1458 These are all required.
1460 \begin_inset Flex CharStyle:MenuItem
1463 \begin_layout Plain Layout
1469 field is used to provide a keyboard shortcut on the menus.
1470 (For example, pressing
1471 \begin_inset Flex CharStyle:MenuItem
1474 \begin_layout Plain Layout
1481 \begin_inset Flex CharStyle:MenuItem
1484 \begin_layout Plain Layout
1485 View\SpecialChar \menuseparator
1494 \begin_layout Standard
1496 \begin_inset Flex CharStyle:MenuItem
1499 \begin_layout Plain Layout
1506 \begin_inset Flex CharStyle:MenuItem
1509 \begin_layout Plain Layout
1516 For example, you might want to use
1517 \begin_inset Flex CharStyle:MenuItem
1520 \begin_layout Plain Layout
1526 to view PostScript files.
1527 You can enter the command needed to start the program in the corresponding
1529 In defining this command, you can use the four variables listed in the
1531 The viewer is launched when you view an image in LyX or use the
1532 \begin_inset Flex CharStyle:MenuItem
1535 \begin_layout Plain Layout
1542 The editor is for example launched when you press the
1543 \begin_inset Flex CharStyle:MenuItem
1546 \begin_layout Plain Layout
1553 \begin_inset Flex CharStyle:MenuItem
1556 \begin_layout Plain Layout
1563 \begin_inset Flex CharStyle:MenuItem
1566 \begin_layout Plain Layout
1575 \begin_layout Standard
1577 \begin_inset Flex CharStyle:MenuItem
1580 \begin_layout Plain Layout
1586 option tells LyX that a format is suitable for document export.
1587 If this is is set and if a suitable conversion route exists (see
1588 \begin_inset CommandInset ref
1590 reference "sub:Converters"
1594 ), the format will appear in the
1595 \begin_inset Flex CharStyle:MenuItem
1598 \begin_layout Plain Layout
1599 File\SpecialChar \menuseparator
1606 The format will also appear in the
1607 \begin_inset Flex CharStyle:MenuItem
1610 \begin_layout Plain Layout
1616 menu if a viewer is specified for the format.
1617 Pure image formats, such as
1618 \begin_inset Flex CharStyle:Code
1621 \begin_layout Plain Layout
1627 , should not use this option.
1628 Formats that can both represent vector graphics and documents like
1629 \begin_inset Flex CharStyle:Code
1632 \begin_layout Plain Layout
1641 \begin_layout Standard
1643 \begin_inset Flex CharStyle:MenuItem
1646 \begin_layout Plain Layout
1647 Vector graphics format
1652 tells LyX that a format can contain vector graphics.
1653 This information is used to determine the target format of included graphics
1655 \begin_inset Flex CharStyle:MenuItem
1658 \begin_layout Plain Layout
1665 Included graphics may need to be converted to either
1666 \begin_inset Flex CharStyle:MenuItem
1669 \begin_layout Plain Layout
1676 \begin_inset Flex CharStyle:MenuItem
1679 \begin_layout Plain Layout
1686 \begin_inset Flex CharStyle:MenuItem
1689 \begin_layout Plain Layout
1696 \begin_inset Flex CharStyle:MenuItem
1699 \begin_layout Plain Layout
1705 cannot handle other image formats.
1706 If an included graphic is not already in
1707 \begin_inset Flex CharStyle:MenuItem
1710 \begin_layout Plain Layout
1717 \begin_inset Flex CharStyle:MenuItem
1720 \begin_layout Plain Layout
1727 \begin_inset Flex CharStyle:MenuItem
1730 \begin_layout Plain Layout
1736 format, it is converted to
1737 \begin_inset Flex CharStyle:MenuItem
1740 \begin_layout Plain Layout
1746 if the vector format option is set, and otherwise to
1747 \begin_inset Flex CharStyle:MenuItem
1750 \begin_layout Plain Layout
1759 \begin_layout Subsection
1763 \begin_layout Standard
1764 Since all conversions from one format to another take place in LyX's temporary
1765 directory, it is sometimes necessary to modify a file before copying it
1766 to the temporary directory in order that the conversion may be performed.
1770 \begin_layout Plain Layout
1771 For example, the file may refer to other files—images, for example—using
1772 relative file names, and these may become invalid when the file is copied
1773 to the temporary directory.
1778 This is done by a Copier: It copies a file to (or from) the temporary directory
1779 and may modify it in the process.
1782 \begin_layout Standard
1783 The definitions of the copiers may use four variables:
1786 \begin_layout Labeling
1787 \labelwidthstring 00.00.0000
1788 \begin_inset Flex CharStyle:Code
1791 \begin_layout Plain Layout
1797 The LyX system directory (e.
1798 \begin_inset space \thinspace{}
1802 \begin_inset space \space{}
1806 \begin_inset Flex CharStyle:MenuItem
1809 \begin_layout Plain Layout
1818 \begin_layout Labeling
1819 \labelwidthstring 00.00.0000
1820 \begin_inset Flex CharStyle:Code
1823 \begin_layout Plain Layout
1832 \begin_layout Labeling
1833 \labelwidthstring 00.00.0000
1834 \begin_inset Flex CharStyle:Code
1837 \begin_layout Plain Layout
1846 \begin_layout Labeling
1847 \labelwidthstring 00.00.0000
1848 \begin_inset Flex CharStyle:Code
1851 \begin_layout Plain Layout
1860 \begin_layout Standard
1861 The latter should be the filename as it would be used in a LaTeX's
1868 It is relevant only when exporting files suitable for such inclusion.
1871 \begin_layout Standard
1872 Copiers can be used to do almost anything with output files.
1873 For example, suppose you want generated pdf files to be copied to a special
1875 \begin_inset Flex CharStyle:Code
1878 \begin_layout Plain Layout
1885 Then you could write a shell script such as this one:
1888 \begin_layout Standard
1889 \begin_inset listings
1893 \begin_layout Plain Layout
1898 \begin_layout Plain Layout
1903 \begin_layout Plain Layout
1905 TOFILE=`basename $2`
1908 \begin_layout Plain Layout
1910 cp $FROMFILE /home/you/pdf/$TOFILE
1915 Save that in your local LyX directory—say,
1916 \begin_inset Flex CharStyle:Code
1919 \begin_layout Plain Layout
1920 /home/you/.lyx/scripts/pdfcopier.sh
1925 —and make it executable, if you need to do so on your platform.
1927 \begin_inset Flex CharStyle:MenuItem
1930 \begin_layout Plain Layout
1931 Tools\SpecialChar \menuseparator
1937 dialog, select under
1938 \begin_inset Flex CharStyle:MenuItem
1941 \begin_layout Plain Layout
1942 File Handling\SpecialChar \menuseparator
1949 \begin_inset Flex CharStyle:MenuItem
1952 \begin_layout Plain Layout
1958 format—or one of the other pdf formats—and enter
1959 \begin_inset Flex CharStyle:Code
1962 \begin_layout Plain Layout
1963 pdfcopier.sh $$i $$o
1969 \begin_inset Flex CharStyle:MenuItem
1972 \begin_layout Plain Layout
1982 \begin_layout Standard
1983 Copiers are used by LyX in various of its own conversions.
1984 For example, if appropriate programs are found, LyX will automatically
1985 install copiers for the
1986 \begin_inset Flex CharStyle:MenuItem
1989 \begin_layout Plain Layout
1996 \begin_inset Flex CharStyle:MenuItem
1999 \begin_layout Plain Layout
2001 \begin_inset space ~
2010 When these formats are exported, the copier sees that not just the main
2011 HTML file but various associated files (style files, images, etc.) are also
2013 All these files are written to a subdirectory of the directory in which
2014 the original LyX file was found.
2018 \begin_layout Plain Layout
2019 This copier can be customized.
2021 \begin_inset Quotes eld
2025 \begin_inset Quotes erd
2028 argument takes a comma-separated list of extensions to be copied; if it
2029 is omitted, all files will be copied.
2031 \begin_inset Quotes eld
2035 \begin_inset Quotes erd
2038 argument determines the extension added to the generated directory.
2040 \begin_inset Quotes eld
2044 \begin_inset Flex CharStyle:MenuItem
2047 \begin_layout Plain Layout
2054 \begin_inset Quotes erd
2057 , so HTML generated from
2058 \begin_inset Flex CharStyle:MenuItem
2061 \begin_layout Plain Layout
2062 /path/to/filename.lyx
2068 \begin_inset Flex CharStyle:MenuItem
2071 \begin_layout Plain Layout
2072 /path/to/filename.html.LyXconv
2086 \begin_layout Subsection
2087 \begin_inset CommandInset label
2089 name "sub:Converters"
2096 \begin_layout Standard
2097 You can define your own Converters to convert files between different formats.
2099 \begin_inset Flex CharStyle:MenuItem
2102 \begin_layout Plain Layout
2103 Tools\SpecialChar \menuseparator
2104 Preferences\SpecialChar \menuseparator
2105 File Handling\SpecialChar \menuseparator
2114 \begin_layout Standard
2115 To define a new converter, select the
2116 \begin_inset Flex CharStyle:MenuItem
2119 \begin_layout Plain Layout
2121 \begin_inset space ~
2130 \begin_inset Flex CharStyle:MenuItem
2133 \begin_layout Plain Layout
2135 \begin_inset space ~
2143 from the drop-down lists, enter the command needed for the conversion,
2145 \begin_inset Flex CharStyle:MenuItem
2148 \begin_layout Plain Layout
2155 Several variables can be used in the definition of converters:
2158 \begin_layout Labeling
2159 \labelwidthstring 00.00.0000
2160 \begin_inset Flex CharStyle:Code
2163 \begin_layout Plain Layout
2169 The LyX system directory
2172 \begin_layout Labeling
2173 \labelwidthstring 00.00.0000
2174 \begin_inset Flex CharStyle:Code
2177 \begin_layout Plain Layout
2186 \begin_layout Labeling
2187 \labelwidthstring 00.00.0000
2188 \begin_inset Flex CharStyle:Code
2191 \begin_layout Plain Layout
2200 \begin_layout Labeling
2201 \labelwidthstring 00.00.0000
2202 \begin_inset Flex CharStyle:Code
2205 \begin_layout Plain Layout
2211 The base filename of the input file (i.
2212 \begin_inset space \thinspace{}
2215 g., without the extension)
2218 \begin_layout Labeling
2219 \labelwidthstring 00.00.0000
2220 \begin_inset Flex CharStyle:Code
2223 \begin_layout Plain Layout
2229 The path to the input file
2232 \begin_layout Labeling
2233 \labelwidthstring 00.00.0000
2234 \begin_inset Flex CharStyle:Code
2237 \begin_layout Plain Layout
2243 The path to the original input file (this is different from $$p when chain
2244 of converters is called).
2247 \begin_layout Standard
2249 \begin_inset Flex CharStyle:MenuItem
2252 \begin_layout Plain Layout
2254 \begin_inset space ~
2262 field you can enter the following flags, separated by commas:
2265 \begin_layout Labeling
2266 \labelwidthstring 00.00.0000
2267 \begin_inset Flex CharStyle:Code
2270 \begin_layout Plain Layout
2276 This converter runs some form of LaTeX.
2277 This will make LyX's LaTeX error logs available.
2280 \begin_layout Labeling
2281 \labelwidthstring 00.00.0000
2282 \begin_inset Flex CharStyle:Code
2285 \begin_layout Plain Layout
2292 \begin_inset Flex CharStyle:MenuItem
2295 \begin_layout Plain Layout
2301 file for the conversion.
2304 \begin_layout Labeling
2305 \labelwidthstring 00.00.0000
2306 \begin_inset Flex CharStyle:Code
2309 \begin_layout Plain Layout
2318 \begin_layout Standard
2319 The following three flags are not really flags at all because they take
2321 \begin_inset Flex CharStyle:MenuItem
2324 \begin_layout Plain Layout
2326 \begin_inset space ~
2330 \begin_inset space ~
2341 \begin_layout Labeling
2342 \labelwidthstring 00.00.0000
2343 \begin_inset Flex CharStyle:Code
2346 \begin_layout Plain Layout
2352 If set, the converter's standard error will be redirected to a file
2353 \begin_inset Flex CharStyle:Code
2356 \begin_layout Plain Layout
2362 , and the script given as argument will be run as:
2363 \begin_inset Flex CharStyle:Code
2366 \begin_layout Plain Layout
2367 script <infile.out >infile.log
2373 The argument may contain
2374 \begin_inset Flex CharStyle:Code
2377 \begin_layout Plain Layout
2386 \begin_layout Labeling
2387 \labelwidthstring 00.00.0000
2388 \begin_inset Flex CharStyle:Code
2391 \begin_layout Plain Layout
2397 The name of the directory in which the converter will dump the generated
2399 LyX will not create this directory, and it does not copy anything into
2400 it, though it will copy this directory to the destination.
2401 The argument may contain
2402 \begin_inset Flex CharStyle:Code
2405 \begin_layout Plain Layout
2411 , which will be replaced by the base name of the input and output files,
2412 respectively, when the directory is copied.
2413 \begin_inset Newline newline
2416 Note that resultdir and usetempdir make no sense together.
2417 The latter will be ignored if the former is given.
2420 \begin_layout Labeling
2421 \labelwidthstring 00.00.0000
2422 \begin_inset Flex CharStyle:Code
2425 \begin_layout Plain Layout
2431 Determines the output file name and may, contain
2432 \begin_inset Flex CharStyle:Code
2435 \begin_layout Plain Layout
2442 Sensible only with resultdir and optional even then; if not given, it defaults
2446 \begin_layout Standard
2447 None of these last three are presently used in any of the converters that
2448 are installed with LyX.
2452 \begin_layout Standard
2453 You do not have to define converters between all the formats between which
2454 you want to convert.
2455 For example, you will note that there is no `LyX to PostScript' converter,
2456 but LyX will export PostScript.
2457 It does so by first creating a LaTeX file (no converter needs to be defined
2458 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2459 and finally converting the resulting DVI file to PostScript.
2460 LyX finds such `chains' of converters automatically, and it will always
2461 choose the shortest possible chain.
2462 You can, though, still define multiple conversion methods between file
2464 For example, the standard LyX configuration provides three ways to convert
2465 LaTeX to PDF: Directly, using
2466 \begin_inset Flex CharStyle:MenuItem
2469 \begin_layout Plain Layout
2475 ; via (DVI and) PostScript, using
2476 \begin_inset Flex CharStyle:MenuItem
2479 \begin_layout Plain Layout
2486 \begin_inset Flex CharStyle:MenuItem
2489 \begin_layout Plain Layout
2496 To define such alternate chains, you must define multiple target `file
2497 formats', as described in section
2498 \begin_inset CommandInset ref
2500 reference "sub:Formats"
2505 For example, in the standard configuration, the formats named
2506 \begin_inset Flex CharStyle:MenuItem
2509 \begin_layout Plain Layout
2516 \begin_inset Flex CharStyle:MenuItem
2519 \begin_layout Plain Layout
2526 \begin_inset Flex CharStyle:MenuItem
2529 \begin_layout Plain Layout
2535 are defined, all of which share the extension
2536 \begin_inset Flex CharStyle:MenuItem
2539 \begin_layout Plain Layout
2545 , and which correspond to the conversion methods just mentioned.
2548 \begin_layout Chapter
2549 Internationalizing LyX
2550 \begin_inset CommandInset label
2559 \begin_layout Standard
2560 LyX supports using a translated interface.
2561 Last time we checked, LyX provided text in thirty languages.
2562 The language of choice is called your
2567 (For further reading on locale settings, see also the documentation for
2568 locale that comes with your operating system.
2569 For Linux, the manual page for
2570 \begin_inset Flex CharStyle:Code
2573 \begin_layout Plain Layout
2579 could be a good place to start).
2582 \begin_layout Standard
2583 Notice that these translations will work, but do contain a few flaws.
2584 In particular, all dialogs have been designed with the English text in
2585 mind, which means that some of the translated text will be too large to
2586 fit within the space allocated.
2587 This is only a display problem and will not cause any harm.
2588 Also, you will find that some of the translations do not define shortcut
2589 keys for everything.
2590 Sometimes, there are simply not enough free letters to do it.
2591 Other times, the translator just hasn't got around to doing it yet.
2592 Our localization team, which you may wish to join,
2596 \begin_layout Plain Layout
2597 If you are a fluent speaker of a language other than English, joining these
2598 teams is a great way to give back to the LyX community!
2603 will of course try to fix these shortcomings in future versions of LyX.
2606 \begin_layout Section
2610 \begin_layout Subsection
2611 Translating the graphical user interface (text messages).
2614 \begin_layout Standard
2616 \begin_inset Flex CharStyle:Code
2619 \begin_layout Plain Layout
2625 library to handle the internationalization of the interface.
2626 To have LyX speak your favorite language in all menus and dialogs, you
2628 \begin_inset Flex CharStyle:Code
2631 \begin_layout Plain Layout
2637 -file for that language.
2638 When this is available, you'll have to generate a
2639 \begin_inset Flex CharStyle:Code
2642 \begin_layout Plain Layout
2648 -file from it and install the
2649 \begin_inset Flex CharStyle:Code
2652 \begin_layout Plain Layout
2659 The process of doing all of this is explained in the documentation for
2661 \begin_inset Flex CharStyle:Code
2664 \begin_layout Plain Layout
2671 It is possible to do this just for yourself, but if you're going to do
2672 it, you might as well share the results of your labors with the rest of
2674 Send a message to the LyX developers' list for more information about how
2678 \begin_layout Standard
2679 In short, this is what you should do (xx denotes the language code):
2682 \begin_layout Itemize
2683 Check out the LyX source code.
2685 \begin_inset CommandInset href
2687 name "information on the web"
2688 target "http://www.lyx.org/devel/cvs.php"
2695 \begin_layout Itemize
2697 \begin_inset Flex CharStyle:Code
2700 \begin_layout Plain Layout
2706 to the folder of the
2707 \begin_inset Flex CharStyle:Code
2710 \begin_layout Plain Layout
2718 \begin_inset Flex CharStyle:Code
2721 \begin_layout Plain Layout
2729 \begin_inset Flex CharStyle:Code
2732 \begin_layout Plain Layout
2738 doesn't exist anywhere, it can be remade with the console command
2739 \begin_inset Flex CharStyle:Code
2742 \begin_layout Plain Layout
2748 in that directory, or you can use an existing po-file for some other language
2752 \begin_layout Itemize
2754 \begin_inset Flex CharStyle:Code
2757 \begin_layout Plain Layout
2767 \begin_layout Plain Layout
2768 This is just a text file, so it can be edited in any text editor.
2769 But there are also specialized programs that support such editing, such
2774 (for all platforms) or
2783 contains a `mode' for editing
2784 \begin_inset Flex CharStyle:Code
2787 \begin_layout Plain Layout
2798 For some menu- and widget-labels, there are also shortcut keys that should
2800 Those keys are marked after a `|', and should be translated according to
2801 the words and phrases of the language.
2802 You should also fill also out the information at the beginning of the new
2804 \begin_inset Flex CharStyle:Code
2807 \begin_layout Plain Layout
2813 -file with your email-address, etc., so people know where to reach you with
2814 suggestions and entertaining flames.
2817 \begin_layout Standard
2818 If you are just doing this on your own, then:
2821 \begin_layout Itemize
2823 \begin_inset Flex CharStyle:Code
2826 \begin_layout Plain Layout
2833 This can be done with
2834 \begin_inset Flex CharStyle:Code
2837 \begin_layout Plain Layout
2838 msgfmt -o xx.mo < xx.po
2846 \begin_layout Itemize
2848 \begin_inset Flex CharStyle:Code
2851 \begin_layout Plain Layout
2857 -file to your locale-tree, at the correct directory for application messages
2862 xx, and under the name
2863 \begin_inset Flex CharStyle:Code
2866 \begin_layout Plain Layout
2873 \begin_inset space \thinspace{}
2877 \begin_inset space \space{}
2881 \begin_inset Flex CharStyle:Code
2884 \begin_layout Plain Layout
2885 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2895 \begin_layout Standard
2896 As said, however, it would be best if the new
2897 \begin_inset Flex CharStyle:Code
2900 \begin_layout Plain Layout
2906 -file could be added to the LyX distribution, so others can use it.
2907 Adding it involves making additional changes to LyX.
2908 So send an email to the developers' mailing list if you're interested in
2912 \begin_layout Subsubsection
2916 \begin_layout Standard
2917 Sometimes it turns out that one English message needs to be translated into
2918 different messages in the target language.
2919 One example is the message
2920 \begin_inset Flex CharStyle:Code
2923 \begin_layout Plain Layout
2929 which has the German translation
2937 , depending upon exactly what the English
2938 \begin_inset Quotes eld
2942 \begin_inset Quotes erd
2947 \begin_inset Flex CharStyle:Code
2950 \begin_layout Plain Layout
2956 does not handle such ambiguous translations.
2957 Therefore you have to add some context information to the message: Instead
2959 \begin_inset Flex CharStyle:Code
2962 \begin_layout Plain Layout
2969 \begin_inset Flex CharStyle:Code
2972 \begin_layout Plain Layout
2973 To[[as in 'From format x to format y']]
2979 \begin_inset Flex CharStyle:Code
2982 \begin_layout Plain Layout
2983 To[[as in 'From page x to page y']].
2988 Now the two occurrences of
2989 \begin_inset Flex CharStyle:Code
2992 \begin_layout Plain Layout
2999 \begin_inset Flex CharStyle:Code
3002 \begin_layout Plain Layout
3008 and can be translated correctly to
3019 \begin_layout Standard
3020 Of course the context information needs to be stripped off the original
3021 message when no translation is used.
3022 Therefore you have to put it in double square brackets at the end of the
3023 message (see the example above).
3024 The translation mechanism of LyX ensures that everything in double square
3025 brackets at the end of messages is removed before displaying the message.
3028 \begin_layout Subsection
3029 Translating the documentation.
3032 \begin_layout Standard
3033 The online documentation (in the
3034 \begin_inset Flex CharStyle:MenuItem
3037 \begin_layout Plain Layout
3043 -menu) can (and should!) be translated.
3044 If there are translated versions of the documentation available
3048 \begin_layout Plain Layout
3049 As of March 2008, at least some of the documents have been translated into
3050 fourteen languages, with the Tutorial available in a few more.
3055 and the locale is set accordingly, these will be used automagically by
3057 LyX looks for translated versions as
3058 \begin_inset Flex CharStyle:Code
3061 \begin_layout Plain Layout
3062 LyXDir/doc/xx/DocName.lyx
3068 \begin_inset Flex CharStyle:Code
3071 \begin_layout Plain Layout
3077 is the code for the language currently in use.
3078 If there are no translated documents, the default English versions will
3080 Note that the translated versions must have the same filenames (
3081 \begin_inset Flex CharStyle:Code
3084 \begin_layout Plain Layout
3090 above) as the original.
3091 If you feel up to translating the documentation (an excellent way to proof-read
3092 the original documentation by the way!), there are a few things you should
3096 \begin_layout Itemize
3098 \begin_inset Flex CharStyle:Code
3101 \begin_layout Plain Layout
3107 , the guide to writing LyX documentation.
3108 Pay special attention to the translator's section.
3111 \begin_layout Itemize
3112 Check out the documentation translation web page at
3113 \begin_inset CommandInset href
3115 name "http://www.lyx.org/Translation"
3116 target "http://www.lyx.org/Translation"
3121 That way, you can find out which (if any) documents have already been translate
3122 d into your language.
3123 You can also find out who (if anyone) is organizing the effort to translate
3124 the documentation into your language.
3125 If no one is organizing the effort, please let us know that you're interested.
3128 \begin_layout Standard
3129 Once you get to actually translating, here's a few hints for you that may
3133 \begin_layout Itemize
3134 Join the documentation team! There is information on how to do that in
3135 \begin_inset Flex CharStyle:Code
3138 \begin_layout Plain Layout
3145 \begin_inset Flex CharStyle:MenuItem
3148 \begin_layout Plain Layout
3149 Help\SpecialChar \menuseparator
3159 ), which by the way is the first document you should translate.
3162 \begin_layout Itemize
3163 Learn the typographic conventions for the language you are translating to.
3164 Typography is an ancient art and over the centuries, a great variety of
3165 conventions have developed throughout different parts of the world.
3166 Also study the professional terminology amongst typographers in your country.
3167 Inventing your own terminology will only confuse the users.
3170 (Warning! Typography is addictive!)
3173 \begin_layout Itemize
3174 Make a copy of the document.
3175 This will be your working copy.
3176 You can use this as your personal translated help-file by placing it in
3178 \begin_inset Flex CharStyle:Code
3181 \begin_layout Plain Layout
3190 \begin_layout Itemize
3191 Sometimes the original document (from the LyX-team) will be updated.
3192 Use the source viewer at
3193 \begin_inset CommandInset href
3195 name "http://www.lyx.org/trac/timeline"
3196 target "http://www.lyx.org/trac/timeline"
3200 to see what has been changed.
3201 That way you can easily see which parts of the translated document need
3205 \begin_layout Standard
3206 If you ever find an error in the original document, fix it and notify the
3207 rest of the documentation team of the changes! (You didn't forget to join
3208 the documentation team, did you?)
3211 \begin_layout Standard
3212 \begin_inset Branch OutDated
3215 \begin_layout Section
3216 International Keyboard Support
3219 \begin_layout Standard
3222 [Editor's Note: The following section is by
3230 It needs to be fixed to conform to the new Documentation Style sheet and
3231 to make use of the new v1.0 features.
3232 The whole thing also needs to be merged with the section following it.-jw
3233 It may also be badly out of date.-rh (2008)]
3236 \begin_layout Subsection
3237 Defining Own Keymaps: Keymap File Format
3240 \begin_layout Standard
3241 Let's look at a keyboard definition file a little closer.
3242 It is a plain text file defining
3245 \begin_layout Itemize
3246 key-to-key or key-to-string translations
3249 \begin_layout Itemize
3253 \begin_layout Itemize
3254 dead keys exceptions
3257 \begin_layout Standard
3258 To define key-to-key or key-to-string translation, use this command:
3261 \begin_layout Quotation
3262 \begin_inset Flex CharStyle:Code
3265 \begin_layout Plain Layout
3274 \begin_inset Flex CharStyle:Code
3277 \begin_layout Plain Layout
3286 \begin_layout Standard
3288 \begin_inset Flex CharStyle:Code
3291 \begin_layout Plain Layout
3297 is the key to be translated and
3298 \begin_inset Flex CharStyle:Code
3301 \begin_layout Plain Layout
3307 is the string to be inserted into the document.
3308 To define dead keys, use:
3311 \begin_layout Quotation
3312 \begin_inset Flex CharStyle:Code
3315 \begin_layout Plain Layout
3324 \begin_inset Flex CharStyle:Code
3327 \begin_layout Plain Layout
3336 \begin_layout Standard
3338 \begin_inset Flex CharStyle:Code
3341 \begin_layout Plain Layout
3347 is a keyboard key and
3348 \begin_inset Flex CharStyle:Code
3351 \begin_layout Plain Layout
3358 The following dead keys are supported (shortcut name is in parentheses):
3361 \begin_layout Quotation
3365 \begin_inset space \hfill{}
3371 \begin_layout Quotation
3373 \begin_inset space \hfill{}
3379 \begin_layout Quotation
3381 \begin_inset space \hfill{}
3387 \begin_layout Quotation
3389 \begin_inset space \hfill{}
3395 \begin_layout Quotation
3397 \begin_inset space \hfill{}
3403 \begin_layout Quotation
3405 \begin_inset space \hfill{}
3412 \begin_layout Plain Layout
3424 \begin_layout Quotation
3426 \begin_inset space \hfill{}
3432 \begin_layout Quotation
3434 \begin_inset space \hfill{}
3441 \begin_layout Plain Layout
3453 \begin_layout Quotation
3455 \begin_inset space \hfill{}
3461 \begin_layout Quotation
3463 \begin_inset space \hfill{}
3469 \begin_layout Quotation
3471 \begin_inset space \hfill{}
3478 \begin_layout Plain Layout
3490 \begin_layout Quotation
3492 \begin_inset space \hfill{}
3499 \begin_layout Plain Layout
3511 \begin_layout Quotation
3513 \begin_inset space \hfill{}
3519 \begin_layout Quotation
3520 hungarian umlaut (hug)
3521 \begin_inset space \hfill{}
3527 \begin_layout Quotation
3529 \begin_inset space \hfill{}
3535 \begin_layout Quotation
3537 \begin_inset space \hfill{}
3544 \begin_layout Plain Layout
3556 \begin_layout Standard
3557 Since in many international keyboards there are exceptions to what some
3558 dead keys should do, you can define them using
3561 \begin_layout Quotation
3562 \begin_inset Flex CharStyle:Code
3565 \begin_layout Plain Layout
3573 deadkey key outstring
3576 \begin_layout Standard
3577 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3581 \begin_layout Quotation
3582 \begin_inset Flex CharStyle:Code
3585 \begin_layout Plain Layout
3598 \begin_layout Standard
3599 to make it work correctly.
3600 Also, you have to define as exceptions dead keys over i and j, to remove
3601 the dot from them before inserting an accent mark.
3602 I will change this when the time comes, but so far I haven't had time.
3605 \begin_layout Standard
3606 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3609 \begin_inset Flex CharStyle:Code
3612 \begin_layout Plain Layout
3618 have different meaning.
3620 \begin_inset Flex CharStyle:Code
3623 \begin_layout Plain Layout
3629 marks comments, quotes start and end LaTeX-style commands.
3630 To enter quote, you'll need to use
3631 \begin_inset Flex CharStyle:Code
3634 \begin_layout Plain Layout
3643 \begin_inset Flex CharStyle:Code
3646 \begin_layout Plain Layout
3653 \begin_inset Flex CharStyle:Code
3656 \begin_layout Plain Layout
3667 \begin_layout Standard
3668 If you make a keyboard description file that works for your language, please
3669 mail it to me, so I can include it in the next keymap distribution.
3672 \begin_layout Standard
3673 More keywords will be supported in keymap configuration file in future,
3677 \begin_layout Itemize
3678 \begin_inset Flex CharStyle:Code
3681 \begin_layout Plain Layout
3692 \begin_inset space \hfill{}
3696 \begin_inset Flex CharStyle:Code
3699 \begin_layout Plain Layout
3708 \begin_layout Itemize
3709 \begin_inset Flex CharStyle:Code
3712 \begin_layout Plain Layout
3723 \begin_inset space \hfill{}
3727 \begin_inset Flex CharStyle:Code
3730 \begin_layout Plain Layout
3736 an external keymap translation program
3739 \begin_layout Standard
3740 Also, it should look into
3741 \begin_inset Flex CharStyle:Code
3744 \begin_layout Plain Layout
3750 file for defaults, too (for example, a
3751 \begin_inset Flex CharStyle:Code
3754 \begin_layout Plain Layout
3762 option to include default keyboard).
3770 \begin_layout Section
3771 \begin_inset CommandInset label
3777 International Keymap Stuff
3780 \begin_layout Standard
3781 \begin_inset Note Note
3784 \begin_layout Plain Layout
3785 In doing the revisions on this document in March 2008, I did not look over
3786 this stuff, as I do not understand it.
3787 It would be good if someone else could do so.
3795 \begin_layout Standard
3796 The next two sections describe the
3797 \begin_inset Flex CharStyle:Code
3800 \begin_layout Plain Layout
3809 \begin_inset Flex CharStyle:Code
3812 \begin_layout Plain Layout
3820 file syntax in detail.
3821 These sections should help you design your own key map if the ones provided
3822 do not meet your needs.
3825 \begin_layout Subsection
3829 \begin_layout Standard
3833 \begin_inset Flex CharStyle:Code
3836 \begin_layout Plain Layout
3842 file maps keystrokes to characters or strings.
3843 As the name suggests, it sets a keyboard mapping.
3845 \begin_inset Flex CharStyle:Code
3848 \begin_layout Plain Layout
3859 \begin_inset Flex CharStyle:Code
3862 \begin_layout Plain Layout
3877 \begin_inset Flex CharStyle:Code
3880 \begin_layout Plain Layout
3893 \begin_inset Flex CharStyle:Code
3896 \begin_layout Plain Layout
3905 \begin_inset Flex CharStyle:Code
3908 \begin_layout Plain Layout
3916 are described in this section.
3919 \begin_layout Labeling
3920 \labelwidthstring 00.00.0000
3921 \begin_inset Flex CharStyle:Code
3924 \begin_layout Plain Layout
3932 Map a character to a string
3935 \begin_layout LyX-Code
3950 \begin_layout Standard
3983 the double-quote (")
4000 must be escaped with a preceding backslash (
4011 \begin_layout Standard
4013 \begin_inset Flex CharStyle:MenuItem
4016 \begin_layout Plain Layout
4024 statement to cause the symbol
4025 \begin_inset Flex CharStyle:MenuItem
4028 \begin_layout Plain Layout
4036 to be output for the keystroke
4037 \begin_inset Flex CharStyle:MenuItem
4040 \begin_layout Plain Layout
4051 \begin_layout LyX-Code
4057 \begin_layout Labeling
4058 \labelwidthstring 00.00.0000
4059 \begin_inset Flex CharStyle:Code
4062 \begin_layout Plain Layout
4070 Specify an accent character
4073 \begin_layout LyX-Code
4082 \begin_layout Standard
4083 This will make the cha
4121 This is the dead key
4125 \begin_layout Plain Layout
4132 refers to a key that does not produce a character by itself, but when followed
4133 with another key, produces the desired accent character.
4134 For example, a German characte
4136 r with an umlaut like
4146 can be produced in this manner.
4155 \begin_layout Standard
4168 and then another key not in
4185 followed by the other, not allowed key, as output.
4189 \begin_inset Flex CharStyle:MenuItem
4192 \begin_layout Plain Layout
4200 cancels a dead key, so if
4211 \begin_inset Flex CharStyle:MenuItem
4214 \begin_layout Plain Layout
4223 , the cursor will not go one position backwards but will instead cancel
4239 might have had on the next keystroke.
4243 \begin_layout Standard
4244 The following example specifies that the character ' is to be an acute accent,
4245 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4248 \begin_layout LyX-Code
4251 kmod ' acute aeiouAEIOU
4254 \begin_layout Labeling
4255 \labelwidthstring 00.00.0000
4256 \begin_inset Flex CharStyle:Code
4259 \begin_layout Plain Layout
4265 Specify an exception to the accent character
4268 \begin_layout LyX-Code
4277 \begin_layout Standard
4278 This defines an exce
4319 have been assigned a keystroke with a previous
4322 \begin_inset Flex CharStyle:Code
4325 \begin_layout Plain Layout
4349 must not belong in the
4396 If such a declaration does not exist in
4404 \begin_inset Flex CharStyle:Code
4407 \begin_layout Plain Layout
4441 \begin_inset Flex CharStyle:Code
4444 \begin_layout Plain Layout
4458 \begin_layout Standard
4459 The following command produces causes äi to be produced when you enter acute-i
4463 \begin_layout LyX-Code
4477 \begin_layout Labeling
4478 \labelwidthstring 00.00.0000
4479 \begin_inset Flex CharStyle:Code
4482 \begin_layout Plain Layout
4488 Combine two accent characters
4491 \begin_layout LyX-Code
4497 accent1 accent2 allowed
4500 \begin_layout Standard
4501 This one is getting pretty esoteric.
4502 It allows you to combine the effect
4558 \begin_inset Flex CharStyle:Code
4561 \begin_layout Plain Layout
4589 \begin_layout Standard
4590 Consider this example from the
4591 \begin_inset Flex CharStyle:Code
4594 \begin_layout Plain Layout
4605 \begin_layout LyX-Code
4608 kmod ; acute aeioyvhAEIOYVH
4612 kcomb acute umlaut iyIY
4615 \begin_layout Standard
4616 This allows you to press
4617 \begin_inset Flex CharStyle:MenuItem
4620 \begin_layout Plain Layout
4628 and get the effect of
4629 \begin_inset Flex CharStyle:Code
4632 \begin_layout Plain Layout
4651 in this case cancels the last dead key, so if you press
4652 \begin_inset Flex CharStyle:MenuItem
4655 \begin_layout Plain Layout
4664 \begin_inset Flex CharStyle:Code
4667 \begin_layout Plain Layout
4680 \begin_layout Subsection
4684 \begin_layout Standard
4686 \begin_inset Flex CharStyle:Code
4689 \begin_layout Plain Layout
4697 mapping is performed, a
4698 \begin_inset Flex CharStyle:Code
4701 \begin_layout Plain Layout
4711 file maps the strings that the symbols generate to characters in the current
4713 The LyX distribution currently includes at least the
4714 \begin_inset Flex CharStyle:Code
4717 \begin_layout Plain Layout
4726 \begin_inset Flex CharStyle:Code
4729 \begin_layout Plain Layout
4740 \begin_layout Standard
4742 \begin_inset Flex CharStyle:Code
4745 \begin_layout Plain Layout
4753 file is a sequence of declarations of the form
4756 \begin_layout LyX-Code
4769 \begin_layout Standard
4770 For example, in order to map
4771 \begin_inset Flex CharStyle:MenuItem
4774 \begin_layout Plain Layout
4784 to the corresponding character in the iso-8859-1 set (233), the following
4788 \begin_layout LyX-Code
4796 \begin_layout Standard
4798 \begin_inset Flex CharStyle:Code
4801 \begin_layout Plain Layout
4810 \begin_inset Flex CharStyle:Code
4813 \begin_layout Plain Layout
4831 the same character can apply to more than one string.
4833 \begin_inset Flex CharStyle:Code
4836 \begin_layout Plain Layout
4847 \begin_layout LyX-Code
4859 \begin_inset Newline newline
4875 \begin_layout Standard
4876 If LyX cannot find a mapping for the string produced by the keystroke or
4877 a deadkey sequence, it will check if it looks like an accented char and
4878 try to draw an accent over the character on screen.
4881 \begin_layout Subsection
4885 \begin_layout Standard
4886 There is a second way to add support for international characters through
4887 so-called dead-keys.
4888 A dead-key works in combination with a letter to produce an accented character.
4889 Here, we'll explain how to create a really simple dead-key to illustrate
4893 \begin_layout Standard
4894 Suppose you happen to need the circumflex character,
4895 \begin_inset Quotes eld
4899 \begin_inset Quotes erd
4904 \begin_inset Flex CharStyle:MenuItem
4907 \begin_layout Plain Layout
4914 \begin_inset space ~
4918 \begin_inset Flex CharStyle:MenuItem
4921 \begin_layout Plain Layout
4927 ] to the LyX command
4928 \begin_inset Flex CharStyle:Code
4931 \begin_layout Plain Layout
4938 \begin_inset Flex CharStyle:Code
4941 \begin_layout Plain Layout
4948 Now, whenever you type the
4949 \begin_inset Flex CharStyle:MenuItem
4952 \begin_layout Plain Layout
4958 -key followed by a letter, that letter will have a circumflex accent on
4960 For example, the sequence
4961 \begin_inset Quotes eld
4965 \begin_inset Flex CharStyle:MenuItem
4968 \begin_layout Plain Layout
4975 \begin_inset Quotes erd
4978 produces the letter:
4979 \begin_inset Quotes eld
4983 \begin_inset Quotes erd
4987 If you tried to type
4988 \begin_inset Quotes eld
4992 \begin_inset Flex CharStyle:MenuItem
4995 \begin_layout Plain Layout
5002 \begin_inset Quotes erd
5005 , however, LyX will complain with a beep, since a
5006 \begin_inset Quotes eld
5010 \begin_inset Flex CharStyle:MenuItem
5013 \begin_layout Plain Layout
5020 \begin_inset Quotes erd
5023 never takes a circumflex accent.
5025 \begin_inset Flex CharStyle:MenuItem
5028 \begin_layout Plain Layout
5034 after a dead-key produces the bare-accent.
5035 Please note this last point! If you bind a key to a dead-key, you'll need
5036 to rebind the character on that key to yet another key.
5038 \begin_inset Flex CharStyle:MenuItem
5041 \begin_layout Plain Layout
5047 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
5050 \begin_layout Standard
5051 One common way to bind dead-keys is to use
5052 \begin_inset Flex CharStyle:MenuItem
5055 \begin_layout Plain Layout
5062 \begin_inset Flex CharStyle:MenuItem
5065 \begin_layout Plain Layout
5072 \begin_inset Flex CharStyle:MenuItem
5075 \begin_layout Plain Layout
5081 in combination with an accent, like
5082 \begin_inset Quotes eld
5086 \begin_inset Flex CharStyle:MenuItem
5089 \begin_layout Plain Layout
5096 \begin_inset Quotes erd
5100 \begin_inset Quotes eld
5104 \begin_inset Flex CharStyle:MenuItem
5107 \begin_layout Plain Layout
5114 \begin_inset Quotes erd
5118 \begin_inset Quotes eld
5122 \begin_inset Flex CharStyle:MenuItem
5125 \begin_layout Plain Layout
5132 \begin_inset Quotes erd
5136 Another way involves using
5137 \begin_inset Flex CharStyle:Code
5140 \begin_layout Plain Layout
5147 \begin_inset Flex CharStyle:Code
5150 \begin_layout Plain Layout
5156 to set up the special
5157 \begin_inset Flex CharStyle:Code
5160 \begin_layout Plain Layout
5168 \begin_inset Flex CharStyle:Code
5171 \begin_layout Plain Layout
5177 acts in some ways just like
5178 \begin_inset Flex CharStyle:MenuItem
5181 \begin_layout Plain Layout
5187 and permits you to bind keys to accented characters.
5188 You can also turn keys into dead-keys by binding them to something like
5190 \begin_inset Flex CharStyle:Code
5193 \begin_layout Plain Layout
5199 and then binding this symbolic key to the corresponding LyX command.
5203 \begin_layout Plain Layout
5208 : This is exactly what I do in my
5209 \begin_inset Flex CharStyle:Code
5212 \begin_layout Plain Layout
5219 \begin_inset Flex CharStyle:Code
5222 \begin_layout Plain Layout
5230 \begin_inset Flex CharStyle:MenuItem
5233 \begin_layout Plain Layout
5235 \begin_inset space ~
5244 \begin_inset Flex CharStyle:Code
5247 \begin_layout Plain Layout
5253 and a bunch of these
5254 \begin_inset Quotes eld
5258 \begin_inset Flex CharStyle:Code
5261 \begin_layout Plain Layout
5268 \begin_inset Quotes erd
5271 symbolic keys bound such things as
5272 \begin_inset Flex CharStyle:MenuItem
5275 \begin_layout Plain Layout
5277 \begin_inset space ~
5286 \begin_inset Flex CharStyle:MenuItem
5289 \begin_layout Plain Layout
5291 \begin_inset space ~
5300 This is how I produce my accented characters.
5305 You can make just about anything into the
5306 \begin_inset Flex CharStyle:Code
5309 \begin_layout Plain Layout
5316 \begin_inset Flex CharStyle:MenuItem
5319 \begin_layout Plain Layout
5325 keys, a spare function key, etc.
5326 As for the LyX commands that produce accents, check the entry for
5327 \begin_inset Flex CharStyle:Code
5330 \begin_layout Plain Layout
5341 You'll find the complete list there.
5344 \begin_layout Subsection
5345 Saving your Language Configuration
5348 \begin_layout Standard
5349 You can edit your preferences so that your desired language environment
5350 is automatically configured when LyX starts up, via the
5351 \begin_inset Flex CharStyle:MenuItem
5354 \begin_layout Plain Layout
5355 Edit\SpecialChar \menuseparator
5364 \begin_layout Chapter
5365 Installing New Document Classes, Layouts, and Templates
5366 \begin_inset CommandInset label
5368 name "chap:textclass"
5376 \begin_layout Plain Layout
5377 Installing New Document Classes
5385 \begin_layout Standard
5386 In this chapter, we describe the procedures for creating and installing
5387 new LyX layout and template files, as well as offer a refresher on correctly
5388 installing new LaTeX document classes.
5389 Some definitions: a document class is a LaTeX file (usually ending in
5390 \begin_inset Flex CharStyle:Code
5393 \begin_layout Plain Layout
5400 \begin_inset Flex CharStyle:Code
5403 \begin_layout Plain Layout
5409 ) that describes the format of a document such as an article, report, journal
5410 preprint, etc, and all the commands needed to realize that format.
5411 A layout file is a LyX file that corresponds to a LaTeX document class
5412 and that tells LyX how to
5413 \begin_inset Quotes eld
5417 \begin_inset Quotes erd
5420 things on the screen to make the display look something like the final
5422 More precisely, a layout file describes a
5423 \begin_inset Quotes eld
5427 \begin_inset Quotes erd
5430 which is the internal construct LyX uses to render the screen display.
5432 \begin_inset Quotes eld
5436 \begin_inset Quotes erd
5440 \begin_inset Quotes eld
5444 \begin_inset Quotes erd
5447 can be used somewhat interchangeably, but it is better to refer to the
5448 file as the layout, and the thing living in LyX's memory as the text class.
5449 A template file is simply a LyX document that contains a set of predefined
5450 entries for a given document class—entries that are generally required
5452 Templates are especially useful for things like journal manuscripts that
5453 are to be submitted electronically.
5456 \begin_layout Section
5457 Installing a new LaTeX package
5460 \begin_layout Standard
5461 Some installations may not include a LaTeX package that you would like to
5463 For example, you might need FoilTeX, a package for preparing slides or
5464 viewgraphs for overhead projectors.
5465 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5466 a user interface for that.
5467 For example on MiKTeX you start its program
5468 \begin_inset Quotes eld
5472 \begin_inset Quotes erd
5475 to get a list of available packages.
5476 To install one, right click on it or use the installing toolbar button.
5477 When the package you want to install is not in the list, but you have it
5479 \begin_inset Flex CharStyle:Code
5482 \begin_layout Plain Layout
5489 \begin_inset Flex CharStyle:Code
5492 \begin_layout Plain Layout
5498 -file, then copy these files to a subfolder of your LaTeX distribution,
5499 for example to the folder
5508 Then update the file name database of your LaTeX-distribution.
5509 For example on MiKTeX this is done by pressing the button
5512 \begin_inset space ~
5517 that you find in MiKTeX's
5518 \begin_inset Quotes eld
5522 \begin_inset Quotes erd
5526 In both cases you need afterwards to reconfigure LyX using the menu
5527 \begin_inset Flex CharStyle:MenuItem
5530 \begin_layout Plain Layout
5531 Tools\SpecialChar \menuseparator
5537 and then to restart LyX.
5540 \begin_layout Standard
5541 If your LaTeX distribution doesn't provide a user interface, then you can
5542 follow these steps by using a UNIX/Linux console.
5545 \begin_layout Enumerate
5546 Get the package from
5547 \begin_inset CommandInset href
5550 target "http://www.ctan.org/"
5557 \begin_layout Enumerate
5558 You can install this package in several different places.
5559 If you want it to be available for all users on your system, then you should
5560 install it in your `local' TeX tree; if you want (or need) it to be available
5561 just for you, then you can install it in your own `user' TeX tree.
5562 Where these should be created, if they do not already exist, depends upon
5563 the details of your system.
5564 To find out, look in the file
5565 \begin_inset Flex CharStyle:Code
5568 \begin_layout Plain Layout
5578 \begin_layout Plain Layout
5579 This usually lives in the directory
5580 \begin_inset Flex CharStyle:Code
5583 \begin_layout Plain Layout
5589 , though you can run
5590 \begin_inset Flex CharStyle:Code
5593 \begin_layout Plain Layout
5604 The location of the `local' TeX tree is defined by
5605 \begin_inset Flex CharStyle:Code
5608 \begin_layout Plain Layout
5614 ; this is usually somewhere like
5615 \begin_inset Flex CharStyle:Code
5618 \begin_layout Plain Layout
5619 /usr/local/share/texmf/
5625 The `user' TeX tree is defined by
5626 \begin_inset Flex CharStyle:Code
5629 \begin_layout Plain Layout
5636 \begin_inset Flex CharStyle:Code
5639 \begin_layout Plain Layout
5646 (If these variables are not predefined, you can define them.) You'll probably
5647 need root permissions to create or modify the `local' tree; but your `user'
5648 tree shouldn't have such limitations.
5651 \begin_layout Enumerate
5653 \begin_inset Flex CharStyle:Code
5656 \begin_layout Plain Layout
5663 \begin_inset Flex CharStyle:Code
5666 \begin_layout Plain Layout
5673 \begin_inset Flex CharStyle:Code
5676 \begin_layout Plain Layout
5683 \begin_inset space \thinspace{}
5687 \begin_inset Newline newline
5691 \begin_inset Flex CharStyle:Code
5694 \begin_layout Plain Layout
5695 TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
5701 \begin_inset Newline newline
5704 But, again, most of this will
5705 \begin_inset Quotes eld
5709 \begin_inset Quotes erd
5715 \begin_layout Enumerate
5720 \begin_layout Plain Layout
5721 We'll assume henceforth that you're defining `local' TeX tree.
5722 If you're defining a user tree, just adjust as necessary.
5728 You must follow the directory structure of your existing
5729 \begin_inset Flex CharStyle:Code
5732 \begin_layout Plain Layout
5738 directory, which will be found at
5739 \begin_inset Flex CharStyle:Code
5742 \begin_layout Plain Layout
5749 For example, latex packages should go under
5750 \begin_inset Flex CharStyle:Code
5753 \begin_layout Plain Layout
5754 $TEXMFLOCAL/tex/latex/
5762 \begin_layout Enumerate
5763 Install the package.
5764 For example, you would unpack the FoilTeX tarball and copy it to
5765 \begin_inset Flex CharStyle:Code
5768 \begin_layout Plain Layout
5769 $TEXMFLOCAL/tex/latex/foiltex
5776 \begin_inset Flex CharStyle:Code
5779 \begin_layout Plain Layout
5785 directory contains various files.
5788 \begin_layout Enumerate
5790 \begin_inset Flex CharStyle:Code
5793 \begin_layout Plain Layout
5801 \begin_inset Flex CharStyle:Code
5804 \begin_layout Plain Layout
5813 \begin_layout Standard
5814 Your package is now installed and available to LaTeX.
5815 To make it available to LyX, you need to create a Layout file, if one is
5816 not already available.
5817 (See the next section.) Once you have a layout file, you need only reconfigure
5819 \begin_inset Flex CharStyle:MenuItem
5822 \begin_layout Plain Layout
5823 Tools\SpecialChar \menuseparator
5829 ) and then restart LyX.
5830 You should then see your new package—for example
5831 \begin_inset Flex CharStyle:MenuItem
5834 \begin_layout Plain Layout
5841 \begin_inset Flex CharStyle:MenuItem
5844 \begin_layout Plain Layout
5845 Document\SpecialChar \menuseparator
5852 \begin_inset Flex CharStyle:MenuItem
5855 \begin_layout Plain Layout
5865 \begin_layout Section
5869 \begin_layout Standard
5870 This section describes how to write and install your own LyX layout files
5871 and walks through the
5872 \begin_inset Flex CharStyle:Code
5875 \begin_layout Plain Layout
5881 text class format as an example.
5883 \begin_inset Flex CharStyle:Code
5886 \begin_layout Plain Layout
5892 files describe what paragraph and character styles are available for a
5893 given document class and how LyX should display them.
5894 We try to provide a thorough description of the process here; however,
5895 there are so many different types of documents supported by LaTeX classes
5896 that we can't hope to cover every different possibility or problem you
5898 (The LyX users' list is frequented by people with lots of experience with
5899 layout design who are willing to share what they've learned.)
5902 \begin_layout Standard
5903 As you prepare to write a new layout, it is extremely helpful to look at
5904 the example layouts distributed with LyX.
5905 If you use a nice LaTeX document class that might be of interest for others,
5906 too, and have a nice corresponding LyX layout, feel free to contribute
5907 the stuff to us, so we may put it into the distribution.
5909 \begin_inset CommandInset href
5911 name "section on the LyX wiki"
5912 target "http://wiki.lyx.org/Layouts/Layouts"
5916 for this kind of material.
5919 \begin_layout Standard
5920 All the tags described in this chapter are case-insensitive; this means
5922 \begin_inset Flex CharStyle:Code
5925 \begin_layout Plain Layout
5932 \begin_inset Flex CharStyle:Code
5935 \begin_layout Plain Layout
5942 \begin_inset Flex CharStyle:Code
5945 \begin_layout Plain Layout
5951 are really the same command.
5952 The possible values are printed in brackets after the feature's name.
5953 The default value if a feature isn't specified inside a text class-description
5955 \begin_inset Flex CharStyle:Code
5958 \begin_layout Plain Layout
5967 If the argument has a data type like
5968 \begin_inset Quotes eld
5972 \begin_inset Quotes erd
5976 \begin_inset Quotes eld
5980 \begin_inset Quotes erd
5983 , the default is shown like this:
5984 \begin_inset Flex CharStyle:Code
5987 \begin_layout Plain Layout
5998 \begin_layout Subsection
5999 \begin_inset CommandInset label
6001 name "sub:Layout-modules"
6008 \begin_layout Standard
6009 Similar to layout files, and new with LyX 1.6, are layout
6014 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
6015 some modules—such as the endnotes module—provide support for just such
6017 In a sense, layout modules are similar to included files—files like
6018 \begin_inset Flex CharStyle:Code
6021 \begin_layout Plain Layout
6027 —in that modules are not specific to a given document layout but may be
6028 used with many different layouts.
6029 The difference is that using a layout module does not require editing the
6031 Rather, modules are selected in the
6032 \begin_inset Flex CharStyle:MenuItem
6035 \begin_layout Plain Layout
6036 Document\SpecialChar \menuseparator
6045 \begin_layout Standard
6046 Building modules is the easiest way to get started with layout editing,
6047 since it can be as simple as adding a single new paragraph or flex inset.
6048 But modules may, in principle, contain anything a layout file can contain.
6051 \begin_layout Standard
6052 A module must begin with a line like the following:
6055 \begin_layout LyX-Code
6058 DeclareLyXModule[endnotes.sty]{Endnotes}
6061 \begin_layout Standard
6062 The argument in square brackets is optional: It declares any LaTeX packages
6063 on which the module depends.
6064 The mandatory argument, in curly brackets, is the name of the module, as
6066 \begin_inset Flex CharStyle:MenuItem
6069 \begin_layout Plain Layout
6070 Document\SpecialChar \menuseparator
6080 \begin_layout Standard
6081 The module declaration should then be followed by lines like the following:
6084 \begin_layout LyX-Code
6088 \begin_layout LyX-Code
6089 #Adds an endnote command, in addition to footnotes.
6093 \begin_layout LyX-Code
6094 #You will need to add
6096 theendnotes in TeX code where you
6099 \begin_layout LyX-Code
6100 #want the endnotes to appear.
6104 \begin_layout LyX-Code
6108 \begin_layout LyX-Code
6109 #Requires: somemodule | othermodule
6112 \begin_layout LyX-Code
6113 #Excludes: badmodule
6116 \begin_layout Standard
6117 The description is used in
6118 \begin_inset Flex CharStyle:MenuItem
6121 \begin_layout Plain Layout
6122 Document\SpecialChar \menuseparator
6128 to provide the user with information about what the module does.
6130 \begin_inset Flex CharStyle:Code
6133 \begin_layout Plain Layout
6139 line is used to identify other modules with which this one must be used;
6141 \begin_inset Flex CharStyle:Code
6144 \begin_layout Plain Layout
6150 line is used to identify modules with which this one may not be used.
6151 Both are optional, and, as shown, multiple modules should be separated
6152 with the pipe symbol: |.
6153 Note that the required modules are treated disjunctively:
6157 of the required modules must be used.
6162 excluded module may be used.
6163 Note that modules are identified here by their
6167 without the .module extension.
6169 \begin_inset Flex CharStyle:Code
6172 \begin_layout Plain Layout
6179 \begin_inset Flex CharStyle:Code
6182 \begin_layout Plain Layout
6191 \begin_layout Standard
6192 After creating a new module, you will need to reconfigure and then restart
6193 LyX for the module to appear in the menu.
6194 However, changes you make to the module will be seen immediately, if you
6196 \begin_inset Flex CharStyle:MenuItem
6199 \begin_layout Plain Layout
6200 Document\SpecialChar \menuseparator
6206 , highlight something, and then hit
6207 \begin_inset Quotes eld
6211 \begin_inset Quotes erd
6217 It is strongly recommended that you save your work before doing so
6222 it is strongly recommended that you not attempt to edit modules while simultaneo
6223 usly working on documents
6226 Though of course the developers strive to keep LyX stable in such situations,
6227 syntax errors and the like in your module file could cause strange behavior.
6230 \begin_layout Subsection
6231 Supporting new document classes
6234 \begin_layout Standard
6235 There are two situations you are likely to encounter when wanting to support
6236 a new LaTeX document class, involving LaTeX2e class (
6237 \begin_inset Flex CharStyle:Code
6240 \begin_layout Plain Layout
6247 \begin_inset Flex CharStyle:Code
6250 \begin_layout Plain Layout
6257 Supporting a style file is usually fairly easy.
6258 Supporting a new document class is a bit harder.
6261 \begin_layout Subsection
6263 \begin_inset Flex CharStyle:MenuItem
6266 \begin_layout Plain Layout
6275 \begin_layout Standard
6276 If your new document class is provided as a style file that is used in conjuncti
6277 on with an existing, supported document class—for the sake of the example,
6278 we'll assume that the style file is called
6279 \begin_inset Flex CharStyle:MenuItem
6282 \begin_layout Plain Layout
6288 and it is meant to be used with
6289 \begin_inset Flex CharStyle:MenuItem
6292 \begin_layout Plain Layout
6298 , which is a standard class—start by copying the existing class's layout
6299 file into your local directory:
6302 \begin_layout LyX-Code
6303 cp report.layout ~/.lyx/layouts/myclass.layout
6306 \begin_layout Standard
6308 \begin_inset Flex CharStyle:Code
6311 \begin_layout Plain Layout
6317 and change the line:
6320 \begin_layout LyX-Code
6323 DeclareLaTeXClass{report}
6326 \begin_layout Standard
6330 \begin_layout LyX-Code
6333 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6336 \begin_layout Standard
6340 \begin_layout LyX-Code
6342 \begin_inset Newline newline
6348 \begin_inset Newline newline
6354 \begin_layout Standard
6355 near the top of the file.
6358 \begin_layout Standard
6359 Start LyX and select
6360 \begin_inset Flex CharStyle:MenuItem
6363 \begin_layout Plain Layout
6364 Tools\SpecialChar \menuseparator
6371 Then restart LyX and try creating a new document.
6373 \begin_inset Flex CharStyle:MenuItem
6376 \begin_layout Plain Layout
6382 " as a document class option in the
6383 \begin_inset Flex CharStyle:MenuItem
6386 \begin_layout Plain Layout
6387 Document\SpecialChar \menuseparator
6394 It is likely that some of the sectioning commands and such in your new
6395 class will work differently from how they worked in the base class—
6396 \begin_inset Flex CharStyle:Code
6399 \begin_layout Plain Layout
6405 in this example—so you can fiddle around with the settings for the different
6406 sections if you wish.
6409 \begin_layout Subsection
6411 \begin_inset Flex CharStyle:MenuItem
6414 \begin_layout Plain Layout
6423 \begin_layout Standard
6424 There are two possibilities here.
6425 One is that the class file is itself based upon an existing document class.
6426 For example, many thesis classes are based upon
6427 \begin_inset Flex CharStyle:MenuItem
6430 \begin_layout Plain Layout
6437 To see whether yours is, look for a line like
6440 \begin_layout LyX-Code
6446 \begin_layout Standard
6448 If so, then you may proceed largely as in the previous section, though
6449 the DeclareLaTeXClass line will be different.
6450 If your new class is thesis, and it is based upon book, then the line should
6455 \begin_layout Plain Layout
6456 And it will be easiest if you save the file to
6457 \begin_inset Flex CharStyle:Code
6460 \begin_layout Plain Layout
6466 : LyX assumes that the document class has the same name as the layout file.
6475 \begin_layout LyX-Code
6478 DeclareLaTeXClass[thesis,book]{thesis}
6481 \begin_layout Standard
6482 If, on the other hand, the new class is not based upon an existing class,
6483 you will probably have to
6484 \begin_inset Quotes eld
6488 \begin_inset Quotes erd
6492 We strongly suggest copying an existing layout file which uses a similar
6493 LaTeX class and then modifying it, if you can do so.
6494 At least use an existing file as a starting point so you can find out what
6495 items you need to worry about.
6496 Again, the specifics are covered below.
6499 \begin_layout Section
6500 Declaring a new text class
6503 \begin_layout Standard
6504 When it's finally time to get your hands dirty and create or edit your own
6505 layout file, the following sections describe what you're up against.
6506 Our advice is to go slowly, save and test often, listen to soothing music,
6507 and enjoy one or two of your favorite adult beverages; more if you are
6508 getting particularly stuck.
6509 It's really not that hard, except that the multitude of options can become
6510 overwhelming if you try to do to much in one sitting.
6511 Go have another adult beverage, just for good measure.
6514 \begin_layout Standard
6518 \begin_layout Standard
6519 Lines in a layout file which begin with a
6520 \begin_inset Flex CharStyle:Code
6523 \begin_layout Plain Layout
6530 There is one exception to this rule: all layouts should begin with lines
6534 \begin_layout LyX-Code
6537 #% Do not delete the line below; configure depends on this
6540 \begin_layout LyX-Code
6545 DeclareLaTeXClass{article}
6548 \begin_layout Standard
6549 The second line is used when you configure LyX.
6550 The layout file is read by the LaTeX script
6551 \begin_inset Flex CharStyle:Code
6554 \begin_layout Plain Layout
6560 , in a special mode where
6561 \begin_inset Flex CharStyle:Code
6564 \begin_layout Plain Layout
6571 The first line is just a LaTeX comment, and the second one contains the
6572 declaration of the text class.
6573 If these lines appear in a file named
6574 \begin_inset Flex CharStyle:Code
6577 \begin_layout Plain Layout
6583 , then they define a text class of name
6584 \begin_inset Flex CharStyle:Code
6587 \begin_layout Plain Layout
6593 (the name of the layout file) which uses the LaTeX document class
6594 \begin_inset Flex CharStyle:Code
6597 \begin_layout Plain Layout
6603 (the default is to use the same name as the layout).
6605 \begin_inset Quotes eld
6609 \begin_inset Quotes erd
6612 that appears above is used as a description of the text class in the
6613 \begin_inset Flex CharStyle:MenuItem
6616 \begin_layout Plain Layout
6617 Document\SpecialChar \menuseparator
6626 \begin_layout Standard
6627 Let's assume that you wrote your own text class that uses the
6628 \begin_inset Flex CharStyle:Code
6631 \begin_layout Plain Layout
6637 document class, but where you changed the appearance of the section headings.
6638 If you put it in a file
6639 \begin_inset Flex CharStyle:Code
6642 \begin_layout Plain Layout
6648 , the header of this file should be:
6651 \begin_layout LyX-Code
6654 #% Do not delete the line below; configure depends on this
6657 \begin_layout LyX-Code
6662 DeclareLaTeXClass[article]{article (with my own headings)}
6665 \begin_layout Standard
6666 This declares a text class
6667 \begin_inset Flex CharStyle:Code
6670 \begin_layout Plain Layout
6676 , associated with the LaTeX document class
6677 \begin_inset Flex CharStyle:Code
6680 \begin_layout Plain Layout
6687 \begin_inset Quotes eld
6690 article (with my own headings)
6691 \begin_inset Quotes erd
6695 If your text class depends on several packages, you can declare it as:
6698 \begin_layout LyX-Code
6701 #% Do not delete the line below; configure depends on this
6704 \begin_layout LyX-Code
6709 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
6712 \begin_layout Standard
6713 This indicates that your text class uses the foo.sty package.
6714 Finally, it is also possible to declare classes for DocBook code.
6715 Typical declarations will look like
6718 \begin_layout LyX-Code
6721 #% Do not delete the line below; configure depends on this
6724 \begin_layout LyX-Code
6729 DeclareDocBookClass[article]{SGML (DocBook article)}
6732 \begin_layout Standard
6733 Note that these declarations can also be given an optional parameter declaring
6734 the name of the document class (but not a list).
6737 \begin_layout Standard
6738 So, to be as explicit as possible, the form of the layout declaration is:
6741 \begin_layout LyX-Code
6746 DeclareLaTeXClass[class,package.sty]{layout description}
6749 \begin_layout Standard
6750 The class need only be specified if the name of the LaTeX class file and
6751 the name of the layout file are different; if the name of the class file
6752 is not specified, then LyX will simply assume that it is the same as the
6753 name of the layout file.
6756 \begin_layout Standard
6757 When the text class has been modified to your taste, all you have to do
6758 is to copy it either to
6759 \begin_inset Flex CharStyle:Code
6762 \begin_layout Plain Layout
6769 \begin_inset Flex CharStyle:Code
6772 \begin_layout Plain Layout
6779 \begin_inset Flex CharStyle:MenuItem
6782 \begin_layout Plain Layout
6783 Tools\SpecialChar \menuseparator
6789 , exit LyX and restart it.
6790 Then your new text class should be available along with the others.
6793 \begin_layout Standard
6794 In versions of LyX prior to 1.6, you had to restart LyX to see any changes
6795 you made to your layout files.
6796 As a result, editing layout files could be very time consuming.
6797 Beginning with 1.6, however, you can force a reload of the layout currently
6798 in use by using the LyX function
6799 \begin_inset Flex CharStyle:MenuItem
6802 \begin_layout Plain Layout
6809 There is no default binding for this function—though, of course, you can
6810 bind it to a key yourself.
6811 If you want to use this function, then, you should simply enter it in the
6817 : This is very much an `advanced feature'.
6822 recommended that you save your work before using this function.
6827 recommended that you not attempt to edit your layout while simultaneously
6828 working on a document that you care about.
6829 Use a test document.
6830 Syntax errors and the like in your layout file could cause peculiar behavior.
6831 In particular, such errors could cause LyX to regard the current layout
6832 as invalid and to attempt to switch to some other layout.
6833 The LyX team strives to keep LyX stable in such situations, but safe is
6837 \begin_layout Subsection
6841 \begin_layout Standard
6842 The first non-comment line must contain the file format number:
6845 \begin_layout Description
6846 \begin_inset Flex CharStyle:Code
6849 \begin_layout Plain Layout
6856 \begin_inset Flex CharStyle:Code
6859 \begin_layout Plain Layout
6865 ] This tag was introduced with LyX 1.4.0 (layout files of LyX 1.3.x and earlier
6866 don't have an explicit file format).
6867 The file format that is documented here is format 12.
6870 \begin_layout Subsection
6871 General text class parameters
6874 \begin_layout Standard
6875 These are the general parameters which describe the form of the entire document:
6878 \begin_layout Description
6879 \begin_inset Flex CharStyle:Code
6882 \begin_layout Plain Layout
6888 Adds information to the document preamble.
6890 \begin_inset Quotes eld
6894 \begin_inset Flex CharStyle:Code
6897 \begin_layout Plain Layout
6904 \begin_inset Quotes erd
6910 \begin_layout Description
6911 \begin_inset Flex CharStyle:Code
6914 \begin_layout Plain Layout
6920 Describes various global options supported by the document class.
6922 \begin_inset space ~
6926 \begin_inset CommandInset ref
6928 reference "sec:classoptions"
6934 \begin_inset Quotes eld
6938 \begin_inset Flex CharStyle:Code
6941 \begin_layout Plain Layout
6948 \begin_inset Quotes erd
6954 \begin_layout Description
6955 \begin_inset Flex CharStyle:Code
6958 \begin_layout Plain Layout
6965 \begin_inset Flex CharStyle:Code
6968 \begin_layout Plain Layout
6977 \begin_inset Flex CharStyle:Code
6980 \begin_layout Plain Layout
6986 ] Whether the class should default to having one or two columns.
6987 Can be changed in the
6988 \begin_inset Flex CharStyle:MenuItem
6991 \begin_layout Plain Layout
6992 Document\SpecialChar \menuseparator
7001 \begin_layout Description
7002 \begin_inset Flex CharStyle:Code
7005 \begin_layout Plain Layout
7011 This sequence defines a new counter.
7013 \begin_inset space ~
7017 \begin_inset CommandInset ref
7019 reference "sec:counter"
7025 \begin_inset Quotes eld
7029 \begin_inset Flex CharStyle:Code
7032 \begin_layout Plain Layout
7039 \begin_inset Quotes erd
7045 \begin_layout Description
7046 \begin_inset Flex CharStyle:Code
7049 \begin_layout Plain Layout
7055 Sets the default font used to display the document.
7057 \begin_inset space ~
7061 \begin_inset CommandInset ref
7063 reference "sec:fonts"
7067 for how to declare fonts.
7069 \begin_inset Quotes eld
7073 \begin_inset Flex CharStyle:Code
7076 \begin_layout Plain Layout
7083 \begin_inset Quotes erd
7089 \begin_layout Description
7090 \begin_inset Flex CharStyle:Code
7093 \begin_layout Plain Layout
7100 \begin_inset Flex CharStyle:Code
7103 \begin_layout Plain Layout
7109 Specifies a module to be included by default with this document class,
7110 which should be specified by filename without the
7111 \begin_inset Flex CharStyle:Code
7114 \begin_layout Plain Layout
7121 The user can still remove the module, but it will be active at the outset.
7122 (This applies only when new files are created, or when this class is chosen
7123 for an existing document.)
7126 \begin_layout Description
7127 \begin_inset Flex CharStyle:Code
7130 \begin_layout Plain Layout
7137 \begin_inset Flex CharStyle:Code
7140 \begin_layout Plain Layout
7146 ] This is the style that will be assigned to new paragraphs, usually
7147 \begin_inset Flex CharStyle:MenuItem
7150 \begin_layout Plain Layout
7157 This will default to the first defined style if not given, but you are
7158 highly encouraged to use this directive.
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 ] Indicates that the module in question—which should be specified by filename
7183 \begin_inset Flex CharStyle:Code
7186 \begin_layout Plain Layout
7192 extension—cannot be used with this document class.
7193 This might be used in a journal-specific layout file to prevent, say, the
7195 \begin_inset Flex CharStyle:Code
7198 \begin_layout Plain Layout
7204 module that numbers theorems by section.
7209 be used in a module.
7210 Modules have their own way of excluding other modules (see
7211 \begin_inset CommandInset ref
7213 reference "sub:Layout-modules"
7220 \begin_layout Description
7221 \begin_inset Flex CharStyle:Code
7224 \begin_layout Plain Layout
7230 Defines a new float.
7232 \begin_inset space ~
7236 \begin_inset CommandInset ref
7238 reference "sec:floats"
7244 \begin_inset Quotes eld
7248 \begin_inset Flex CharStyle:Code
7251 \begin_layout Plain Layout
7258 \begin_inset Quotes erd
7264 \begin_layout Description
7265 \begin_inset Flex CharStyle:Code
7268 \begin_layout Plain Layout
7274 As its name implies, this command allows you to include another layout
7275 definition file within yours to avoid duplicating commands.
7276 Common examples are the standard layout files, for example,
7277 \begin_inset Flex CharStyle:Code
7280 \begin_layout Plain Layout
7286 , which contains most of the basic layouts.
7289 \begin_layout Description
7290 \begin_inset Flex CharStyle:Code
7293 \begin_layout Plain Layout
7299 This section (re-)defines the layout of an inset.
7300 It can be applied to an existing inset of to a new, user-defined inset,
7302 \begin_inset space \thinspace{}
7306 \begin_inset space \space{}
7309 a new character style.
7311 \begin_inset space ~
7315 \begin_inset CommandInset ref
7317 reference "sec:charstyle"
7321 for more information.
7323 \begin_inset Quotes eld
7327 \begin_inset Flex CharStyle:Code
7330 \begin_layout Plain Layout
7337 \begin_inset Quotes erd
7343 \begin_layout Description
7344 \begin_inset Flex CharStyle:Code
7347 \begin_layout Plain Layout
7353 A string that indicates the width of the left margin on the screen, for
7355 \begin_inset Quotes eld
7359 \begin_inset Quotes erd
7365 \begin_layout Description
7366 \begin_inset Flex CharStyle:Code
7369 \begin_layout Plain Layout
7375 This command deletes an existing float.
7376 This is particularly useful when you want to suppress a float that has
7377 be defined in an input file.
7380 \begin_layout Description
7381 \begin_inset Flex CharStyle:Code
7384 \begin_layout Plain Layout
7390 This command deletes an existing style.
7391 This is particularly useful when you want to suppress a style that has
7392 be defined in an input file.
7395 \begin_layout Description
7396 \begin_inset Flex CharStyle:Code
7399 \begin_layout Plain Layout
7405 A string indicating what sort of output documents using this class will
7407 At present, the options are: `docbook', `latex', and `literate'.
7410 \begin_layout Description
7411 \begin_inset Flex CharStyle:Code
7414 \begin_layout Plain Layout
7425 \begin_inset Flex CharStyle:Code
7428 \begin_layout Plain Layout
7439 \begin_inset Flex CharStyle:Code
7442 \begin_layout Plain Layout
7449 \begin_inset Flex CharStyle:Code
7452 \begin_layout Plain Layout
7458 ] The class default pagestyle.
7459 Can be changed in the
7460 \begin_inset Flex CharStyle:MenuItem
7463 \begin_layout Plain Layout
7464 Document\SpecialChar \menuseparator
7473 \begin_layout Description
7474 \begin_inset Flex CharStyle:Code
7477 \begin_layout Plain Layout
7483 Sets the preamble for the LaTeX document.
7484 Note that this will completely override any prior
7485 \begin_inset Flex CharStyle:Code
7488 \begin_layout Plain Layout
7495 \begin_inset Flex CharStyle:Code
7498 \begin_layout Plain Layout
7506 \begin_inset Quotes eld
7510 \begin_inset Flex CharStyle:Code
7513 \begin_layout Plain Layout
7520 \begin_inset Quotes erd
7526 \begin_layout Description
7527 \begin_inset Flex CharStyle:Code
7530 \begin_layout Plain Layout
7537 \begin_inset Flex CharStyle:Code
7540 \begin_layout Plain Layout
7547 \begin_inset Flex CharStyle:Code
7550 \begin_layout Plain Layout
7559 \begin_inset Flex CharStyle:Code
7562 \begin_layout Plain Layout
7568 ] Whether the class already provides the feature
7569 \begin_inset Flex CharStyle:Code
7572 \begin_layout Plain Layout
7579 A feature is in general the name of a package (
7580 \begin_inset Flex CharStyle:Code
7583 \begin_layout Plain Layout
7590 \begin_inset Flex CharStyle:Code
7593 \begin_layout Plain Layout
7599 , \SpecialChar \ldots{}
7601 \begin_inset Flex CharStyle:Code
7604 \begin_layout Plain Layout
7611 \begin_inset Flex CharStyle:Code
7614 \begin_layout Plain Layout
7620 ,\SpecialChar \ldots{}
7621 ); the complete list of supported features is unfortunately not documented
7622 outside the LyX source code—but see
7623 \begin_inset Flex CharStyle:Code
7626 \begin_layout Plain Layout
7632 if you're interested.
7634 \begin_inset Flex CharStyle:MenuItem
7637 \begin_layout Plain Layout
7638 Help\SpecialChar \menuseparator
7644 also gives an overview of the supported packages.
7647 \begin_layout Description
7648 \begin_inset Flex CharStyle:Code
7651 \begin_layout Plain Layout
7658 \begin_inset Flex CharStyle:Code
7661 \begin_layout Plain Layout
7667 ] Indicates that this layout provides the functionality of the module mentioned,
7668 which should be specified by the filename without the
7669 \begin_inset Flex CharStyle:Code
7672 \begin_layout Plain Layout
7679 This will typically be used if the layout includes the module directly,
7680 rather than using the
7681 \begin_inset Flex CharStyle:Code
7684 \begin_layout Plain Layout
7690 tag to indicate that it ought to be used.
7691 It could be used in a module that provided an alternate implementation
7692 of the same functionality.
7695 \begin_layout Description
7696 \begin_inset Flex CharStyle:Code
7699 \begin_layout Plain Layout
7706 \begin_inset Flex CharStyle:Code
7709 \begin_layout Plain Layout
7715 ] Whether the class requires the feature
7716 \begin_inset Flex CharStyle:Code
7719 \begin_layout Plain Layout
7726 Multiple features must be separated by commas.
7727 Note that you can only request supported features.
7730 \begin_layout Description
7731 \begin_inset Flex CharStyle:Code
7734 \begin_layout Plain Layout
7740 A string that indicates the width of the right margin on the screen, for
7742 \begin_inset Quotes eld
7746 \begin_inset Quotes erd
7752 \begin_layout Description
7753 \begin_inset Flex CharStyle:Code
7756 \begin_layout Plain Layout
7762 Sets which divisions get numbered.
7764 \begin_inset Flex CharStyle:Code
7767 \begin_layout Plain Layout
7776 \begin_layout Description
7777 \begin_inset Flex CharStyle:Code
7780 \begin_layout Plain Layout
7789 \begin_inset Flex CharStyle:Code
7792 \begin_layout Plain Layout
7803 \begin_inset Flex CharStyle:Code
7806 \begin_layout Plain Layout
7812 ] Whether the class-default should be printing on one or both sides of the
7814 Can be changed in the
7815 \begin_inset Flex CharStyle:MenuItem
7818 \begin_layout Plain Layout
7819 Document\SpecialChar \menuseparator
7828 \begin_layout Description
7829 \begin_inset Flex CharStyle:Code
7832 \begin_layout Plain Layout
7838 This sequence defines a new paragraph style.
7839 If the style already exists, it will redefine some of its parameters instead.
7841 \begin_inset space ~
7845 \begin_inset CommandInset ref
7847 reference "sec:style"
7853 \begin_inset Quotes eld
7857 \begin_inset Flex CharStyle:Code
7860 \begin_layout Plain Layout
7867 \begin_inset Quotes erd
7873 \begin_layout Description
7874 \begin_inset Flex CharStyle:Code
7877 \begin_layout Plain Layout
7884 \begin_inset Flex CharStyle:Code
7887 \begin_layout Plain Layout
7893 ] The name of the command or environment to be used with
7894 \begin_inset Flex CharStyle:Code
7897 \begin_layout Plain Layout
7906 \begin_layout Description
7907 \begin_inset Flex CharStyle:Code
7910 \begin_layout Plain Layout
7917 \begin_inset Flex CharStyle:Code
7920 \begin_layout Plain Layout
7929 \begin_inset Flex CharStyle:Code
7932 \begin_layout Plain Layout
7938 ] Indicates what kind of markup is used to define the title of a document.
7940 \begin_inset Flex CharStyle:Code
7943 \begin_layout Plain Layout
7949 means that the macro with name
7950 \begin_inset Flex CharStyle:Code
7953 \begin_layout Plain Layout
7959 will be inserted after the last layout which has
7960 \begin_inset Quotes eld
7964 \begin_inset Flex CharStyle:Code
7967 \begin_layout Plain Layout
7974 \begin_inset Quotes erd
7979 \begin_inset Flex CharStyle:Code
7982 \begin_layout Plain Layout
7988 corresponds to the case where the block of paragraphs which have
7989 \begin_inset Quotes eld
7993 \begin_inset Flex CharStyle:Code
7996 \begin_layout Plain Layout
8003 \begin_inset Quotes erd
8006 should be enclosed into the
8007 \begin_inset Flex CharStyle:Code
8010 \begin_layout Plain Layout
8019 \begin_layout Description
8020 \begin_inset Flex CharStyle:Code
8023 \begin_layout Plain Layout
8029 Sets which divisions are included in the table of contents.
8031 \begin_inset Flex CharStyle:Code
8034 \begin_layout Plain Layout
8043 \begin_layout Subsection
8044 \begin_inset Flex CharStyle:Code
8047 \begin_layout Plain Layout
8056 \begin_layout Standard
8057 \begin_inset CommandInset label
8059 name "sec:classoptions"
8064 \begin_inset Flex CharStyle:Code
8067 \begin_layout Plain Layout
8073 section can contain the following entries:
8076 \begin_layout Description
8077 \begin_inset Flex CharStyle:Code
8080 \begin_layout Plain Layout
8087 \begin_inset Flex CharStyle:Code
8090 \begin_layout Plain Layout
8096 ] The list of available font sizes for the document's main font, separated
8098 \begin_inset Quotes eld
8102 \begin_inset Flex CharStyle:Code
8105 \begin_layout Plain Layout
8112 \begin_inset Quotes erd
8118 \begin_layout Description
8119 \begin_inset Flex CharStyle:Code
8122 \begin_layout Plain Layout
8128 Used to set the DTD line with XML-based output classes.
8130 \begin_inset space \thinspace{}
8134 \begin_inset Quotes eld
8137 -//OASIS//DTD DocBook V4.2//EN
8138 \begin_inset Quotes erd
8144 \begin_layout Description
8145 \begin_inset Flex CharStyle:Code
8148 \begin_layout Plain Layout
8155 \begin_inset Flex CharStyle:Code
8158 \begin_layout Plain Layout
8159 string="empty|plain|headings|fancy"
8164 ] The list of available page styles, separated by
8165 \begin_inset Quotes eld
8169 \begin_inset Flex CharStyle:Code
8172 \begin_layout Plain Layout
8179 \begin_inset Quotes erd
8185 \begin_layout Description
8186 \begin_inset Flex CharStyle:Code
8189 \begin_layout Plain Layout
8196 \begin_inset Flex CharStyle:Code
8199 \begin_layout Plain Layout
8205 ] Some document class options, separated by a comma, that will be added
8206 to the optional part of the
8207 \begin_inset Flex CharStyle:Code
8210 \begin_layout Plain Layout
8221 \begin_layout Standard
8223 \begin_inset Flex CharStyle:Code
8226 \begin_layout Plain Layout
8232 section must end with
8233 \begin_inset Quotes eld
8237 \begin_inset Flex CharStyle:Code
8240 \begin_layout Plain Layout
8247 \begin_inset Quotes erd
8253 \begin_layout Subsection
8257 \begin_layout Standard
8258 \begin_inset CommandInset label
8264 A paragraph style description looks like this:
8268 \begin_layout Plain Layout
8269 Note that this will either define a new layout or modify an existing one.
8277 \begin_layout LyX-Code
8284 \begin_layout LyX-Code
8288 \begin_layout LyX-Code
8292 \begin_layout Standard
8293 where the following commands are allowed:
8296 \begin_layout Description
8297 \begin_inset Flex CharStyle:Code
8300 \begin_layout Plain Layout
8307 \begin_inset Flex CharStyle:Code
8310 \begin_layout Plain Layout
8315 , left, right, center
8320 ] Paragraph alignment.
8323 \begin_layout Description
8324 \begin_inset Flex CharStyle:Code
8327 \begin_layout Plain Layout
8334 \begin_inset Flex CharStyle:Code
8337 \begin_layout Plain Layout
8342 , left, right, center
8347 ] A comma separated list of permitted alignments.
8348 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
8350 For example a right-aligned or centered enumeration isn't possible.)
8353 \begin_layout Description
8354 \begin_inset Flex CharStyle:Code
8357 \begin_layout Plain Layout
8364 \begin_inset Flex CharStyle:Code
8367 \begin_layout Plain Layout
8377 \begin_layout Plain Layout
8378 Note that a `float' here is a real number, such as: 1.5.
8383 The vertical space with which the last of a chain of paragraphs with this
8384 layout is separated from the following paragraph.
8385 If the next paragraph has another layout, the separations are not simply
8386 added, but the maximum is taken.
8389 \begin_layout Description
8390 \begin_inset Flex CharStyle:Code
8393 \begin_layout Plain Layout
8400 \begin_inset Flex CharStyle:Code
8403 \begin_layout Plain Layout
8409 The category for this style.
8410 This is used to group related styles in the Layout combobox on the toolbar.
8411 Any string can be used, but you may want to use existing categories with
8416 \begin_layout Description
8417 \begin_inset Flex CharStyle:Code
8420 \begin_layout Plain Layout
8426 Depth of XML command.
8427 Used only with XML-type formats.
8430 \begin_layout Description
8431 \begin_inset Flex CharStyle:Code
8434 \begin_layout Plain Layout
8441 \begin_inset CommandInset label
8443 name "des:CopyStyle"
8448 \begin_inset Flex CharStyle:Code
8451 \begin_layout Plain Layout
8457 Copies all the features of an existing style into the current one.
8461 \begin_layout Description
8462 \begin_inset Flex CharStyle:Code
8465 \begin_layout Plain Layout
8471 The name of a style whose preamble should be output
8476 This allows to ensure some ordering of the preamble snippets when macros
8477 definitions depend on one another.
8481 \begin_layout Plain Layout
8482 Note that, besides that functionality, there is no way to ensure any ordering
8484 The ordering that you see in a given version of LyX may change without
8485 warning in later versions.
8493 \begin_layout Description
8494 \begin_inset Flex CharStyle:Code
8497 \begin_layout Plain Layout
8504 \begin_inset Flex CharStyle:Code
8507 \begin_layout Plain Layout
8512 , Box, Filled_Box, Static
8517 ] The type of label that stands at the end of the paragraph (or sequence
8519 \begin_inset Flex CharStyle:Code
8522 \begin_layout Plain Layout
8529 \begin_inset Flex CharStyle:Code
8532 \begin_layout Plain Layout
8539 \begin_inset Flex CharStyle:Code
8542 \begin_layout Plain Layout
8549 \begin_inset Flex CharStyle:Code
8552 \begin_layout Plain Layout
8560 \begin_inset Flex CharStyle:Code
8563 \begin_layout Plain Layout
8570 \begin_inset Quotes eld
8574 \begin_inset Quotes erd
8578 \begin_inset Flex CharStyle:Code
8581 \begin_layout Plain Layout
8588 \begin_inset Flex CharStyle:Code
8591 \begin_layout Plain Layout
8592 \begin_inset space ~
8601 \begin_inset space ~
8604 black) square suitable for end of proof markers,
8605 \begin_inset Flex CharStyle:Code
8608 \begin_layout Plain Layout
8614 is an explicit text string.
8617 \begin_layout Description
8618 \begin_inset Flex CharStyle:Code
8621 \begin_layout Plain Layout
8628 \begin_inset Flex CharStyle:Code
8631 \begin_layout Plain Layout
8637 ] The string used for a label with a
8638 \begin_inset Flex CharStyle:Code
8641 \begin_layout Plain Layout
8648 \begin_inset Flex CharStyle:Code
8651 \begin_layout Plain Layout
8661 \begin_layout Description
8662 \begin_inset Flex CharStyle:Code
8665 \begin_layout Plain Layout
8672 \begin_inset Flex CharStyle:Code
8675 \begin_layout Plain Layout
8686 \begin_inset Flex CharStyle:Code
8689 \begin_layout Plain Layout
8698 \begin_layout Description
8699 \begin_inset Flex CharStyle:Code
8702 \begin_layout Plain Layout
8709 \begin_inset Flex CharStyle:Code
8712 \begin_layout Plain Layout
8722 ] With this parameter the
8723 \begin_inset Flex CharStyle:MenuItem
8726 \begin_layout Plain Layout
8733 \begin_inset Quotes eld
8736 Vertical space above
8737 \begin_inset Quotes erd
8741 \begin_inset Flex CharStyle:MenuItem
8744 \begin_layout Plain Layout
8745 Edit\SpecialChar \menuseparator
8747 \begin_inset space ~
8755 dialog can be set when initializing a paragraph with this style.
8759 \begin_layout Plain Layout
8762 Note from Jean-Marc:
8764 I'm not sure that this setting has much use, and it should probably be
8765 removed in later versions.
8773 \begin_layout Description
8774 \begin_inset Flex CharStyle:Code
8777 \begin_layout Plain Layout
8783 The font used for both the text body
8789 \begin_inset space ~
8793 \begin_inset CommandInset ref
8795 reference "sec:fonts"
8800 Note that defining this font automatically defines the
8801 \begin_inset Flex CharStyle:Code
8804 \begin_layout Plain Layout
8811 So you should define this one first if you also want to define
8812 \begin_inset Flex CharStyle:Code
8815 \begin_layout Plain Layout
8824 \begin_layout Description
8825 \begin_inset Flex CharStyle:Code
8828 \begin_layout Plain Layout
8835 \begin_inset CommandInset label
8837 name "des:FreeSpacing"
8844 \begin_inset Flex CharStyle:Code
8847 \begin_layout Plain Layout
8858 \begin_inset Flex CharStyle:Code
8861 \begin_layout Plain Layout
8867 ] Usually LyX doesn't allow you to insert more than one space between words,
8868 since a space is considered as the separation between two words, not a
8869 character or symbol of its own.
8870 This is a very fine thing but sometimes annoying, for example, when typing
8871 program code or plain LaTeX code.
8873 \begin_inset Flex CharStyle:Code
8876 \begin_layout Plain Layout
8883 Note that LyX will create protected blanks for the additional blanks when
8884 in another mode than LaTeX-mode.
8887 \begin_layout Description
8888 \begin_inset Flex CharStyle:Code
8891 \begin_layout Plain Layout
8897 Language dependent information to be included in the LaTeX preamble when
8899 Note that this will completely override any prior
8900 \begin_inset Flex CharStyle:Code
8903 \begin_layout Plain Layout
8911 \begin_inset Quotes eld
8915 \begin_inset Flex CharStyle:Code
8918 \begin_layout Plain Layout
8925 \begin_inset Quotes erd
8929 The contents of this tag will occur once in the LaTeX preamble for each
8930 language used by the document.
8931 Each time, the following substitutions are made:
8935 \begin_layout Itemize
8936 \begin_inset Flex CharStyle:Code
8939 \begin_layout Plain Layout
8945 is replaced by the language name (as used by the babel package).
8948 \begin_layout Itemize
8950 \begin_inset Quotes eld
8954 \begin_inset Quotes erd
8958 \begin_inset Flex CharStyle:Code
8961 \begin_layout Plain Layout
8967 replaces its argument by the translation of the argument to the current
8971 \begin_layout Standard
8972 If the style defines text that appears in the typeset document, it may use
8974 \begin_inset Flex CharStyle:Code
8977 \begin_layout Plain Layout
8983 to support non-english and even multilanguage documents correctly.
8984 The following excerpt (from the
8985 \begin_inset Flex CharStyle:Code
8988 \begin_layout Plain Layout
8994 file) shows how this works:
8997 \begin_layout LyX-Code
9001 \begin_layout LyX-Code
9009 \begin_layout LyX-Code
9012 theoremstyle{remark}
9015 \begin_layout LyX-Code
9018 newtheorem{claim}[thm]{
9025 \begin_layout LyX-Code
9029 \begin_layout LyX-Code
9033 \begin_layout LyX-Code
9049 \begin_layout LyX-Code
9058 claimname}{_(Claim)}}%
9061 \begin_layout LyX-Code
9067 \begin_layout LyX-Code
9071 \begin_layout Standard
9072 The key to correct translation of the user visible text is the definition
9074 \begin_inset Flex CharStyle:Code
9077 \begin_layout Plain Layout
9085 in the standard preamble.
9086 This command holds the name of the theorem that will appear in the output.
9088 \begin_inset Flex CharStyle:Code
9091 \begin_layout Plain Layout
9097 then uses the commands offered by the babel package to redefine
9098 \begin_inset Flex CharStyle:Code
9101 \begin_layout Plain Layout
9109 for each used language.
9111 \begin_inset Flex CharStyle:Code
9114 \begin_layout Plain Layout
9124 test ensures that no LaTeX error occurs in documents that do not use babel.
9125 Since LyX loads babel after the style-specific preamble, the whole command
9126 is deferred to the actual start of the document with
9127 \begin_inset Flex CharStyle:Code
9130 \begin_layout Plain Layout
9142 \begin_layout Description
9143 \begin_inset Flex CharStyle:Code
9146 \begin_layout Plain Layout
9152 [[FIXME]] (Used only with XML-type formats.)
9155 \begin_layout Description
9156 \begin_inset Flex CharStyle:Code
9159 \begin_layout Plain Layout
9166 \begin_inset Flex CharStyle:Code
9169 \begin_layout Plain Layout
9175 If 1, marks the layout as being part of a title block (see also the
9176 \begin_inset Flex CharStyle:Code
9179 \begin_layout Plain Layout
9186 \begin_inset Flex CharStyle:Code
9189 \begin_layout Plain Layout
9198 \begin_layout Description
9199 \begin_inset Flex CharStyle:Code
9202 \begin_layout Plain Layout
9209 \begin_inset Flex CharStyle:Code
9212 \begin_layout Plain Layout
9218 ] This provides extra space between paragraphs that have the same layout.
9219 If you put other layouts into an environment, each is separated with the
9221 \begin_inset Flex CharStyle:Code
9224 \begin_layout Plain Layout
9231 But the whole items of the environment are additionally separated with
9233 \begin_inset Flex CharStyle:Code
9236 \begin_layout Plain Layout
9248 \begin_layout Description
9249 \begin_inset Flex CharStyle:Code
9252 \begin_layout Plain Layout
9258 [[FIXME]] (Used only with XML-type formats.)
9261 \begin_layout Description
9262 \begin_inset Flex CharStyle:Code
9265 \begin_layout Plain Layout
9272 \begin_inset CommandInset label
9274 name "des:KeepEmpty"
9281 \begin_inset Flex CharStyle:Code
9284 \begin_layout Plain Layout
9295 \begin_inset Flex CharStyle:Code
9298 \begin_layout Plain Layout
9304 ] Usually LyX does not allow you to leave a paragraph empty, since it would
9305 lead to empty LaTeX output.
9306 There are some cases where this could be desirable however: in a letter
9307 template, the required fields can be provided as empty fields, so that
9308 people do not forget them; in some special classes, a layout can be used
9309 as some kind of break, which does not contain actual text.
9312 \begin_layout Description
9313 \begin_inset Flex CharStyle:Code
9316 \begin_layout Plain Layout
9322 [float=0] The vertical space between the label and the text body.
9323 Only used for labels that are above the text body (
9324 \begin_inset Flex CharStyle:Code
9327 \begin_layout Plain Layout
9334 \begin_inset Flex CharStyle:Code
9337 \begin_layout Plain Layout
9338 Centered_Top_Environment
9346 \begin_layout Description
9347 \begin_inset Flex CharStyle:Code
9350 \begin_layout Plain Layout
9357 \begin_inset Flex CharStyle:Code
9360 \begin_layout Plain Layout
9367 \begin_inset Newline newline
9370 The name of the counter for automatic numbering (see Section
9371 \begin_inset CommandInset ref
9373 reference "sec:counter"
9378 This must be given if
9379 \begin_inset Flex CharStyle:Code
9382 \begin_layout Plain Layout
9389 \begin_inset Flex CharStyle:Code
9392 \begin_layout Plain Layout
9401 \begin_layout Description
9402 \begin_inset Flex CharStyle:Code
9405 \begin_layout Plain Layout
9411 The font used for the label.
9413 \begin_inset space ~
9417 \begin_inset CommandInset ref
9419 reference "sec:fonts"
9426 \begin_layout Description
9427 \begin_inset Flex CharStyle:Code
9430 \begin_layout Plain Layout
9436 Text that indicates how far a label should be indented.
9439 \begin_layout Description
9440 \begin_inset Flex CharStyle:Code
9443 \begin_layout Plain Layout
9450 \begin_inset Flex CharStyle:Code
9453 \begin_layout Plain Layout
9459 ] The horizontal space between the label and the text body.
9460 Only used for labels that are not above the text body.
9463 \begin_layout Description
9464 \begin_inset Flex CharStyle:Code
9467 \begin_layout Plain Layout
9474 \begin_inset Flex CharStyle:Code
9477 \begin_layout Plain Layout
9483 ] The string used for a label with a
9484 \begin_inset Flex CharStyle:Code
9487 \begin_layout Plain Layout
9495 \begin_inset Flex CharStyle:Code
9498 \begin_layout Plain Layout
9504 is set, this string can be contain the special formatting commands described
9506 \begin_inset CommandInset ref
9508 reference "sec:counter"
9516 \begin_layout Plain Layout
9517 For the sake of backwards compatibility, the string
9518 \begin_inset Flex CharStyle:Code
9521 \begin_layout Plain Layout
9531 will be replaced by the expanded
9532 \begin_inset Flex CharStyle:Code
9535 \begin_layout Plain Layout
9542 \begin_inset Flex CharStyle:Code
9545 \begin_layout Plain Layout
9554 This feature is now obsolete and should be replaced by the mechanisms of
9556 \begin_inset CommandInset ref
9558 reference "sec:counter"
9570 \begin_layout Description
9571 \begin_inset Flex CharStyle:Code
9574 \begin_layout Plain Layout
9581 \begin_inset Flex CharStyle:Code
9584 \begin_layout Plain Layout
9590 ] This is used inside the appendix instead of
9591 \begin_inset Flex CharStyle:Code
9594 \begin_layout Plain Layout
9602 \begin_inset Flex CharStyle:Code
9605 \begin_layout Plain Layout
9612 \begin_inset Flex CharStyle:Code
9615 \begin_layout Plain Layout
9624 \begin_layout Description
9625 \begin_inset Flex CharStyle:Code
9628 \begin_layout Plain Layout
9634 [FIXME] (Used only with XML-type formats.)
9637 \begin_layout Description
9638 \begin_inset Flex CharStyle:Code
9641 \begin_layout Plain Layout
9648 \begin_inset Flex CharStyle:Code
9651 \begin_layout Plain Layout
9656 , Manual, Static, Top_Environment,
9657 \begin_inset Newline newline
9660 Centered_Top_Environment, Sensitive, Counter
9666 \begin_inset Newline newline
9670 \begin_inset Flex CharStyle:Code
9673 \begin_layout Plain Layout
9679 means the label is the very first word (up to the first real blank).
9683 \begin_layout Plain Layout
9684 Use protected spaces if you want more than one word as the label.
9690 \begin_inset Flex CharStyle:Code
9693 \begin_layout Plain Layout
9699 means it is defined in the layout (see
9700 \begin_inset Flex CharStyle:Code
9703 \begin_layout Plain Layout
9711 \begin_inset Flex CharStyle:Code
9714 \begin_layout Plain Layout
9721 \begin_inset Flex CharStyle:Code
9724 \begin_layout Plain Layout
9725 Centered_Top_Environment
9730 are special cases of
9731 \begin_inset Flex CharStyle:Code
9734 \begin_layout Plain Layout
9741 The label will be printed above the paragraph, but only at the top of an
9742 environment or the top of a chain of paragraphs with this layout.
9743 Usage is for example the
9744 \begin_inset Flex CharStyle:MenuItem
9747 \begin_layout Plain Layout
9754 \begin_inset Flex CharStyle:MenuItem
9757 \begin_layout Plain Layout
9764 This is also the case for
9765 \begin_inset Flex CharStyle:Code
9768 \begin_layout Plain Layout
9774 labels with latex type
9775 \begin_inset Flex CharStyle:Code
9778 \begin_layout Plain Layout
9784 , in order to make layouts for theorems work correctly.
9786 \begin_inset Flex CharStyle:Code
9789 \begin_layout Plain Layout
9795 is a special case for the caption-labels
9796 \begin_inset Quotes eld
9800 \begin_inset Quotes erd
9804 \begin_inset Quotes eld
9808 \begin_inset Quotes erd
9813 \begin_inset Flex CharStyle:Code
9816 \begin_layout Plain Layout
9822 means the (hardcoded) label string depends on the kind of float.
9824 \begin_inset Flex CharStyle:Code
9827 \begin_layout Plain Layout
9833 label type defines automatically numbered labels.
9835 \begin_inset CommandInset ref
9837 reference "sec:counter"
9844 \begin_layout Description
9845 \begin_inset Flex CharStyle:Code
9848 \begin_layout Plain Layout
9854 The name of the corresponding LaTeX stuff.
9855 Either the environment or command name.
9858 \begin_layout Description
9859 \begin_inset Flex CharStyle:Code
9862 \begin_layout Plain Layout
9868 An optional parameter for the corresponding
9869 \begin_inset Flex CharStyle:Code
9872 \begin_layout Plain Layout
9879 This parameter cannot be changed from within LyX.
9882 \begin_layout Description
9883 \begin_inset Flex CharStyle:Code
9886 \begin_layout Plain Layout
9893 \begin_inset CommandInset label
9895 name "des:LatexType"
9900 \begin_inset Flex CharStyle:Code
9903 \begin_layout Plain Layout
9908 , Command, Environment, Item_Environment,
9914 \begin_inset Flex CharStyle:Code
9917 \begin_layout Plain Layout
9923 ] How the layout should be translated into LaTeX.
9925 \begin_inset Flex CharStyle:Code
9928 \begin_layout Plain Layout
9934 means nothing special.
9936 \begin_inset Flex CharStyle:Code
9939 \begin_layout Plain Layout
9946 \begin_inset Flex CharStyle:Code
9949 \begin_layout Plain Layout
9956 {\SpecialChar \ldots{}
9963 \begin_inset Flex CharStyle:Code
9966 \begin_layout Plain Layout
9973 \begin_inset Flex CharStyle:Code
9976 \begin_layout Plain Layout
9983 }\SpecialChar \ldots{}
9997 \begin_inset Flex CharStyle:Code
10000 \begin_layout Plain Layout
10007 \begin_inset Flex CharStyle:Code
10010 \begin_layout Plain Layout
10017 \begin_inset Flex CharStyle:Code
10020 \begin_layout Plain Layout
10028 is generated for each paragraph of this environment.
10030 \begin_inset Flex CharStyle:Code
10033 \begin_layout Plain Layout
10040 \begin_inset Flex CharStyle:Code
10043 \begin_layout Plain Layout
10050 \begin_inset Flex CharStyle:Code
10053 \begin_layout Plain Layout
10059 is passed as an argument to the environment.
10061 \begin_inset Flex CharStyle:Code
10064 \begin_layout Plain Layout
10070 can be defined in the
10071 \begin_inset Flex CharStyle:MenuItem
10074 \begin_layout Plain Layout
10079 ayout\SpecialChar \menuseparator
10091 \begin_inset Flex CharStyle:Code
10094 \begin_layout Plain Layout
10102 is perhaps a bit misleading, since these rules apply to SGML classes, too.
10103 Visit the SGML class files for specific examples.
10106 \begin_layout Standard
10107 Putting the last few things together, the LaTeX output will be either:
10110 \begin_layout LyX-Code
10113 latexname[latexparam]{\SpecialChar \ldots{}
10117 \begin_layout Standard
10121 \begin_layout LyX-Code
10124 begin{latexname}[latexparam] \SpecialChar \ldots{}
10130 \begin_layout Standard
10131 depending upon the LaTeX type.
10134 \begin_layout Description
10135 \begin_inset Flex CharStyle:Code
10138 \begin_layout Plain Layout
10145 \begin_inset Flex CharStyle:Code
10148 \begin_layout Plain Layout
10154 ] If you put layouts into environments, the leftmargins are not simply added,
10155 but added with a factor
10156 \begin_inset Formula $\frac{4}{depth+4}$
10160 Note that this parameter is also used when the margin is defined as
10161 \begin_inset Flex CharStyle:Code
10164 \begin_layout Plain Layout
10171 \begin_inset Flex CharStyle:Code
10174 \begin_layout Plain Layout
10181 Then it is added to the manual or dynamic margin.
10183 \begin_inset Newline newline
10186 The argument is passed as a string.
10188 \begin_inset Quotes eld
10192 \begin_inset Flex CharStyle:Code
10195 \begin_layout Plain Layout
10202 \begin_inset Quotes erd
10205 means that the paragraph is indented with the width of
10206 \begin_inset Quotes eld
10210 \begin_inset Flex CharStyle:Code
10213 \begin_layout Plain Layout
10220 \begin_inset Quotes erd
10223 in the normal font.
10224 You can get a negative width by prefixing the string with
10225 \begin_inset Quotes eld
10229 \begin_inset Flex CharStyle:Code
10232 \begin_layout Plain Layout
10239 \begin_inset Quotes erd
10243 This way was chosen so that the look is the same with each used screen
10248 \begin_layout Description
10249 \begin_inset Flex CharStyle:Code
10252 \begin_layout Plain Layout
10259 \begin_inset Flex CharStyle:Code
10262 \begin_layout Plain Layout
10267 , Manual, Dynamic, First_Dynamic, Right_Address_Box
10273 \begin_inset Newline newline
10276 The kind of margin that the layout has on the left side.
10278 \begin_inset Flex CharStyle:Code
10281 \begin_layout Plain Layout
10287 just means a fixed margin.
10289 \begin_inset Flex CharStyle:Code
10292 \begin_layout Plain Layout
10298 means that the left margin depends on the string entered in the
10299 \begin_inset Flex CharStyle:MenuItem
10302 \begin_layout Plain Layout
10303 Edit\SpecialChar \menuseparator
10305 \begin_inset space ~
10314 This is used to typeset nice lists without tabulators.
10316 \begin_inset Flex CharStyle:Code
10319 \begin_layout Plain Layout
10325 means that the margin depends on the size of the label.
10326 This is used for automatic enumerated headlines.
10327 It is obvious that the headline
10328 \begin_inset Quotes eld
10331 5.4.3.2.1 Very long headline
10332 \begin_inset Quotes erd
10335 must have a wider left margin (as wide as
10336 \begin_inset Quotes eld
10340 \begin_inset Quotes erd
10343 plus the space) than
10344 \begin_inset Quotes eld
10347 3.2 Very long headline
10348 \begin_inset Quotes erd
10352 \begin_inset Quotes eld
10356 \begin_inset Quotes erd
10359 are not able to do this.
10361 \begin_inset Flex CharStyle:Code
10364 \begin_layout Plain Layout
10370 is similar, but only the very first row of the paragraph is dynamic, while
10371 the others are static; this is used, for example, for descriptions.
10373 \begin_inset Flex CharStyle:Code
10376 \begin_layout Plain Layout
10382 means the margin is chosen in a way that the longest row of this paragraph
10383 fits to the right margin.
10384 This is used to typeset an address on the right edge of the page.
10387 \begin_layout Description
10388 \begin_inset Flex CharStyle:Code
10391 \begin_layout Plain Layout
10398 \begin_inset Flex CharStyle:Code
10401 \begin_layout Plain Layout
10410 \begin_inset Flex CharStyle:Code
10413 \begin_layout Plain Layout
10419 ] Whether fragile commands in this layout should be
10420 \begin_inset Flex CharStyle:Code
10423 \begin_layout Plain Layout
10436 whether this command should itself be protected.)
10439 \begin_layout Description
10440 \begin_inset Flex CharStyle:Code
10443 \begin_layout Plain Layout
10450 \begin_inset Flex CharStyle:Code
10453 \begin_layout Plain Layout
10460 \begin_inset Flex CharStyle:Code
10463 \begin_layout Plain Layout
10471 ] Whether newlines are translated into LaTeX newlines (
10472 \begin_inset Flex CharStyle:Code
10475 \begin_layout Plain Layout
10486 The translation can be switched off to allow more comfortable LaTeX editing
10490 \begin_layout Description
10491 \begin_inset Flex CharStyle:Code
10494 \begin_layout Plain Layout
10501 \begin_inset Flex CharStyle:Code
10504 \begin_layout Plain Layout
10511 \begin_inset Flex CharStyle:Code
10514 \begin_layout Plain Layout
10522 ] Whether the following Paragraph is allowed to indent its very first row.
10524 \begin_inset Flex CharStyle:Code
10527 \begin_layout Plain Layout
10533 means that it is not allowed to do so;
10534 \begin_inset Flex CharStyle:Code
10537 \begin_layout Plain Layout
10543 means it could do so if it wants to.
10546 \begin_layout Description
10547 \begin_inset Flex CharStyle:Code
10550 \begin_layout Plain Layout
10556 Name of a layout that has replaced this layout.
10557 This is used to rename a layout, while keeping backward compatibility.
10560 \begin_layout Description
10561 \begin_inset Flex CharStyle:Code
10564 \begin_layout Plain Layout
10571 \begin_inset Flex CharStyle:Code
10574 \begin_layout Plain Layout
10580 ] The number of optional arguments that can be used with this layout.
10581 This is useful for things like section headings, and only makes sense with
10585 \begin_layout Description
10586 \begin_inset Flex CharStyle:Code
10589 \begin_layout Plain Layout
10596 \begin_inset Flex CharStyle:Code
10599 \begin_layout Plain Layout
10605 ] The indent of the very first line of a paragraph.
10607 \begin_inset Flex CharStyle:Code
10610 \begin_layout Plain Layout
10616 will be fixed for a certain layout.
10617 The exception is Standard layout, since the indentation of a Standard layout
10618 paragraph can be prohibited with
10619 \begin_inset Flex CharStyle:Code
10622 \begin_layout Plain Layout
10629 Also, Standard layout paragraphs inside environments use the
10630 \begin_inset Flex CharStyle:Code
10633 \begin_layout Plain Layout
10639 of the environment, not their native one.
10640 For example, Standard paragraphs inside an enumeration are not indented.
10643 \begin_layout Description
10644 \begin_inset Flex CharStyle:Code
10647 \begin_layout Plain Layout
10654 \begin_inset Flex CharStyle:Code
10657 \begin_layout Plain Layout
10663 ] The vertical space between two paragraphs of this layout.
10666 \begin_layout Description
10667 \begin_inset Flex CharStyle:Code
10670 \begin_layout Plain Layout
10677 \begin_inset Flex CharStyle:Code
10680 \begin_layout Plain Layout
10686 ] LyX allows the user to choose either
10687 \begin_inset Quotes eld
10691 \begin_inset Quotes erd
10695 \begin_inset Quotes eld
10699 \begin_inset Quotes erd
10702 to typeset a document.
10704 \begin_inset Quotes eld
10708 \begin_inset Quotes erd
10711 is chosen, this value is completely ignored.
10713 \begin_inset Quotes eld
10717 \begin_inset Quotes erd
10720 is chosen, the parindent of a LaTeXtype
10721 \begin_inset Quotes eld
10725 \begin_inset Quotes erd
10728 layout is ignored and all paragraphs are separated by this parskip argument.
10729 The vertical space is calculated with
10730 \begin_inset Flex CharStyle:Code
10733 \begin_layout Plain Layout
10735 \begin_inset space ~
10744 \begin_inset Flex CharStyle:Code
10747 \begin_layout Plain Layout
10753 is the height of a row with the normal font.
10754 This way, the look stays the same with different screen fonts.
10757 \begin_layout Description
10758 \begin_inset Flex CharStyle:Code
10761 \begin_layout Plain Layout
10768 \begin_inset CommandInset label
10770 name "des:PathThru"
10777 \begin_inset Flex CharStyle:Code
10780 \begin_layout Plain Layout
10791 \begin_inset Flex CharStyle:Code
10794 \begin_layout Plain Layout
10800 ] Whether the contents of this paragraph should be output in raw form, meaning
10801 without special translations that LaTeX would require.
10804 \begin_layout Description
10805 \begin_inset Flex CharStyle:Code
10808 \begin_layout Plain Layout
10815 \begin_inset CommandInset label
10817 name "des:Preamble"
10821 Information to be included in the LaTeX preamble when this style is used.
10822 Used to define macros, load packages, etc., required by this particular
10825 \begin_inset Quotes eld
10829 \begin_inset Flex CharStyle:Code
10832 \begin_layout Plain Layout
10839 \begin_inset Quotes erd
10845 \begin_layout Description
10846 \begin_inset Flex CharStyle:Code
10849 \begin_layout Plain Layout
10856 \begin_inset Flex CharStyle:Code
10859 \begin_layout Plain Layout
10866 \begin_inset CommandInset label
10868 name "des:Requires"
10872 Whether the layout requires the feature
10873 \begin_inset Flex CharStyle:Code
10876 \begin_layout Plain Layout
10883 See the description of
10884 \begin_inset Flex CharStyle:Code
10887 \begin_layout Plain Layout
10894 \begin_inset CommandInset ref
10895 LatexCommand pageref
10896 reference "des:FreeSpacing"
10900 ) for information on `features'.
10904 \begin_layout Description
10905 \begin_inset Flex CharStyle:Code
10908 \begin_layout Plain Layout
10915 \begin_inset Flex CharStyle:Code
10918 \begin_layout Plain Layout
10925 \begin_inset Flex CharStyle:Code
10928 \begin_layout Plain Layout
10937 \begin_layout Description
10938 \begin_inset Flex CharStyle:Code
10941 \begin_layout Plain Layout
10948 \begin_inset Flex CharStyle:Code
10951 \begin_layout Plain Layout
10956 , onehalf, double, other
10965 ] This defines what the default spacing should be in the layout.
10967 \begin_inset Flex CharStyle:Code
10970 \begin_layout Plain Layout
10977 \begin_inset Flex CharStyle:Code
10980 \begin_layout Plain Layout
10987 \begin_inset Flex CharStyle:Code
10990 \begin_layout Plain Layout
10996 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
10997 If you specify the argument
10998 \begin_inset Flex CharStyle:Code
11001 \begin_layout Plain Layout
11007 , then you should also provide a numerical argument which will be the actual
11009 Note that, contrary to other parameters,
11010 \begin_inset Flex CharStyle:Code
11013 \begin_layout Plain Layout
11019 implies the generation of specific LaTeX code, using the package
11022 \begin_inset Flex CharStyle:Code
11025 \begin_layout Plain Layout
11034 \begin_layout Description
11035 \begin_inset Flex CharStyle:Code
11038 \begin_layout Plain Layout
11044 The font used for the text body .
11046 \begin_inset CommandInset ref
11048 reference "sec:fonts"
11055 \begin_layout Description
11056 \begin_inset Flex CharStyle:Code
11059 \begin_layout Plain Layout
11067 The level of the style in the table of contents.
11068 This is used for automatic numbering of section headings.
11071 \begin_layout Description
11072 \begin_inset Flex CharStyle:Code
11075 \begin_layout Plain Layout
11082 \begin_inset Flex CharStyle:Code
11085 \begin_layout Plain Layout
11091 ] The vertical space with which the very first of a chain of paragraphs
11092 with this layout is separated from the previous paragraph.
11093 If the previous paragraph has another layout, the separations are not simply
11094 added, but the maximum is taken.
11097 \begin_layout Subsection
11101 \begin_layout Standard
11102 \begin_inset CommandInset label
11108 Since version 1.3.0 of LyX, it is has been both possible and necessary to
11109 define the floats (
11110 \begin_inset Flex CharStyle:MenuItem
11113 \begin_layout Plain Layout
11120 \begin_inset Flex CharStyle:MenuItem
11123 \begin_layout Plain Layout
11129 , \SpecialChar \ldots{}
11130 ) in the text class itself.
11131 Standard floats are included in the file
11132 \begin_inset Flex CharStyle:Code
11135 \begin_layout Plain Layout
11141 , so you may have to do no more than add
11144 \begin_layout LyX-Code
11145 Input stdfloats.inc
11148 \begin_layout Standard
11149 to your layout file.
11150 If you want to implement a text class that proposes some other float types
11151 (like the AGU class bundled with LyX), the information below will hopefully
11155 \begin_layout Description
11156 \begin_inset Flex CharStyle:Code
11159 \begin_layout Plain Layout
11166 \begin_inset Flex CharStyle:Code
11169 \begin_layout Plain Layout
11176 \begin_inset Quotes erd
11180 \begin_inset Quotes erd
11183 ] The file name extension of an auxiliary file for the list of figures (or
11185 LaTeX writes the captions to this file.
11188 \begin_layout Description
11189 \begin_inset Flex CharStyle:Code
11192 \begin_layout Plain Layout
11199 \begin_inset Flex CharStyle:Code
11202 \begin_layout Plain Layout
11209 \begin_inset Quotes erd
11213 \begin_inset Quotes erd
11216 ] The string that will be used in the menus and also for the caption.
11219 \begin_layout Description
11220 \begin_inset Flex CharStyle:Code
11223 \begin_layout Plain Layout
11230 \begin_inset Flex CharStyle:Code
11233 \begin_layout Plain Layout
11242 \begin_inset Flex CharStyle:Code
11245 \begin_layout Plain Layout
11252 \begin_inset Flex CharStyle:Code
11255 \begin_layout Plain Layout
11261 if the float is already defined by the LaTeX document class.
11263 \begin_inset Flex CharStyle:Code
11266 \begin_layout Plain Layout
11272 , the float will be defined using the LaTeX package
11273 \begin_inset Flex CharStyle:Code
11276 \begin_layout Plain Layout
11285 \begin_layout Description
11286 \begin_inset Flex CharStyle:Code
11289 \begin_layout Plain Layout
11296 \begin_inset Flex CharStyle:Code
11299 \begin_layout Plain Layout
11306 \begin_inset Quotes erd
11310 \begin_inset Quotes erd
11313 ] The heading used for the list of floats.
11316 \begin_layout Description
11317 \begin_inset Flex CharStyle:Code
11320 \begin_layout Plain Layout
11327 \begin_inset Flex CharStyle:Code
11330 \begin_layout Plain Layout
11337 \begin_inset Quotes erd
11341 \begin_inset Quotes erd
11344 ] This (optional) argument determines whether floats of this class will
11345 be numbered within some sectional unit of the document.
11346 For example, if within is equal to
11347 \begin_inset Flex CharStyle:Code
11350 \begin_layout Plain Layout
11356 , the floats will be numbered within chapters.
11360 \begin_layout Description
11361 \begin_inset Flex CharStyle:Code
11364 \begin_layout Plain Layout
11371 \begin_inset Flex CharStyle:Code
11374 \begin_layout Plain Layout
11381 \begin_inset Quotes erd
11385 \begin_inset Quotes erd
11388 ] The default placement for the given class of floats.
11389 The string should be as in standard LaTeX:
11390 \begin_inset Flex CharStyle:Code
11393 \begin_layout Plain Layout
11400 \begin_inset Flex CharStyle:Code
11403 \begin_layout Plain Layout
11410 \begin_inset Flex CharStyle:Code
11413 \begin_layout Plain Layout
11420 \begin_inset Flex CharStyle:Code
11423 \begin_layout Plain Layout
11429 for top, bottom, page, and here, respectively.
11433 \begin_layout Plain Layout
11434 Note that the order of these letters in the string is irrelevant, like in
11440 On top of that there is a new type,
11441 \begin_inset Flex CharStyle:Code
11444 \begin_layout Plain Layout
11450 , which does not really correspond to a float, since it means: put it
11451 \begin_inset Quotes eld
11455 \begin_inset Quotes erd
11459 Note however that the
11460 \begin_inset Flex CharStyle:Code
11463 \begin_layout Plain Layout
11469 specifier is special and, because of implementation details, cannot be
11470 used in non-built in float types.
11471 If you do not understand what this means, just use
11472 \begin_inset Quotes eld
11476 \begin_inset Flex CharStyle:Code
11479 \begin_layout Plain Layout
11486 \begin_inset Quotes erd
11492 \begin_layout Description
11493 \begin_inset Flex CharStyle:Code
11496 \begin_layout Plain Layout
11503 \begin_inset Flex CharStyle:Code
11506 \begin_layout Plain Layout
11513 \begin_inset Quotes erd
11517 \begin_inset Quotes erd
11520 ] The style used when defining the float using
11521 \begin_inset Flex CharStyle:Code
11524 \begin_layout Plain Layout
11535 \begin_layout Description
11536 \begin_inset Flex CharStyle:Code
11539 \begin_layout Plain Layout
11546 \begin_inset Flex CharStyle:Code
11549 \begin_layout Plain Layout
11556 \begin_inset Quotes erd
11560 \begin_inset Quotes erd
11564 \begin_inset Quotes eld
11568 \begin_inset Quotes erd
11571 of the new class of floats, like program or algorithm.
11572 After the appropriate
11573 \begin_inset Flex CharStyle:Code
11576 \begin_layout Plain Layout
11585 \begin_inset Flex CharStyle:Code
11588 \begin_layout Plain Layout
11597 \begin_inset Flex CharStyle:Code
11600 \begin_layout Plain Layout
11611 \begin_layout Standard
11612 Note that defining a float with type
11613 \begin_inset Flex CharStyle:Code
11616 \begin_layout Plain Layout
11624 automatically defines the corresponding counter with name
11625 \begin_inset Flex CharStyle:Code
11628 \begin_layout Plain Layout
11639 \begin_layout Subsection
11640 Flex insets and InsetLayout
11643 \begin_layout Standard
11644 \begin_inset CommandInset label
11646 name "sec:charstyle"
11650 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
11651 these are called Flex insets.
11655 \begin_layout Standard
11656 Flex insets come in three different kinds:
11659 \begin_layout Itemize
11661 \begin_inset Flex CharStyle:Code
11664 \begin_layout Plain Layout
11670 ): These define semantic markup corresponding to such LaTeX commands as
11672 \begin_inset Flex CharStyle:Code
11675 \begin_layout Plain Layout
11684 \begin_inset Flex CharStyle:Code
11687 \begin_layout Plain Layout
11698 \begin_layout Itemize
11700 \begin_inset Flex CharStyle:Code
11703 \begin_layout Plain Layout
11709 ): These can be used to define custom collapsible insets, similar to TeX
11710 code, footnote, and the like.
11711 An obvious example is an endnote inset, which is defined in the
11712 \begin_inset Flex CharStyle:Code
11715 \begin_layout Plain Layout
11724 \begin_layout Itemize
11726 \begin_inset Flex CharStyle:Code
11729 \begin_layout Plain Layout
11735 ): For use with DocBook classes.
11738 \begin_layout Standard
11739 Flex insets are defined using the
11740 \begin_inset Flex CharStyle:Code
11743 \begin_layout Plain Layout
11749 tag, which shall be explained in a moment.
11752 \begin_layout Standard
11754 \begin_inset Flex CharStyle:Code
11757 \begin_layout Plain Layout
11763 tag also serves another function: It can be used to customize the general
11764 layout of many different types of insets.
11766 \begin_inset Flex CharStyle:Code
11769 \begin_layout Plain Layout
11775 can be used to customize the layout parameters for footnotes, marginal
11776 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
11777 boxes, tables, algorithms, URLs, and optional arguments, as well as to
11778 define Flex insets.
11781 \begin_layout Standard
11783 \begin_inset Flex CharStyle:Code
11786 \begin_layout Plain Layout
11792 definition must begin with a line of the form:
11795 \begin_layout LyX-Code
11799 \begin_layout Standard
11801 \begin_inset Flex CharStyle:Code
11804 \begin_layout Plain Layout
11810 indicates the inset whose layout is being defined, and here there are two
11814 \begin_layout Enumerate
11815 The layout for a pre-existing inset is being modified.
11816 In this case, can be
11817 \begin_inset Flex CharStyle:Code
11820 \begin_layout Plain Layout
11826 any one of the following:
11827 \begin_inset Flex CharStyle:Code
11830 \begin_layout Plain Layout
11837 \begin_inset Flex CharStyle:Code
11840 \begin_layout Plain Layout
11847 \begin_inset Flex CharStyle:Code
11850 \begin_layout Plain Layout
11857 \begin_inset Flex CharStyle:Code
11860 \begin_layout Plain Layout
11867 \begin_inset Flex CharStyle:Code
11870 \begin_layout Plain Layout
11877 \begin_inset Flex CharStyle:Code
11880 \begin_layout Plain Layout
11887 \begin_inset Flex CharStyle:Code
11890 \begin_layout Plain Layout
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 Flex CharStyle:Code
11920 \begin_layout Plain Layout
11927 \begin_inset Flex CharStyle:Code
11930 \begin_layout Plain Layout
11937 \begin_inset Flex CharStyle:Code
11940 \begin_layout Plain Layout
11947 \begin_inset Flex CharStyle:Code
11950 \begin_layout Plain Layout
11957 \begin_inset Flex CharStyle:Code
11960 \begin_layout Plain Layout
11967 \begin_inset Flex CharStyle:Code
11970 \begin_layout Plain Layout
11977 \begin_inset Flex CharStyle:Code
11980 \begin_layout Plain Layout
11987 \begin_inset Flex CharStyle:Code
11990 \begin_layout Plain Layout
11997 \begin_inset Flex CharStyle:Code
12000 \begin_layout Plain Layout
12007 \begin_inset Flex CharStyle:Code
12010 \begin_layout Plain Layout
12017 \begin_inset Flex CharStyle:Code
12020 \begin_layout Plain Layout
12030 \begin_layout Enumerate
12031 The layout for a Flex inset is being defined.
12033 \begin_inset Flex CharStyle:Code
12036 \begin_layout Plain Layout
12042 can be any valid identifier not used by a pre-existing inset.
12043 Note that the definition of a flex inset must
12048 \begin_inset Flex CharStyle:Code
12051 \begin_layout Plain Layout
12060 \begin_layout Standard
12062 \begin_inset Flex CharStyle:Code
12065 \begin_layout Plain Layout
12071 definition can contain the following entries:
12074 \begin_layout Description
12075 \begin_inset Flex CharStyle:Code
12078 \begin_layout Plain Layout
12084 The color for the inset's background.
12085 The valid colors are defined in
12086 \begin_inset Flex CharStyle:Code
12089 \begin_layout Plain Layout
12098 \begin_layout Description
12099 \begin_inset Flex CharStyle:Code
12102 \begin_layout Plain Layout
12108 As with paragraph styles (see page
12109 \begin_inset CommandInset ref
12111 reference "des:CopyStyle"
12118 \begin_layout Description
12119 \begin_inset Flex CharStyle:Code
12122 \begin_layout Plain Layout
12129 \begin_inset Flex CharStyle:Code
12132 \begin_layout Plain Layout
12141 \begin_inset Flex CharStyle:Code
12144 \begin_layout Plain Layout
12150 ] Indicates whether the user may employ the Paragraph Settings dialog to
12151 customize the paragraph.
12154 \begin_layout Description
12155 \begin_inset Flex CharStyle:Code
12158 \begin_layout Plain Layout
12165 \begin_inset Flex CharStyle:Code
12168 \begin_layout Plain Layout
12175 \begin_inset Flex CharStyle:Code
12178 \begin_layout Plain Layout
12185 \begin_inset Flex CharStyle:Code
12188 \begin_layout Plain Layout
12194 , describing the rendering style used for the inset's frame and buttons.
12195 Footnotes generally use
12196 \begin_inset Flex CharStyle:Code
12199 \begin_layout Plain Layout
12205 , ERT insets generally
12206 \begin_inset Flex CharStyle:Code
12209 \begin_layout Plain Layout
12215 , and character styles
12216 \begin_inset Flex CharStyle:Code
12219 \begin_layout Plain Layout
12228 \begin_layout Description
12229 \begin_inset Flex CharStyle:Code
12232 \begin_layout Plain Layout
12238 Required at the end of the InsetLayout declarations.
12241 \begin_layout Description
12242 \begin_inset Flex CharStyle:Code
12245 \begin_layout Plain Layout
12251 The font used for both the text body
12257 \begin_inset space ~
12261 \begin_inset CommandInset ref
12263 reference "sec:fonts"
12268 Note that defining this font automatically defines the
12269 \begin_inset Flex CharStyle:Code
12272 \begin_layout Plain Layout
12278 to the same value, so define this first and define
12279 \begin_inset Flex CharStyle:Code
12282 \begin_layout Plain Layout
12288 later if you want them to be different.
12291 \begin_layout Description
12292 \begin_inset Flex CharStyle:Code
12295 \begin_layout Plain Layout
12302 \begin_inset Quotes eld
12306 \begin_inset Quotes erd
12309 language, leading to Left-to-Right (latin) output, e.
12310 \begin_inset space \thinspace{}
12314 \begin_inset space \space{}
12317 in TeX code or URL.
12321 \begin_layout Description
12322 \begin_inset Flex CharStyle:Code
12325 \begin_layout Plain Layout
12332 \begin_inset Flex CharStyle:Code
12335 \begin_layout Plain Layout
12344 \begin_inset Flex CharStyle:Code
12347 \begin_layout Plain Layout
12353 ] Indicates whether the PlainLayout should be used or, instead, the user
12354 can change the paragraph style used in the inset.
12357 \begin_layout Description
12358 \begin_inset Flex CharStyle:Code
12361 \begin_layout Plain Layout
12367 As with paragraph styles (see page
12368 \begin_inset CommandInset ref
12369 LatexCommand pageref
12370 reference "des:FreeSpacing"
12377 \begin_layout Description
12378 \begin_inset Flex CharStyle:Code
12381 \begin_layout Plain Layout
12387 As with paragraph styles (see page
12388 \begin_inset CommandInset ref
12389 LatexCommand pageref
12390 reference "des:KeepEmpty"
12397 \begin_layout Description
12398 \begin_inset Flex CharStyle:Code
12401 \begin_layout Plain Layout
12407 The font used for the label.
12409 \begin_inset space ~
12413 \begin_inset CommandInset ref
12415 reference "sec:fonts"
12420 Note that this definition can never appear before
12421 \begin_inset Flex CharStyle:Code
12424 \begin_layout Plain Layout
12430 , lest it be ineffective.
12433 \begin_layout Description
12434 \begin_inset Flex CharStyle:Code
12437 \begin_layout Plain Layout
12443 What will be displayed on the button or elsewhere as the inset label.
12444 Some inset types (TeX code and Branch) modify this label on the fly.
12447 \begin_layout Description
12448 \begin_inset Flex CharStyle:Code
12451 \begin_layout Plain Layout
12457 The name of the corresponding LaTeX stuff.
12458 Either the environment or command name.
12461 \begin_layout Description
12462 \begin_inset Flex CharStyle:Code
12465 \begin_layout Plain Layout
12471 The optional parameter for the corresponding
12472 \begin_inset Flex CharStyle:Code
12475 \begin_layout Plain Layout
12481 stuff, including possible bracket pairs like
12482 \begin_inset Flex CharStyle:Code
12485 \begin_layout Plain Layout
12492 This parameter cannot be changed from within LyX.
12495 \begin_layout Description
12496 \begin_inset Flex CharStyle:Code
12499 \begin_layout Plain Layout
12505 As with paragraph styles (see page
12506 \begin_inset CommandInset ref
12507 LatexCommand pageref
12508 reference "des:LatexType"
12515 \begin_layout Description
12516 \begin_inset Flex CharStyle:Code
12519 \begin_layout Plain Layout
12526 \begin_inset Flex CharStyle:Code
12529 \begin_layout Plain Layout
12536 \begin_inset Flex CharStyle:Code
12539 \begin_layout Plain Layout
12546 \begin_inset Flex CharStyle:Code
12549 \begin_layout Plain Layout
12556 \begin_inset Flex CharStyle:Code
12559 \begin_layout Plain Layout
12565 (indicating a dummy definition ending definitions of charstyles, etc).
12566 This entry is required in and is only meaningful for Flex insets.
12567 Among other things, it determines on which menu this inset will appear.
12570 \begin_layout Description
12571 \begin_inset Flex CharStyle:Code
12574 \begin_layout Plain Layout
12581 \begin_inset Flex CharStyle:Code
12584 \begin_layout Plain Layout
12593 \begin_inset Flex CharStyle:Code
12596 \begin_layout Plain Layout
12602 ] Whether multiple paragraphs are permitted in this inset.
12603 This will also set CustomPars to the same value and ForcePlain to the opposite
12605 These can be reset to other values, if they are used
12612 \begin_layout Description
12613 \begin_inset Flex CharStyle:Code
12616 \begin_layout Plain Layout
12623 \begin_inset Flex CharStyle:Code
12626 \begin_layout Plain Layout
12635 \begin_inset Flex CharStyle:Code
12638 \begin_layout Plain Layout
12644 ] Whether fragile commands in this layout should be
12645 \begin_inset Flex CharStyle:Code
12648 \begin_layout Plain Layout
12661 whether the command should itself be protected.)
12664 \begin_layout Description
12665 \begin_inset Flex CharStyle:Code
12668 \begin_layout Plain Layout
12675 \begin_inset Flex CharStyle:Code
12678 \begin_layout Plain Layout
12687 \begin_inset Flex CharStyle:Code
12690 \begin_layout Plain Layout
12696 ] As with paragraph styles (see page
12697 \begin_inset CommandInset ref
12699 reference "des:PathThru"
12706 \begin_layout Description
12707 \begin_inset Flex CharStyle:Code
12710 \begin_layout Plain Layout
12716 As with paragraph styles (see page
12717 \begin_inset CommandInset ref
12718 LatexCommand pageref
12719 reference "des:Preamble"
12726 \begin_layout Description
12727 \begin_inset Flex CharStyle:Code
12730 \begin_layout Plain Layout
12737 \begin_inset Flex CharStyle:Code
12740 \begin_layout Plain Layout
12746 ] As with paragraph styles (see page
12747 \begin_inset CommandInset ref
12748 LatexCommand pageref
12749 reference "des:Requires"
12756 \begin_layout Subsection
12760 \begin_layout Standard
12761 \begin_inset CommandInset label
12767 Since version 1.3.0 of LyX, it is both possible and necessary to define the
12769 \begin_inset Flex CharStyle:MenuItem
12772 \begin_layout Plain Layout
12779 \begin_inset Flex CharStyle:MenuItem
12782 \begin_layout Plain Layout
12788 , \SpecialChar \ldots{}
12789 ) in the text class itself.
12790 The standard counters are defined in the file
12791 \begin_inset Flex CharStyle:Code
12794 \begin_layout Plain Layout
12800 , so you may have to do no more than add
12803 \begin_layout LyX-Code
12804 Input stdcounters.inc
12807 \begin_layout Standard
12808 to your layout file to get them to work.
12809 But if you want to define custom counters, then you can do so.
12810 The counter declaration must begin with:
12813 \begin_layout LyX-Code
12817 \begin_layout Standard
12818 where of course `name' is replaced by the name of the counter.
12819 And it must end with
12820 \begin_inset Quotes eld
12824 \begin_inset Flex CharStyle:Code
12827 \begin_layout Plain Layout
12834 \begin_inset Quotes erd
12838 The following parameters can also be used:
12841 \begin_layout Description
12842 \begin_inset Flex CharStyle:Code
12845 \begin_layout Plain Layout
12846 LabelString [string=""]
12851 when this is defined, this string defines how the counter is displayed.
12852 Setting this value sets
12853 \begin_inset Flex CharStyle:Code
12856 \begin_layout Plain Layout
12857 LabelStringAppendix
12863 The following special constructs can be used in the string:
12867 \begin_layout Itemize
12868 \begin_inset Flex CharStyle:Code
12871 \begin_layout Plain Layout
12879 will be replaced by the expansion of the
12880 \begin_inset Flex CharStyle:Code
12883 \begin_layout Plain Layout
12890 \begin_inset Flex CharStyle:Code
12893 \begin_layout Plain Layout
12894 LabelStringAppendix
12900 \begin_inset Flex CharStyle:Code
12903 \begin_layout Plain Layout
12913 \begin_layout Itemize
12914 counter values can be expressed using LaTeX-like macros
12915 \begin_inset Flex CharStyle:Code
12918 \begin_layout Plain Layout
12935 \begin_inset Flex CharStyle:Code
12938 \begin_layout Plain Layout
12950 \begin_layout Plain Layout
12960 Actually, the situation is a bit more complicated: any
12979 other than those described below will produce arabic numerals.
12980 It would not be surprising to see this change in the future.
12986 \begin_inset Flex CharStyle:Code
12989 \begin_layout Plain Layout
12995 : 1, 2, 3,\SpecialChar \ldots{}
12997 \begin_inset Flex CharStyle:Code
13000 \begin_layout Plain Layout
13006 for lower-case letters: a, b, c, \SpecialChar \ldots{}
13008 \begin_inset Flex CharStyle:Code
13011 \begin_layout Plain Layout
13017 for upper-case letters: A, B, C, \SpecialChar \ldots{}
13019 \begin_inset Flex CharStyle:Code
13022 \begin_layout Plain Layout
13028 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
13030 \begin_inset Flex CharStyle:Code
13033 \begin_layout Plain Layout
13039 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
13041 \begin_inset Flex CharStyle:Code
13044 \begin_layout Plain Layout
13050 for hebrew numerals.
13054 \begin_layout Standard
13055 If LabelString is not defined, a default value is constructed as follows:
13056 if the counter has a master counter
13057 \begin_inset Flex CharStyle:Code
13060 \begin_layout Plain Layout
13067 \begin_inset Flex CharStyle:Code
13070 \begin_layout Plain Layout
13077 \begin_inset Flex CharStyle:Code
13080 \begin_layout Plain Layout
13090 is used; otherwise the string
13091 \begin_inset Flex CharStyle:Code
13094 \begin_layout Plain Layout
13105 \begin_layout Description
13106 \begin_inset Flex CharStyle:Code
13109 \begin_layout Plain Layout
13110 LabelStringAppendix [string=""]
13116 \begin_inset Flex CharStyle:Code
13119 \begin_layout Plain Layout
13125 , but for use in the Appendix.
13128 \begin_layout Description
13129 \begin_inset Flex CharStyle:Code
13132 \begin_layout Plain Layout
13139 \begin_inset Flex CharStyle:Code
13142 \begin_layout Plain Layout
13149 \begin_inset Quotes erd
13153 \begin_inset Quotes erd
13156 ] If this is set to the name of another counter, the present counter will
13157 be reset every time the other one is increased.
13159 \begin_inset Flex CharStyle:Code
13162 \begin_layout Plain Layout
13169 \begin_inset Flex CharStyle:Code
13172 \begin_layout Plain Layout
13181 \begin_layout Subsection
13185 \begin_layout Standard
13186 \begin_inset CommandInset label
13192 A font description looks like this:
13195 \begin_layout LyX-Code
13205 \begin_layout LyX-Code
13209 \begin_layout LyX-Code
13213 \begin_layout Standard
13214 The following commands are available:
13217 \begin_layout Description
13218 \begin_inset Flex CharStyle:Code
13221 \begin_layout Plain Layout
13228 \begin_inset Flex CharStyle:Code
13231 \begin_layout Plain Layout
13240 \begin_inset Flex CharStyle:Code
13243 \begin_layout Plain Layout
13250 \begin_inset Flex CharStyle:Code
13253 \begin_layout Plain Layout
13260 \begin_inset Flex CharStyle:Code
13263 \begin_layout Plain Layout
13270 \begin_inset Flex CharStyle:Code
13273 \begin_layout Plain Layout
13280 \begin_inset Flex CharStyle:Code
13283 \begin_layout Plain Layout
13290 \begin_inset Flex CharStyle:Code
13293 \begin_layout Plain Layout
13300 \begin_inset Flex CharStyle:Code
13303 \begin_layout Plain Layout
13310 \begin_inset Flex CharStyle:Code
13313 \begin_layout Plain Layout
13322 \begin_layout Description
13323 \begin_inset Flex CharStyle:Code
13326 \begin_layout Plain Layout
13335 \begin_inset Flex CharStyle:Code
13338 \begin_layout Plain Layout
13349 \begin_inset Flex CharStyle:Code
13352 \begin_layout Plain Layout
13359 \begin_inset Flex CharStyle:Code
13362 \begin_layout Plain Layout
13371 \begin_layout Description
13372 \begin_inset Flex CharStyle:Code
13375 \begin_layout Plain Layout
13382 \begin_inset Flex CharStyle:Code
13385 \begin_layout Plain Layout
13391 ] Valid argument are:
13392 \begin_inset Flex CharStyle:Code
13395 \begin_layout Plain Layout
13402 \begin_inset Flex CharStyle:Code
13405 \begin_layout Plain Layout
13412 \begin_inset Flex CharStyle:Code
13415 \begin_layout Plain Layout
13422 \begin_inset Flex CharStyle:Code
13425 \begin_layout Plain Layout
13432 \begin_inset Flex CharStyle:Code
13435 \begin_layout Plain Layout
13442 \begin_inset Flex CharStyle:Code
13445 \begin_layout Plain Layout
13452 Each of these turns on or off the corresponding attribute.
13455 \begin_layout Description
13456 \begin_inset Flex CharStyle:Code
13459 \begin_layout Plain Layout
13468 \begin_inset Flex CharStyle:Code
13471 \begin_layout Plain Layout
13482 \begin_inset Flex CharStyle:Code
13485 \begin_layout Plain Layout
13494 \begin_layout Description
13495 \begin_inset Flex CharStyle:Code
13498 \begin_layout Plain Layout
13507 \begin_inset Flex CharStyle:Code
13510 \begin_layout Plain Layout
13521 \begin_inset Flex CharStyle:Code
13524 \begin_layout Plain Layout
13531 \begin_inset Flex CharStyle:Code
13534 \begin_layout Plain Layout
13541 \begin_inset Flex CharStyle:Code
13544 \begin_layout Plain Layout
13553 \begin_layout Description
13554 \begin_inset Flex CharStyle:Code
13557 \begin_layout Plain Layout
13564 \begin_inset Flex CharStyle:Code
13567 \begin_layout Plain Layout
13574 \begin_inset Flex CharStyle:Code
13577 \begin_layout Plain Layout
13584 \begin_inset Flex CharStyle:Code
13587 \begin_layout Plain Layout
13596 \begin_inset Flex CharStyle:Code
13599 \begin_layout Plain Layout
13606 \begin_inset Flex CharStyle:Code
13609 \begin_layout Plain Layout
13616 \begin_inset Flex CharStyle:Code
13619 \begin_layout Plain Layout
13626 \begin_inset Flex CharStyle:Code
13629 \begin_layout Plain Layout
13636 \begin_inset Flex CharStyle:Code
13639 \begin_layout Plain Layout
13648 \begin_layout Subsection
13649 Upgrading old layout files
13652 \begin_layout Standard
13653 The file format of layout files changes from time to time, so old layout
13654 files need to be converted.
13655 This process has been automated since LyX 1.4.0: If LyX reads an old format
13656 layout file it will call the conversion tool
13657 \begin_inset Flex CharStyle:Code
13660 \begin_layout Plain Layout
13661 LyXDir/scripts/layout2layout.py
13666 and convert it to a temporary file in current format.
13667 The original file is left untouched.
13668 If you want to convert the layout file permanently, just call the converter
13672 \begin_layout LyX-Code
13673 python $LyXDir/scripts/layout2layout.py myclass.layout myclassnew.layout
13676 \begin_layout Standard
13677 (You need to replace
13678 \begin_inset Flex CharStyle:Code
13681 \begin_layout Plain Layout
13687 with the name of your LyX system directory, unless you happen to have defined
13688 such an environment variable.) Then copy
13689 \begin_inset Flex CharStyle:Code
13692 \begin_layout Plain Layout
13699 \begin_inset Flex CharStyle:Code
13702 \begin_layout Plain Layout
13711 \begin_layout Standard
13712 The automatic conversion only handles syntax changes.
13713 It cannot handle the case where the contents of included files was changed,
13714 so these will have to be converted separately.
13717 \begin_layout Section
13719 \begin_inset CommandInset label
13721 name "sec:templates"
13728 \begin_layout Standard
13729 Templates are created just like usual documents.
13730 The only difference is that usual documents contain all possible settings,
13731 including the font scheme and the paper size.
13732 Usually a user doesn't want a template to overwrite his defaults in these
13734 For that reason, the designer of a template should remove the corresponding
13736 \begin_inset Flex CharStyle:Code
13739 \begin_layout Plain Layout
13748 \begin_inset Flex CharStyle:Code
13751 \begin_layout Plain Layout
13759 from the template LyX file.
13760 This can be done with any simple text-editor, for example
13761 \begin_inset Flex CharStyle:Code
13764 \begin_layout Plain Layout
13771 \begin_inset Flex CharStyle:Code
13774 \begin_layout Plain Layout
13784 \begin_layout Standard
13785 Put the edited template files you create in
13786 \begin_inset Flex CharStyle:Code
13789 \begin_layout Plain Layout
13795 , copy the ones you use from the global template directory in
13796 \begin_inset Flex CharStyle:Code
13799 \begin_layout Plain Layout
13805 to the same place, and redefine the template path in the
13806 \begin_inset Flex CharStyle:MenuItem
13809 \begin_layout Plain Layout
13810 Tools\SpecialChar \menuseparator
13811 Preferences\SpecialChar \menuseparator
13820 \begin_layout Standard
13821 Note that there is a template which has a particular meaning:
13822 \begin_inset Flex CharStyle:Code
13825 \begin_layout Plain Layout
13832 This template is loaded every time you create a new document with
13833 \begin_inset Flex CharStyle:MenuItem
13836 \begin_layout Plain Layout
13837 File\SpecialChar \menuseparator
13843 in order to provide useful defaults.
13844 To create this template from inside LyX, all you have to do is to open
13845 a document with the correct settings, and use the
13846 \begin_inset Flex CharStyle:MenuItem
13849 \begin_layout Plain Layout
13850 Save as Document Defaults
13858 \begin_layout Chapter
13859 Including External Material
13862 \begin_layout Standard
13863 \begin_inset Box Shadowbox
13872 height_special "totalheight"
13875 \begin_layout Plain Layout
13876 WARNING: This portion of the documentation has not been updated for some
13878 We certainly hope that it is still accurate, but there are no guarantees.
13886 \begin_layout Standard
13887 The use of material from sources external to LyX is covered in detail in
13893 This part of the manual covers what needs to happen behind the scenes for
13894 new sorts of material to be included.
13897 \begin_layout Section
13901 \begin_layout Standard
13902 The external material feature is based on the concept of a
13907 A template is a specification of how LyX should interface with a certain
13909 As bundled, LyX comes with predefined templates for Xfig figures, various
13910 raster format images, chess diagrams, and LilyPond music notation.
13911 You can check the actual list by using the menu
13912 \begin_inset Flex CharStyle:MenuItem
13915 \begin_layout Plain Layout
13916 Insert\SpecialChar \menuseparator
13917 File\SpecialChar \menuseparator
13924 Furthermore, it is possible to roll your own template to support a specific
13926 Later we'll describe in more detail what is involved, and hopefully you
13927 will submit all the templates you create so we can include them in a later
13931 \begin_layout Standard
13932 Another basic idea of the external material feature is to distinguish between
13933 the original file that serves as a base for final material and the produced
13934 file that is included in your exported or printed document.
13935 For example, consider the case of a figure produced with
13936 \begin_inset Flex CharStyle:Code
13939 \begin_layout Plain Layout
13946 The Xfig application itself works on an original file with the
13947 \begin_inset Flex CharStyle:Code
13950 \begin_layout Plain Layout
13957 Within Xfig, you create and change your figure, and when you are done,
13959 \begin_inset Flex CharStyle:Code
13962 \begin_layout Plain Layout
13969 When you want to include the figure in your document, you invoke
13970 \begin_inset Flex CharStyle:Code
13973 \begin_layout Plain Layout
13979 in order to create a PostScript file that can readily be included in your
13982 \begin_inset Flex CharStyle:Code
13985 \begin_layout Plain Layout
13991 file is the original file, and the PostScript file is the produced file.
13994 \begin_layout Standard
13995 This distinction is important in order to allow updating of the material
13996 while you are in the process of writing the document.
13997 Furthermore, it provides us with the flexibility that is needed to support
13998 multiple export formats.
13999 For instance, in the case of a plain text file, it is not exactly an award-winn
14000 ing idea to include the figure as raw PostScript.
14001 Instead, you'd either prefer to just include a reference to the figure
14002 or try to invoke some graphics to ASCII converter to make the final result
14003 look similar to the real graphics.
14004 The external material management allows you to do this, because it is parametri
14005 zed on the different export formats that LyX supports.
14008 \begin_layout Standard
14009 Besides supporting the production of different products according to the
14010 exported format, it supports tight integration with editing and viewing
14012 In the case of an Xfig figure, you are able to invoke Xfig on the original
14013 file with a single click from within the external material dialog in LyX,
14014 and also preview the produced PostScript file with Ghostview with another
14016 No more fiddling around with the command line and/or file browsers to locate
14017 and manipulate the original or produced files.
14018 In this way, you are finally able to take full advantage of the many different
14019 applications that are relevant to use when you write your documents, and
14020 ultimately be more productive.
14023 \begin_layout Section
14024 The external template configuration file
14027 \begin_layout Standard
14028 It is relatively easy to add custom external template definitions to LyX.
14029 However, be aware that doing this in an careless manner most probably
14033 introduce an easily exploitable security hole.
14034 So before you do this, please read the discussion about security in section
14036 \begin_inset CommandInset ref
14038 reference "sec:Security-discussion"
14045 \begin_layout Standard
14046 Having said that, we encourage you to submit any interesting templates that
14051 \begin_layout Standard
14052 The external templates are defined in the
14053 \begin_inset Flex CharStyle:Code
14056 \begin_layout Plain Layout
14057 LyXDir/lib/external_templates
14063 You can place your own version in
14064 \begin_inset Flex CharStyle:Code
14067 \begin_layout Plain Layout
14068 UserDir/external_templates
14076 \begin_layout Standard
14077 A typical template looks like this:
14080 \begin_layout LyX-Code
14084 \begin_layout LyX-Code
14085 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
14088 \begin_layout LyX-Code
14092 \begin_layout LyX-Code
14096 \begin_layout LyX-Code
14100 \begin_layout LyX-Code
14104 \begin_layout LyX-Code
14108 \begin_layout LyX-Code
14109 AutomaticProduction true
14112 \begin_layout LyX-Code
14116 \begin_layout LyX-Code
14120 \begin_layout LyX-Code
14124 \begin_layout LyX-Code
14125 TransformCommand Rotate RotationLatexCommand
14128 \begin_layout LyX-Code
14129 TransformCommand Resize ResizeLatexCommand
14132 \begin_layout LyX-Code
14133 Product "$$RotateFront$$ResizeFront
14136 \begin_layout LyX-Code
14141 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
14144 \begin_layout LyX-Code
14145 $$ResizeBack$$RotateBack"
14148 \begin_layout LyX-Code
14152 \begin_layout LyX-Code
14153 UpdateResult "$$AbsPath$$Basename.pstex_t"
14156 \begin_layout LyX-Code
14157 Requirement "graphicx"
14160 \begin_layout LyX-Code
14161 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
14164 \begin_layout LyX-Code
14165 ReferencedFile latex "$$AbsPath$$Basename.eps"
14168 \begin_layout LyX-Code
14169 ReferencedFile dvi "$$AbsPath$$Basename.eps"
14172 \begin_layout LyX-Code
14176 \begin_layout LyX-Code
14180 \begin_layout LyX-Code
14181 TransformCommand Rotate RotationLatexCommand
14184 \begin_layout LyX-Code
14185 TransformCommand Resize ResizeLatexCommand
14188 \begin_layout LyX-Code
14189 Product "$$RotateFront$$ResizeFront
14192 \begin_layout LyX-Code
14197 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
14200 \begin_layout LyX-Code
14201 $$ResizeBack$$RotateBack"
14204 \begin_layout LyX-Code
14205 UpdateFormat pdftex
14208 \begin_layout LyX-Code
14209 UpdateResult "$$AbsPath$$Basename.pdftex_t"
14212 \begin_layout LyX-Code
14213 Requirement "graphicx"
14216 \begin_layout LyX-Code
14217 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
14220 \begin_layout LyX-Code
14221 ReferencedFile latex "$$AbsPath$$Basename.pdf"
14224 \begin_layout LyX-Code
14228 \begin_layout LyX-Code
14232 \begin_layout LyX-Code
14233 Product "$$Contents(
14235 "$$AbsPath$$Basename.asc
14240 \begin_layout LyX-Code
14241 UpdateFormat asciixfig
14244 \begin_layout LyX-Code
14245 UpdateResult "$$AbsPath$$Basename.asc"
14248 \begin_layout LyX-Code
14252 \begin_layout LyX-Code
14256 \begin_layout LyX-Code
14257 Product "<graphic fileref=
14259 "$$AbsOrRelPathMaster$$Basename.eps
14264 \begin_layout LyX-Code
14268 \begin_layout LyX-Code
14272 \begin_layout LyX-Code
14273 UpdateResult "$$AbsPath$$Basename.eps"
14276 \begin_layout LyX-Code
14277 ReferencedFile docbook "$$AbsPath$$Basename.eps"
14280 \begin_layout LyX-Code
14281 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
14284 \begin_layout LyX-Code
14288 \begin_layout LyX-Code
14289 Product "[XFig: $$FName]"
14292 \begin_layout LyX-Code
14296 \begin_layout LyX-Code
14300 \begin_layout Standard
14301 As you can see, the template is enclosed in
14302 \begin_inset Flex CharStyle:Code
14305 \begin_layout Plain Layout
14311 \SpecialChar \ldots{}
14313 \begin_inset Flex CharStyle:Code
14316 \begin_layout Plain Layout
14323 It contains a header specifying some general settings and, for each supported
14324 primary document file format, a section
14325 \begin_inset Flex CharStyle:Code
14328 \begin_layout Plain Layout
14334 \SpecialChar \ldots{}
14336 \begin_inset Flex CharStyle:Code
14339 \begin_layout Plain Layout
14348 \begin_layout Subsection
14349 The template header
14352 \begin_layout Description
14353 \begin_inset Flex CharStyle:Code
14356 \begin_layout Plain Layout
14357 AutomaticProduction
14358 \begin_inset space ~
14366 Whether the file represented by the template must be generated by LyX.
14367 This command must occur exactly once.
14370 \begin_layout Description
14371 \begin_inset Flex CharStyle:Code
14374 \begin_layout Plain Layout
14376 \begin_inset space ~
14384 A glob pattern that is used in the file dialog to filter out the desired
14386 If there is more than one possible file extension (e.
14387 \begin_inset space \thinspace{}
14391 \begin_inset space \space{}
14395 \begin_inset Flex CharStyle:Code
14398 \begin_layout Plain Layout
14405 \begin_inset Flex CharStyle:Code
14408 \begin_layout Plain Layout
14414 ), use something like
14415 \begin_inset Flex CharStyle:Code
14418 \begin_layout Plain Layout
14425 This command must occur exactly once.
14428 \begin_layout Description
14429 \begin_inset Flex CharStyle:Code
14432 \begin_layout Plain Layout
14434 \begin_inset space ~
14442 The text that is displayed on the button.
14443 This command must occur exactly once.
14446 \begin_layout Description
14447 \begin_inset Flex CharStyle:Code
14450 \begin_layout Plain Layout
14452 \begin_inset space ~
14456 \begin_inset space ~
14464 The help text that is used in the External dialog.
14465 Provide enough information to explain to the user just what the template
14466 can provide him with.
14467 This command must occur exactly once.
14470 \begin_layout Description
14471 \begin_inset Flex CharStyle:Code
14474 \begin_layout Plain Layout
14476 \begin_inset space ~
14484 The file format of the original file.
14485 This must be the name of a format that is known to LyX (see section
14486 \begin_inset CommandInset ref
14488 reference "sub:Formats"
14494 \begin_inset Quotes eld
14498 \begin_inset Flex CharStyle:Code
14501 \begin_layout Plain Layout
14508 \begin_inset Quotes erd
14511 if the template can handle original files of more than one format.
14512 LyX will attempt to interrogate the file itself in order to deduce its
14513 format in this case.
14514 This command must occur exactly once.
14517 \begin_layout Description
14518 \begin_inset Flex CharStyle:Code
14521 \begin_layout Plain Layout
14523 \begin_inset space ~
14531 A unique name for the template.
14532 It must not contain substitution macros (see below).
14535 \begin_layout Description
14536 \begin_inset Flex CharStyle:Code
14539 \begin_layout Plain Layout
14541 \begin_inset space ~
14544 Rotate|Resize|Clip|Extra
14549 This command specifies which transformations are supported by this template.
14550 It may occur zero or more times.
14551 This command enables the corresponding tabs in the external dialog.
14553 \begin_inset Flex CharStyle:Code
14556 \begin_layout Plain Layout
14562 command must have either a corresponding
14563 \begin_inset Flex CharStyle:Code
14566 \begin_layout Plain Layout
14573 \begin_inset Flex CharStyle:Code
14576 \begin_layout Plain Layout
14583 \begin_inset Flex CharStyle:Code
14586 \begin_layout Plain Layout
14593 Otherwise the transformation will not be supported by that format.
14596 \begin_layout Subsection
14600 \begin_layout Description
14601 \begin_inset Flex CharStyle:Code
14604 \begin_layout Plain Layout
14606 \begin_inset space ~
14609 LaTeX|PDFLaTeX|PlainText|DocBook
14614 The primary document file format that this format definition is for.
14615 Not every template has a sensible representation in all document file formats.
14616 Please define nevertheless a
14617 \begin_inset Flex CharStyle:Code
14620 \begin_layout Plain Layout
14626 section for all formats.
14627 Use a dummy text when no representation is available.
14628 Then you can at least see a reference to the external material in the exported
14632 \begin_layout Description
14633 \begin_inset Flex CharStyle:Code
14636 \begin_layout Plain Layout
14638 \begin_inset space ~
14642 \begin_inset space ~
14650 This command defines an additional macro
14651 \begin_inset Flex CharStyle:Code
14654 \begin_layout Plain Layout
14660 for substitution in
14661 \begin_inset Flex CharStyle:Code
14664 \begin_layout Plain Layout
14672 \begin_inset Flex CharStyle:Code
14675 \begin_layout Plain Layout
14681 itself may contain substitution macros.
14682 The advantage over using
14683 \begin_inset Flex CharStyle:Code
14686 \begin_layout Plain Layout
14693 \begin_inset Flex CharStyle:Code
14696 \begin_layout Plain Layout
14702 is that the substituted value of
14703 \begin_inset Flex CharStyle:Code
14706 \begin_layout Plain Layout
14712 is sanitized so that it is a valid optional argument in the document format.
14713 This command may occur zero or more times.
14716 \begin_layout Description
14717 \begin_inset Flex CharStyle:Code
14720 \begin_layout Plain Layout
14722 \begin_inset space ~
14730 The text that is inserted in the exported document.
14731 This is actually the most important command and can be quite complex.
14732 This command must occur exactly once.
14735 \begin_layout Description
14736 \begin_inset Flex CharStyle:Code
14739 \begin_layout Plain Layout
14741 \begin_inset space ~
14749 This command specifies a preamble snippet that will be included in the
14751 It has to be defined using
14752 \begin_inset Flex CharStyle:Code
14755 \begin_layout Plain Layout
14761 \SpecialChar \ldots{}
14763 \begin_inset Flex CharStyle:Code
14766 \begin_layout Plain Layout
14773 This command may occur zero or more times.
14776 \begin_layout Description
14777 \begin_inset Flex CharStyle:Code
14780 \begin_layout Plain Layout
14782 \begin_inset space ~
14786 \begin_inset space ~
14794 This command denotes files that are created by the conversion process and
14795 are needed for a particular export format.
14796 If the filename is relative, it is interpreted relative to the master document.
14797 This command may be given zero or more times.
14800 \begin_layout Description
14801 \begin_inset Flex CharStyle:Code
14804 \begin_layout Plain Layout
14806 \begin_inset space ~
14814 The name of a required LaTeX package.
14815 The package is included via
14816 \begin_inset Flex CharStyle:Code
14819 \begin_layout Plain Layout
14827 in the LaTeX preamble.
14828 This command may occur zero or more times.
14831 \begin_layout Description
14832 \begin_inset Flex CharStyle:Code
14835 \begin_layout Plain Layout
14837 \begin_inset space ~
14841 \begin_inset space ~
14844 RotationLatexCommand
14849 This command specifies that the built in LaTeX command should be used for
14851 This command may occur once or not at all.
14854 \begin_layout Description
14855 \begin_inset Flex CharStyle:Code
14858 \begin_layout Plain Layout
14860 \begin_inset space ~
14864 \begin_inset space ~
14872 This command specifies that the built in LaTeX command should be used for
14874 This command may occur once or not at all.
14877 \begin_layout Description
14878 \begin_inset Flex CharStyle:Code
14881 \begin_layout Plain Layout
14883 \begin_inset space ~
14887 \begin_inset space ~
14890 RotationLatexOption
14895 This command specifies that rotation is done via an optional argument.
14896 This command may occur once or not at all.
14899 \begin_layout Description
14900 \begin_inset Flex CharStyle:Code
14903 \begin_layout Plain Layout
14905 \begin_inset space ~
14909 \begin_inset space ~
14917 This command specifies that resizing is done via an optional argument.
14918 This command may occur once or not at all.
14921 \begin_layout Description
14922 \begin_inset Flex CharStyle:Code
14925 \begin_layout Plain Layout
14927 \begin_inset space ~
14931 \begin_inset space ~
14939 This command specifies that clipping is done via an optional argument.
14940 This command may occur once or not at all.
14943 \begin_layout Description
14944 \begin_inset Flex CharStyle:Code
14947 \begin_layout Plain Layout
14949 \begin_inset space ~
14953 \begin_inset space ~
14961 This command specifies that an extra optional argument is used.
14962 This command may occur once or not at all.
14965 \begin_layout Description
14966 \begin_inset Flex CharStyle:Code
14969 \begin_layout Plain Layout
14971 \begin_inset space ~
14979 The file format of the converted file.
14980 This must be the name of a format that is known to LyX (see the
14981 \begin_inset Flex CharStyle:MenuItem
14984 \begin_layout Plain Layout
14989 ools\SpecialChar \menuseparator
14994 references:Conversion
15000 This command must occur exactly once.
15003 \begin_layout Description
15004 \begin_inset Flex CharStyle:Code
15007 \begin_layout Plain Layout
15009 \begin_inset space ~
15017 The file name of the converted file.
15018 The file name must be absolute.
15019 This command must occur exactly once.
15022 \begin_layout Subsection
15023 Preamble definitions
15026 \begin_layout Standard
15027 The external template configuration file may contain additional preamble
15028 definitions enclosed by
15029 \begin_inset Flex CharStyle:Code
15032 \begin_layout Plain Layout
15038 \SpecialChar \ldots{}
15040 \begin_inset Flex CharStyle:Code
15043 \begin_layout Plain Layout
15050 They can be used by the templates in the
15051 \begin_inset Flex CharStyle:Code
15054 \begin_layout Plain Layout
15063 \begin_layout Section
15064 The substitution mechanism
15067 \begin_layout Standard
15068 When the external material facility invokes an external program, it is done
15069 on the basis of a command defined in the template configuration file.
15070 These commands can contain various macros that are expanded before execution.
15071 Execution always take place in the directory of the containing document.
15074 \begin_layout Standard
15075 Also, whenever external material is to be displayed, the name will be produced
15076 by the substitution mechanism, and most other commands in the template
15077 definition support substitution as well.
15080 \begin_layout Standard
15081 The available macros are the following:
15084 \begin_layout Description
15085 \begin_inset Flex CharStyle:Code
15088 \begin_layout Plain Layout
15089 $$AbsOrRelPathMaster
15094 The file path, absolute or relative to the master LyX document.
15097 \begin_layout Description
15098 \begin_inset Flex CharStyle:Code
15101 \begin_layout Plain Layout
15102 $$AbsOrRelPathParent
15107 The file path, absolute or relative to the LyX document.
15110 \begin_layout Description
15111 \begin_inset Flex CharStyle:Code
15114 \begin_layout Plain Layout
15120 The absolute file path.
15123 \begin_layout Description
15124 \begin_inset Flex CharStyle:Code
15127 \begin_layout Plain Layout
15133 The filename without path and without the extension.
15136 \begin_layout Description
15137 \begin_inset Flex CharStyle:Code
15140 \begin_layout Plain Layout
15142 \begin_inset Quotes eld
15146 \begin_inset Quotes erd
15154 This macro will expand to the contents of the file with the name
15155 \begin_inset Flex CharStyle:Code
15158 \begin_layout Plain Layout
15167 \begin_layout Description
15168 \begin_inset Flex CharStyle:Code
15171 \begin_layout Plain Layout
15177 The file extension (including the dot).
15180 \begin_layout Description
15181 \begin_inset Flex CharStyle:Code
15184 \begin_layout Plain Layout
15190 The filename of the file specified in the external material dialog.
15191 This is either an absolute name, or it is relative to the LyX document.
15194 \begin_layout Description
15195 \begin_inset Flex CharStyle:Code
15198 \begin_layout Plain Layout
15205 \begin_inset Flex CharStyle:Code
15208 \begin_layout Plain Layout
15214 (absolute name or relative to the LyX document).
15217 \begin_layout Description
15218 \begin_inset Flex CharStyle:Code
15221 \begin_layout Plain Layout
15227 The file path, relative to the master LyX document.
15230 \begin_layout Description
15231 \begin_inset Flex CharStyle:Code
15234 \begin_layout Plain Layout
15240 The file path, relative to the LyX document.
15243 \begin_layout Description
15244 \begin_inset Flex CharStyle:Code
15247 \begin_layout Plain Layout
15253 This macro will expand to the absolute path of the system directory.
15254 This is typically used to point to the various helper scripts that are
15258 \begin_layout Description
15259 \begin_inset Flex CharStyle:Code
15262 \begin_layout Plain Layout
15268 A name and full path to a temporary file which will be automatically deleted
15269 whenever the containing document is closed, or the external material insertion
15273 \begin_layout Standard
15274 All path macros contain a trailing directory separator, so you can construct
15276 \begin_inset space \thinspace{}
15280 \begin_inset space \space{}
15283 the absolute filename with
15284 \begin_inset Flex CharStyle:Code
15287 \begin_layout Plain Layout
15288 $$AbsPath$$Basename$$Extension
15296 \begin_layout Standard
15297 The macros above are substituted in all commands unless otherwise noted.
15299 \begin_inset Flex CharStyle:Code
15302 \begin_layout Plain Layout
15308 supports additionally the following substitutions if they are enabled by
15310 \begin_inset Flex CharStyle:Code
15313 \begin_layout Plain Layout
15320 \begin_inset Flex CharStyle:Code
15323 \begin_layout Plain Layout
15332 \begin_layout Description
15333 \begin_inset Flex CharStyle:Code
15336 \begin_layout Plain Layout
15342 The front part of the resize command.
15345 \begin_layout Description
15346 \begin_inset Flex CharStyle:Code
15349 \begin_layout Plain Layout
15355 The back part of the resize command.
15358 \begin_layout Description
15359 \begin_inset Flex CharStyle:Code
15362 \begin_layout Plain Layout
15368 The front part of the rotation command.
15371 \begin_layout Description
15372 \begin_inset Flex CharStyle:Code
15375 \begin_layout Plain Layout
15381 The back part of the rotation command.
15384 \begin_layout Standard
15385 The value string of the
15386 \begin_inset Flex CharStyle:Code
15389 \begin_layout Plain Layout
15395 command supports additionally the following substitutions if they are enabled
15397 \begin_inset Flex CharStyle:Code
15400 \begin_layout Plain Layout
15407 \begin_inset Flex CharStyle:Code
15410 \begin_layout Plain Layout
15419 \begin_layout Description
15420 \begin_inset Flex CharStyle:Code
15423 \begin_layout Plain Layout
15432 \begin_layout Description
15433 \begin_inset Flex CharStyle:Code
15436 \begin_layout Plain Layout
15445 \begin_layout Description
15446 \begin_inset Flex CharStyle:Code
15449 \begin_layout Plain Layout
15458 \begin_layout Description
15459 \begin_inset Flex CharStyle:Code
15462 \begin_layout Plain Layout
15468 The rotation option.
15471 \begin_layout Standard
15472 You may ask why there are so many path macros.
15473 There are mainly two reasons:
15476 \begin_layout Enumerate
15477 Relative and absolute file names should remain relative or absolute, respectivel
15479 Users may have reasons to prefer either form.
15480 Relative names are useful for portable documents that should work on different
15481 machines, for example.
15482 Absolute names may be required by some programs.
15485 \begin_layout Enumerate
15486 LaTeX treats relative file names differently than LyX and other programs
15487 in nested included files.
15488 For LyX, a relative file name is always relative to the document that contains
15490 For LaTeX, it is always relative to the master document.
15491 These two definitions are identical if you have only one document, but
15492 differ if you have a master document that includes part documents.
15493 That means that relative filenames must be transformed when presented to
15495 Fortunately LyX does this automatically for you if you choose the right
15499 \begin_layout Standard
15500 So which path macro should be used in new template definitions? The rule
15504 \begin_layout Itemize
15506 \begin_inset Flex CharStyle:Code
15509 \begin_layout Plain Layout
15515 if an absolute path is required.
15518 \begin_layout Itemize
15520 \begin_inset Flex CharStyle:Code
15523 \begin_layout Plain Layout
15524 $$AbsOrRelPathMaster
15529 if the substituted string is some kind of LaTeX input.
15532 \begin_layout Itemize
15534 \begin_inset Flex CharStyle:Code
15537 \begin_layout Plain Layout
15538 $$AbsOrRelPathParent
15543 in order to preserve the user's choice.
15546 \begin_layout Standard
15547 There are special cases where this rule does not work and e.
15548 \begin_inset space \thinspace{}
15552 \begin_inset space \space{}
15555 relative names are needed, but normally it will work just fine.
15556 One example for such a case is the command
15557 \begin_inset Flex CharStyle:Code
15560 \begin_layout Plain Layout
15561 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
15566 in the XFig template above: We can't use the absolute name because the
15568 \begin_inset Flex CharStyle:Code
15571 \begin_layout Plain Layout
15577 files needs the relative name in order to rewrite the file content.
15580 \begin_layout Section
15581 \begin_inset CommandInset label
15583 name "sec:Security-discussion"
15587 Security discussion
15590 \begin_layout Standard
15591 \begin_inset Box Shadowbox
15600 height_special "totalheight"
15603 \begin_layout Plain Layout
15604 WARNING: This section is definitely outdated.
15612 \begin_layout Standard
15613 The external material feature interfaces with a lot of external programs
15614 and does so automatically, so we have to consider the security implications
15616 In particular, since you have the option of including your own filenames
15617 and/or parameter strings and those are expanded into a command, it seems
15618 that it would be possible to create a malicious document which executes
15619 arbitrary commands when a user views or prints the document.
15620 This is something we definitely want to avoid.
15623 \begin_layout Standard
15624 However, since the external program commands are specified in the template
15625 configuration file only, there are no security issues if LyX is properly
15626 configured with safe templates only.
15627 This is so because the external programs are invoked with the
15628 \begin_inset Flex CharStyle:Code
15631 \begin_layout Plain Layout
15637 -system call rather than the
15638 \begin_inset Flex CharStyle:Code
15641 \begin_layout Plain Layout
15647 system-call, so it's not possible to execute arbitrary commands from the
15648 filename or parameter section via the shell.
15651 \begin_layout Standard
15652 This also implies that you are restricted in what command strings you can
15653 use in the external material templates.
15654 In particular, pipes and redirection are not readily available.
15655 This has to be so if LyX should remain safe.
15656 If you want to use some of the shell features, you should write a safe
15657 script to do this in a controlled manner, and then invoke the script from
15658 the command string.
15660 \begin_inset Flex CharStyle:Code
15663 \begin_layout Plain Layout
15669 directory of the LyX installation, you can find a safe wrapper script
15670 \begin_inset Flex CharStyle:Code
15673 \begin_layout Plain Layout
15674 general_command_wrapper.py
15679 that supports redirection of input and output.
15680 That can serve as an example for how to write safe template scripts.
15681 For a more advanced example that uses
15682 \begin_inset Flex CharStyle:Code
15685 \begin_layout Plain Layout
15691 and friends, take a look at the
15692 \begin_inset Flex CharStyle:Code
15695 \begin_layout Plain Layout
15704 \begin_layout Standard
15705 It is possible to design a template that interacts directly with the shell,
15706 but since this would allow a malicious user to execute arbitrary commands
15707 by writing clever filenames and/or parameters, we generally recommend that
15708 you only use safe scripts that work with the
15709 \begin_inset Flex CharStyle:Code
15712 \begin_layout Plain Layout
15718 system call in a controlled manner.
15719 Of course, for use in a controlled environment, it can be tempting to just
15720 fall back to use ordinary shell scripts.
15721 If you do so, be aware that you
15725 provide an easily exploitable security hole in your system.
15726 Of course it stands to reason that such unsafe templates will never be
15727 included in the standard LyX distribution, although we do encourage people
15728 to submit new templates in the open source tradition.
15729 But LyX as shipped from the official distribution channels will never have
15733 \begin_layout Standard
15734 Including external material provides a lot of power, and you have to be
15735 careful not to introduce security hazards with this power.
15736 A subtle error in a single line in an innocent looking script can open
15737 the door to huge security problems.
15738 So if you do not fully understand the issues, we recommend that you consult
15739 a knowledgeable security professional or the LyX development team if you
15740 have any questions about whether a given template is safe or not.
15741 And do this before you use it in an uncontrolled environment.