1 #LyX 2.1 created this file. For more info see http://www.lyx.org/
7 % DO NOT ALTER THIS PREAMBLE!!!
9 % This preamble is designed to ensure that this document prints
10 % out as advertised. If you mess with this preamble,
11 % parts of this document may not print out as expected. If you
12 % have problems LaTeXing this file, please contact
13 % the documentation team
14 % email: lyx-docs@lists.lyx.org
16 \usepackage{ifpdf} % part of the hyperref bundle
17 \ifpdf % if pdflatex is used
19 % set fonts for nicer pdf view
20 \IfFileExists{lmodern.sty}
21 {\usepackage{lmodern}}{}
23 \fi % end if pdflatex is used
25 % the pages of the TOC is numbered roman
26 % and a pdf-bookmark for the TOC is added
27 \let\myTOC\tableofcontents
28 \renewcommand\tableofcontents{%
30 \pdfbookmark[1]{\contentsname}{}
34 \options fleqn,bibliography=totoc,index=totoc,BCOR7.5mm,titlepage,captions=tableheading
35 \use_default_options false
39 \maintain_unincluded_children false
42 InsetLayout Flex:MenuItem
51 \newcommand*{\menuitem}[1]{{\sffamily #1}}
54 # In case we need to do with sans...
55 #InsetLayout CharStyle:Code
60 #\renewcommand{\code}[1]{{\sffamily #1}}
65 \language_package default
70 \font_typewriter default
71 \font_default_family default
72 \use_non_tex_fonts false
79 \default_output_format default
81 \bibtex_command default
82 \index_command default
86 \pdf_title "LyX Configuration Manual"
87 \pdf_author "LyX Team"
88 \pdf_subject "LyX-documentation Customization"
89 \pdf_keywords "LyX, documentation, customization"
91 \pdf_bookmarksnumbered true
92 \pdf_bookmarksopen true
93 \pdf_bookmarksopenlevel 1
98 \pdf_pdfusetitle false
99 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true, pdfstartview=XYZ, plainpages=false"
102 \use_package amsmath 0
103 \use_package amssymb 0
105 \use_package mathdots 1
106 \use_package mathtools 0
107 \use_package mhchem 0
108 \use_package undertilde 0
110 \cite_engine_type numerical
114 \paperorientation portrait
129 \paragraph_separation indent
130 \paragraph_indentation default
131 \quotes_language english
134 \paperpagestyle headings
135 \tracking_changes true
136 \output_changes false
140 \author -195340706 "Georg Baum"
142 \author 1414654397 "Richard Heck"
148 Customizing LyX: Features for the Advanced User
156 \begin_layout Plain Layout
158 If you have comments or error corrections, please send them to the LyX Documenta
160 \begin_inset CommandInset href
162 target "lyx-docs@lists.lyx.org"
169 \begin_inset Quotes eld
173 \begin_inset Quotes erd
176 in the subject header, and please cc the current maintainer of this file,
177 Richard Heck <rgheck@comcast.net>.
183 \begin_inset Newline newline
187 \begin_inset Newline newline
193 \begin_layout Standard
194 \begin_inset CommandInset toc
195 LatexCommand tableofcontents
202 \begin_layout Standard
203 \begin_inset Note Note
206 \begin_layout Plain Layout
207 Please use change tracking when modifying this document.
208 This makes it easier for our translators to recognize things that have
209 been changed, and it helps the maintainer keep up-to-date with what's been
218 \begin_layout Chapter
222 \begin_layout Standard
223 This manual covers the customization features present in LyX.
224 In it, we discuss issues like keyboard shortcuts, screen previewing options,
225 printer options, sending commands to LyX via the LyX Server, internationalizati
226 on, installing new LaTeX classes and LyX layouts, etc.
227 We can't possibly hope to touch on everything you can change—our developers
228 add new features faster than we can document them—but we will explain the
229 most common customizations and hopefully point you in the right direction
230 for some of the more obscure ones.
233 \begin_layout Standard
234 \begin_inset Branch OutDated
237 \begin_layout Standard
238 Information from previous versions of this document that now seems to be
239 outdated is contained in the OutDated branch of this document.
240 By default, this information will not appear in the LaTeX output.
248 \begin_layout Chapter
249 LyX configuration files
252 \begin_layout Standard
253 This chapter aims to help you to find your way through the LyX configuration
255 Before continuing to read this chapter, you should find out where your
256 LyX library and user directories are by using
257 \begin_inset Flex MenuItem
260 \begin_layout Plain Layout
261 Help\SpecialChar \menuseparator
272 The library directory is the place where LyX places its system-wide configurati
273 on files; the user directory is where you can place your modified versions.
274 We will call the former
275 \begin_inset Flex Code
278 \begin_layout Plain Layout
285 \begin_inset Flex MenuItem
288 \begin_layout Plain Layout
294 in the remainder of this document.
298 \begin_layout Section
300 \begin_inset Flex Code
303 \begin_layout Plain Layout
312 \begin_layout Standard
313 \begin_inset Flex Code
316 \begin_layout Plain Layout
322 and its sub-directories contain a number of files and that can be used
323 to customize LyX's behavior.
324 You can change many of these files from within LyX itself through the
325 \begin_inset Flex MenuItem
328 \begin_layout Plain Layout
329 Tools\SpecialChar \menuseparator
336 Most customization that you will want to do in LyX is possible through
338 However, many other inner aspects of LyX can be customized by modifying
340 \begin_inset Flex Code
343 \begin_layout Plain Layout
350 These files fall in different categories, described in the following subsection
354 \begin_layout Subsection
355 Automatically generated files
358 \begin_layout Standard
359 The files, which are to be found in
360 \begin_inset Flex MenuItem
363 \begin_layout Plain Layout
369 , are generated when you configure LyX.
370 They contain various default values that are guessed by inspection.
371 In general, it is not a good idea to modify them, since they might be overwritt
375 \begin_layout Labeling
376 \labelwidthstring 00.00.0000
377 \begin_inset Flex Code
380 \begin_layout Plain Layout
386 contains defaults for various commands.
389 \begin_layout Labeling
390 \labelwidthstring 00.00.0000
391 \begin_inset Flex Code
394 \begin_layout Plain Layout
400 contains the list of packages that have been recognized by LyX.
401 It is currently unused by the LyX program itself, but the information extracted
402 , and more, is made available with
403 \begin_inset Flex MenuItem
406 \begin_layout Plain Layout
407 Help\SpecialChar \menuseparator
420 \begin_layout Labeling
421 \labelwidthstring 00.00.0000
422 \begin_inset Flex Code
425 \begin_layout Plain Layout
431 the list of text classes that have been found in your
432 \begin_inset Flex Code
435 \begin_layout Plain Layout
441 directories, along with the associated LaTeX document class and their descripti
445 \begin_layout Labeling
446 \labelwidthstring 00.00.0000
447 \begin_inset Flex Code
450 \begin_layout Plain Layout
456 the list of layout modules found in your
457 \begin_inset Flex Code
460 \begin_layout Plain Layout
469 \begin_layout Labeling
470 \labelwidthstring 00.00.0000
471 \begin_inset Flex Code
474 \begin_layout Plain Layout
480 lists of various sorts of LaTeX-related files found on your system
483 \begin_layout Labeling
484 \labelwidthstring 00.00.0000
485 \begin_inset Flex Code
488 \begin_layout Plain Layout
494 is automatically generated during configuration from the file
495 \begin_inset Flex Code
498 \begin_layout Plain Layout
505 It contains information on your LaTeX configuration.
508 \begin_layout Subsection
512 \begin_layout Standard
513 These directories are duplicated between
514 \begin_inset Flex Code
517 \begin_layout Plain Layout
524 \begin_inset Flex Code
527 \begin_layout Plain Layout
534 If a particular files exists in both places, the one in
535 \begin_inset Flex Code
538 \begin_layout Plain Layout
547 \begin_layout Labeling
548 \labelwidthstring 00.00.0000
549 \begin_inset Flex Code
552 \begin_layout Plain Layout
558 this directory contains files with the extension
559 \begin_inset Flex Code
562 \begin_layout Plain Layout
568 that define the keybindings used in LyX.
569 If there exists an internationalized version of the bind file named
570 \begin_inset Flex Code
573 \begin_layout Plain Layout
579 , that will be used first.
582 \begin_layout Labeling
583 \labelwidthstring 00.00.0000
584 \begin_inset Flex Code
587 \begin_layout Plain Layout
593 contains graphics files that can be included in documents.
597 \begin_layout Labeling
598 \labelwidthstring 00.00.0000
599 \begin_inset Flex Code
602 \begin_layout Plain Layout
608 contains LyX documentation files (including the one you are currently reading).
610 \begin_inset Flex Code
613 \begin_layout Plain Layout
619 deserves special attention, as noted above.
620 The internationalized help docs are in subdirectories
621 \begin_inset Flex Code
624 \begin_layout Plain Layout
631 \begin_inset Quotes eld
635 \begin_inset Quotes erd
638 is the ISO language code.
644 \begin_inset CommandInset ref
646 reference "cha:Internationalizing-LyX"
653 \begin_layout Labeling
654 \labelwidthstring 00.00.0000
655 \begin_inset Flex Code
658 \begin_layout Plain Layout
664 contains example files that explain how to use some features.
665 In the file browser, press the
666 \begin_inset Flex MenuItem
669 \begin_layout Plain Layout
678 \begin_layout Labeling
679 \labelwidthstring 00.00.0000
680 \begin_inset Flex Code
683 \begin_layout Plain Layout
689 contains image files that are used by the
690 \begin_inset Flex MenuItem
693 \begin_layout Plain Layout
700 In addition, it also contains the individual icons used in the toolbar
701 and the banners that can be shown when LyX is launched.
704 \begin_layout Labeling
705 \labelwidthstring 00.00.0000
706 \begin_inset Flex Code
709 \begin_layout Plain Layout
715 contains keyboard keymapping files.
721 \begin_inset CommandInset ref
723 reference "sec:International-Keymap-Stuff"
730 \begin_layout Labeling
731 \labelwidthstring 00.00.0000
732 \begin_inset Flex Code
735 \begin_layout Plain Layout
741 contains the text class and module files described in Chapter
746 \begin_inset CommandInset ref
748 reference "cha:Installing-New-Document"
755 \begin_layout Labeling
756 \labelwidthstring 00.00.0000
757 \begin_inset Flex Code
760 \begin_layout Plain Layout
767 \begin_inset Flex Code
770 \begin_layout Plain Layout
776 Python scripts used to convert between LyX versions.
777 These can be run from the command line if, say, you want to batch-convert
781 \begin_layout Labeling
782 \labelwidthstring 00.00.0000
783 \begin_inset Flex Code
786 \begin_layout Plain Layout
792 contains some files that demonstrate the capabilities of the
793 \begin_inset Flex MenuItem
796 \begin_layout Plain Layout
807 Also contains some scripts used by LyX itself.
810 \begin_layout Labeling
811 \labelwidthstring 00.00.0000
812 \begin_inset Flex Code
815 \begin_layout Plain Layout
821 contains the standard LyX template files described in Chapter
826 \begin_inset CommandInset ref
828 reference "sub:Creating-Templates"
835 \begin_layout Labeling
836 \labelwidthstring 00.00.0000
837 \begin_inset Flex Code
840 \begin_layout Plain Layout
846 contains files with the extension
847 \begin_inset Flex Code
850 \begin_layout Plain Layout
856 that define the user interface to LyX.
857 That is, the files define which items appear in which menus and the items
858 appearing on the toolbar.
861 \begin_layout Subsection
862 Files you don't want to modify
865 \begin_layout Standard
866 These files are used internally by LyX and you generally do not need to
867 modify them unless you are a developer.
870 \begin_layout Labeling
871 \labelwidthstring 00.00.0000
872 \begin_inset Flex Code
875 \begin_layout Plain Layout
881 this file contains the list of LyX developers.
882 The contents are displayed with the menu entry
883 \begin_inset Flex MenuItem
886 \begin_layout Plain Layout
887 Help\SpecialChar \menuseparator
900 \begin_layout Labeling
901 \labelwidthstring 00.00.0000
902 \begin_inset Flex Code
905 \begin_layout Plain Layout
911 this is a LaTeX script used during the configuration process.
915 \begin_layout Labeling
916 \labelwidthstring 00.00.0000
917 \begin_inset Flex Code
920 \begin_layout Plain Layout
926 this is the script that is used to re-configure LyX.
927 It creates configuration files in the directory it was run from.
930 \begin_layout Subsection
931 Other files needing a line or two...
934 \begin_layout Labeling
935 \labelwidthstring 00.00.0000
936 \begin_inset Flex Code
939 \begin_layout Plain Layout
945 this contains tables describing how different character encodings can be
949 \begin_layout Labeling
950 \labelwidthstring 00.00.0000
951 \begin_inset Flex Code
954 \begin_layout Plain Layout
960 this file contains the templates available to the new
961 \begin_inset Flex MenuItem
964 \begin_layout Plain Layout
977 \begin_layout Labeling
978 \labelwidthstring 00.00.0000
979 \begin_inset Flex Code
982 \begin_layout Plain Layout
988 this file contains a list of all the languages currently supported by LyX.
989 \change_inserted -195340706 1334775793
993 \begin_layout Labeling
994 \labelwidthstring 00.00.0000
996 \change_inserted -195340706 1334775793
997 \begin_inset Flex Code
1000 \begin_layout Plain Layout
1002 \change_inserted -195340706 1334775793
1008 this file contains translations for internationalized paragraph styles
1010 \begin_inset space \thinspace{}
1014 \begin_inset CommandInset ref
1016 reference "sub:I18n"
1025 \begin_layout Section
1026 Your local configuration directory
1029 \begin_layout Standard
1030 Even if you are using LyX as an unprivileged user, you might want to change
1031 LyX configuration for your own use.
1033 \begin_inset Flex Code
1036 \begin_layout Plain Layout
1042 directory contains all your personal configuration files.
1043 This is the directory described as
1044 \begin_inset Quotes eld
1048 \begin_inset Quotes erd
1052 \begin_inset Flex MenuItem
1055 \begin_layout Plain Layout
1056 Help\SpecialChar \menuseparator
1058 \begin_inset space ~
1067 This directory is used as a mirror of
1068 \begin_inset Flex Code
1071 \begin_layout Plain Layout
1077 , which means that every file in
1078 \begin_inset Flex Code
1081 \begin_layout Plain Layout
1087 is a replacement for the corresponding file in
1088 \begin_inset Flex Code
1091 \begin_layout Plain Layout
1098 Any configuration file described in the above sections can be placed either
1099 in the system-wide directory, in which case it will affect all users, or
1100 in your local directory for your own use.
1103 \begin_layout Standard
1104 To make things clearer, let's provide a few examples:
1107 \begin_layout Itemize
1108 The preferences set in the
1109 \begin_inset Flex MenuItem
1112 \begin_layout Plain Layout
1113 Tools\SpecialChar \menuseparator
1119 dialog are saved to a file
1120 \begin_inset Flex Code
1123 \begin_layout Plain Layout
1130 \begin_inset Flex Code
1133 \begin_layout Plain Layout
1142 \begin_layout Itemize
1143 When you reconfigure using
1144 \begin_inset Flex MenuItem
1147 \begin_layout Plain Layout
1148 Tools\SpecialChar \menuseparator
1155 \begin_inset Flex Code
1158 \begin_layout Plain Layout
1164 script, and the resulting files are written in your local configuration
1166 This means that any additional text class file that you might have added
1168 \begin_inset Flex Code
1171 \begin_layout Plain Layout
1177 will be added to the list of classes in the
1178 \begin_inset Flex MenuItem
1181 \begin_layout Plain Layout
1182 Document\SpecialChar \menuseparator
1191 \begin_layout Itemize
1192 If you get some updated documentation from LyX ftp site and cannot install
1193 it because you do not have sysadmin rights on your system, you can just
1195 \begin_inset Flex Code
1198 \begin_layout Plain Layout
1204 and the items in the
1205 \begin_inset Flex MenuItem
1208 \begin_layout Plain Layout
1214 menu will open them!
1217 \begin_layout Section
1218 Running LyX with multiple configurations
1221 \begin_layout Standard
1222 The configuration freedom of the local configuration directory may not suffice
1223 if you want to have more than one configuration at your disposal.
1224 For example, you may want to be use different key bindings or printer settings
1226 You can achieve this by having several such directories.
1227 You then specify which directory to use at run-time.
1230 \begin_layout Standard
1231 Invoking LyX with the command line switch
1232 \begin_inset Flex Code
1235 \begin_layout Plain Layout
1245 instructs the program to read the configuration from that directory, and
1246 not from the default directory.
1247 (You can determine the default directory by running LyX without the
1248 \begin_inset Flex Code
1251 \begin_layout Plain Layout
1257 switch.) If the specified directory does not exist, LyX offers to create
1258 it for you, just like it does for the default directory on the first time
1259 you run the program.
1260 You can modify the configuration options in this additional user directory
1261 exactly as you would for the default directory.
1262 These directories are completely independent (but read on).
1263 Note that setting the environment variable
1264 \begin_inset Flex Code
1267 \begin_layout Plain Layout
1273 to some value has exactly the same effect.
1276 \begin_layout Standard
1277 Having several configurations also requires more maintenance: if you want
1278 to add a new layout to
1279 \begin_inset Flex Code
1282 \begin_layout Plain Layout
1288 which you want available from all your configurations, you must add it
1289 to each directory separately.
1290 You can avoid this with the following trick: after LyX creates the additional
1291 directory, most of the subdirectories (see above) are empty.
1292 If you want the new configuration to mirror an existing one, replace the
1293 empty subdirectory with a symbolic link to the matching subdirectory in
1294 the existing configuration.
1296 \begin_inset Flex Code
1299 \begin_layout Plain Layout
1305 subdirectory, however, since it contains a file written by the configuration
1306 script (also accessible through
1307 \begin_inset Flex MenuItem
1310 \begin_layout Plain Layout
1311 Tools\SpecialChar \menuseparator
1317 ) which is configuration-specific.
1320 \begin_layout Chapter
1321 The Preferences dialog
1324 \begin_layout Standard
1325 All options of the preferences dialog are described in the Appendix
1327 The Preferences Dialog
1334 For some options you might find here more details.
1337 \begin_layout Section
1339 \begin_inset CommandInset label
1348 \begin_layout Standard
1349 The first step is to define your file formats if they are not already defined.
1351 \begin_inset Flex MenuItem
1354 \begin_layout Plain Layout
1355 Tools\SpecialChar \menuseparator
1363 \begin_inset Flex MenuItem
1366 \begin_layout Plain Layout
1367 File Handling\SpecialChar \menuseparator
1374 \begin_inset Flex MenuItem
1377 \begin_layout Plain Layout
1378 New\SpecialChar \ldots{}
1384 button to define your new format.
1386 \begin_inset Flex MenuItem
1389 \begin_layout Plain Layout
1395 field contains the name used to identify the format in the GUI.
1397 \begin_inset Flex MenuItem
1400 \begin_layout Plain Layout
1406 is used to identify the format internally.
1407 You will also need to enter a file extension.
1408 These are all required.
1410 \begin_inset Flex MenuItem
1413 \begin_layout Plain Layout
1419 field is used to provide a keyboard shortcut on the menus.
1420 (For example, pressing
1421 \begin_inset Flex MenuItem
1424 \begin_layout Plain Layout
1431 \begin_inset Flex MenuItem
1434 \begin_layout Plain Layout
1435 View\SpecialChar \menuseparator
1436 View (Other Formats)\SpecialChar \menuseparator
1445 \begin_layout Standard
1447 \begin_inset Flex MenuItem
1450 \begin_layout Plain Layout
1457 \begin_inset Flex MenuItem
1460 \begin_layout Plain Layout
1467 For example, you might want to use
1468 \begin_inset Flex MenuItem
1471 \begin_layout Plain Layout
1477 to view PostScript files.
1478 You can enter the command needed to start the program in the corresponding
1480 In defining this command, you can use the four variables listed in the
1482 The viewer is launched when you view an image in LyX or use the
1483 \begin_inset Flex MenuItem
1486 \begin_layout Plain Layout
1493 The editor is for example launched when you right-click on an image and
1495 \begin_inset Flex MenuItem
1498 \begin_layout Plain Layout
1504 in the appearing context menu.
1507 \begin_layout Standard
1509 \change_inserted -195340706 1329851811
1511 \begin_inset Flex MenuItem
1514 \begin_layout Plain Layout
1520 type of a format is optional, but if it is specified, it must be unique
1522 It is used to detect files of this format from the file contents.
1523 For some important file formats there is no MIME type officially registered
1525 \begin_inset CommandInset href
1528 target "http://www.iana.org/assignments/media-types/"
1533 Therefore LyX uses the extended list of MIME types as specified by
1534 \begin_inset CommandInset href
1536 name "freedesktop.org"
1537 target "http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec"
1544 \begin_layout Standard
1546 \begin_inset Flex MenuItem
1549 \begin_layout Plain Layout
1555 option tells LyX that a format is suitable for document export.
1556 If this is set and if a suitable conversion route exists (see sec.
1557 \begin_inset space \thinspace{}
1561 \begin_inset CommandInset ref
1563 reference "sec:Converters"
1567 ), the format will appear in the
1568 \begin_inset Flex MenuItem
1571 \begin_layout Plain Layout
1572 File\SpecialChar \menuseparator
1579 The format will also appear in the
1580 \begin_inset Flex MenuItem
1583 \begin_layout Plain Layout
1589 menu if a viewer is specified for the format.
1590 Pure image formats, such as
1591 \begin_inset Flex Code
1594 \begin_layout Plain Layout
1600 , should not use this option.
1601 Formats that can both represent vector graphics and documents like
1602 \begin_inset Flex Code
1605 \begin_layout Plain Layout
1614 \begin_layout Standard
1616 \begin_inset Flex MenuItem
1619 \begin_layout Plain Layout
1620 Vector graphics format
1625 tells LyX that a format can contain vector graphics.
1626 This information is used to determine the target format of included graphics
1628 \begin_inset Flex MenuItem
1631 \begin_layout Plain Layout
1638 Included graphics may need to be converted to either
1639 \begin_inset Flex MenuItem
1642 \begin_layout Plain Layout
1649 \begin_inset Flex MenuItem
1652 \begin_layout Plain Layout
1659 \begin_inset Flex MenuItem
1662 \begin_layout Plain Layout
1669 \begin_inset Flex MenuItem
1672 \begin_layout Plain Layout
1678 cannot handle other image formats.
1679 If an included graphic is not already in
1680 \begin_inset Flex MenuItem
1683 \begin_layout Plain Layout
1690 \begin_inset Flex MenuItem
1693 \begin_layout Plain Layout
1700 \begin_inset Flex MenuItem
1703 \begin_layout Plain Layout
1709 format, it is converted to
1710 \begin_inset Flex MenuItem
1713 \begin_layout Plain Layout
1719 if the vector format option is set, and otherwise to
1720 \begin_inset Flex MenuItem
1723 \begin_layout Plain Layout
1732 \begin_layout Section
1736 \begin_layout Standard
1737 Since all conversions from one format to another take place in LyX's temporary
1738 directory, it is sometimes necessary to modify a file before copying it
1739 to the temporary directory in order that the conversion may be performed.
1743 \begin_layout Plain Layout
1744 For example, the file may refer to other files—images, for example—using
1745 relative file names, and these may become invalid when the file is copied
1746 to the temporary directory.
1751 This is done by a Copier: It copies a file to (or from) the temporary directory
1752 and may modify it in the process.
1755 \begin_layout Standard
1756 The definitions of the copiers may use four variables:
1759 \begin_layout Labeling
1760 \labelwidthstring 00.00.0000
1761 \begin_inset Flex Code
1764 \begin_layout Plain Layout
1770 The LyX system directory (e.
1771 \begin_inset space \thinspace{}
1775 \begin_inset space \space{}
1779 \begin_inset Flex MenuItem
1782 \begin_layout Plain Layout
1791 \begin_layout Labeling
1792 \labelwidthstring 00.00.0000
1793 \begin_inset Flex Code
1796 \begin_layout Plain Layout
1805 \begin_layout Labeling
1806 \labelwidthstring 00.00.0000
1807 \begin_inset Flex Code
1810 \begin_layout Plain Layout
1819 \begin_layout Labeling
1820 \labelwidthstring 00.00.0000
1821 \begin_inset Flex Code
1824 \begin_layout Plain Layout
1833 \begin_layout Standard
1834 The latter should be the filename as it would be used in a LaTeX's
1841 It is relevant only when exporting files suitable for such inclusion.
1844 \begin_layout Standard
1845 Copiers can be used to do almost anything with output files.
1846 For example, suppose you want generated pdf files to be copied to a special
1848 \begin_inset Flex Code
1851 \begin_layout Plain Layout
1858 Then you could write a shell script such as this one:
1861 \begin_layout Standard
1862 \begin_inset listings
1866 \begin_layout Plain Layout
1871 \begin_layout Plain Layout
1876 \begin_layout Plain Layout
1878 TOFILE=`basename $2`
1881 \begin_layout Plain Layout
1883 cp $FROMFILE /home/you/pdf/$TOFILE
1888 Save it in your local LyX directory—say,
1889 \begin_inset Flex Code
1892 \begin_layout Plain Layout
1893 /home/you/.lyx/scripts/pdfcopier.sh
1898 —and make it executable, if you need to do so on your platform.
1900 \begin_inset Flex MenuItem
1903 \begin_layout Plain Layout
1904 Tools\SpecialChar \menuseparator
1910 dialog, select under
1911 \begin_inset Flex MenuItem
1914 \begin_layout Plain Layout
1915 File Handling\SpecialChar \menuseparator
1922 \begin_inset Flex MenuItem
1925 \begin_layout Plain Layout
1931 format—or one of the other pdf formats—and enter
1932 \begin_inset Flex Code
1935 \begin_layout Plain Layout
1936 pdfcopier.sh $$i $$o
1942 \begin_inset Flex MenuItem
1945 \begin_layout Plain Layout
1955 \begin_layout Standard
1956 Copiers are used by LyX in various of its own conversions.
1957 For example, if appropriate programs are found, LyX will automatically
1958 install copiers for the
1959 \begin_inset Flex MenuItem
1962 \begin_layout Plain Layout
1969 \begin_inset Flex MenuItem
1972 \begin_layout Plain Layout
1974 \begin_inset space ~
1983 When these formats are exported, the copier sees that not just the main
1984 HTML file but various associated files (style files, images, etc.) are also
1986 All these files are written to a subdirectory of the directory in which
1987 the original LyX file was found.
1991 \begin_layout Plain Layout
1992 This copier can be customized.
1994 \begin_inset Quotes eld
1998 \begin_inset Quotes erd
2001 argument takes a comma-separated list of extensions to be copied; if it
2002 is omitted, all files will be copied.
2004 \begin_inset Quotes eld
2008 \begin_inset Quotes erd
2011 argument determines the extension added to the generated directory.
2013 \begin_inset Quotes eld
2017 \begin_inset Flex MenuItem
2020 \begin_layout Plain Layout
2027 \begin_inset Quotes erd
2030 , so HTML generated from
2031 \begin_inset Flex MenuItem
2034 \begin_layout Plain Layout
2035 /path/to/filename.lyx
2041 \begin_inset Flex MenuItem
2044 \begin_layout Plain Layout
2045 /path/to/filename.html.LyXconv
2059 \begin_layout Section
2061 \begin_inset CommandInset label
2063 name "sec:Converters"
2070 \begin_layout Standard
2071 You can define your own Converters to convert files between different formats.
2073 \begin_inset Flex MenuItem
2076 \begin_layout Plain Layout
2077 Tools\SpecialChar \menuseparator
2078 Preferences\SpecialChar \menuseparator
2079 File Handling\SpecialChar \menuseparator
2088 \begin_layout Standard
2089 To define a new converter, select the
2090 \begin_inset Flex MenuItem
2093 \begin_layout Plain Layout
2095 \begin_inset space ~
2104 \begin_inset Flex MenuItem
2107 \begin_layout Plain Layout
2109 \begin_inset space ~
2117 from the drop-down lists, enter the command needed for the conversion,
2119 \begin_inset Flex MenuItem
2122 \begin_layout Plain Layout
2129 Several variables can be used in the definition of converters:
2132 \begin_layout Labeling
2133 \labelwidthstring 00.00.0000
2134 \begin_inset Flex Code
2137 \begin_layout Plain Layout
2143 The LyX system directory
2146 \begin_layout Labeling
2147 \labelwidthstring 00.00.0000
2148 \begin_inset Flex Code
2151 \begin_layout Plain Layout
2160 \begin_layout Labeling
2161 \labelwidthstring 00.00.0000
2162 \begin_inset Flex Code
2165 \begin_layout Plain Layout
2174 \begin_layout Labeling
2175 \labelwidthstring 00.00.0000
2176 \begin_inset Flex Code
2179 \begin_layout Plain Layout
2185 The base filename of the input file (i.
2186 \begin_inset space \thinspace{}
2189 g., without the extension)
2192 \begin_layout Labeling
2193 \labelwidthstring 00.00.0000
2194 \begin_inset Flex Code
2197 \begin_layout Plain Layout
2203 The path to the input file
2206 \begin_layout Labeling
2207 \labelwidthstring 00.00.0000
2208 \begin_inset Flex Code
2211 \begin_layout Plain Layout
2217 The path to the original input file (this is different from $$p when a
2218 chain of converters is called)
2221 \begin_layout Labeling
2222 \labelwidthstring 00.00.0000
2223 \begin_inset Flex Code
2226 \begin_layout Plain Layout
2232 The iconv name for the encoding of the document.
2235 \begin_layout Standard
2237 \begin_inset Flex MenuItem
2240 \begin_layout Plain Layout
2242 \begin_inset space ~
2250 field you can enter the following flags, separated by commas:
2253 \begin_layout Labeling
2254 \labelwidthstring 00.00.0000
2255 \begin_inset Flex Code
2258 \begin_layout Plain Layout
2264 This converter runs some form of LaTeX.
2265 This will make LyX's LaTeX error logs available.
2268 \begin_layout Labeling
2269 \labelwidthstring 00.00.0000
2270 \begin_inset Flex Code
2273 \begin_layout Plain Layout
2280 \begin_inset Flex MenuItem
2283 \begin_layout Plain Layout
2289 file for the conversion.
2290 \change_inserted 1414654397 1337693117
2294 \begin_layout Labeling
2295 \labelwidthstring 00.00.0000
2297 \change_inserted 1414654397 1337693188
2298 \begin_inset Flex Code
2301 \begin_layout Plain Layout
2303 \change_inserted 1414654397 1337693129
2312 \begin_inset Quotes eld
2316 \begin_inset Quotes erd
2319 file from the backend, which in practice means a LaTeX file like the one
2320 we would export, without
2321 \begin_inset Flex Code
2324 \begin_layout Plain Layout
2326 \change_inserted 1414654397 1337693184
2339 \begin_layout Labeling
2340 \labelwidthstring 00.00.0000
2341 \begin_inset Flex Code
2344 \begin_layout Plain Layout
2353 \begin_layout Standard
2354 The following three flags are not really flags at all because they take
2356 \begin_inset Flex MenuItem
2359 \begin_layout Plain Layout
2361 \begin_inset space ~
2365 \begin_inset space ~
2376 \begin_layout Labeling
2377 \labelwidthstring 00.00.0000
2378 \begin_inset Flex Code
2381 \begin_layout Plain Layout
2387 If set, the converter's standard error will be redirected to a file
2388 \begin_inset Flex Code
2391 \begin_layout Plain Layout
2397 , and the script given as argument will be run as:
2398 \begin_inset Flex Code
2401 \begin_layout Plain Layout
2402 script < infile.out > infile.log
2408 The argument may contain
2409 \begin_inset Flex Code
2412 \begin_layout Plain Layout
2421 \begin_layout Labeling
2422 \labelwidthstring 00.00.0000
2423 \begin_inset Flex Code
2426 \begin_layout Plain Layout
2432 The name of the directory in which the converter will dump the generated
2434 LyX will not create this directory, and it does not copy anything into
2435 it, though it will copy this directory to the destination.
2436 The argument may contain
2437 \begin_inset Flex Code
2440 \begin_layout Plain Layout
2446 , which will be replaced by the base name of the input and output files,
2447 respectively, when the directory is copied.
2448 \begin_inset Newline newline
2451 Note that resultdir and usetempdir make no sense together.
2452 The latter will be ignored if the former is given.
2455 \begin_layout Labeling
2456 \labelwidthstring 00.00.0000
2457 \begin_inset Flex Code
2460 \begin_layout Plain Layout
2466 Determines the output file name and may, contain
2467 \begin_inset Flex Code
2470 \begin_layout Plain Layout
2477 Sensible only with resultdir and optional even then; if not given, it defaults
2481 \begin_layout Standard
2482 None of these last three are presently used in any of the converters that
2483 are installed with LyX.
2487 \begin_layout Standard
2488 You do not have to define converters for all formats between which you want
2490 For example, you will note that there is no `LyX to PostScript' converter,
2491 but LyX will export PostScript.
2492 It does so by first creating a LaTeX file (no converter needs to be defined
2493 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2494 and finally converting the resulting DVI file to PostScript.
2495 LyX finds such `chains' of converters automatically, and it will always
2496 choose the shortest possible chain.
2497 You can, though, still define multiple conversion methods between file
2499 For example, the standard LyX configuration provides three ways to convert
2500 LaTeX to PDF: Directly, using
2501 \begin_inset Flex MenuItem
2504 \begin_layout Plain Layout
2510 ; via (DVI and) PostScript, using
2511 \begin_inset Flex MenuItem
2514 \begin_layout Plain Layout
2521 \begin_inset Flex MenuItem
2524 \begin_layout Plain Layout
2531 To define such alternate chains, you must define multiple target `file
2532 formats', as described in section
2533 \begin_inset CommandInset ref
2535 reference "sec:Formats"
2540 For example, in the standard configuration, the formats named
2541 \begin_inset Flex MenuItem
2544 \begin_layout Plain Layout
2551 \begin_inset Flex MenuItem
2554 \begin_layout Plain Layout
2561 \begin_inset Flex MenuItem
2564 \begin_layout Plain Layout
2570 are defined, all of which share the extension
2571 \begin_inset Flex MenuItem
2574 \begin_layout Plain Layout
2580 , and which correspond to the conversion methods just mentioned.
2583 \begin_layout Chapter
2584 Internationalizing LyX
2585 \begin_inset CommandInset label
2587 name "cha:Internationalizing-LyX"
2594 \begin_layout Standard
2595 LyX supports using a translated interface.
2596 Last time we checked, LyX provided text in thirty languages.
2597 The language of choice is called your
2602 (For further reading on locale settings, see also the documentation for
2603 locale that comes with your operating system.
2604 For Linux, the manual page for
2605 \begin_inset Flex Code
2608 \begin_layout Plain Layout
2614 could be a good place to start).
2617 \begin_layout Standard
2618 Notice that these translations will work, but do contain a few flaws.
2619 In particular, all dialogs have been designed with the English text in
2620 mind, which means that some of the translated text will be too large to
2621 fit within the space allocated.
2622 This is only a display problem and will not cause any harm.
2623 Also, you will find that some of the translations do not define shortcut
2624 keys for everything.
2625 Sometimes, there are simply not enough free letters to do it.
2626 Other times, the translator just hasn't got around to doing it yet.
2627 Our localization team, which you may wish to join,
2631 \begin_layout Plain Layout
2632 If you are a fluent speaker of a language other than English, joining these
2633 teams is a great way to give back to the LyX community!
2638 will of course try to fix these shortcomings in future versions of LyX.
2641 \begin_layout Section
2645 \begin_layout Subsection
2646 Translating the graphical user interface (text messages).
2649 \begin_layout Standard
2651 \begin_inset Flex Code
2654 \begin_layout Plain Layout
2660 library to handle the internationalization of the interface.
2661 To have LyX speak your favorite language in all menus and dialogs, you
2663 \begin_inset Flex Code
2666 \begin_layout Plain Layout
2672 -file for that language.
2673 When this is available, you'll have to generate a
2674 \begin_inset Flex Code
2677 \begin_layout Plain Layout
2683 -file from it and install the
2684 \begin_inset Flex Code
2687 \begin_layout Plain Layout
2694 The process of doing all of this is explained in the documentation for
2696 \begin_inset Flex Code
2699 \begin_layout Plain Layout
2706 It is possible to do this just for yourself, but if you're going to do
2707 it, you might as well share the results of your labors with the rest of
2709 Send a message to the LyX developers' list for more information about how
2713 \begin_layout Standard
2714 In short, this is what you should do (xx denotes the language code):
2717 \begin_layout Itemize
2718 Check out the LyX source code.
2720 \begin_inset CommandInset href
2722 name "information on the web"
2723 target "http://www.lyx.org/HowToUseSVN"
2730 \begin_layout Itemize
2732 \begin_inset Flex Code
2735 \begin_layout Plain Layout
2741 to the folder of the
2742 \begin_inset Flex Code
2745 \begin_layout Plain Layout
2753 \begin_inset Flex Code
2756 \begin_layout Plain Layout
2764 \begin_inset Flex Code
2767 \begin_layout Plain Layout
2773 doesn't exist anywhere, it can be remade with the console command
2774 \begin_inset Flex Code
2777 \begin_layout Plain Layout
2783 in that directory, or you can use an existing po-file for some other language
2787 \begin_layout Itemize
2789 \begin_inset Flex Code
2792 \begin_layout Plain Layout
2802 \begin_layout Plain Layout
2803 This is just a text file, so it can be edited in any text editor.
2804 But there are also specialized programs that support such editing, such
2809 (for all platforms) or
2818 contains a `mode' for editing
2819 \begin_inset Flex Code
2822 \begin_layout Plain Layout
2833 For some menu- and widget-labels, there are also shortcut keys that should
2835 Those keys are marked after a `|', and should be translated according to
2836 the words and phrases of the language.
2837 You should also fill also out the information at the beginning of the new
2839 \begin_inset Flex Code
2842 \begin_layout Plain Layout
2848 -file with your email-address, etc., so people know where to reach you with
2849 suggestions and entertaining flames.
2852 \begin_layout Standard
2853 If you are just doing this on your own, then:
2856 \begin_layout Itemize
2858 \begin_inset Flex Code
2861 \begin_layout Plain Layout
2868 This can be done with
2869 \begin_inset Flex Code
2872 \begin_layout Plain Layout
2873 msgfmt -o xx.mo < xx.po
2881 \begin_layout Itemize
2883 \begin_inset Flex Code
2886 \begin_layout Plain Layout
2892 -file to your locale-tree, at the correct directory for application messages
2897 xx, and under the name
2898 \begin_inset Flex Code
2901 \begin_layout Plain Layout
2908 \begin_inset space \thinspace{}
2912 \begin_inset space \space{}
2916 \begin_inset Flex Code
2919 \begin_layout Plain Layout
2920 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2930 \begin_layout Standard
2931 As said, however, it would be best if the new
2932 \begin_inset Flex Code
2935 \begin_layout Plain Layout
2941 -file could be added to the LyX distribution, so others can use it.
2942 Adding it involves making additional changes to LyX.
2943 So send an email to the developers' mailing list if you're interested in
2947 \begin_layout Subsubsection
2951 \begin_layout Standard
2952 Sometimes it turns out that one English message needs to be translated into
2953 different messages in the target language.
2954 One example is the message
2955 \begin_inset Flex Code
2958 \begin_layout Plain Layout
2964 which has the German translation
2972 , depending upon exactly what the English
2973 \begin_inset Quotes eld
2977 \begin_inset Quotes erd
2982 \begin_inset Flex Code
2985 \begin_layout Plain Layout
2991 does not handle such ambiguous translations.
2992 Therefore you have to add some context information to the message: Instead
2994 \begin_inset Flex Code
2997 \begin_layout Plain Layout
3004 \begin_inset Flex Code
3007 \begin_layout Plain Layout
3008 To[[as in 'From format x to format y']]
3014 \begin_inset Flex Code
3017 \begin_layout Plain Layout
3018 To[[as in 'From page x to page y']].
3023 Now the two occurrences of
3024 \begin_inset Flex Code
3027 \begin_layout Plain Layout
3034 \begin_inset Flex Code
3037 \begin_layout Plain Layout
3043 and can be translated correctly to
3054 \begin_layout Standard
3055 Of course the context information needs to be stripped off the original
3056 message when no translation is used.
3057 Therefore you have to put it in double square brackets at the end of the
3058 message (see the example above).
3059 The translation mechanism of LyX ensures that everything in double square
3060 brackets at the end of messages is removed before displaying the message.
3063 \begin_layout Subsection
3064 Translating the documentation.
3067 \begin_layout Standard
3068 The online documentation (in the
3069 \begin_inset Flex MenuItem
3072 \begin_layout Plain Layout
3078 -menu) can (and should!) be translated.
3079 If there are translated versions of the documentation available
3083 \begin_layout Plain Layout
3084 As of March 2008, at least some of the documents have been translated into
3085 fourteen languages, with the Tutorial available in a few more.
3090 and the locale is set accordingly, these will be used automagically by
3092 LyX looks for translated versions as
3093 \begin_inset Flex Code
3096 \begin_layout Plain Layout
3097 LyXDir/doc/xx/DocName.lyx
3103 \begin_inset Flex Code
3106 \begin_layout Plain Layout
3112 is the code for the language currently in use.
3113 If there are no translated documents, the default English versions will
3115 Note that the translated versions must have the same filenames (
3116 \begin_inset Flex Code
3119 \begin_layout Plain Layout
3125 above) as the original.
3126 If you feel up to translating the documentation (an excellent way to proof-read
3127 the original documentation by the way!), there are a few things you should
3131 \begin_layout Itemize
3132 Check out the documentation translation web page at
3133 \begin_inset CommandInset href
3135 name "http://www.lyx.org/Translation"
3136 target "http://www.lyx.org/Translation"
3141 That way, you can find out which (if any) documents have already been translate
3142 d into your language.
3143 You can also find out who (if anyone) is organizing the effort to translate
3144 the documentation into your language.
3145 If no one is organizing the effort, please let us know that you're interested.
3148 \begin_layout Standard
3149 Once you get to actually translating, here's a few hints for you that may
3153 \begin_layout Itemize
3154 Join the documentation team! There is information on how to do that in
3155 \begin_inset Flex Code
3158 \begin_layout Plain Layout
3165 \begin_inset Flex MenuItem
3168 \begin_layout Plain Layout
3169 Help\SpecialChar \menuseparator
3175 ), which by the way is the first document you should translate.
3178 \begin_layout Itemize
3179 Learn the typographic conventions for the language you are translating to.
3180 Typography is an ancient art and over the centuries, a great variety of
3181 conventions have developed throughout different parts of the world.
3182 Also study the professional terminology amongst typographers in your country.
3183 Inventing your own terminology will only confuse the users.
3186 (Warning! Typography is addictive!)
3189 \begin_layout Itemize
3190 Make a copy of the document.
3191 This will be your working copy.
3192 You can use this as your personal translated help-file by placing it in
3194 \begin_inset Flex Code
3197 \begin_layout Plain Layout
3206 \begin_layout Itemize
3207 Sometimes the original document (from the LyX-team) will be updated.
3208 Use the source viewer at
3209 \begin_inset CommandInset href
3211 name "http://www.lyx.org/trac/timeline"
3212 target "http://www.lyx.org/trac/timeline"
3216 to see what has been changed.
3217 That way you can easily see which parts of the translated document need
3221 \begin_layout Standard
3222 If you ever find an error in the original document, fix it and notify the
3223 rest of the documentation team of the changes! (You didn't forget to join
3224 the documentation team, did you?)
3227 \begin_layout Standard
3228 \begin_inset Branch OutDated
3231 \begin_layout Section
3232 International Keyboard Support
3235 \begin_layout Standard
3238 [Editor's Note: The following section is by
3246 It needs to be fixed to conform to the new Documentation Style sheet and
3247 to make use of the new v1.0 features.
3248 The whole thing also needs to be merged with the section following it.-jw
3249 It may also be badly out of date.-rh (2008)]
3252 \begin_layout Subsection
3253 Defining Own Keymaps: Keymap File Format
3256 \begin_layout Standard
3257 Let's look at a keyboard definition file a little closer.
3258 It is a plain text file defining
3261 \begin_layout Itemize
3262 key-to-key or key-to-string translations
3265 \begin_layout Itemize
3269 \begin_layout Itemize
3270 dead keys exceptions
3273 \begin_layout Standard
3274 To define key-to-key or key-to-string translation, use this command:
3277 \begin_layout Quotation
3278 \begin_inset Flex Code
3281 \begin_layout Plain Layout
3290 \begin_inset Flex Code
3293 \begin_layout Plain Layout
3302 \begin_layout Standard
3304 \begin_inset Flex Code
3307 \begin_layout Plain Layout
3313 is the key to be translated and
3314 \begin_inset Flex Code
3317 \begin_layout Plain Layout
3323 is the string to be inserted into the document.
3324 To define dead keys, use:
3327 \begin_layout Quotation
3328 \begin_inset Flex Code
3331 \begin_layout Plain Layout
3340 \begin_inset Flex Code
3343 \begin_layout Plain Layout
3352 \begin_layout Standard
3354 \begin_inset Flex Code
3357 \begin_layout Plain Layout
3363 is a keyboard key and
3364 \begin_inset Flex Code
3367 \begin_layout Plain Layout
3374 The following dead keys are supported (shortcut name is in parentheses):
3377 \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{}
3411 \begin_layout Quotation
3413 \begin_inset space \hfill{}
3419 \begin_layout Quotation
3421 \begin_inset space \hfill{}
3428 \begin_layout Plain Layout
3440 \begin_layout Quotation
3442 \begin_inset space \hfill{}
3448 \begin_layout Quotation
3450 \begin_inset space \hfill{}
3457 \begin_layout Plain Layout
3469 \begin_layout Quotation
3471 \begin_inset space \hfill{}
3477 \begin_layout Quotation
3479 \begin_inset space \hfill{}
3485 \begin_layout Quotation
3487 \begin_inset space \hfill{}
3494 \begin_layout Plain Layout
3506 \begin_layout Quotation
3508 \begin_inset space \hfill{}
3515 \begin_layout Plain Layout
3527 \begin_layout Quotation
3529 \begin_inset space \hfill{}
3535 \begin_layout Quotation
3536 hungarian umlaut (hug)
3537 \begin_inset space \hfill{}
3543 \begin_layout Quotation
3545 \begin_inset space \hfill{}
3551 \begin_layout Quotation
3553 \begin_inset space \hfill{}
3560 \begin_layout Plain Layout
3572 \begin_layout Standard
3573 Since in many international keyboards there are exceptions to what some
3574 dead keys should do, you can define them using
3577 \begin_layout Quotation
3578 \begin_inset Flex Code
3581 \begin_layout Plain Layout
3589 deadkey key outstring
3592 \begin_layout Standard
3593 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3597 \begin_layout Quotation
3598 \begin_inset Flex Code
3601 \begin_layout Plain Layout
3614 \begin_layout Standard
3615 to make it work correctly.
3616 Also, you have to define as exceptions dead keys over i and j, to remove
3617 the dot from them before inserting an accent mark.
3618 I will change this when the time comes, but so far I haven't had time.
3621 \begin_layout Standard
3622 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3625 \begin_inset Flex Code
3628 \begin_layout Plain Layout
3634 have different meaning.
3636 \begin_inset Flex Code
3639 \begin_layout Plain Layout
3645 marks comments, quotes start and end LaTeX-style commands.
3646 To enter quote, you'll need to use
3647 \begin_inset Flex Code
3650 \begin_layout Plain Layout
3659 \begin_inset Flex Code
3662 \begin_layout Plain Layout
3669 \begin_inset Flex Code
3672 \begin_layout Plain Layout
3683 \begin_layout Standard
3684 If you make a keyboard description file that works for your language, please
3685 mail it to me, so I can include it in the next keymap distribution.
3688 \begin_layout Standard
3689 More keywords will be supported in keymap configuration file in future,
3693 \begin_layout Itemize
3694 \begin_inset Flex Code
3697 \begin_layout Plain Layout
3708 \begin_inset space \hfill{}
3712 \begin_inset Flex Code
3715 \begin_layout Plain Layout
3724 \begin_layout Itemize
3725 \begin_inset Flex Code
3728 \begin_layout Plain Layout
3739 \begin_inset space \hfill{}
3743 \begin_inset Flex Code
3746 \begin_layout Plain Layout
3752 an external keymap translation program
3755 \begin_layout Standard
3756 Also, it should look into
3757 \begin_inset Flex Code
3760 \begin_layout Plain Layout
3766 file for defaults, too (for example, a
3767 \begin_inset Flex Code
3770 \begin_layout Plain Layout
3778 option to include default keyboard).
3786 \begin_layout Section
3787 International Keymap Stuff
3788 \begin_inset CommandInset label
3790 name "sec:International-Keymap-Stuff"
3797 \begin_layout Standard
3798 \begin_inset Note Note
3801 \begin_layout Plain Layout
3802 In doing the revisions on this document in March 2008, I did not look over
3803 this stuff, as I do not understand it.
3804 It would be good if someone else could do so.
3813 \begin_layout Standard
3814 The next two sections describe the
3815 \begin_inset Flex Code
3818 \begin_layout Plain Layout
3827 \begin_inset Flex Code
3830 \begin_layout Plain Layout
3838 file syntax in detail.
3839 These sections should help you design your own key map if the ones provided
3840 do not meet your needs.
3843 \begin_layout Subsection
3847 \begin_layout Standard
3851 \begin_inset Flex Code
3854 \begin_layout Plain Layout
3860 file maps keystrokes to characters or strings.
3861 As the name suggests, it sets a keyboard mapping.
3863 \begin_inset Flex Code
3866 \begin_layout Plain Layout
3877 \begin_inset Flex Code
3880 \begin_layout Plain Layout
3895 \begin_inset Flex Code
3898 \begin_layout Plain Layout
3911 \begin_inset Flex Code
3914 \begin_layout Plain Layout
3923 \begin_inset Flex Code
3926 \begin_layout Plain Layout
3934 are described in this section.
3937 \begin_layout Labeling
3938 \labelwidthstring 00.00.0000
3939 \begin_inset Flex Code
3942 \begin_layout Plain Layout
3950 Map a character to a string
3953 \begin_layout LyX-Code
3968 \begin_layout Standard
4001 the double-quote (")
4018 must be escaped with a preceding backslash (
4029 \begin_layout Standard
4031 \begin_inset Flex MenuItem
4034 \begin_layout Plain Layout
4042 statement to cause the symbol
4043 \begin_inset Flex MenuItem
4046 \begin_layout Plain Layout
4054 to be output for the keystroke
4055 \begin_inset Flex MenuItem
4058 \begin_layout Plain Layout
4069 \begin_layout LyX-Code
4075 \begin_layout Labeling
4076 \labelwidthstring 00.00.0000
4077 \begin_inset Flex Code
4080 \begin_layout Plain Layout
4088 Specify an accent character
4091 \begin_layout LyX-Code
4100 \begin_layout Standard
4101 This will make the cha
4139 This is the dead key
4143 \begin_layout Plain Layout
4150 refers to a key that does not produce a character by itself, but when followed
4151 with another key, produces the desired accent character.
4152 For example, a German characte
4154 r with an umlaut like
4164 can be produced in this manner.
4173 \begin_layout Standard
4186 and then another key not in
4203 followed by the other, not allowed key, as output.
4207 \begin_inset Flex MenuItem
4210 \begin_layout Plain Layout
4218 cancels a dead key, so if
4229 \begin_inset Flex MenuItem
4232 \begin_layout Plain Layout
4241 , the cursor will not go one position backwards but will instead cancel
4257 might have had on the next keystroke.
4261 \begin_layout Standard
4262 The following example specifies that the character ' is to be an acute accent,
4263 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4266 \begin_layout LyX-Code
4269 kmod ' acute aeiouAEIOU
4272 \begin_layout Labeling
4273 \labelwidthstring 00.00.0000
4274 \begin_inset Flex Code
4277 \begin_layout Plain Layout
4283 Specify an exception to the accent character
4286 \begin_layout LyX-Code
4295 \begin_layout Standard
4296 This defines an exce
4337 have been assigned a keystroke with a previous
4340 \begin_inset Flex Code
4343 \begin_layout Plain Layout
4367 must not belong in the
4414 If such a declaration does not exist in
4422 \begin_inset Flex Code
4425 \begin_layout Plain Layout
4459 \begin_inset Flex Code
4462 \begin_layout Plain Layout
4476 \begin_layout Standard
4477 The following command produces causes äi to be produced when you enter acute-i
4481 \begin_layout LyX-Code
4495 \begin_layout Labeling
4496 \labelwidthstring 00.00.0000
4497 \begin_inset Flex Code
4500 \begin_layout Plain Layout
4506 Combine two accent characters
4509 \begin_layout LyX-Code
4515 accent1 accent2 allowed
4518 \begin_layout Standard
4519 This one is getting pretty esoteric.
4520 It allows you to combine the effect
4576 \begin_inset Flex Code
4579 \begin_layout Plain Layout
4607 \begin_layout Standard
4608 Consider this example from the
4609 \begin_inset Flex Code
4612 \begin_layout Plain Layout
4623 \begin_layout LyX-Code
4626 kmod ; acute aeioyvhAEIOYVH
4630 kcomb acute umlaut iyIY
4633 \begin_layout Standard
4634 This allows you to press
4635 \begin_inset Flex MenuItem
4638 \begin_layout Plain Layout
4646 and get the effect of
4647 \begin_inset Flex Code
4650 \begin_layout Plain Layout
4669 in this case cancels the last dead key, so if you press
4670 \begin_inset Flex MenuItem
4673 \begin_layout Plain Layout
4682 \begin_inset Flex Code
4685 \begin_layout Plain Layout
4698 \begin_layout Subsection
4702 \begin_layout Standard
4704 \begin_inset Flex Code
4707 \begin_layout Plain Layout
4715 mapping is performed, a
4716 \begin_inset Flex Code
4719 \begin_layout Plain Layout
4729 file maps the strings that the symbols generate to characters in the current
4731 The LyX distribution currently includes at least the
4732 \begin_inset Flex Code
4735 \begin_layout Plain Layout
4744 \begin_inset Flex Code
4747 \begin_layout Plain Layout
4758 \begin_layout Standard
4760 \begin_inset Flex Code
4763 \begin_layout Plain Layout
4771 file is a sequence of declarations of the form
4774 \begin_layout LyX-Code
4787 \begin_layout Standard
4788 For example, in order to map
4789 \begin_inset Flex MenuItem
4792 \begin_layout Plain Layout
4802 to the corresponding character in the iso-8859-1 set (233), the following
4806 \begin_layout LyX-Code
4814 \begin_layout Standard
4816 \begin_inset Flex Code
4819 \begin_layout Plain Layout
4828 \begin_inset Flex Code
4831 \begin_layout Plain Layout
4849 the same character can apply to more than one string.
4851 \begin_inset Flex Code
4854 \begin_layout Plain Layout
4865 \begin_layout LyX-Code
4877 \begin_inset Newline newline
4893 \begin_layout Standard
4894 If LyX cannot find a mapping for the string produced by the keystroke or
4895 a deadkey sequence, it will check if it looks like an accented char and
4896 try to draw an accent over the character on screen.
4899 \begin_layout Subsection
4903 \begin_layout Standard
4904 There is a second way to add support for international characters through
4905 so-called dead-keys.
4906 A dead-key works in combination with a letter to produce an accented character.
4907 Here, we'll explain how to create a really simple dead-key to illustrate
4911 \begin_layout Standard
4912 Suppose you happen to need the circumflex character,
4913 \begin_inset Quotes eld
4917 \begin_inset Quotes erd
4922 \begin_inset Flex MenuItem
4925 \begin_layout Plain Layout
4932 \begin_inset space ~
4936 \begin_inset Flex MenuItem
4939 \begin_layout Plain Layout
4945 ] to the LyX command
4946 \begin_inset Flex Code
4949 \begin_layout Plain Layout
4956 \begin_inset Flex Code
4959 \begin_layout Plain Layout
4966 Now, whenever you type the
4967 \begin_inset Flex MenuItem
4970 \begin_layout Plain Layout
4976 -key followed by a letter, that letter will have a circumflex accent on
4978 For example, the sequence
4979 \begin_inset Quotes eld
4983 \begin_inset Flex MenuItem
4986 \begin_layout Plain Layout
4993 \begin_inset Quotes erd
4996 produces the letter:
4997 \begin_inset Quotes eld
5001 \begin_inset Quotes erd
5005 If you tried to type
5006 \begin_inset Quotes eld
5010 \begin_inset Flex MenuItem
5013 \begin_layout Plain Layout
5020 \begin_inset Quotes erd
5023 , however, LyX will complain with a beep, since a
5024 \begin_inset Quotes eld
5028 \begin_inset Flex MenuItem
5031 \begin_layout Plain Layout
5038 \begin_inset Quotes erd
5041 never takes a circumflex accent.
5043 \begin_inset Flex MenuItem
5046 \begin_layout Plain Layout
5052 after a dead-key produces the bare-accent.
5053 Please note this last point! If you bind a key to a dead-key, you'll need
5054 to rebind the character on that key to yet another key.
5056 \begin_inset Flex MenuItem
5059 \begin_layout Plain Layout
5065 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
5068 \begin_layout Standard
5069 One common way to bind dead-keys is to use
5070 \begin_inset Flex MenuItem
5073 \begin_layout Plain Layout
5080 \begin_inset Flex MenuItem
5083 \begin_layout Plain Layout
5090 \begin_inset Flex MenuItem
5093 \begin_layout Plain Layout
5099 in combination with an accent, like
5100 \begin_inset Quotes eld
5104 \begin_inset Flex MenuItem
5107 \begin_layout Plain Layout
5114 \begin_inset Quotes erd
5118 \begin_inset Quotes eld
5122 \begin_inset Flex MenuItem
5125 \begin_layout Plain Layout
5132 \begin_inset Quotes erd
5136 \begin_inset Quotes eld
5140 \begin_inset Flex MenuItem
5143 \begin_layout Plain Layout
5150 \begin_inset Quotes erd
5154 Another way involves using
5155 \begin_inset Flex Code
5158 \begin_layout Plain Layout
5165 \begin_inset Flex Code
5168 \begin_layout Plain Layout
5174 to set up the special
5175 \begin_inset Flex Code
5178 \begin_layout Plain Layout
5186 \begin_inset Flex Code
5189 \begin_layout Plain Layout
5195 acts in some ways just like
5196 \begin_inset Flex MenuItem
5199 \begin_layout Plain Layout
5205 and permits you to bind keys to accented characters.
5206 You can also turn keys into dead-keys by binding them to something like
5208 \begin_inset Flex Code
5211 \begin_layout Plain Layout
5217 and then binding this symbolic key to the corresponding LyX command.
5221 \begin_layout Plain Layout
5226 : This is exactly what I do in my
5227 \begin_inset Flex Code
5230 \begin_layout Plain Layout
5237 \begin_inset Flex Code
5240 \begin_layout Plain Layout
5248 \begin_inset Flex MenuItem
5251 \begin_layout Plain Layout
5253 \begin_inset space ~
5262 \begin_inset Flex Code
5265 \begin_layout Plain Layout
5271 and a bunch of these
5272 \begin_inset Quotes eld
5276 \begin_inset Flex Code
5279 \begin_layout Plain Layout
5286 \begin_inset Quotes erd
5289 symbolic keys bound such things as
5290 \begin_inset Flex MenuItem
5293 \begin_layout Plain Layout
5295 \begin_inset space ~
5304 \begin_inset Flex MenuItem
5307 \begin_layout Plain Layout
5309 \begin_inset space ~
5318 This is how I produce my accented characters.
5323 You can make just about anything into the
5324 \begin_inset Flex Code
5327 \begin_layout Plain Layout
5334 \begin_inset Flex MenuItem
5337 \begin_layout Plain Layout
5343 keys, a spare function key, etc.
5344 As for the LyX commands that produce accents, check the entry for
5345 \begin_inset Flex Code
5348 \begin_layout Plain Layout
5359 You'll find the complete list there.
5362 \begin_layout Subsection
5363 Saving your Language Configuration
5366 \begin_layout Standard
5367 You can edit your preferences so that your desired language environment
5368 is automatically configured when LyX starts up, via the
5369 \begin_inset Flex MenuItem
5372 \begin_layout Plain Layout
5373 Edit\SpecialChar \menuseparator
5382 \begin_layout Chapter
5383 Installing New Document Classes, Layouts, and Templates
5384 \begin_inset CommandInset label
5386 name "cha:Installing-New-Document"
5391 \begin_inset Argument
5394 \begin_layout Plain Layout
5395 Installing New Document Classes
5403 \begin_layout Standard
5404 In this chapter, we describe the procedures for creating and installing
5405 new LyX layout and template files, as well as offer a refresher on correctly
5406 installing new LaTeX document classes.
5410 \begin_layout Standard
5411 First, let us a say a few words about how one ought to think about the relation
5412 between LyX and LaTeX.
5413 The thing to understand is that, in a certain sense, LyX doesn't know anything
5415 Indeed, from LyX's point of view, LaTeX is just one of several
5416 \begin_inset Quotes eld
5420 \begin_inset Quotes erd
5423 in which it is capable of producing output.
5424 Other such formats are DocBook, plaintext, and XHTML.
5425 LaTeX is, of course, a particularly important format, but very little of
5426 the information LyX has about LaTeX is actually contained in the program
5431 \begin_layout Plain Layout
5432 Some commands are sufficiently complex that they are
5433 \begin_inset Quotes eld
5437 \begin_inset Quotes erd
5441 But the developers generally regard this as a Bad Thing.
5446 Rather, that information, even for the standard classes like
5447 \begin_inset Flex Code
5450 \begin_layout Plain Layout
5456 , is contained in `layout files'.
5457 Similarly, LyX itself does not know much about DocBook or XHTML.
5458 What it knows is contained in layout files.
5461 \begin_layout Standard
5462 You can think of the layout file for a given document class as a translation
5463 manual between LyX constructs---paragraphs with their corresponding styles,
5464 certain sorts of insets, etc---and the corresponding LaTeX, DocBook, or
5466 Almost everything LyX knows about
5467 \begin_inset Flex Code
5470 \begin_layout Plain Layout
5476 , for example, is contained in the file
5477 \begin_inset Flex Code
5480 \begin_layout Plain Layout
5486 and in various other files it includes.
5487 For this reason, anyone intending to write layout files should plan to
5488 study the existing files.
5489 A good place to start is with
5490 \begin_inset Flex Code
5493 \begin_layout Plain Layout
5499 , which is included in
5500 \begin_inset Flex Code
5503 \begin_layout Plain Layout
5510 \begin_inset Flex Code
5513 \begin_layout Plain Layout
5519 , and many of the other layout files for document classes.
5520 This file is where sections and the like are defined:
5521 \begin_inset Flex Code
5524 \begin_layout Plain Layout
5530 tells LyX how paragraphs that are marked with the Section, Subsection,
5531 etc, styles can be translated into corresponding LaTeX, DocBook, and XHTML
5534 \begin_inset Flex Code
5537 \begin_layout Plain Layout
5543 file basically just includes several of these
5544 \begin_inset Flex Code
5547 \begin_layout Plain Layout
5556 \begin_layout Standard
5557 Defining the LyX--LaTeX correspondence is not the only thing layout files
5559 Their other job is to define how the LyX constructs themselves will appear
5561 The fact that layout files have these two jobs is often a source of confusion,
5562 because they are completely separate.
5563 Telling LyX how to translate a certain paragraph style into LaTeX does
5564 not tell LyX how to display it; conversely, telling LyX how to display
5565 a certain paragraph style does not tell LyX how to translate it into LaTeX
5566 (let alone tell LaTeX how to display it).
5567 So, in general, when you define a new LyX construct, you must always do
5568 two quite separate things: (i)
5569 \begin_inset space ~
5572 tell LyX how to translate it into LaTeX and (ii)
5573 \begin_inset space ~
5576 tell LyX how to display it.
5579 \begin_layout Standard
5580 Much the same is true, of course, as regards LyX's other backend formats,
5581 though XHTML is in some ways different, because in that case LyX
5585 able, to some extent, to use information about how it should display a
5586 paragraph on the screen to output information (in the form of CSS) about
5587 how the paragraph should be displayed in a browser.
5588 Even in this case, however, the distinction between what LyX does internally
5589 and how things are rendered externally remains in force, and the two can
5590 be controlled separately.
5592 \begin_inset CommandInset ref
5594 reference "sec:Tags-for-XHTML"
5601 \begin_layout Section
5602 Installing new LaTeX files
5605 \begin_layout Standard
5606 Some installations may not include a LaTeX package or class file that you
5607 would like to use within LyX.
5608 For example, you might need FoilTeX, a package for preparing slides for
5609 overhead projectors.
5610 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5611 a user interface for installing such packages.
5612 For example, with MiKTeX, you start the program
5613 \begin_inset Quotes eld
5617 \begin_inset space ~
5621 \begin_inset Quotes erd
5624 to get a list of available packages.
5625 To install one of them, right click on it or use the corresponding toolbar
5629 \begin_layout Standard
5630 If your LaTeX distribution does not provide such a `package manager', or
5631 if the package is not available from your distribution, then follow these
5632 steps to install it manually:
5635 \begin_layout Enumerate
5636 Get the package from
5637 \begin_inset CommandInset href
5640 target "http://www.ctan.org/"
5647 \begin_layout Enumerate
5648 If the package contains a file with the ending
5649 \begin_inset Quotes eld
5653 \begin_inset Flex Code
5656 \begin_layout Plain Layout
5663 \begin_inset Quotes erd
5666 (is the case for FoilTeX) then open a console, change to the folder of
5667 this file and execute the command
5668 \begin_inset Flex Code
5671 \begin_layout Plain Layout
5678 You have now unpacked the package and have all files to install it.
5679 Most LaTeX-packages are not packed and you can skip this step.
5682 \begin_layout Enumerate
5683 Now you need to decide if the package should be available for all users
5688 \begin_layout Enumerate
5689 On *nix systems (Linux, OSX, etc.), if you want the new package to be available
5690 for all users on your system, then install it in your `local' TeX tree,
5691 otherwise install it in your own `user' TeX tree.
5692 Where these trees should be created, if they do not already exist, depends
5694 To find this out, look in the file
5695 \begin_inset Flex Code
5698 \begin_layout Plain Layout
5708 \begin_layout Plain Layout
5709 This is usually in the directory
5710 \begin_inset Flex Code
5713 \begin_layout Plain Layout
5719 , though you can execute the command
5720 \begin_inset Flex Code
5723 \begin_layout Plain Layout
5734 The location of the `local' TeX tree is defined by the
5735 \begin_inset Flex Code
5738 \begin_layout Plain Layout
5744 variable; this is usually somewhere like
5745 \begin_inset Flex Code
5748 \begin_layout Plain Layout
5749 /usr/local/share/texmf
5755 The location of the `user' TeX tree is defined by
5756 \begin_inset Flex Code
5759 \begin_layout Plain Layout
5766 \begin_inset Flex Code
5769 \begin_layout Plain Layout
5776 (If these variables are not predefined, you have to define them.) You'll
5777 probably need root permissions to create or modify the `local' tree, but
5778 not for your `user' tree.
5779 \begin_inset Newline newline
5782 In general, it is recommended to install in the user tree because your user
5783 will not be modified or even overwritten when you upgrade your system.
5784 It will typically also be backed up together with everything else when
5785 you backup your home directory (which, of course, you do on a regular basis).
5788 \begin_layout Enumerate
5789 On Windows, if you want the new package to be available for all users on
5790 your system, change to the folder where LaTeX is installed and then change
5792 \begin_inset Flex Code
5795 \begin_layout Plain Layout
5806 (For MiKTeX, this would be by default the folder
5807 \begin_inset Flex Code
5810 \begin_layout Plain Layout
5828 \begin_layout Plain Layout
5829 Note that this will be the correct path only on English installations.
5830 On a German one, it would be
5831 \begin_inset Flex Code
5834 \begin_layout Plain Layout
5848 , and similarly for other languages.
5853 Create there a new folder
5854 \begin_inset Flex Code
5857 \begin_layout Plain Layout
5863 and copy all files of the package into it.
5865 \begin_inset Newline newline
5868 If the package should only available for you or you don't have admin permissions
5869 , do the same, but in the local LaTeX folder.
5871 \begin_inset space \thinspace{}
5875 \begin_inset space ~
5878 2.8 under Windows XP, this would be the folder:
5879 \begin_inset Newline newline
5885 \begin_inset Flex Code
5888 \begin_layout Plain Layout
5891 Documents and Settings
5903 \begin_inset Newline newline
5909 \begin_inset Phantom HPhantom
5912 \begin_layout Plain Layout
5923 \begin_inset Flex Code
5926 \begin_layout Plain Layout
5939 \begin_inset Newline newline
5942 On Vista, it would be:
5943 \begin_inset Newline newline
5947 \begin_inset Flex Code
5950 \begin_layout Plain Layout
5976 \begin_layout Enumerate
5977 Now one only need to tell LaTeX that there are new files.
5978 This depends on the used LaTeX-Distribution:
5982 \begin_layout Enumerate
5983 For TeXLive execute the command
5984 \begin_inset Flex Code
5987 \begin_layout Plain Layout
5994 If you installed the package for all users, then you will probably need
5995 to have root permissions for that.
5998 \begin_layout Enumerate
5999 For MiKTeX, if you have installed the package for all users, start the program
6001 \begin_inset Quotes eld
6005 \begin_inset space ~
6009 \begin_inset Quotes erd
6012 and press the button marked
6013 \begin_inset Quotes eld
6017 \begin_inset Quotes erd
6021 Otherwise start the program
6022 \begin_inset Quotes eld
6026 \begin_inset Quotes erd
6033 \begin_layout Enumerate
6034 Finally, you need to tell LyX that there are new packages available.
6035 So, in LyX, use the menu
6036 \begin_inset Flex MenuItem
6039 \begin_layout Plain Layout
6042 \SpecialChar \menuseparator
6048 and then restart LyX.
6051 \begin_layout Standard
6052 Now the package is installed.
6053 In our example, the document class
6054 \begin_inset Flex Code
6057 \begin_layout Plain Layout
6059 \begin_inset space ~
6066 \begin_layout Plain Layout
6078 will now be available under
6079 \begin_inset Flex MenuItem
6082 \begin_layout Plain Layout
6083 Document\SpecialChar \menuseparator
6084 Settings\SpecialChar \menuseparator
6094 \begin_layout Standard
6095 If you would like to use a LaTeX document class that is not even listed
6097 \begin_inset Flex MenuItem
6100 \begin_layout Plain Layout
6101 Document\SpecialChar \menuseparator
6102 Settings\SpecialChar \menuseparator
6108 , then you need to create a `layout' file for it.
6109 That is the topic of the next section.
6112 \begin_layout Section
6113 Types of layout files
6116 \begin_layout Standard
6117 This section describes the various sorts of LyX files that contain layout
6119 These files describe various paragraph and character styles, determining
6120 how LyX should display them and how they should be translated into LaTeX,
6121 DocBook, XHTML, or whatever output format is being used.
6125 \begin_layout Standard
6126 We shall try to provide a thorough description of the process of writing
6128 However, there are so many different types of documents supported even
6129 by just LaTeX that we can't hope to cover every different possibility or
6130 problem you might encounter.
6131 The LyX users' list is frequented by people with lots of experience with
6132 layout design who are willing to share what they've learned, so please
6133 feel free to ask questions there.
6136 \begin_layout Standard
6137 As you prepare to write a new layout, it is extremely helpful to look at
6138 the layouts distributed with LyX.
6139 If you write a LyX layout for a LaTeX document class that might also be
6140 used by others, or write a module that might be useful to others, then
6141 you should consider posting your layout to the
6142 \begin_inset CommandInset href
6144 name "layout section on the LyX wiki"
6145 target "http://wiki.lyx.org/Layouts/Layouts"
6149 or even to the LyX developers' list, so that it might be included in LyX
6154 \begin_layout Plain Layout
6155 Note that LyX is licensed under the General Public License, so any material
6156 that is contributed to LyX must be similarly licensed.
6164 \begin_layout Subsection
6166 \begin_inset CommandInset label
6168 name "sub:Layout-modules"
6175 \begin_layout Standard
6176 We have spoken to this point about `layout files'.
6177 But there are different sorts of files that contain layout information.
6178 Layout files, strictly so called, have the
6179 \begin_inset Flex Code
6182 \begin_layout Plain Layout
6188 extension and provide LyX with information about document classes.
6189 As of LyX 1.6, however, layout information can also be contained in layout
6195 \begin_inset Flex Code
6198 \begin_layout Plain Layout
6205 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
6206 some modules—such as the
6207 \begin_inset Flex Code
6210 \begin_layout Plain Layout
6216 module—specifically provide support for one package.
6217 In a sense, layout modules are similar to included
6221 \begin_layout Plain Layout
6222 These can have any extension, but by convention have the
6223 \begin_inset Flex Code
6226 \begin_layout Plain Layout
6238 \begin_inset Flex Code
6241 \begin_layout Plain Layout
6247 —in that modules are not specific to a given document class but may be used
6248 with many different classes.
6249 The difference is that using an included file with
6250 \begin_inset Flex Code
6253 \begin_layout Plain Layout
6259 requires editing that file.
6260 Modules, by contrast, are selected in the
6261 \begin_inset Flex MenuItem
6264 \begin_layout Plain Layout
6265 Document\SpecialChar \menuseparator
6274 \begin_layout Standard
6275 Building modules is the easiest way to get started with layout editing,
6276 since it can be as simple as adding a single new paragraph style or flex
6278 But modules may, in principle, contain anything a layout file can contain.
6281 \begin_layout Standard
6282 After creating a new module and copying it to the
6283 \begin_inset Flex Code
6286 \begin_layout Plain Layout
6292 folder, you will need to reconfigure and then restart LyX for the module
6293 to appear in the menu.
6294 However, changes you make to the module will be seen immediately, if you
6296 \begin_inset Flex MenuItem
6299 \begin_layout Plain Layout
6300 Document\SpecialChar \menuseparator
6306 , highlight something, and then hit
6307 \begin_inset Quotes eld
6311 \begin_inset Quotes erd
6317 It is strongly recommended that you save your work before doing this
6322 it is strongly recommended that you not attempt to edit modules while simultaneo
6323 usly working on actual documents
6326 Though of course the developers strive to keep LyX stable in such situations,
6327 syntax errors and the like in your module file could cause strange behavior.
6330 \begin_layout Subsubsection
6334 \begin_layout Standard
6335 Modules are to LyX as packages are to LaTeX.
6336 Sometimes, however, you find yourself wanting a specific inset or character
6337 style just for one document and writing a module that will also be available
6338 to other documents makes little sense.
6339 What you need is LyX's
6340 \begin_inset Quotes eld
6344 \begin_inset Quotes erd
6350 \begin_layout Standard
6351 You will find it under
6353 Document\SpecialChar \menuseparator
6354 Settings\SpecialChar \menuseparator
6358 The large text box allows you to enter anything that you might enter in
6359 a layout file or module.
6360 You can think of a document's local layout, in fact, as a module that belongs
6362 So, in particular, you must enter a
6363 \begin_inset Flex Code
6366 \begin_layout Plain Layout
6373 Any format is acceptable, but one would normally use the format current
6375 (In LyX 2.0, the current layout format is 35.) You should be aware that local
6376 layout is not supported by versions of LyX prior to 1.6, so you should not
6377 use it if you want to be able to export your document to LyX 1.5 or earlier
6378 (without, that is, losing the local layout information).
6379 If you wish to be able to export to 1.6---local layout is supported in 1.6,
6380 though there is no UI for it---then you should use format 11 and, of course,
6381 use only layout constructs that were available in LyX 1.6.
6384 \begin_layout Standard
6385 When you have entered something in the
6386 \begin_inset Flex Code
6389 \begin_layout Plain Layout
6395 pane, LyX will enable the
6396 \begin_inset Quotes eld
6400 \begin_inset Quotes erd
6403 button at the bottom.
6404 Clicking this button will cause LyX to determine whether what you have
6405 entered is valid layout information for the chosen format.
6406 LyX will report the result but, unfortunately, will not tell you what errors
6407 there might have been.
6408 These will be written to the terminal, however, if LyX is started from
6410 You will not be permitted to save your local layout until you have entered
6414 \begin_layout Standard
6415 The warnings at the end of the previous section apply here, too.
6416 Do not play with local layout while you are actually working, especially
6417 if you have not saved your document.
6418 That said, using local layout with a test document can be a very convenient
6419 way to try out layout ideas, or even to start developing a module.
6422 \begin_layout Subsection
6424 \begin_inset Flex MenuItem
6427 \begin_layout Plain Layout
6436 \begin_layout Standard
6437 There are two situations you are likely to encounter when wanting to support
6438 a new LaTeX document class, involving style (
6439 \begin_inset Flex Code
6442 \begin_layout Plain Layout
6448 ) files and LaTeX2e class (
6449 \begin_inset Flex Code
6452 \begin_layout Plain Layout
6459 Supporting a style file is usually fairly easy.
6460 Supporting a new class file is a bit harder.
6461 We'll discuss the former in this section and the latter in the next.
6462 Similar remarks apply, of course, if you want to support a new DocBook
6466 \begin_layout Standard
6467 The easier case is the one in which your new document class is provided
6468 as a style file that is to be used in conjunction with an already supported
6470 For the sake of the example, we'll assume that the style file is called
6472 \begin_inset Flex MenuItem
6475 \begin_layout Plain Layout
6481 and that it is meant to be used with
6482 \begin_inset Flex MenuItem
6485 \begin_layout Plain Layout
6491 , which is a standard class.
6495 \begin_layout Standard
6496 Start by copying the existing class's layout file into your local directory:
6500 \begin_layout Plain Layout
6501 Of course, which directory is your local directory will vary by platform,
6502 and LyX allows you to specify your local directory on startup, too, using
6504 \begin_inset Flex Code
6507 \begin_layout Plain Layout
6521 \begin_layout LyX-Code
6522 cp report.layout ~/.lyx/layouts/myclass.layout
6525 \begin_layout Standard
6527 \begin_inset Flex Code
6530 \begin_layout Plain Layout
6536 and change the line:
6539 \begin_layout LyX-Code
6542 DeclareLaTeXClass{report}
6545 \begin_layout Standard
6549 \begin_layout LyX-Code
6552 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6555 \begin_layout Standard
6559 \begin_layout LyX-Code
6561 \begin_inset Newline newline
6567 \begin_inset Newline newline
6573 \begin_layout Standard
6574 near the top of the file.
6577 \begin_layout Standard
6578 Start LyX and select
6579 \begin_inset Flex MenuItem
6582 \begin_layout Plain Layout
6583 Tools\SpecialChar \menuseparator
6590 Then restart LyX and try creating a new document.
6592 \begin_inset Flex MenuItem
6595 \begin_layout Plain Layout
6601 " as a document class option in the
6602 \begin_inset Flex MenuItem
6605 \begin_layout Plain Layout
6606 Document\SpecialChar \menuseparator
6613 It is likely that some of the sectioning commands and such in your new
6614 class will work differently from how they worked in the base class—
6615 \begin_inset Flex Code
6618 \begin_layout Plain Layout
6624 in this example—so you can fiddle around with the settings for the different
6625 sections if you wish.
6626 The layout information for sections is contained in
6627 \begin_inset Flex Code
6630 \begin_layout Plain Layout
6636 , but you do not need to copy and change this file.
6637 Instead, you can simply add your changes to your layout file, after the
6639 \begin_inset Flex Code
6642 \begin_layout Plain Layout
6648 , which itself includes
6649 \begin_inset Flex Code
6652 \begin_layout Plain Layout
6659 For example, you might add these lines:
6662 \begin_layout LyX-Code
6666 \begin_layout LyX-Code
6670 \begin_layout LyX-Code
6674 \begin_layout LyX-Code
6678 \begin_layout LyX-Code
6682 \begin_layout Standard
6683 to change the font for chapter headings to sans-serif.
6684 This will override (or, in this case, add to) the existing declaration
6685 for the Chapter style.
6689 \begin_layout Standard
6690 Your new package may also provide commands or environments not present in
6692 In this case, you will want to add these to the layout file.
6694 \begin_inset CommandInset ref
6696 reference "sec:TextClass"
6700 for information on how to do so.
6703 \begin_layout Standard
6705 \begin_inset Flex MenuItem
6708 \begin_layout Plain Layout
6714 can be used with several different document classes, and even if it cannot,
6715 you might find it easiest just to write a module that you can load with
6717 The simplest possible such module would be:
6720 \begin_layout LyX-Code
6723 DeclareLyXModule{My Package}
6726 \begin_layout LyX-Code
6730 \begin_layout LyX-Code
6731 #Support for mypkg.sty.
6734 \begin_layout LyX-Code
6736 \begin_inset Newline newline
6742 \begin_layout LyX-Code
6744 \begin_inset Newline newline
6750 \begin_layout LyX-Code
6752 \begin_inset Newline newline
6758 \begin_inset Newline newline
6764 \begin_layout Standard
6765 A more complex module might modify the behavior of some existing constructs
6766 or define some new ones.
6768 \begin_inset CommandInset ref
6770 reference "sec:TextClass"
6777 \begin_layout Subsection
6779 \begin_inset Flex MenuItem
6782 \begin_layout Plain Layout
6791 \begin_layout Standard
6792 There are two possibilities here.
6793 One is that the class file is itself based upon an existing document class.
6794 For example, many thesis classes are based upon
6795 \begin_inset Flex MenuItem
6798 \begin_layout Plain Layout
6805 To see whether yours is, look for a line like
6808 \begin_layout LyX-Code
6814 \begin_layout Standard
6816 If so, then you may proceed largely as in the previous section, though
6818 \begin_inset Flex Code
6821 \begin_layout Plain Layout
6827 line will be different.
6828 If your new class is
6829 \begin_inset Flex Code
6832 \begin_layout Plain Layout
6838 and it is based upon
6839 \begin_inset Flex Code
6842 \begin_layout Plain Layout
6848 , then the line should read:
6852 \begin_layout Plain Layout
6853 And it will be easiest if you save the file to
6854 \begin_inset Flex Code
6857 \begin_layout Plain Layout
6863 : LyX assumes that the document class has the same name as the layout file.
6872 \begin_layout LyX-Code
6875 DeclareLaTeXClass[thesis,book]{thesis}
6878 \begin_layout Standard
6879 If, on the other hand, the new class is not based upon an existing class,
6880 you will probably have to
6881 \begin_inset Quotes eld
6885 \begin_inset Quotes erd
6889 We strongly suggest copying an existing layout file which uses a similar
6890 LaTeX class and then modifying it, if you can do so.
6891 At least use an existing file as a starting point so you can find out what
6892 items you need to worry about.
6893 Again, the specifics are covered below.
6896 \begin_layout Subsection
6898 \begin_inset CommandInset label
6900 name "sub:Creating-Templates"
6907 \begin_layout Standard
6908 Once you have written a layout file for a new document class, you might
6909 want to consider writing a
6914 A template acts as a kind of tutorial for your layout, showing how it might
6915 be used, though containing dummy content.
6916 You can of course look at the various templates included with LyX for ideas.
6919 \begin_layout Standard
6920 Templates are created just like usual documents: using LyX.
6921 The only difference is that usual documents contain all possible settings,
6922 including the font scheme and the paper size.
6923 Usually a user doesn't want a template to overwrite his preferred settings
6924 for such parameters.
6925 For that reason, the designer of a template should remove the corresponding
6927 \begin_inset Flex Code
6930 \begin_layout Plain Layout
6939 \begin_inset Flex Code
6942 \begin_layout Plain Layout
6950 from the template LyX file.
6951 This can be done with any simple text-editor, for example
6952 \begin_inset Flex Code
6955 \begin_layout Plain Layout
6962 \begin_inset Flex Code
6965 \begin_layout Plain Layout
6975 \begin_layout Standard
6976 Put the edited template files you create in
6977 \begin_inset Flex Code
6980 \begin_layout Plain Layout
6986 , copy the ones you use from the global template directory in
6987 \begin_inset Flex Code
6990 \begin_layout Plain Layout
6996 to the same place, and redefine the template path in the
6997 \begin_inset Flex MenuItem
7000 \begin_layout Plain Layout
7001 Tools\SpecialChar \menuseparator
7002 Preferences\SpecialChar \menuseparator
7011 \begin_layout Standard
7012 Note, by the way, that there is a template which has a particular meaning:
7014 \begin_inset Flex Code
7017 \begin_layout Plain Layout
7024 This template is loaded every time you create a new document with
7025 \begin_inset Flex MenuItem
7028 \begin_layout Plain Layout
7029 File\SpecialChar \menuseparator
7035 in order to provide useful defaults.
7036 To create this template from inside LyX, all you have to do is to open
7037 a document with the correct settings, and use the
7038 \begin_inset Flex MenuItem
7041 \begin_layout Plain Layout
7042 Save as Document Defaults
7050 \begin_layout Subsection
7051 Upgrading old layout files
7054 \begin_layout Standard
7055 The format of layout files changes with each LyX release, so old layout
7056 files need to be converted to the new format.
7057 This process has been automated since LyX 1.4: If LyX reads a layout file
7058 in an older format, it automatically calls the script
7059 \begin_inset Flex Code
7062 \begin_layout Plain Layout
7068 to convert it to a temporary file in current format.
7069 The original file is left untouched.
7070 If you use the layout file often, then, you may want to convert it permanently,
7071 so that LyX does not have to do so itself every time.
7072 To do this, you can call the converter manually:
7075 \begin_layout LyX-Code
7076 mv myclass.layout myclass.old
7079 \begin_layout LyX-Code
7080 python LyXDir/scripts/layout2layout.py myclass.old myclass.layout
7083 \begin_layout Standard
7085 \begin_inset Flex Code
7088 \begin_layout Plain Layout
7094 with the name of your LyX system directory, of course.
7097 \begin_layout Standard
7098 Note that manual conversion does not affect included files, so these will
7099 have to be converted separately.
7102 \begin_layout Section
7103 \begin_inset CommandInset label
7105 name "sec:TextClass"
7109 The layout file format
7112 \begin_layout Standard
7113 When it's finally time to get your hands dirty and create or edit your own
7114 layout file, the following sections describe what you're up against.
7115 Our advice is to go slowly, save and test often, listen to soothing music,
7116 and enjoy one or two of your favorite adult beverages; more if you are
7117 getting particularly stuck.
7118 It's really not that hard, except that the multitude of options can become
7119 overwhelming if you try to do too much in one sitting.
7120 Go have another adult beverage, just for good measure.
7123 \begin_layout Standard
7124 Note that all the tags used in layout files are case-insensitive.
7126 \begin_inset Flex Code
7129 \begin_layout Plain Layout
7136 \begin_inset Flex Code
7139 \begin_layout Plain Layout
7146 \begin_inset Flex Code
7149 \begin_layout Plain Layout
7155 are really the same tag.
7156 The possible values are printed in brackets after the feature's name.
7157 The default value if a feature isn't specified inside a text class-description
7159 \begin_inset Flex Code
7162 \begin_layout Plain Layout
7171 If the argument has a data type like
7172 \begin_inset Quotes eld
7176 \begin_inset Quotes erd
7180 \begin_inset Quotes eld
7184 \begin_inset Quotes erd
7187 , the default is shown like this:
7188 \begin_inset Flex Code
7191 \begin_layout Plain Layout
7202 \begin_layout Subsection
7203 The document class declaration
7206 \begin_layout Standard
7207 Lines in a layout file which begin with
7208 \begin_inset Flex Code
7211 \begin_layout Plain Layout
7218 There is one exception to this rule.
7220 \begin_inset Flex Code
7223 \begin_layout Plain Layout
7229 files should begin with a line like:
7232 \begin_layout LyX-Code
7235 #% Do not delete the line below; configure depends on this
7238 \begin_layout LyX-Code
7243 DeclareLaTeXClass{article}
7246 \begin_layout Standard
7247 The second line is used when you (re)configure LyX.
7248 The layout file is read by the LaTeX script
7249 \begin_inset Flex Code
7252 \begin_layout Plain Layout
7258 , in a special mode where
7259 \begin_inset Flex Code
7262 \begin_layout Plain Layout
7269 The first line is just a LaTeX comment, and the second one contains the
7270 declaration of the text class.
7271 If these lines appear in a file named
7272 \begin_inset Flex Code
7275 \begin_layout Plain Layout
7281 , then they define a text class of name
7282 \begin_inset Flex Code
7285 \begin_layout Plain Layout
7291 (the name of the layout file) which uses the LaTeX document class
7292 \begin_inset Flex Code
7295 \begin_layout Plain Layout
7301 (the default is to use the same name as the layout).
7303 \begin_inset Quotes eld
7307 \begin_inset Quotes erd
7310 that appears above is used as a description of the text class in the
7311 \begin_inset Flex MenuItem
7314 \begin_layout Plain Layout
7315 Document\SpecialChar \menuseparator
7324 \begin_layout Standard
7325 Let's assume that you wrote your own text class that uses the
7326 \begin_inset Flex Code
7329 \begin_layout Plain Layout
7335 document class, but where you changed the appearance of the section headings.
7336 If you put it in a file
7337 \begin_inset Flex Code
7340 \begin_layout Plain Layout
7346 , the header of this file should be:
7349 \begin_layout LyX-Code
7352 #% Do not delete the line below; configure depends on this
7355 \begin_layout LyX-Code
7360 DeclareLaTeXClass[article]{article (with my own headings)}
7363 \begin_layout Standard
7364 This declares a text class
7365 \begin_inset Flex Code
7368 \begin_layout Plain Layout
7374 , associated with the LaTeX document class
7375 \begin_inset Flex Code
7378 \begin_layout Plain Layout
7385 \begin_inset Quotes eld
7388 article (with my own headings)
7389 \begin_inset Quotes erd
7393 If your text class depends on several packages, you can declare it as:
7396 \begin_layout LyX-Code
7399 #% Do not delete the line below; configure depends on this
7402 \begin_layout LyX-Code
7407 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
7410 \begin_layout Standard
7411 This indicates that your text class uses the
7412 \begin_inset Flex Code
7415 \begin_layout Plain Layout
7422 Finally, it is also possible to declare classes for DocBook code.
7423 Typical declarations will look like:
7426 \begin_layout LyX-Code
7429 #% Do not delete the line below; configure depends on this
7432 \begin_layout LyX-Code
7437 DeclareDocBookClass[article]{SGML (DocBook article)}
7440 \begin_layout Standard
7441 Note that these declarations can also be given an optional parameter declaring
7442 the name of the document class (but not a list).
7445 \begin_layout Standard
7446 So, to be as explicit as possible, the form of the layout declaration is:
7449 \begin_layout LyX-Code
7454 DeclareLaTeXClass[class,package.sty]{layout description}
7457 \begin_layout Standard
7458 The class need only be specified if the name of the LaTeX class file and
7459 the name of the layout file are different or if there are packages to load.
7460 If the name of the class file is not specified, then LyX will simply assume
7461 that it is the same as the name of the layout file.
7464 \begin_layout Standard
7465 When the text class has been modified to your taste, all you have to do
7466 is to copy it either to
7467 \begin_inset Flex Code
7470 \begin_layout Plain Layout
7477 \begin_inset Flex Code
7480 \begin_layout Plain Layout
7487 \begin_inset Flex MenuItem
7490 \begin_layout Plain Layout
7491 Tools\SpecialChar \menuseparator
7497 , exit LyX and restart.
7498 Then your new text class should be available along with the others.
7501 \begin_layout Standard
7502 Once the layout file is installed, you can edit it and see your changes
7503 without having to reconfigure or to restart LyX.
7508 \begin_layout Plain Layout
7509 In versions of LyX prior to 1.6, this was not true.
7510 As a result, editing layout files was very time consuming, since you had
7511 constantly to restart LyX to see changes.
7516 You can force a reload of the current layout by using the LyX function
7518 \begin_inset Flex MenuItem
7521 \begin_layout Plain Layout
7528 There is no default binding for this function—though, of course, you can
7529 bind it to a key yourself.
7530 But you will normally use this function simply by entering it in the mini-buffe
7535 \begin_layout Standard
7541 \begin_inset Flex MenuItem
7544 \begin_layout Plain Layout
7550 is very much an `advanced feature'.
7555 recommended that you save your work before using this function.
7560 recommended that you not attempt to edit layout information while simultaneousl
7561 y working on a document that you care about.
7562 Use a test document.
7563 Syntax errors and the like in your layout file could cause peculiar behavior.
7564 In particular, such errors could cause LyX to regard the current layout
7565 as invalid and to attempt to switch to some other layout.
7569 \begin_layout Plain Layout
7570 Really bad syntax errors may even caused LyX to exit.
7571 This is because certain sorts of errors may make LyX unable to read
7581 The LyX team strives to keep LyX stable in such situations, but safe is
7586 \begin_layout Plain Layout
7587 While we're giving advice: make regular backups.
7588 And be nice to your mother.
7596 \begin_layout Subsection
7597 The Module declaration
7600 \begin_layout Standard
7601 A module must begin with a line like the following:
7604 \begin_layout LyX-Code
7607 DeclareLyXModule[endnotes.sty]{Endnotes}
7610 \begin_layout Standard
7611 The mandatory argument, in curly brackets, is the name of the module, as
7613 \begin_inset Flex MenuItem
7616 \begin_layout Plain Layout
7617 Document\SpecialChar \menuseparator
7618 Settings\SpecialChar \menuseparator
7625 The argument in square brackets is optional: It declares any LaTeX packages
7626 on which the module depends.
7627 Please note that only packages about which LyX knows should be listed in
7628 the square brackets.
7632 \begin_layout Plain Layout
7633 The list of such packages is documented only in the source code.
7638 LyX will not check for arbitrary packages.
7639 It is also possible to use the form
7640 \begin_inset Flex MenuItem
7643 \begin_layout Plain Layout
7649 as an optional argument, which declares that the module can only be used
7650 when there exists a conversion chain between the formats `
7651 \begin_inset Flex Code
7654 \begin_layout Plain Layout
7661 \begin_inset Flex Code
7664 \begin_layout Plain Layout
7673 \begin_layout Standard
7674 The module declaration should then be followed by lines like the following
7678 \begin_layout Plain Layout
7679 Preferably in English if the module should be published with LyX.
7680 This description will appear in the list of messages to be translated and
7681 will be thus translated with the next interface update.
7689 \begin_layout LyX-Code
7693 \begin_layout LyX-Code
7694 #Adds an endnote command, in addition to footnotes.
7698 \begin_layout LyX-Code
7699 #You will need to add
7701 theendnotes in TeX code where you
7704 \begin_layout LyX-Code
7705 #want the endnotes to appear.
7709 \begin_layout LyX-Code
7713 \begin_layout LyX-Code
7714 #Requires: somemodule | othermodule
7717 \begin_layout LyX-Code
7718 #Excludes: badmodule
7721 \begin_layout Standard
7722 The description is used in
7723 \begin_inset Flex MenuItem
7726 \begin_layout Plain Layout
7727 Document\SpecialChar \menuseparator
7728 Settings\SpecialChar \menuseparator
7734 to provide the user with information about what the module does.
7736 \begin_inset Flex Code
7739 \begin_layout Plain Layout
7745 line is used to identify other modules with which this one must be used;
7747 \begin_inset Flex Code
7750 \begin_layout Plain Layout
7756 line is used to identify modules with which this one may not be used.
7757 Both are optional, and, as shown, multiple modules should be separated
7758 with the pipe symbol: |.
7759 Note that the required modules are treated disjunctively:
7763 of the required modules must be used.
7768 excluded module may be used.
7769 Note that modules are identified here by their
7774 \begin_inset Flex Code
7777 \begin_layout Plain Layout
7785 \begin_inset Flex Code
7788 \begin_layout Plain Layout
7795 \begin_inset Flex Code
7798 \begin_layout Plain Layout
7807 \begin_layout Subsection
7811 \begin_layout Standard
7812 The first non-comment line of any layout file, included file, or module
7817 contain the file format number:
7820 \begin_layout Description
7821 \begin_inset Flex Code
7824 \begin_layout Plain Layout
7831 \begin_inset Flex Code
7834 \begin_layout Plain Layout
7840 ] The format of the layout file.
7843 \begin_layout Standard
7844 This tag was introduced with LyX 1.4.0.
7845 Layout files from LyX 1.3.x and earlier don't have an explicit file format
7846 and are considered to be of format 1.
7847 The format for the present version of LyX is format 21.
7848 But each version of LyX is capable of reading earlier versions' layout
7849 files, just as they are capable of reading files produced by earlier versions
7851 There is, however, no provision for converting to earlier formats.
7852 So LyX 1.6.x will not read layout files in format 21 but only files in format
7856 \begin_layout Subsection
7857 \begin_inset CommandInset label
7859 name "sub:General-text-class"
7863 General text class parameters
7866 \begin_layout Standard
7867 These are general parameters that govern the behavior of an entire document
7873 mean that they must appear in
7874 \begin_inset Flex Code
7877 \begin_layout Plain Layout
7883 files rather than in modules.
7884 A module can contain any layout tag.)
7887 \begin_layout Description
7888 \begin_inset Flex Code
7891 \begin_layout Plain Layout
7897 Adds information that will be output in the
7898 \begin_inset Flex Code
7901 \begin_layout Plain Layout
7907 block when this document class is output to XHTML.
7908 Typically, this would be used to output CSS style information, but it can
7909 be used for anything that can appear in
7910 \begin_inset Flex Code
7913 \begin_layout Plain Layout
7921 \begin_inset Quotes eld
7925 \begin_inset Flex Code
7928 \begin_layout Plain Layout
7935 \begin_inset Quotes erd
7941 \begin_layout Description
7942 \begin_inset Flex Code
7945 \begin_layout Plain Layout
7951 Adds CSS styling information.
7952 This will either be output in a
7953 \begin_inset Quotes eld
7957 \begin_inset Flex Code
7960 \begin_layout Plain Layout
7967 \begin_inset Quotes erd
7970 block or, if the user has so chosen, to a separate CSS file.Must end with
7972 \begin_inset Quotes eld
7976 \begin_inset Flex Code
7979 \begin_layout Plain Layout
7986 \begin_inset Quotes erd
7992 \begin_layout Description
7993 \begin_inset Flex Code
7996 \begin_layout Plain Layout
8002 Adds information to the document preamble.
8004 \begin_inset Quotes eld
8008 \begin_inset Flex Code
8011 \begin_layout Plain Layout
8018 \begin_inset Quotes erd
8024 \begin_layout Description
8025 \begin_inset Flex Code
8028 \begin_layout Plain Layout
8034 Defines formats for use in the display of bibliographic information.
8036 \begin_inset CommandInset ref
8038 reference "sub:Citation-format-description"
8044 \begin_inset Quotes eld
8048 \begin_inset Flex Code
8051 \begin_layout Plain Layout
8058 \begin_inset Quotes erd
8064 \begin_layout Description
8065 \begin_inset Flex Code
8068 \begin_layout Plain Layout
8074 Describes various global options supported by the document class.
8076 \begin_inset space ~
8080 \begin_inset CommandInset ref
8082 reference "sub:ClassOptions"
8088 \begin_inset Quotes eld
8092 \begin_inset Flex Code
8095 \begin_layout Plain Layout
8102 \begin_inset Quotes erd
8108 \begin_layout Description
8109 \begin_inset Flex Code
8112 \begin_layout Plain Layout
8119 \begin_inset Flex Code
8122 \begin_layout Plain Layout
8131 \begin_inset Flex Code
8134 \begin_layout Plain Layout
8140 ] Whether the class should
8144 to having one or two columns.
8145 Can be changed in the
8146 \begin_inset Flex MenuItem
8149 \begin_layout Plain Layout
8150 Document\SpecialChar \menuseparator
8159 \begin_layout Description
8160 \begin_inset Flex Code
8163 \begin_layout Plain Layout
8170 \begin_inset Flex Code
8173 \begin_layout Plain Layout
8179 ] This sequence defines the properties for a counter.
8180 If the counter does not yet exist, it is created; if it does exist, it
8183 \begin_inset Quotes eld
8187 \begin_inset Flex Code
8190 \begin_layout Plain Layout
8197 \begin_inset Quotes erd
8201 \begin_inset Newline newline
8205 \begin_inset space ~
8209 \begin_inset CommandInset ref
8211 reference "sub:Counters"
8215 for details on counters.
8218 \begin_layout Description
8219 \begin_inset Flex Code
8222 \begin_layout Plain Layout
8228 Sets the default font used to display the document.
8230 \begin_inset space ~
8234 \begin_inset CommandInset ref
8236 reference "sub:Font-description"
8240 for how to declare fonts.
8242 \begin_inset Quotes eld
8246 \begin_inset Flex Code
8249 \begin_layout Plain Layout
8256 \begin_inset Quotes erd
8262 \begin_layout Description
8263 \begin_inset Flex Code
8266 \begin_layout Plain Layout
8273 \begin_inset Flex Code
8276 \begin_layout Plain Layout
8282 Specifies a module to be included by default with this document class.
8283 The module should be specified by filename without the
8284 \begin_inset Flex Code
8287 \begin_layout Plain Layout
8294 The user can still remove the module, but it will be active at the outset.
8295 (This applies only when new files are created, or when this class is chosen
8296 for an existing document.)
8299 \begin_layout Description
8300 \begin_inset Flex Code
8303 \begin_layout Plain Layout
8310 \begin_inset Flex Code
8313 \begin_layout Plain Layout
8319 ] This is the style that will be assigned to new paragraphs, usually
8320 \begin_inset Flex MenuItem
8323 \begin_layout Plain Layout
8330 This will default to the first defined style if not given, but you are
8331 encouraged to use this directive.
8334 \begin_layout Description
8335 \begin_inset Flex Code
8338 \begin_layout Plain Layout
8345 \begin_inset Flex Code
8348 \begin_layout Plain Layout
8354 ] This tag indicates that the module in question—which should be specified
8355 by filename without the
8356 \begin_inset Flex Code
8359 \begin_layout Plain Layout
8365 extension—cannot be used with this document class.
8366 This might be used in a journal-specific layout file to prevent, say, the
8368 \begin_inset Flex Code
8371 \begin_layout Plain Layout
8377 module that numbers theorems by section.
8382 be used in a module.
8383 Modules have their own way of excluding other modules (see
8384 \begin_inset CommandInset ref
8386 reference "sub:Layout-modules"
8393 \begin_layout Description
8394 \begin_inset Flex Code
8397 \begin_layout Plain Layout
8403 Defines a new float.
8405 \begin_inset space ~
8409 \begin_inset CommandInset ref
8411 reference "sub:Floats"
8417 \begin_inset Quotes eld
8421 \begin_inset Flex Code
8424 \begin_layout Plain Layout
8431 \begin_inset Quotes erd
8437 \begin_layout Description
8438 \begin_inset Flex Code
8441 \begin_layout Plain Layout
8447 Sets the information that will be output in the
8448 \begin_inset Flex Code
8451 \begin_layout Plain Layout
8457 block when this document class is output to XHTML.
8458 Note that this will completely override any prior
8459 \begin_inset Flex Code
8462 \begin_layout Plain Layout
8469 \begin_inset Flex Code
8472 \begin_layout Plain Layout
8480 \begin_inset Flex Code
8483 \begin_layout Plain Layout
8489 if you just want to add material to the preamble.) Must end with
8490 \begin_inset Quotes eld
8494 \begin_inset Flex Code
8497 \begin_layout Plain Layout
8504 \begin_inset Quotes erd
8510 \begin_layout Description
8511 \begin_inset Flex Code
8514 \begin_layout Plain Layout
8520 Sets CSS styling information.
8521 This will either be output in a
8522 \begin_inset Quotes eld
8526 \begin_inset Flex Code
8529 \begin_layout Plain Layout
8536 \begin_inset Quotes erd
8539 block or, if the user has so chosen, to a separate CSS file.
8540 Note that this will completely override any prior
8541 \begin_inset Flex Code
8544 \begin_layout Plain Layout
8551 \begin_inset Flex Code
8554 \begin_layout Plain Layout
8562 \begin_inset Flex Code
8565 \begin_layout Plain Layout
8571 if you just want to add material.) Must end with
8572 \begin_inset Quotes eld
8576 \begin_inset Flex Code
8579 \begin_layout Plain Layout
8586 \begin_inset Quotes erd
8592 \begin_layout Description
8593 \begin_inset Flex Code
8596 \begin_layout Plain Layout
8603 \begin_inset Flex Code
8606 \begin_layout Plain Layout
8612 ] The layout to use for the table of contents, bibliography, and so forth,
8613 when the document is output to HTML.
8614 For articles, this should normally be Section; for books, Chapter.
8615 If it is not given, then LyX will attempt to figure out which layout to
8619 \begin_layout Description
8620 \begin_inset Flex Code
8623 \begin_layout Plain Layout
8630 \begin_inset Flex Code
8633 \begin_layout Plain Layout
8639 ] Modifies the properties of the given counter.
8640 If the counter does not exist, the section is ignored.
8642 \begin_inset Quotes eld
8646 \begin_inset Flex Code
8649 \begin_layout Plain Layout
8656 \begin_inset Quotes erd
8660 \begin_inset Newline newline
8664 \begin_inset space ~
8668 \begin_inset CommandInset ref
8670 reference "sub:Counters"
8674 for details on counters.
8677 \begin_layout Description
8678 \begin_inset Flex Code
8681 \begin_layout Plain Layout
8688 \begin_inset Flex Code
8691 \begin_layout Plain Layout
8697 ] Modifies the properties of the given paragraph style.
8698 If the style does not exist, the section is ignored.
8700 \begin_inset Quotes eld
8704 \begin_inset Flex Code
8707 \begin_layout Plain Layout
8714 \begin_inset Quotes erd
8720 \begin_layout Description
8721 \begin_inset Flex Code
8724 \begin_layout Plain Layout
8730 As its name implies, this command allows you to include another layout
8731 definition file within yours to avoid duplicating commands.
8732 Common examples are the standard layout files, for example,
8733 \begin_inset Flex Code
8736 \begin_layout Plain Layout
8742 , which contains most of the basic layouts.
8745 \begin_layout Description
8746 \begin_inset Flex Code
8749 \begin_layout Plain Layout
8755 This section (re-)defines the layout of an inset.
8756 It can be applied to an existing inset or to a new, user-defined inset,
8757 e.g., a new character style.
8759 \begin_inset Quotes eld
8763 \begin_inset Flex Code
8766 \begin_layout Plain Layout
8773 \begin_inset Quotes erd
8777 \begin_inset Newline newline
8781 \begin_inset space ~
8785 \begin_inset CommandInset ref
8787 reference "sub:Flex-insets-and"
8791 for more information.
8795 \begin_layout Description
8796 \begin_inset Flex Code
8799 \begin_layout Plain Layout
8806 \begin_inset Flex Code
8809 \begin_layout Plain Layout
8815 ] A string that indicates the width of the left margin on the screen, for
8817 \begin_inset Quotes eld
8821 \begin_inset Quotes erd
8825 (Note that this is not a `length', like
8826 \begin_inset Quotes eld
8830 \begin_inset Quotes erd
8836 \begin_layout Description
8837 \begin_inset Flex Code
8840 \begin_layout Plain Layout
8847 \begin_inset Flex Code
8850 \begin_layout Plain Layout
8856 ] This command deletes an existing counter, usually one defined in an included
8860 \begin_layout Description
8861 \begin_inset Flex Code
8864 \begin_layout Plain Layout
8870 This command deletes an existing float.
8871 This is particularly useful when you want to suppress a float that has
8872 been defined in an input file.
8875 \begin_layout Description
8876 \begin_inset Flex Code
8879 \begin_layout Plain Layout
8885 This command deletes an existing style.
8886 This is particularly useful when you want to suppress a style that has
8887 be defined in an input file.
8890 \begin_layout Description
8891 \begin_inset Flex Code
8894 \begin_layout Plain Layout
8900 A string indicating the file format (as defined in the Preferences dialog)
8901 produced by this class.
8902 It is mainly useful when
8903 \begin_inset Flex Code
8906 \begin_layout Plain Layout
8912 is `literate' and one wants to define a new type of literate document.
8913 This string is reset to `docbook', `latex', or `literate' when the correspondin
8915 \begin_inset Flex Code
8918 \begin_layout Plain Layout
8924 parameter is encountered.
8927 \begin_layout Description
8928 \begin_inset Flex Code
8931 \begin_layout Plain Layout
8937 A string indicating what sort of output documents using this class will
8939 At present, the options are: `docbook', `latex', and `literate'.
8942 \begin_layout Description
8943 \begin_inset Flex Code
8946 \begin_layout Plain Layout
8953 \begin_inset Flex Code
8956 \begin_layout Plain Layout
8965 \begin_inset Flex Code
8968 \begin_layout Plain Layout
8975 \begin_inset Flex Code
8978 \begin_layout Plain Layout
8984 ] The default pagestyle.
8985 Can be changed in the
8986 \begin_inset Flex MenuItem
8989 \begin_layout Plain Layout
8990 Document\SpecialChar \menuseparator
8999 \begin_layout Description
9000 \begin_inset Flex Code
9003 \begin_layout Plain Layout
9009 Sets the preamble for the LaTeX document.
9010 Note that this will completely override any prior
9011 \begin_inset Flex Code
9014 \begin_layout Plain Layout
9021 \begin_inset Flex Code
9024 \begin_layout Plain Layout
9032 \begin_inset Flex Code
9035 \begin_layout Plain Layout
9041 if you just want to add material to the preamble.) Must end with
9042 \begin_inset Quotes eld
9046 \begin_inset Flex Code
9049 \begin_layout Plain Layout
9056 \begin_inset Quotes erd
9062 \begin_layout Description
9063 \begin_inset Flex Code
9066 \begin_layout Plain Layout
9073 \begin_inset Flex Code
9076 \begin_layout Plain Layout
9083 \begin_inset Flex Code
9086 \begin_layout Plain Layout
9095 \begin_inset Flex Code
9098 \begin_layout Plain Layout
9104 ] Whether the class already provides the feature
9105 \begin_inset Flex Code
9108 \begin_layout Plain Layout
9115 A feature is in general the name of a package (
9116 \begin_inset Flex Code
9119 \begin_layout Plain Layout
9126 \begin_inset Flex Code
9129 \begin_layout Plain Layout
9135 , \SpecialChar \ldots{}
9137 \begin_inset Flex Code
9140 \begin_layout Plain Layout
9147 \begin_inset Flex Code
9150 \begin_layout Plain Layout
9156 ,\SpecialChar \ldots{}
9157 ); the complete list of supported features is unfortunately not documented
9158 outside the LyX source code—but see
9159 \begin_inset Flex Code
9162 \begin_layout Plain Layout
9168 if you're interested.
9170 \begin_inset Flex MenuItem
9173 \begin_layout Plain Layout
9174 Help\SpecialChar \menuseparator
9180 also gives an overview of the supported packages.
9183 \begin_layout Description
9184 \begin_inset Flex Code
9187 \begin_layout Plain Layout
9194 \begin_inset Flex Code
9197 \begin_layout Plain Layout
9203 ] Indicates that this layout provides the functionality of the module mentioned,
9204 which should be specified by the filename without the
9205 \begin_inset Flex Code
9208 \begin_layout Plain Layout
9215 This will typically be used if the layout includes the module directly,
9216 rather than using the
9217 \begin_inset Flex Code
9220 \begin_layout Plain Layout
9226 tag to indicate that it ought to be used.
9227 It could also be used in a module that provided an alternate implementation
9228 of the same functionality.
9231 \begin_layout Description
9232 \begin_inset Flex Code
9235 \begin_layout Plain Layout
9242 \begin_inset Flex Code
9245 \begin_layout Plain Layout
9251 ] Whether the class requires the feature
9252 \begin_inset Flex Code
9255 \begin_layout Plain Layout
9262 Multiple features must be separated by commas.
9263 Note that you can only request supported features.
9265 \begin_inset Flex Code
9268 \begin_layout Plain Layout
9274 for a list of these.)
9277 \begin_layout Description
9278 \begin_inset Flex Code
9281 \begin_layout Plain Layout
9287 A string that indicates the width of the right margin on the screen, for
9289 \begin_inset Quotes eld
9293 \begin_inset Quotes erd
9299 \begin_layout Description
9300 \begin_inset Flex Code
9303 \begin_layout Plain Layout
9309 Sets which divisions get numbered.
9311 \begin_inset Flex Code
9314 \begin_layout Plain Layout
9323 \begin_layout Description
9324 \begin_inset Flex Code
9327 \begin_layout Plain Layout
9334 \begin_inset Flex Code
9337 \begin_layout Plain Layout
9346 \begin_inset Flex Code
9349 \begin_layout Plain Layout
9355 ] Whether the class-default should be printing on one or both sides of the
9357 Can be changed in the
9358 \begin_inset Flex MenuItem
9361 \begin_layout Plain Layout
9362 Document\SpecialChar \menuseparator
9371 \begin_layout Description
9372 \begin_inset Flex Code
9375 \begin_layout Plain Layout
9381 This sequence defines a paragraph style.
9382 If the style does not yet exist, it is created; if it does exist, its parameter
9385 \begin_inset Quotes eld
9389 \begin_inset Flex Code
9392 \begin_layout Plain Layout
9399 \begin_inset Quotes erd
9403 \begin_inset Newline newline
9407 \begin_inset space ~
9411 \begin_inset CommandInset ref
9413 reference "sub:Paragraph-Styles"
9417 for details on paragraph styles.
9420 \begin_layout Description
9421 \begin_inset Flex Code
9424 \begin_layout Plain Layout
9431 \begin_inset Flex Code
9434 \begin_layout Plain Layout
9440 ] The name of the command or environment to be used with
9441 \begin_inset Flex Code
9444 \begin_layout Plain Layout
9453 \begin_layout Description
9454 \begin_inset Flex Code
9457 \begin_layout Plain Layout
9464 \begin_inset Flex Code
9467 \begin_layout Plain Layout
9476 \begin_inset Flex Code
9479 \begin_layout Plain Layout
9485 ] Indicates what kind of markup is used to define the title of a document.
9487 \begin_inset Flex Code
9490 \begin_layout Plain Layout
9496 means that the macro with name
9497 \begin_inset Flex Code
9500 \begin_layout Plain Layout
9506 will be inserted after the last layout which has
9507 \begin_inset Quotes eld
9511 \begin_inset Flex Code
9514 \begin_layout Plain Layout
9521 \begin_inset Quotes erd
9526 \begin_inset Flex Code
9529 \begin_layout Plain Layout
9535 corresponds to the case where the block of paragraphs which have
9536 \begin_inset Quotes eld
9540 \begin_inset Flex Code
9543 \begin_layout Plain Layout
9550 \begin_inset Quotes erd
9553 should be enclosed into the
9554 \begin_inset Flex Code
9557 \begin_layout Plain Layout
9566 \begin_layout Description
9567 \begin_inset Flex Code
9570 \begin_layout Plain Layout
9576 Sets which divisions are included in the table of contents.
9578 \begin_inset Flex Code
9581 \begin_layout Plain Layout
9590 \begin_layout Subsection
9591 \begin_inset Flex Code
9594 \begin_layout Plain Layout
9601 \begin_inset CommandInset label
9603 name "sub:ClassOptions"
9610 \begin_layout Standard
9612 \begin_inset Flex Code
9615 \begin_layout Plain Layout
9621 section can contain the following entries:
9624 \begin_layout Description
9625 \begin_inset Flex Code
9628 \begin_layout Plain Layout
9635 \begin_inset Flex Code
9638 \begin_layout Plain Layout
9644 ] The list of available font sizes for the document's main font, separated
9646 \begin_inset Quotes eld
9650 \begin_inset Flex Code
9653 \begin_layout Plain Layout
9660 \begin_inset Quotes erd
9666 \begin_layout Description
9667 \begin_inset Flex Code
9670 \begin_layout Plain Layout
9676 Used to set the DTD line with XML-based output classes.
9678 \begin_inset space \thinspace{}
9682 \begin_inset Quotes eld
9685 -//OASIS//DTD DocBook V4.2//EN
9686 \begin_inset Quotes erd
9692 \begin_layout Description
9693 \begin_inset Flex Code
9696 \begin_layout Plain Layout
9703 \begin_inset Flex Code
9706 \begin_layout Plain Layout
9707 string="empty|plain|headings|fancy"
9712 ] The list of available page styles, separated by
9713 \begin_inset Quotes eld
9717 \begin_inset Flex Code
9720 \begin_layout Plain Layout
9727 \begin_inset Quotes erd
9733 \begin_layout Description
9734 \begin_inset Flex Code
9737 \begin_layout Plain Layout
9744 \begin_inset Flex Code
9747 \begin_layout Plain Layout
9753 ] Some document class options, separated by a comma, that will be added
9754 to the optional part of the
9755 \begin_inset Flex Code
9758 \begin_layout Plain Layout
9769 \begin_layout Standard
9771 \begin_inset Flex Code
9774 \begin_layout Plain Layout
9780 section must end with
9781 \begin_inset Quotes eld
9785 \begin_inset Flex Code
9788 \begin_layout Plain Layout
9795 \begin_inset Quotes erd
9801 \begin_layout Subsection
9803 \begin_inset CommandInset label
9805 name "sub:Paragraph-Styles"
9812 \begin_layout Standard
9813 A paragraph style description looks like this:
9817 \begin_layout Plain Layout
9818 Note that this will either define a new style or modify an existing one.
9826 \begin_layout LyX-Code
9833 \begin_layout LyX-Code
9837 \begin_layout LyX-Code
9841 \begin_layout Standard
9842 where the following commands are allowed:
9845 \begin_layout Description
9846 \begin_inset Flex Code
9849 \begin_layout Plain Layout
9856 \begin_inset Flex Code
9859 \begin_layout Plain Layout
9864 , left, right, center
9869 ] Paragraph alignment.
9872 \begin_layout Description
9873 \begin_inset Flex Code
9876 \begin_layout Plain Layout
9883 \begin_inset Flex Code
9886 \begin_layout Plain Layout
9891 , left, right, center
9896 ] A comma separated list of permitted alignments.
9897 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
9899 For example a right-aligned or centered enumeration isn't possible.)
9902 \begin_layout Description
9903 \begin_inset Flex Code
9906 \begin_layout Plain Layout
9912 Note that this will completely override any prior
9913 \begin_inset Flex Code
9916 \begin_layout Plain Layout
9922 declaration for this style.
9924 \begin_inset Quotes eld
9928 \begin_inset Flex Code
9931 \begin_layout Plain Layout
9938 \begin_inset Quotes erd
9943 \begin_inset CommandInset ref
9945 reference "sub:I18n"
9949 for details on its use.
9952 \begin_layout Description
9953 \begin_inset Flex Code
9956 \begin_layout Plain Layout
9963 \begin_inset Flex Code
9966 \begin_layout Plain Layout
9976 \begin_layout Plain Layout
9977 Note that a `float' here is a real number, such as: 1.5.
9982 The vertical space with which the last of a chain of paragraphs with this
9983 style is separated from the following paragraph.
9984 If the next paragraph has another style, the separations are not simply
9985 added, but the maximum is taken.
9988 \begin_layout Description
9989 \begin_inset Flex Code
9992 \begin_layout Plain Layout
9999 \begin_inset Flex Code
10002 \begin_layout Plain Layout
10008 The category for this style.
10009 This is used to group related styles in the style combobox on the toolbar.
10010 Any string can be used, but you may want to use existing categories with
10015 \begin_layout Description
10016 \begin_inset Flex Code
10019 \begin_layout Plain Layout
10025 Depth of XML command.
10026 Used only with XML-type formats.
10029 \begin_layout Description
10030 \begin_inset Flex Code
10033 \begin_layout Plain Layout
10040 \begin_inset Flex Code
10043 \begin_layout Plain Layout
10049 Copies all the features of an existing style into the current one.
10053 \begin_layout Description
10054 \begin_inset Flex Code
10057 \begin_layout Plain Layout
10063 The name of a style whose preamble should be output
10068 This allows to ensure some ordering of the preamble snippets when macros
10069 definitions depend on one another.
10073 \begin_layout Plain Layout
10074 Note that, besides that functionality, there is no way to ensure any ordering
10076 The ordering that you see in a given version of LyX may change without
10077 warning in later versions.
10085 \begin_layout Description
10086 \begin_inset Flex Code
10089 \begin_layout Plain Layout
10096 \begin_inset Flex Code
10099 \begin_layout Plain Layout
10104 , Box, Filled_Box, Static
10109 ] The type of label that stands at the end of the paragraph (or sequence
10111 \begin_inset Flex Code
10114 \begin_layout Plain Layout
10121 \begin_inset Flex Code
10124 \begin_layout Plain Layout
10131 \begin_inset Flex Code
10134 \begin_layout Plain Layout
10141 \begin_inset Flex Code
10144 \begin_layout Plain Layout
10152 \begin_inset Flex Code
10155 \begin_layout Plain Layout
10162 \begin_inset Quotes eld
10166 \begin_inset Quotes erd
10170 \begin_inset Flex Code
10173 \begin_layout Plain Layout
10180 \begin_inset Flex Code
10183 \begin_layout Plain Layout
10184 \begin_inset space ~
10192 ) is a white (resp.
10193 \begin_inset space ~
10196 black) square suitable for end of proof markers,
10197 \begin_inset Flex Code
10200 \begin_layout Plain Layout
10206 is an explicit text string.
10209 \begin_layout Description
10210 \begin_inset Flex Code
10213 \begin_layout Plain Layout
10220 \begin_inset Flex Code
10223 \begin_layout Plain Layout
10229 ] The string used for a label with a
10230 \begin_inset Flex Code
10233 \begin_layout Plain Layout
10240 \begin_inset Flex Code
10243 \begin_layout Plain Layout
10253 \begin_layout Description
10254 \begin_inset Flex Code
10257 \begin_layout Plain Layout
10263 The font used for both the text body
10269 \begin_inset space ~
10273 \begin_inset CommandInset ref
10275 reference "sub:Font-description"
10280 Note that defining this font automatically defines the
10281 \begin_inset Flex Code
10284 \begin_layout Plain Layout
10291 So you should define this one first if you also want to define
10292 \begin_inset Flex Code
10295 \begin_layout Plain Layout
10304 \begin_layout Description
10305 \begin_inset Flex Code
10308 \begin_layout Plain Layout
10315 \begin_inset CommandInset label
10317 name "des:FreeSpacing"
10322 \begin_inset Flex Code
10325 \begin_layout Plain Layout
10334 \begin_inset Flex Code
10337 \begin_layout Plain Layout
10343 ] Usually LyX doesn't allow you to insert more than one space between words,
10344 since a space is considered as the separation between two words, not a
10345 character or symbol of its own.
10346 This is a very fine thing but sometimes annoying, for example, when typing
10347 program code or plain LaTeX code.
10349 \begin_inset Flex Code
10352 \begin_layout Plain Layout
10359 Note that LyX will create protected blanks for the additional blanks when
10360 in another mode than LaTeX-mode.
10363 \begin_layout Description
10364 \begin_inset Flex Code
10367 \begin_layout Plain Layout
10373 These tags are used with XHTML output.
10375 \begin_inset CommandInset ref
10377 reference "sub:Paragraph-Style-XHTML"
10384 \begin_layout Description
10385 \begin_inset Flex Code
10388 \begin_layout Plain Layout
10394 [[FIXME]] (Used only with XML-type formats.)
10397 \begin_layout Description
10398 \begin_inset Flex Code
10401 \begin_layout Plain Layout
10408 \begin_inset Flex Code
10411 \begin_layout Plain Layout
10417 If 1, marks the style as to be included in the document preamble rather
10418 than in the document body.
10419 This is useful for document classes that want such information as the title
10420 and author to appear in the preamble.
10421 Note that this works only for styles for which the
10422 \begin_inset Flex Code
10425 \begin_layout Plain Layout
10432 \begin_inset Flex Code
10435 \begin_layout Plain Layout
10442 \begin_inset Flex Code
10445 \begin_layout Plain Layout
10454 \begin_layout Description
10455 \begin_inset Flex Code
10458 \begin_layout Plain Layout
10465 \begin_inset Flex Code
10468 \begin_layout Plain Layout
10474 If 1, marks the style as being part of a title block (see also the
10475 \begin_inset Flex Code
10478 \begin_layout Plain Layout
10485 \begin_inset Flex Code
10488 \begin_layout Plain Layout
10497 \begin_layout Description
10498 \begin_inset Flex Code
10501 \begin_layout Plain Layout
10508 \begin_inset Flex Code
10511 \begin_layout Plain Layout
10517 ] This provides extra space between paragraphs that have the same style.
10518 If you put other styles into an environment, each is separated with the
10520 \begin_inset Flex Code
10523 \begin_layout Plain Layout
10530 But the whole items of the environment are additionally separated with
10532 \begin_inset Flex Code
10535 \begin_layout Plain Layout
10542 Note that this is a
10547 \begin_layout Description
10548 \begin_inset Flex Code
10551 \begin_layout Plain Layout
10557 [[FIXME]] (Used only with XML-type formats.)
10560 \begin_layout Description
10561 \begin_inset Flex Code
10564 \begin_layout Plain Layout
10571 \begin_inset Flex Code
10574 \begin_layout Plain Layout
10583 \begin_inset Flex Code
10586 \begin_layout Plain Layout
10592 ] Usually LyX does not allow you to leave a paragraph empty, since it would
10593 lead to empty LaTeX output.
10594 There are some cases where this could be desirable however: in a letter
10595 template, the required fields can be provided as empty fields, so that
10596 people do not forget them; in some special classes, a style can be used
10597 as some kind of break, which does not contain actual text.
10600 \begin_layout Description
10601 \begin_inset Flex Code
10604 \begin_layout Plain Layout
10610 [float=0] The vertical space between the label and the text body.
10611 Only used for labels that are above the text body (
10612 \begin_inset Flex Code
10615 \begin_layout Plain Layout
10622 \begin_inset Flex Code
10625 \begin_layout Plain Layout
10626 Centered_Top_Environment
10634 \begin_layout Description
10635 \begin_inset Flex Code
10638 \begin_layout Plain Layout
10645 \begin_inset Flex Code
10648 \begin_layout Plain Layout
10655 \begin_inset Newline newline
10658 The name of the counter for automatic numbering.
10660 \begin_inset Newline newline
10668 \begin_inset Flex Code
10671 \begin_layout Plain Layout
10678 \begin_inset Flex Code
10681 \begin_layout Plain Layout
10688 In that case, the counter will be stepped each time the style appears.
10690 \begin_inset Newline newline
10698 \begin_inset Flex Code
10701 \begin_layout Plain Layout
10708 \begin_inset Flex Code
10711 \begin_layout Plain Layout
10717 , though this case is a bit complicated.
10718 Suppose you declare
10719 \begin_inset Quotes eld
10723 \begin_inset Flex Code
10726 \begin_layout Plain Layout
10727 LabelCounter myenum
10733 \begin_inset Quotes erd
10737 Then the actual counters used are
10738 \begin_inset Flex Code
10741 \begin_layout Plain Layout
10748 \begin_inset Flex Code
10751 \begin_layout Plain Layout
10758 \begin_inset Flex Code
10761 \begin_layout Plain Layout
10768 \begin_inset Flex Code
10771 \begin_layout Plain Layout
10777 , much as in LaTeX.
10778 These counters must all be declared separately.
10779 \begin_inset Newline newline
10783 \begin_inset CommandInset ref
10785 reference "sub:Counters"
10789 for details on counters.
10792 \begin_layout Description
10793 \begin_inset Flex Code
10796 \begin_layout Plain Layout
10802 The font used for the label.
10804 \begin_inset space ~
10808 \begin_inset CommandInset ref
10810 reference "sub:Font-description"
10817 \begin_layout Description
10818 \begin_inset Flex Code
10821 \begin_layout Plain Layout
10827 Text that indicates how far a label should be indented.
10830 \begin_layout Description
10831 \begin_inset Flex Code
10834 \begin_layout Plain Layout
10841 \begin_inset Flex Code
10844 \begin_layout Plain Layout
10850 ] The horizontal space between the label and the text body.
10851 Only used for labels that are not above the text body.
10854 \begin_layout Description
10855 \begin_inset Flex Code
10858 \begin_layout Plain Layout
10865 \begin_inset Flex Code
10868 \begin_layout Plain Layout
10874 ] The string used for a label with a
10875 \begin_inset Flex Code
10878 \begin_layout Plain Layout
10886 \begin_inset Flex Code
10889 \begin_layout Plain Layout
10895 is set, this string can be contain the special formatting commands described
10897 \begin_inset CommandInset ref
10899 reference "sub:Counters"
10907 \begin_layout Plain Layout
10908 For the sake of backwards compatibility, the string
10909 \begin_inset Flex Code
10912 \begin_layout Plain Layout
10922 will be replaced by the expanded
10923 \begin_inset Flex Code
10926 \begin_layout Plain Layout
10933 \begin_inset Flex Code
10936 \begin_layout Plain Layout
10945 This feature is now obsolete and should be replaced by the mechanisms of
10947 \begin_inset CommandInset ref
10949 reference "sub:Counters"
10961 \begin_layout Description
10962 \begin_inset Flex Code
10965 \begin_layout Plain Layout
10966 LabelStringAppendix
10972 \begin_inset Flex Code
10975 \begin_layout Plain Layout
10981 ] This is used inside the appendix instead of
10982 \begin_inset Flex Code
10985 \begin_layout Plain Layout
10993 \begin_inset Flex Code
10996 \begin_layout Plain Layout
11003 \begin_inset Flex Code
11006 \begin_layout Plain Layout
11007 LabelStringAppendix
11015 \begin_layout Description
11016 \begin_inset Flex Code
11019 \begin_layout Plain Layout
11025 [FIXME] (Used only with XML-type formats.)
11028 \begin_layout Description
11029 \begin_inset Flex Code
11032 \begin_layout Plain Layout
11039 \begin_inset Flex Code
11042 \begin_layout Plain Layout
11047 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
11048 Enumerate, Itemize, Bibliography
11057 \begin_layout Itemize
11058 \begin_inset Flex Code
11061 \begin_layout Plain Layout
11067 means the label is the very first word (up to the first real blank).
11068 Use protected spaces (like
11069 \begin_inset space ~
11072 that one) if you want more than one word as the label.
11076 \begin_layout Itemize
11077 \begin_inset Flex Code
11080 \begin_layout Plain Layout
11086 means the label is simply whatever
11087 \begin_inset Flex Code
11090 \begin_layout Plain Layout
11097 Note that this really is `static'.
11100 \begin_layout Itemize
11101 \begin_inset Flex Code
11104 \begin_layout Plain Layout
11111 \begin_inset Flex Code
11114 \begin_layout Plain Layout
11115 Centered_Top_Environment
11120 are special cases of
11121 \begin_inset Flex Code
11124 \begin_layout Plain Layout
11131 The label will be printed above the paragraph, but only at the top of an
11132 environment or the top of a chain of paragraphs with this style.
11133 This might be used with the
11134 \begin_inset Flex MenuItem
11137 \begin_layout Plain Layout
11143 style, for example.
11146 \begin_layout Itemize
11147 \begin_inset Flex Code
11150 \begin_layout Plain Layout
11156 is a special case for the caption-labels
11157 \begin_inset Quotes eld
11161 \begin_inset Quotes erd
11165 \begin_inset Quotes eld
11169 \begin_inset Quotes erd
11174 \begin_inset Flex Code
11177 \begin_layout Plain Layout
11183 means the (hardcoded) label string depends on the kind of float: It is
11184 hardcoded to be `FloatType N', where N is the value of the counter associated
11188 \begin_layout Itemize
11190 \begin_inset Flex Code
11193 \begin_layout Plain Layout
11199 label type defines automatically numbered labels.
11201 \begin_inset Flex Code
11204 \begin_layout Plain Layout
11210 will be expanded to resolve any counter references it contains: For example,
11212 \begin_inset Quotes eld
11216 \begin_inset Flex Code
11219 \begin_layout Plain Layout
11230 \begin_inset Quotes erd
11235 \begin_inset CommandInset ref
11237 reference "sub:Counters"
11241 for more information on counters.
11244 \begin_layout Itemize
11245 \begin_inset Flex Code
11248 \begin_layout Plain Layout
11254 produces the usual sort of enumeration labels.
11255 At present, it is hardcoded to use Arabic numerals, lowercase letters,
11256 small Roman numerals, and uppercase letters for the four possible depths.
11259 \begin_layout Itemize
11260 \begin_inset Flex Code
11263 \begin_layout Plain Layout
11269 produces various bullets at the different levels.
11270 It is also hardcoded.
11273 \begin_layout Itemize
11274 \begin_inset Flex Code
11277 \begin_layout Plain Layout
11283 is used internally by LyX and should be used only with
11284 \begin_inset Flex Code
11287 \begin_layout Plain Layout
11288 LatexType BibEnvironment
11297 \begin_layout Description
11298 \begin_inset Flex Code
11301 \begin_layout Plain Layout
11307 Note that this will completely override any prior
11308 \begin_inset Flex Code
11311 \begin_layout Plain Layout
11317 declaration for this style.
11319 \begin_inset Quotes eld
11323 \begin_inset Flex Code
11326 \begin_layout Plain Layout
11333 \begin_inset Quotes erd
11338 \begin_inset CommandInset ref
11340 reference "sub:I18n"
11344 for details on its use.
11347 \begin_layout Description
11348 \begin_inset Flex Code
11351 \begin_layout Plain Layout
11357 The name of the corresponding LaTeX stuff.
11358 Either the environment or command name.
11361 \begin_layout Description
11362 \begin_inset Flex Code
11365 \begin_layout Plain Layout
11371 An optional parameter for the corresponding
11372 \begin_inset Flex Code
11375 \begin_layout Plain Layout
11382 This parameter cannot be changed from within LyX.
11385 \begin_layout Description
11386 \begin_inset Flex Code
11389 \begin_layout Plain Layout
11396 \begin_inset Flex Code
11399 \begin_layout Plain Layout
11404 , Command, Environment, Item_Environment,
11410 \begin_inset Flex Code
11413 \begin_layout Plain Layout
11414 List_Environment, Bib_Environment
11419 ] How the style should be translated into LaTeX.
11423 \begin_layout Plain Layout
11424 \begin_inset Flex Code
11427 \begin_layout Plain Layout
11433 is perhaps a bit misleading, since these rules apply to SGML classes, too.
11434 Visit the SGML class files for specific examples.
11443 \begin_layout Itemize
11444 \begin_inset Flex Code
11447 \begin_layout Plain Layout
11453 means nothing special.
11457 \begin_layout Itemize
11458 \begin_inset Flex Code
11461 \begin_layout Plain Layout
11468 \begin_inset Flex Code
11471 \begin_layout Plain Layout
11478 {\SpecialChar \ldots{}
11487 \begin_layout Itemize
11488 \begin_inset Flex Code
11491 \begin_layout Plain Layout
11498 \begin_inset Flex Code
11501 \begin_layout Plain Layout
11508 }\SpecialChar \ldots{}
11524 \begin_layout Itemize
11525 \begin_inset Flex Code
11528 \begin_layout Plain Layout
11535 \begin_inset Flex Code
11538 \begin_layout Plain Layout
11545 \begin_inset Flex Code
11548 \begin_layout Plain Layout
11556 is generated for each paragraph of this environment.
11560 \begin_layout Itemize
11561 \begin_inset Flex Code
11564 \begin_layout Plain Layout
11571 \begin_inset Flex Code
11574 \begin_layout Plain Layout
11581 \begin_inset Flex Code
11584 \begin_layout Plain Layout
11590 is passed as an argument to the environment.
11592 \begin_inset Flex Code
11595 \begin_layout Plain Layout
11601 can be defined in the
11602 \begin_inset Flex MenuItem
11605 \begin_layout Plain Layout
11606 Edit\SpecialChar \menuseparator
11608 \begin_inset space ~
11620 \begin_layout Standard
11621 Putting the last few things together, the LaTeX output will be either:
11624 \begin_layout LyX-Code
11627 latexname[latexparam]{\SpecialChar \ldots{}
11631 \begin_layout Standard
11635 \begin_layout LyX-Code
11638 begin{latexname}[latexparam] \SpecialChar \ldots{}
11644 \begin_layout Standard
11645 depending upon the LaTeX type.
11649 \begin_layout Description
11650 \begin_inset Flex Code
11653 \begin_layout Plain Layout
11660 \begin_inset Flex Code
11663 \begin_layout Plain Layout
11669 ] If you put styles into environments, the leftmargins are not simply added,
11670 but added with a factor
11671 \begin_inset Formula $\frac{4}{depth+4}$
11675 Note that this parameter is also used when the margin is defined as
11676 \begin_inset Flex Code
11679 \begin_layout Plain Layout
11686 \begin_inset Flex Code
11689 \begin_layout Plain Layout
11696 Then it is added to the manual or dynamic margin.
11698 \begin_inset Newline newline
11701 The argument is passed as a string.
11703 \begin_inset Quotes eld
11707 \begin_inset Flex Code
11710 \begin_layout Plain Layout
11717 \begin_inset Quotes erd
11720 means that the paragraph is indented with the width of
11721 \begin_inset Quotes eld
11725 \begin_inset Flex Code
11728 \begin_layout Plain Layout
11735 \begin_inset Quotes erd
11738 in the normal font.
11739 You can get a negative width by prefixing the string with
11740 \begin_inset Quotes eld
11744 \begin_inset Flex Code
11747 \begin_layout Plain Layout
11754 \begin_inset Quotes erd
11758 This way was chosen so that the look is the same with each used screen
11763 \begin_layout Description
11764 \begin_inset Flex Code
11767 \begin_layout Plain Layout
11774 \begin_inset Flex Code
11777 \begin_layout Plain Layout
11782 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11788 \begin_inset Newline newline
11791 The kind of margin that the style has on the left side.
11793 \begin_inset Flex Code
11796 \begin_layout Plain Layout
11802 just means a fixed margin.
11804 \begin_inset Flex Code
11807 \begin_layout Plain Layout
11813 means that the left margin depends on the string entered in the
11814 \begin_inset Flex MenuItem
11817 \begin_layout Plain Layout
11818 Edit\SpecialChar \menuseparator
11820 \begin_inset space ~
11829 This is used to typeset nice lists without tabulators.
11831 \begin_inset Flex Code
11834 \begin_layout Plain Layout
11840 means that the margin depends on the size of the label.
11841 This is used for automatic enumerated headlines.
11842 It is obvious that the headline
11843 \begin_inset Quotes eld
11846 5.4.3.2.1 Very long headline
11847 \begin_inset Quotes erd
11850 must have a wider left margin (as wide as
11851 \begin_inset Quotes eld
11855 \begin_inset Quotes erd
11858 plus the space) than
11859 \begin_inset Quotes eld
11862 3.2 Very long headline
11863 \begin_inset Quotes erd
11867 \begin_inset Quotes eld
11871 \begin_inset Quotes erd
11874 are not able to do this.
11876 \begin_inset Flex Code
11879 \begin_layout Plain Layout
11885 is similar, but only the very first row of the paragraph is dynamic, while
11886 the others are static; this is used, for example, for descriptions.
11888 \begin_inset Flex Code
11891 \begin_layout Plain Layout
11897 means the margin is chosen in a way that the longest row of this paragraph
11898 fits to the right margin.
11899 This is used to typeset an address on the right edge of the page.
11902 \begin_layout Description
11903 \begin_inset Flex Code
11906 \begin_layout Plain Layout
11913 \begin_inset Flex Code
11916 \begin_layout Plain Layout
11925 \begin_inset Flex Code
11928 \begin_layout Plain Layout
11934 ] Whether fragile commands in this style should be
11935 \begin_inset Flex Code
11938 \begin_layout Plain Layout
11951 whether this command should itself be protected.)
11954 \begin_layout Description
11955 \begin_inset Flex Code
11958 \begin_layout Plain Layout
11965 \begin_inset Flex Code
11968 \begin_layout Plain Layout
11975 \begin_inset Flex Code
11978 \begin_layout Plain Layout
11986 ] Whether newlines are translated into LaTeX newlines (
11987 \begin_inset Flex Code
11990 \begin_layout Plain Layout
12001 The translation can be switched off to allow more comfortable LaTeX editing
12005 \begin_layout Description
12006 \begin_inset Flex Code
12009 \begin_layout Plain Layout
12016 \begin_inset Flex Code
12019 \begin_layout Plain Layout
12026 \begin_inset Flex Code
12029 \begin_layout Plain Layout
12037 ] If set to true, and if
12038 \begin_inset Flex Code
12041 \begin_layout Plain Layout
12048 \begin_inset Flex Code
12051 \begin_layout Plain Layout
12057 ) paragraphs are being indented, then the indentation of such a paragraph
12058 following one of this type will be suppressed.
12059 (So this will not affect the display of non-default paragraphs.)
12062 \begin_layout Description
12063 \begin_inset Flex Code
12066 \begin_layout Plain Layout
12072 Name of a style that has replaced this style.
12073 This is used to rename a style, while keeping backward compatibility.
12076 \begin_layout Description
12077 \begin_inset Flex Code
12080 \begin_layout Plain Layout
12087 \begin_inset Flex Code
12090 \begin_layout Plain Layout
12096 ] The number of optional arguments that can be used with this style.
12097 This is useful for things like section headings, and only makes sense with
12099 Note that, on output, the optional arguments will all precede any required
12100 arguments (see below).
12101 So one can have constructs like:
12105 \begin_layout LyX-Code
12108 mycmd[opt1]{req1}{contents of paragraph}
12111 \begin_layout Standard
12112 but one cannot have things like:
12115 \begin_layout LyX-Code
12118 mycmd[opt1]{req1}[opt2]{contents of paragraph}
12121 \begin_layout Standard
12122 at least, not without ERT (with which you can have anything).
12127 \begin_layout Description
12128 \begin_inset Flex Code
12131 \begin_layout Plain Layout
12138 \begin_inset Flex Code
12141 \begin_layout Plain Layout
12150 \begin_inset Flex Code
12153 \begin_layout Plain Layout
12159 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
12160 output, but only by a line break; together with
12161 \begin_inset Flex Code
12164 \begin_layout Plain Layout
12170 , this allows to emulate a plain text editor (like the ERT inset).
12173 \begin_layout Description
12174 \begin_inset Flex Code
12177 \begin_layout Plain Layout
12184 \begin_inset Flex Code
12187 \begin_layout Plain Layout
12193 ] The indent of the very first line of a paragraph.
12195 \begin_inset Flex Code
12198 \begin_layout Plain Layout
12204 will be fixed for a certain style.
12205 The exception is the default style, since the indentation for these paragraphs
12206 can be prohibited with
12207 \begin_inset Flex Code
12210 \begin_layout Plain Layout
12218 \begin_inset Flex Code
12221 \begin_layout Plain Layout
12227 style paragraphs inside environments use the
12228 \begin_inset Flex Code
12231 \begin_layout Plain Layout
12237 of the environment, not their native one.
12239 \begin_inset Flex Code
12242 \begin_layout Plain Layout
12248 paragraphs inside an enumeration are not indented.
12251 \begin_layout Description
12252 \begin_inset Flex Code
12255 \begin_layout Plain Layout
12262 \begin_inset Flex Code
12265 \begin_layout Plain Layout
12271 ] The vertical space between two paragraphs of this style.
12274 \begin_layout Description
12275 \begin_inset Flex Code
12278 \begin_layout Plain Layout
12285 \begin_inset Flex Code
12288 \begin_layout Plain Layout
12294 ] LyX allows the user to choose either
12295 \begin_inset Quotes eld
12299 \begin_inset Quotes erd
12303 \begin_inset Quotes eld
12307 \begin_inset Quotes erd
12310 to typeset a document.
12312 \begin_inset Quotes eld
12316 \begin_inset Quotes erd
12319 is chosen, this value is completely ignored.
12321 \begin_inset Quotes eld
12325 \begin_inset Quotes erd
12328 is chosen, the parindent of a LaTeXtype
12329 \begin_inset Quotes eld
12333 \begin_inset Quotes erd
12336 style is ignored and all paragraphs are separated by this parskip argument.
12337 The vertical space is calculated with
12338 \begin_inset Flex Code
12341 \begin_layout Plain Layout
12343 \begin_inset space ~
12352 \begin_inset Flex Code
12355 \begin_layout Plain Layout
12361 is the height of a row with the normal font.
12362 This way, the look stays the same with different screen fonts.
12365 \begin_layout Description
12366 \begin_inset Flex Code
12369 \begin_layout Plain Layout
12376 \begin_inset Flex Code
12379 \begin_layout Plain Layout
12388 \begin_inset Flex Code
12391 \begin_layout Plain Layout
12397 ] Whether the contents of this paragraph should be output in raw form, meaning
12398 without special translations that LaTeX would require.
12401 \begin_layout Description
12402 \begin_inset Flex Code
12405 \begin_layout Plain Layout
12411 Information to be included in the LaTeX preamble when this style is used.
12412 Used to define macros, load packages, etc., required by this particular
12415 \begin_inset Quotes eld
12419 \begin_inset Flex Code
12422 \begin_layout Plain Layout
12429 \begin_inset Quotes erd
12435 \begin_layout Description
12436 \begin_inset Flex Code
12439 \begin_layout Plain Layout
12446 \begin_inset Flex Code
12449 \begin_layout Plain Layout
12455 ] The prefix to use when creating labels referring to paragraphs of this
12457 This allows the use of formatted references.
12460 \begin_layout Description
12461 \begin_inset Flex Code
12464 \begin_layout Plain Layout
12471 \begin_inset Flex Code
12474 \begin_layout Plain Layout
12480 ] The number of required arguments that the LaTeX command or environment
12481 corresponding to this style expects.
12482 In the case of a command, these are required arguments
12486 that associated with the content of the paragraph itself.
12487 These do not actually have to be provided: LyX will output empty arguments
12489 Note that optional arguments will be output before required arguments.
12490 See the discussion of the
12491 \begin_inset Flex Code
12494 \begin_layout Plain Layout
12500 tag above for more information.
12503 \begin_layout Description
12504 \begin_inset Flex Code
12507 \begin_layout Plain Layout
12514 \begin_inset Flex Code
12517 \begin_layout Plain Layout
12523 ] Whether the style requires the feature
12524 \begin_inset Flex Code
12527 \begin_layout Plain Layout
12534 See the description of
12535 \begin_inset Flex Code
12538 \begin_layout Plain Layout
12545 \begin_inset CommandInset ref
12546 LatexCommand pageref
12547 reference "des:FreeSpacing"
12551 ) for information on `features'.
12555 \begin_layout Description
12556 \begin_inset Flex Code
12559 \begin_layout Plain Layout
12566 \begin_inset Flex Code
12569 \begin_layout Plain Layout
12576 \begin_inset Flex Code
12579 \begin_layout Plain Layout
12588 \begin_layout Description
12589 \begin_inset Flex Code
12592 \begin_layout Plain Layout
12599 \begin_inset Flex Code
12602 \begin_layout Plain Layout
12607 , onehalf, double, other
12616 ] This defines what the default spacing should be in the style.
12618 \begin_inset Flex Code
12621 \begin_layout Plain Layout
12628 \begin_inset Flex Code
12631 \begin_layout Plain Layout
12638 \begin_inset Flex Code
12641 \begin_layout Plain Layout
12647 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
12648 If you specify the argument
12649 \begin_inset Flex Code
12652 \begin_layout Plain Layout
12658 , then you should also provide a numerical argument which will be the actual
12660 Note that, contrary to other parameters,
12661 \begin_inset Flex Code
12664 \begin_layout Plain Layout
12670 implies the generation of specific LaTeX code, using the package
12673 \begin_inset Flex Code
12676 \begin_layout Plain Layout
12685 \begin_layout Description
12686 \begin_inset Flex Code
12689 \begin_layout Plain Layout
12696 \begin_inset Flex Code
12699 \begin_layout Plain Layout
12706 \begin_inset Flex Code
12709 \begin_layout Plain Layout
12717 ] Spellcheck paragraphs of this style.
12721 \begin_layout Description
12722 \begin_inset Flex Code
12725 \begin_layout Plain Layout
12731 The font used for the text body .
12733 \begin_inset CommandInset ref
12735 reference "sub:Font-description"
12742 \begin_layout Description
12743 \begin_inset Flex Code
12746 \begin_layout Plain Layout
12755 \begin_inset Flex Code
12758 \begin_layout Plain Layout
12768 The level of the style in the table of contents.
12769 This is used for automatic numbering of section headings.
12772 \begin_layout Description
12773 \begin_inset Flex Code
12776 \begin_layout Plain Layout
12783 \begin_inset Flex Code
12786 \begin_layout Plain Layout
12792 ] The vertical space with which the very first of a chain of paragraphs
12793 with this style is separated from the previous paragraph.
12794 If the previous paragraph has another style, the separations are not simply
12795 added, but the maximum is taken.
12798 \begin_layout Subsection
12799 \begin_inset CommandInset label
12805 Internationalization of Paragraph Styles
12808 \begin_layout Standard
12809 LyX has long supported internationalization of layout information, but,
12810 until version 2.0, this applied only to the user interface and not to, say,
12812 Thus, French authors were forced to resort to ugly hacks if they wanted
12817 1' instead of `Theorem 1'.
12818 Thanks to Georg Baum, that is no longer the case.
12821 \begin_layout Standard
12823 \begin_inset Flex Code
12826 \begin_layout Plain Layout
12832 defines text that is to appear in the typeset document, it may use
12833 \begin_inset Flex Code
12836 \begin_layout Plain Layout
12843 \begin_inset Flex Code
12846 \begin_layout Plain Layout
12852 to support non-English and even multi-language documents correctly.
12853 The following excerpt (from the
12854 \begin_inset Flex Code
12857 \begin_layout Plain Layout
12863 file) shows how this works:
12866 \begin_layout LyX-Code
12871 \begin_layout LyX-Code
12874 theoremstyle{remark}
12877 \begin_layout LyX-Code
12880 newtheorem{claim}[thm]{
12887 \begin_layout LyX-Code
12891 \begin_layout LyX-Code
12895 \begin_layout LyX-Code
12900 claimname}{_(Claim)}
12903 \begin_layout LyX-Code
12907 \begin_layout LyX-Code
12911 \begin_layout LyX-Code
12920 claimname}{_(Claim)}}
12923 \begin_layout LyX-Code
12928 \begin_layout Standard
12929 In principle, any legal LaTeX may appear in the
12930 \begin_inset Flex Code
12933 \begin_layout Plain Layout
12940 \begin_inset Flex Code
12943 \begin_layout Plain Layout
12949 tags, but in practice they will typically look as they do here.
12950 The key to correct translation of the typeset text is the definition of
12952 \begin_inset Flex Code
12955 \begin_layout Plain Layout
12964 \begin_inset Flex Code
12967 \begin_layout Plain Layout
12979 \begin_layout Standard
12981 \begin_inset Flex Code
12984 \begin_layout Plain Layout
12990 tag provides for internationalization based upon the overall language of
12992 The contents of the tag will be included in the preamble, just as with
12994 \begin_inset Flex Code
12997 \begin_layout Plain Layout
13004 What makes it special is the use of the
13005 \begin_inset Quotes eld
13009 \begin_inset Quotes erd
13013 \begin_inset Flex Code
13016 \begin_layout Plain Layout
13022 , which will be replaced, when LyX produces LaTeX output, with the translation
13023 of its argument into the document language.
13026 \begin_layout Standard
13028 \begin_inset Flex Code
13031 \begin_layout Plain Layout
13037 tag is more complex, since it is meant to provide support for multi-language
13038 documents and so offers an interface to the
13039 \begin_inset Flex Code
13042 \begin_layout Plain Layout
13049 Its contents will be added to the preamble once for each language that
13050 appears in the document.
13051 In this case, the argument to
13052 \begin_inset Flex Code
13055 \begin_layout Plain Layout
13061 will be replaced with its translation into the language in question; the
13063 \begin_inset Flex Code
13066 \begin_layout Plain Layout
13072 is replaced by the language name (as used by the babel package).
13075 \begin_layout Standard
13076 A German document that also included a French section would thus have the
13077 following in the preamble:
13080 \begin_layout LyX-Code
13089 claimname}{Affirmation}}
13097 claimname}{Behauptung}}
13101 claimname}{Behauptung}
13104 \begin_layout Standard
13106 \begin_inset Flex Code
13109 \begin_layout Plain Layout
13115 will then conspire to produce the correct text in the output.
13118 \begin_layout Standard
13119 One important point to note here is that the translations are provided by
13120 LyX itself, through the
13121 \change_inserted -195340706 1334775793
13123 \begin_inset Flex Code
13126 \begin_layout Plain Layout
13128 \change_inserted -195340706 1334775793
13135 \change_deleted -195340706 1334775793
13136 same mechanism it uses for internationalization of the user interface
13139 This means, in effect, that
13140 \begin_inset Flex Code
13143 \begin_layout Plain Layout
13150 \begin_inset Flex Code
13153 \begin_layout Plain Layout
13159 are really only of use in layout files that are provided with LyX, since
13160 text entered in user-created layout files will not be seen by LyX's internation
13162 \change_inserted -195340706 1334775793
13164 \begin_inset Flex Code
13167 \begin_layout Plain Layout
13169 \change_inserted -195340706 1334775793
13175 file is modified accordingly
13178 That said, however, any layout created with the intention that it will
13179 be included with LyX should use these tags where appropriate.
13181 \change_inserted -195340706 1334775793
13182 Please note that the paragraph style translations provided by LyX will
13183 never change with a minor update (e.g.
13184 from version 2.1.x to 2.1.y).
13185 It is however quite likely that a major update (e.g.
13186 from 2.0.x to 2.1.y) will introduce new translations or corrections.
13191 \begin_layout Subsection
13193 \begin_inset CommandInset label
13202 \begin_layout Standard
13203 Since version 1.3.0 of LyX, it is has been both possible and necessary to
13204 define the floats (
13205 \begin_inset Flex MenuItem
13208 \begin_layout Plain Layout
13215 \begin_inset Flex MenuItem
13218 \begin_layout Plain Layout
13224 , \SpecialChar \ldots{}
13225 ) in the text class itself.
13226 Standard floats are included in the file
13227 \begin_inset Flex Code
13230 \begin_layout Plain Layout
13236 , so you may have to do no more than add
13239 \begin_layout LyX-Code
13240 Input stdfloats.inc
13243 \begin_layout Standard
13244 to your layout file.
13245 If you want to implement a text class that proposes some other float types
13246 (like the AGU class bundled with LyX), the information below will hopefully
13250 \begin_layout Description
13251 \begin_inset Flex Code
13254 \begin_layout Plain Layout
13261 \begin_inset Flex Code
13264 \begin_layout Plain Layout
13271 \begin_inset Quotes erd
13275 \begin_inset Quotes erd
13278 ] The file name extension of an auxiliary file for the list of figures (or
13280 LaTeX writes the captions to this file.
13283 \begin_layout Description
13284 \begin_inset Flex Code
13287 \begin_layout Plain Layout
13294 \begin_inset Flex Code
13297 \begin_layout Plain Layout
13304 \begin_inset Quotes erd
13308 \begin_inset Quotes erd
13311 ] The string that will be used in the menus and also for the caption.
13312 This is translated to the current language if babel is used.
13315 \begin_layout Description
13316 \begin_inset Flex Code
13319 \begin_layout Plain Layout
13325 These are used for XHTML output.
13327 \begin_inset CommandInset ref
13329 reference "sec:Tags-for-XHTML"
13336 \begin_layout Description
13337 \begin_inset Flex Code
13340 \begin_layout Plain Layout
13349 \begin_inset Flex Code
13352 \begin_layout Plain Layout
13361 \begin_inset Flex Code
13364 \begin_layout Plain Layout
13370 ] Indicates whether the float is already defined in the document class or
13371 if we instead need to load
13372 \begin_inset Flex Code
13375 \begin_layout Plain Layout
13381 and use what it provides to define it on-the-fly.
13383 \begin_inset Flex Code
13386 \begin_layout Plain Layout
13393 \begin_inset Flex Code
13396 \begin_layout Plain Layout
13403 It should be set to
13404 \begin_inset Flex Code
13407 \begin_layout Plain Layout
13413 if the float is already defined by the LaTeX document class.
13416 \begin_layout Description
13417 \begin_inset Flex Code
13420 \begin_layout Plain Layout
13427 \begin_inset Flex Code
13430 \begin_layout Plain Layout
13437 \begin_inset Quotes erd
13441 \begin_inset Quotes erd
13444 ] The command used to generate a list of floats of this type; the leading
13447 ' should be omitted.
13453 \begin_inset Flex Code
13456 \begin_layout Plain Layout
13462 is false, since there is no standard way to generate this command.
13464 \begin_inset Flex Code
13467 \begin_layout Plain Layout
13473 is true, since in that case there is a standard way to define the command.
13476 \begin_layout Description
13477 \begin_inset Flex Code
13480 \begin_layout Plain Layout
13487 \begin_inset Flex Code
13490 \begin_layout Plain Layout
13497 \begin_inset Quotes erd
13501 \begin_inset Quotes erd
13504 ] A title for a list of floats of this kind (list of figures, tables, or
13506 It is used for the screen label within LyX; it is passed to LaTeX for use
13507 as the title there; and it is used as the title in XHTML output.
13508 It will be translated to the document language.
13511 \begin_layout Description
13512 \begin_inset Flex Code
13515 \begin_layout Plain Layout
13522 \begin_inset Flex Code
13525 \begin_layout Plain Layout
13532 \begin_inset Quotes erd
13536 \begin_inset Quotes erd
13539 ] This (optional) argument determines whether floats of this class will
13540 be numbered within some sectional unit of the document.
13541 For example, if within is equal to
13542 \begin_inset Flex Code
13545 \begin_layout Plain Layout
13551 , the floats will be numbered within chapters.
13555 \begin_layout Description
13556 \begin_inset Flex Code
13559 \begin_layout Plain Layout
13566 \begin_inset Flex Code
13569 \begin_layout Plain Layout
13576 \begin_inset Quotes erd
13580 \begin_inset Quotes erd
13583 ] The default placement for the given class of floats.
13584 The string should be as in standard LaTeX:
13585 \begin_inset Flex Code
13588 \begin_layout Plain Layout
13595 \begin_inset Flex Code
13598 \begin_layout Plain Layout
13605 \begin_inset Flex Code
13608 \begin_layout Plain Layout
13615 \begin_inset Flex Code
13618 \begin_layout Plain Layout
13624 for top, bottom, page, and here, respectively.
13628 \begin_layout Plain Layout
13629 Note that the order of these letters in the string is irrelevant, like in
13635 On top of that there is a new type,
13636 \begin_inset Flex Code
13639 \begin_layout Plain Layout
13645 , which does not really correspond to a float, since it means: put it
13646 \begin_inset Quotes eld
13650 \begin_inset Quotes erd
13654 Note however that the
13655 \begin_inset Flex Code
13658 \begin_layout Plain Layout
13664 specifier is special and, because of implementation details, cannot be
13665 used in non-built in float types.
13666 If you do not understand what this means, just use
13667 \begin_inset Quotes eld
13671 \begin_inset Flex Code
13674 \begin_layout Plain Layout
13681 \begin_inset Quotes erd
13687 \begin_layout Description
13688 \begin_inset Flex Code
13691 \begin_layout Plain Layout
13698 \begin_inset Flex Code
13701 \begin_layout Plain Layout
13707 ] The prefix to use when creating labels referring to floats of this type.
13708 This allows the use of formatted references.
13709 Note that you can remove any
13710 \begin_inset Flex Code
13713 \begin_layout Plain Layout
13719 set by a copied style by using the special value
13720 \begin_inset Quotes eld
13724 \begin_inset Quotes erd
13727 , which must be all caps.
13730 \begin_layout Description
13731 \begin_inset Flex Code
13734 \begin_layout Plain Layout
13741 \begin_inset Flex Code
13744 \begin_layout Plain Layout
13751 \begin_inset Quotes erd
13755 \begin_inset Quotes erd
13758 ] The style used when defining the float using
13759 \begin_inset Flex Code
13762 \begin_layout Plain Layout
13773 \begin_layout Description
13774 \begin_inset Flex Code
13777 \begin_layout Plain Layout
13784 \begin_inset Flex Code
13787 \begin_layout Plain Layout
13794 \begin_inset Quotes erd
13798 \begin_inset Quotes erd
13802 \begin_inset Quotes eld
13806 \begin_inset Quotes erd
13809 of the new class of floats, like program or algorithm.
13810 After the appropriate
13811 \begin_inset Flex Code
13814 \begin_layout Plain Layout
13823 \begin_inset Flex Code
13826 \begin_layout Plain Layout
13835 \begin_inset Flex Code
13838 \begin_layout Plain Layout
13849 \begin_layout Description
13850 \begin_inset Flex Code
13853 \begin_layout Plain Layout
13860 \begin_inset Flex Code
13863 \begin_layout Plain Layout
13870 \begin_inset Flex Code
13873 \begin_layout Plain Layout
13881 ] Tells us whether this float is defined using the facilities provided by
13883 \begin_inset Flex Code
13886 \begin_layout Plain Layout
13892 , either by the class file or a package, or on-the-fly by LyX itself.
13895 \begin_layout Standard
13896 Note that defining a float with type
13897 \begin_inset Flex Code
13900 \begin_layout Plain Layout
13908 automatically defines the corresponding counter with name
13909 \begin_inset Flex Code
13912 \begin_layout Plain Layout
13923 \begin_layout Subsection
13924 Flex insets and InsetLayout
13925 \begin_inset CommandInset label
13927 name "sub:Flex-insets-and"
13934 \begin_layout Standard
13935 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
13936 these are called Flex insets.
13940 \begin_layout Standard
13941 Flex insets come in three different kinds:
13944 \begin_layout Itemize
13946 \begin_inset Flex Code
13949 \begin_layout Plain Layout
13955 ): These define semantic markup corresponding to such LaTeX commands as
13957 \begin_inset Flex Code
13960 \begin_layout Plain Layout
13969 \begin_inset Flex Code
13972 \begin_layout Plain Layout
13983 \begin_layout Itemize
13985 \begin_inset Flex Code
13988 \begin_layout Plain Layout
13994 ): These can be used to define custom collapsible insets, similar to TeX
13995 code, footnote, and the like.
13996 An obvious example is an endnote inset, which is defined in the
13997 \begin_inset Flex Code
14000 \begin_layout Plain Layout
14009 \begin_layout Itemize
14011 \begin_inset Flex Code
14014 \begin_layout Plain Layout
14020 ): For use with DocBook classes.
14023 \begin_layout Standard
14024 Flex insets are defined using the
14025 \begin_inset Flex Code
14028 \begin_layout Plain Layout
14034 tag, which shall be explained in a moment.
14037 \begin_layout Standard
14039 \begin_inset Flex Code
14042 \begin_layout Plain Layout
14048 tag also serves another function: It can be used to customize the general
14049 layout of many different types of insets.
14051 \begin_inset Flex Code
14054 \begin_layout Plain Layout
14060 can be used to customize the layout parameters for footnotes, marginal
14061 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
14062 boxes, tables, algorithms, URLs, and optional arguments, as well as to
14063 define Flex insets.
14066 \begin_layout Standard
14068 \begin_inset Flex Code
14071 \begin_layout Plain Layout
14077 definition must begin with a line of the form:
14080 \begin_layout LyX-Code
14084 \begin_layout Standard
14086 \begin_inset Flex Code
14089 \begin_layout Plain Layout
14095 indicates the inset whose layout is being defined, and here there are
14096 \change_inserted 5863208 1334489266
14098 \change_deleted 5863208 1334489267
14104 \begin_layout Enumerate
14105 The layout for a pre-existing inset is being modified.
14106 In this case, can be
14107 \begin_inset Flex Code
14110 \begin_layout Plain Layout
14116 any one of the following:
14117 \begin_inset Flex Code
14120 \begin_layout Plain Layout
14127 \begin_inset Flex Code
14130 \begin_layout Plain Layout
14137 \begin_inset Flex Code
14140 \begin_layout Plain Layout
14147 \begin_inset Flex Code
14150 \begin_layout Plain Layout
14157 \begin_inset Flex Code
14160 \begin_layout Plain Layout
14167 \begin_inset Flex Code
14170 \begin_layout Plain Layout
14177 \begin_inset Flex Code
14180 \begin_layout Plain Layout
14187 \begin_inset Flex Code
14190 \begin_layout Plain Layout
14197 \begin_inset Flex Code
14200 \begin_layout Plain Layout
14207 \begin_inset Flex Code
14210 \begin_layout Plain Layout
14217 \begin_inset Flex Code
14220 \begin_layout Plain Layout
14227 \begin_inset Flex Code
14230 \begin_layout Plain Layout
14237 \begin_inset Flex Code
14240 \begin_layout Plain Layout
14247 \begin_inset Flex Code
14250 \begin_layout Plain Layout
14257 \begin_inset Flex Code
14260 \begin_layout Plain Layout
14267 \begin_inset Flex Code
14270 \begin_layout Plain Layout
14277 \begin_inset Flex Code
14280 \begin_layout Plain Layout
14287 \begin_inset Flex Code
14290 \begin_layout Plain Layout
14297 \begin_inset Flex Code
14300 \begin_layout Plain Layout
14307 \begin_inset Flex Code
14310 \begin_layout Plain Layout
14319 \begin_layout Enumerate
14320 The layout for a Flex inset is being defined.
14322 \begin_inset Flex Code
14325 \begin_layout Plain Layout
14331 must be of the form
14332 \begin_inset Quotes eld
14336 \begin_inset Flex Code
14339 \begin_layout Plain Layout
14346 \begin_inset Quotes erd
14350 \begin_inset Flex Code
14353 \begin_layout Plain Layout
14359 may be be any valid identifier not used by a pre-existing Flex inset.
14360 The identifier may include spaces, but in that case the whole thing must
14361 be wrapped in quotes.
14362 Note that the definition of a flex inset
14367 \begin_inset Flex Code
14370 \begin_layout Plain Layout
14376 entry, declaring which type of inset it defines.
14377 \change_inserted 5863208 1334489312
14381 \begin_layout Enumerate
14383 \change_inserted 5863208 1334492248
14384 The layout for user specific branch is being defined.
14386 \begin_inset Flex Code
14389 \begin_layout Plain Layout
14391 \change_inserted 5863208 1334489384
14397 must be of the form
14398 \begin_inset Quotes eld
14402 \begin_inset Flex Code
14405 \begin_layout Plain Layout
14407 \change_inserted 5863208 1334489392
14414 \begin_inset Quotes erd
14418 \begin_inset Flex Code
14421 \begin_layout Plain Layout
14423 \change_inserted 5863208 1334489384
14429 may be be any valid identifier of branch defined in user's document.
14430 The identifier may include spaces, but in that case the whole thing must
14431 be wrapped in quotes.
14432 The main purpose of this feature is to allow LaTeX wrapping around specific
14433 branches as user needs.
14438 \begin_layout Standard
14440 \begin_inset Flex Code
14443 \begin_layout Plain Layout
14449 definition can contain the following entries:
14452 \begin_layout Description
14454 \change_inserted -195340706 1333913893
14455 \begin_inset Flex Code
14458 \begin_layout Plain Layout
14464 Preamble for changing languages.
14466 \begin_inset space ~
14470 \begin_inset CommandInset ref
14472 reference "sub:I18n"
14479 \begin_layout Description
14480 \begin_inset Flex Code
14483 \begin_layout Plain Layout
14489 The color for the inset's background.
14490 The valid colors are defined in
14491 \begin_inset Flex Code
14494 \begin_layout Plain Layout
14503 \begin_layout Description
14504 \begin_inset Flex Code
14507 \begin_layout Plain Layout
14514 \begin_inset Flex Code
14517 \begin_layout Plain Layout
14526 \begin_inset Flex Code
14529 \begin_layout Plain Layout
14535 ] Whether to use the content of the inset as the label, when the inset is
14540 \begin_layout Description
14541 \begin_inset Flex Code
14544 \begin_layout Plain Layout
14551 \begin_inset Flex Code
14554 \begin_layout Plain Layout
14560 Copies all the features of an existing style into the current one.
14564 \begin_layout Description
14565 \begin_inset Flex Code
14568 \begin_layout Plain Layout
14575 \begin_inset Flex Code
14578 \begin_layout Plain Layout
14587 \begin_inset Flex Code
14590 \begin_layout Plain Layout
14596 ] Indicates whether the user may employ the Paragraph Settings dialog to
14597 customize the paragraph.
14600 \begin_layout Description
14601 \begin_inset Flex Code
14604 \begin_layout Plain Layout
14611 \begin_inset Flex Code
14614 \begin_layout Plain Layout
14621 \begin_inset Flex Code
14624 \begin_layout Plain Layout
14631 \begin_inset Flex Code
14634 \begin_layout Plain Layout
14640 , describing the rendering style used for the inset's frame and buttons.
14641 Footnotes generally use
14642 \begin_inset Flex Code
14645 \begin_layout Plain Layout
14651 , ERT insets generally
14652 \begin_inset Flex Code
14655 \begin_layout Plain Layout
14661 , and character styles
14662 \begin_inset Flex Code
14665 \begin_layout Plain Layout
14674 \begin_layout Description
14675 \begin_inset Flex Code
14678 \begin_layout Plain Layout
14685 \begin_inset Flex Code
14688 \begin_layout Plain Layout
14695 \begin_inset Flex Code
14698 \begin_layout Plain Layout
14707 \begin_inset Flex Code
14710 \begin_layout Plain Layout
14717 \begin_inset Flex Code
14720 \begin_layout Plain Layout
14727 Indicates whether the environment will stand on its own in LaTeX output
14728 or will appear inline with the surrounding text.
14729 If set to false, it is supposed that the LaTeX environment ignores white
14730 space (including one newline character) after the
14731 \begin_inset Flex Code
14734 \begin_layout Plain Layout
14747 \begin_inset Flex Code
14750 \begin_layout Plain Layout
14766 \begin_layout Description
14767 \begin_inset Flex Code
14770 \begin_layout Plain Layout
14776 Required at the end of the InsetLayout declarations.
14779 \begin_layout Description
14780 \begin_inset Flex Code
14783 \begin_layout Plain Layout
14789 The font used for both the text body
14795 \begin_inset space ~
14799 \begin_inset CommandInset ref
14801 reference "sub:Font-description"
14806 Note that defining this font automatically defines the
14807 \begin_inset Flex Code
14810 \begin_layout Plain Layout
14816 to the same value, so define this first and define
14817 \begin_inset Flex Code
14820 \begin_layout Plain Layout
14826 later if you want them to be different.
14829 \begin_layout Description
14830 \begin_inset Flex Code
14833 \begin_layout Plain Layout
14840 \begin_inset Quotes eld
14844 \begin_inset Quotes erd
14847 language, leading to Left-to-Right (latin) output, e.
14848 \begin_inset space \thinspace{}
14852 \begin_inset space \space{}
14855 in TeX code or URL.
14859 \begin_layout Description
14860 \begin_inset Flex Code
14863 \begin_layout Plain Layout
14870 \begin_inset Flex Code
14873 \begin_layout Plain Layout
14882 \begin_inset Flex Code
14885 \begin_layout Plain Layout
14891 ] Indicates whether the
14892 \begin_inset Flex Code
14895 \begin_layout Plain Layout
14901 should be used or, instead, the user can change the paragraph style used
14906 \begin_layout Description
14907 \begin_inset Flex Code
14910 \begin_layout Plain Layout
14917 \begin_inset Flex Code
14920 \begin_layout Plain Layout
14929 \begin_inset Flex Code
14932 \begin_layout Plain Layout
14938 ] Usually LyX doesn't allow you to insert more than one space between words,
14939 since a space is considered as the separation between two words, not a
14940 character or symbol of its own.
14941 This is a very fine thing but sometimes annoying, for example, when typing
14942 program code or plain LaTeX code.
14944 \begin_inset Flex Code
14947 \begin_layout Plain Layout
14954 Note that LyX will create protected blanks for the additional blanks when
14955 in another mode than LaTeX-mode.
14959 \begin_layout Description
14960 \begin_inset Flex Code
14963 \begin_layout Plain Layout
14969 These tags control XHTML output.
14971 \begin_inset CommandInset ref
14973 reference "sec:Tags-for-XHTML"
14980 \begin_layout Description
14981 \begin_inset Flex Code
14984 \begin_layout Plain Layout
14991 \begin_inset Flex Code
14994 \begin_layout Plain Layout
15003 \begin_inset Flex Code
15006 \begin_layout Plain Layout
15012 ] Whether to include the contents of this inset in the strings generated
15013 for the `Outline' pane.
15014 One would not, for example, want the content of a footnote in a section
15015 header to be included in the TOC displayed in the outline, but one would
15016 normally want the content of a character style displayed.
15017 Default is false: not to include.
15020 \begin_layout Description
15021 \begin_inset Flex Code
15024 \begin_layout Plain Layout
15031 \begin_inset Flex Code
15034 \begin_layout Plain Layout
15043 \begin_inset Flex Code
15046 \begin_layout Plain Layout
15052 ] Usually LyX does not allow you to leave a paragraph empty, since it would
15053 lead to empty LaTeX output.
15054 There are some cases where this could be desirable however: in a letter
15055 template, the required fields can be provided as empty fields, so that
15056 people do not forget them; in some special classes, a style can be used
15057 as some kind of break, which does not contain actual text.
15061 \begin_layout Description
15062 \begin_inset Flex Code
15065 \begin_layout Plain Layout
15071 The font used for the label.
15073 \begin_inset space ~
15077 \begin_inset CommandInset ref
15079 reference "sub:Font-description"
15084 Note that this definition can never appear before
15085 \begin_inset Flex Code
15088 \begin_layout Plain Layout
15094 , lest it be ineffective.
15097 \begin_layout Description
15098 \begin_inset Flex Code
15101 \begin_layout Plain Layout
15107 What will be displayed on the button or elsewhere as the inset label.
15109 \begin_inset Flex Code
15112 \begin_layout Plain Layout
15119 \begin_inset Flex Code
15122 \begin_layout Plain Layout
15128 ) modify this label on the fly.
15131 \begin_layout Description
15133 \change_inserted -195340706 1333913893
15134 \begin_inset Flex Code
15137 \begin_layout Plain Layout
15143 Language dependent preamble.
15145 \begin_inset space ~
15149 \begin_inset CommandInset ref
15151 reference "sub:I18n"
15158 \begin_layout Description
15159 \begin_inset Flex Code
15162 \begin_layout Plain Layout
15168 The name of the corresponding LaTeX stuff.
15169 Either the environment or command name.
15172 \begin_layout Description
15173 \begin_inset Flex Code
15176 \begin_layout Plain Layout
15182 The optional parameter for the corresponding
15183 \begin_inset Flex Code
15186 \begin_layout Plain Layout
15192 stuff, including possible bracket pairs like
15193 \begin_inset Flex Code
15196 \begin_layout Plain Layout
15203 This parameter cannot be changed from within LyX.
15206 \begin_layout Description
15207 \begin_inset Flex Code
15210 \begin_layout Plain Layout
15217 \begin_inset Flex Code
15220 \begin_layout Plain Layout
15225 , Command, Environment, Item_Environment,
15231 \begin_inset Flex Code
15234 \begin_layout Plain Layout
15235 List_Environment, Bib_Environment
15240 ] How the style should be translated into LaTeX.
15244 \begin_layout Plain Layout
15245 \begin_inset Flex Code
15248 \begin_layout Plain Layout
15254 is perhaps a bit misleading, since these rules apply to SGML classes, too.
15255 Visit the SGML class files for specific examples.
15264 \begin_layout Itemize
15265 \begin_inset Flex Code
15268 \begin_layout Plain Layout
15274 means nothing special.
15278 \begin_layout Itemize
15279 \begin_inset Flex Code
15282 \begin_layout Plain Layout
15289 \begin_inset Flex Code
15292 \begin_layout Plain Layout
15299 {\SpecialChar \ldots{}
15308 \begin_layout Itemize
15309 \begin_inset Flex Code
15312 \begin_layout Plain Layout
15319 \begin_inset Flex Code
15322 \begin_layout Plain Layout
15329 }\SpecialChar \ldots{}
15345 \begin_layout Itemize
15346 \begin_inset Flex Code
15349 \begin_layout Plain Layout
15356 \begin_inset Flex Code
15359 \begin_layout Plain Layout
15366 \begin_inset Flex Code
15369 \begin_layout Plain Layout
15377 is generated for each paragraph of this environment.
15381 \begin_layout Itemize
15382 \begin_inset Flex Code
15385 \begin_layout Plain Layout
15392 \begin_inset Flex Code
15395 \begin_layout Plain Layout
15402 \begin_inset Flex Code
15405 \begin_layout Plain Layout
15411 is passed as an argument to the environment.
15413 \begin_inset Flex Code
15416 \begin_layout Plain Layout
15422 can be defined in the
15423 \begin_inset Flex MenuItem
15426 \begin_layout Plain Layout
15431 \SpecialChar \menuseparator
15437 \begin_inset space ~
15449 \begin_layout Standard
15450 Putting the last few things together, the LaTeX output will be either:
15453 \begin_layout LyX-Code
15456 latexname[latexparam]{\SpecialChar \ldots{}
15460 \begin_layout Standard
15464 \begin_layout LyX-Code
15467 begin{latexname}[latexparam] \SpecialChar \ldots{}
15473 \begin_layout Standard
15474 depending upon the LaTeX type.
15478 \begin_layout Description
15479 \begin_inset Flex Code
15482 \begin_layout Plain Layout
15489 \begin_inset Flex Code
15492 \begin_layout Plain Layout
15499 \begin_inset Flex Code
15502 \begin_layout Plain Layout
15509 \begin_inset Flex Code
15512 \begin_layout Plain Layout
15519 \begin_inset Flex Code
15522 \begin_layout Plain Layout
15528 (indicating a dummy definition ending definitions of charstyles, etc).
15529 This entry is required in and is only meaningful for Flex insets.
15530 Among other things, it determines on which menu this inset will appear.
15532 \begin_inset Flex Code
15535 \begin_layout Plain Layout
15542 \begin_inset Flex Code
15545 \begin_layout Plain Layout
15552 \begin_inset Flex Code
15555 \begin_layout Plain Layout
15563 \begin_inset Flex Code
15566 \begin_layout Plain Layout
15572 can be set to true for charstyle insets, if you wish, by setting it
15577 \begin_inset Flex Code
15580 \begin_layout Plain Layout
15589 \begin_layout Description
15590 \begin_inset Flex Code
15593 \begin_layout Plain Layout
15600 \begin_inset Flex Code
15603 \begin_layout Plain Layout
15612 \begin_inset Flex Code
15615 \begin_layout Plain Layout
15621 ] Whether multiple paragraphs are permitted in this inset.
15623 \begin_inset Flex Code
15626 \begin_layout Plain Layout
15632 to the same value and
15633 \begin_inset Flex Code
15636 \begin_layout Plain Layout
15642 to the opposite value.
15643 These can be reset to other values, if they are used
15648 \begin_inset Flex Code
15651 \begin_layout Plain Layout
15661 \begin_layout Description
15662 \begin_inset Flex Code
15665 \begin_layout Plain Layout
15672 \begin_inset Flex Code
15675 \begin_layout Plain Layout
15684 \begin_inset Flex Code
15687 \begin_layout Plain Layout
15693 ] Whether fragile commands in this inset should be
15694 \begin_inset Flex Code
15697 \begin_layout Plain Layout
15710 whether the command should itself be protected.) Default is false.
15713 \begin_layout Description
15714 \begin_inset Flex Code
15717 \begin_layout Plain Layout
15724 \begin_inset Flex Code
15727 \begin_layout Plain Layout
15736 \begin_inset Flex Code
15739 \begin_layout Plain Layout
15745 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
15746 output, but only by a line break; together with
15747 \begin_inset Flex Code
15750 \begin_layout Plain Layout
15756 , this allows to emulate a plain text editor (like the ERT inset).
15760 \begin_layout Description
15761 \begin_inset Flex Code
15764 \begin_layout Plain Layout
15771 \begin_inset Flex Code
15774 \begin_layout Plain Layout
15783 \begin_inset Flex Code
15786 \begin_layout Plain Layout
15792 ] Whether the contents of this paragraph should be output in raw form, meaning
15793 without special translations that LaTeX would require.
15796 \begin_layout Description
15797 \begin_inset Flex Code
15800 \begin_layout Plain Layout
15806 Information to be included in the LaTeX preamble when this style is used.
15807 Used to define macros, load packages, etc., required by this particular
15810 \begin_inset Quotes eld
15814 \begin_inset Flex Code
15817 \begin_layout Plain Layout
15824 \begin_inset Quotes erd
15830 \begin_layout Description
15831 \begin_inset Flex Code
15834 \begin_layout Plain Layout
15841 \begin_inset Flex Code
15844 \begin_layout Plain Layout
15850 ] The prefix to use when creating labels referring to insets of this type.
15851 This allows the use of formatted references.
15854 \begin_layout Description
15855 \begin_inset Flex Code
15858 \begin_layout Plain Layout
15865 \begin_inset Flex Code
15868 \begin_layout Plain Layout
15874 ] Whether the style requires the feature
15875 \begin_inset Flex Code
15878 \begin_layout Plain Layout
15885 See the description of
15886 \begin_inset Flex Code
15889 \begin_layout Plain Layout
15896 \begin_inset CommandInset ref
15897 LatexCommand pageref
15898 reference "des:FreeSpacing"
15902 ) for information on `features'.
15906 \begin_layout Description
15907 \begin_inset Flex Code
15910 \begin_layout Plain Layout
15917 \begin_inset Flex Code
15920 \begin_layout Plain Layout
15927 \begin_inset Flex Code
15930 \begin_layout Plain Layout
15938 ] Whether this inset should use the font of its surrounding environment
15940 Default is true: uses its own.
15943 \begin_layout Description
15944 \begin_inset Flex Code
15947 \begin_layout Plain Layout
15954 \begin_inset Flex Code
15957 \begin_layout Plain Layout
15964 \begin_inset Flex Code
15967 \begin_layout Plain Layout
15975 ] Spellcheck the contents of this inset.
15979 \begin_layout Subsection
15981 \begin_inset CommandInset label
15983 name "sub:Counters"
15990 \begin_layout Standard
15991 Since version 1.3.0 of LyX, it is both possible and necessary to define the
15993 \begin_inset Flex MenuItem
15996 \begin_layout Plain Layout
16003 \begin_inset Flex MenuItem
16006 \begin_layout Plain Layout
16012 , \SpecialChar \ldots{}
16013 ) in the text class itself.
16014 The standard counters are defined in the file
16015 \begin_inset Flex Code
16018 \begin_layout Plain Layout
16024 , so you may have to do no more than add
16027 \begin_layout LyX-Code
16028 Input stdcounters.inc
16031 \begin_layout Standard
16032 to your layout file to get them to work.
16033 But if you want to define custom counters, then you can do so.
16034 The counter declaration must begin with:
16037 \begin_layout LyX-Code
16038 Counter CounterName
16041 \begin_layout Standard
16043 \begin_inset Flex Code
16046 \begin_layout Plain Layout
16052 ' is replaced by the name of the counter.
16053 And it must end with
16054 \begin_inset Quotes eld
16058 \begin_inset Flex Code
16061 \begin_layout Plain Layout
16068 \begin_inset Quotes erd
16072 The following parameters can also be used:
16075 \begin_layout Description
16076 \begin_inset Flex Code
16079 \begin_layout Plain Layout
16086 \begin_inset Flex Code
16089 \begin_layout Plain Layout
16096 \begin_inset Quotes erd
16100 \begin_inset Quotes erd
16103 ] When defined, this string defines how the counter is displayed.
16104 Setting this value sets
16105 \begin_inset Flex Code
16108 \begin_layout Plain Layout
16109 LabelStringAppendix
16115 The following special constructs can be used in the string:
16119 \begin_layout Itemize
16120 \begin_inset Flex Code
16123 \begin_layout Plain Layout
16131 will be replaced by the expansion of the
16132 \begin_inset Flex Code
16135 \begin_layout Plain Layout
16142 \begin_inset Flex Code
16145 \begin_layout Plain Layout
16146 LabelStringAppendix
16152 \begin_inset Flex Code
16155 \begin_layout Plain Layout
16165 \begin_layout Itemize
16166 counter values can be expressed using LaTeX-like macros
16167 \begin_inset Flex Code
16170 \begin_layout Plain Layout
16187 \begin_inset Flex Code
16190 \begin_layout Plain Layout
16202 \begin_layout Plain Layout
16212 Actually, the situation is a bit more complicated: any
16231 other than those described below will produce arabic numerals.
16232 It would not be surprising to see this change in the future.
16238 \begin_inset Flex Code
16241 \begin_layout Plain Layout
16247 : 1, 2, 3,\SpecialChar \ldots{}
16249 \begin_inset Flex Code
16252 \begin_layout Plain Layout
16258 for lower-case letters: a, b, c, \SpecialChar \ldots{}
16260 \begin_inset Flex Code
16263 \begin_layout Plain Layout
16269 for upper-case letters: A, B, C, \SpecialChar \ldots{}
16271 \begin_inset Flex Code
16274 \begin_layout Plain Layout
16280 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
16282 \begin_inset Flex Code
16285 \begin_layout Plain Layout
16291 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
16293 \begin_inset Flex Code
16296 \begin_layout Plain Layout
16302 for hebrew numerals.
16306 \begin_layout Standard
16307 If LabelString is not defined, a default value is constructed as follows:
16308 if the counter has a master counter
16309 \begin_inset Flex Code
16312 \begin_layout Plain Layout
16319 \begin_inset Flex Code
16322 \begin_layout Plain Layout
16329 \begin_inset Flex Code
16332 \begin_layout Plain Layout
16342 is used; otherwise the string
16343 \begin_inset Flex Code
16346 \begin_layout Plain Layout
16357 \begin_layout Description
16358 \begin_inset Flex Code
16361 \begin_layout Plain Layout
16362 LabelStringAppendix
16368 \begin_inset Flex Code
16371 \begin_layout Plain Layout
16378 \begin_inset Quotes erd
16382 \begin_inset Quotes erd
16386 \begin_inset Flex Code
16389 \begin_layout Plain Layout
16395 , but for use in the Appendix.
16398 \begin_layout Description
16399 \begin_inset Flex Code
16402 \begin_layout Plain Layout
16409 \begin_inset Flex Code
16412 \begin_layout Plain Layout
16419 \begin_inset Quotes erd
16423 \begin_inset Quotes erd
16426 ] A format for use with formatted references to this counter.
16427 For example, one might want to have references to section numbers appear
16429 \begin_inset Quotes eld
16433 \begin_inset Quotes erd
16437 The string should contain
16438 \begin_inset Quotes eld
16442 \begin_inset Quotes erd
16446 This will be replaced by the counter number itself.
16447 So, for sections, it would be: Section ##.
16450 \begin_layout Description
16451 \begin_inset Flex Code
16454 \begin_layout Plain Layout
16461 \begin_inset Flex Code
16464 \begin_layout Plain Layout
16471 \begin_inset Quotes erd
16475 \begin_inset Quotes erd
16478 ] If this is set to the name of another counter, the present counter will
16479 be reset every time the other one is increased.
16481 \begin_inset Flex Code
16484 \begin_layout Plain Layout
16491 \begin_inset Flex Code
16494 \begin_layout Plain Layout
16503 \begin_layout Subsection
16505 \begin_inset CommandInset label
16507 name "sub:Font-description"
16514 \begin_layout Standard
16515 A font description looks like this:
16518 \begin_layout LyX-Code
16528 \begin_layout LyX-Code
16532 \begin_layout LyX-Code
16536 \begin_layout Standard
16537 The following commands are available:
16540 \begin_layout Description
16541 \begin_inset Flex Code
16544 \begin_layout Plain Layout
16551 \begin_inset Flex Code
16554 \begin_layout Plain Layout
16563 \begin_inset Flex Code
16566 \begin_layout Plain Layout
16573 \begin_inset Flex Code
16576 \begin_layout Plain Layout
16583 \begin_inset Flex Code
16586 \begin_layout Plain Layout
16593 \begin_inset Flex Code
16596 \begin_layout Plain Layout
16603 \begin_inset Flex Code
16606 \begin_layout Plain Layout
16613 \begin_inset Flex Code
16616 \begin_layout Plain Layout
16623 \begin_inset Flex Code
16626 \begin_layout Plain Layout
16633 \begin_inset Flex Code
16636 \begin_layout Plain Layout
16645 \begin_layout Description
16646 \begin_inset Flex Code
16649 \begin_layout Plain Layout
16656 \begin_inset Flex Code
16659 \begin_layout Plain Layout
16668 \begin_inset Flex Code
16671 \begin_layout Plain Layout
16678 \begin_inset Flex Code
16681 \begin_layout Plain Layout
16690 \begin_layout Description
16691 \begin_inset Flex Code
16694 \begin_layout Plain Layout
16701 \begin_inset Flex Code
16704 \begin_layout Plain Layout
16710 ] Valid arguments are:
16711 \begin_inset Flex Code
16714 \begin_layout Plain Layout
16721 \begin_inset Flex Code
16724 \begin_layout Plain Layout
16731 \begin_inset Flex Code
16734 \begin_layout Plain Layout
16741 \begin_inset Flex Code
16744 \begin_layout Plain Layout
16751 \begin_inset Flex Code
16754 \begin_layout Plain Layout
16761 \begin_inset Flex Code
16764 \begin_layout Plain Layout
16771 \begin_inset Flex Code
16774 \begin_layout Plain Layout
16781 \begin_inset Flex Code
16784 \begin_layout Plain Layout
16791 \begin_inset Flex Code
16794 \begin_layout Plain Layout
16801 \begin_inset Flex Code
16804 \begin_layout Plain Layout
16811 \begin_inset Flex Code
16814 \begin_layout Plain Layout
16821 \begin_inset Flex Code
16824 \begin_layout Plain Layout
16831 Each of these turns on or off the corresponding attribute.
16833 \begin_inset Flex Code
16836 \begin_layout Plain Layout
16842 turns on emphasis, and
16843 \begin_inset Flex Code
16846 \begin_layout Plain Layout
16854 \begin_inset Newline newline
16857 If the latter seems puzzling, remember that the font settings for the present
16858 context are generally inherited from the surrounding context.
16860 \begin_inset Flex Code
16863 \begin_layout Plain Layout
16869 would turn off the emphasis that was anyway in effect, say, in a theorem
16873 \begin_layout Description
16874 \begin_inset Flex Code
16877 \begin_layout Plain Layout
16884 \begin_inset Flex Code
16887 \begin_layout Plain Layout
16896 \begin_inset Flex Code
16899 \begin_layout Plain Layout
16908 \begin_layout Description
16909 \begin_inset Flex Code
16912 \begin_layout Plain Layout
16919 \begin_inset Flex Code
16922 \begin_layout Plain Layout
16931 \begin_inset Flex Code
16934 \begin_layout Plain Layout
16941 \begin_inset Flex Code
16944 \begin_layout Plain Layout
16951 \begin_inset Flex Code
16954 \begin_layout Plain Layout
16963 \begin_layout Description
16964 \begin_inset Flex Code
16967 \begin_layout Plain Layout
16974 \begin_inset Flex Code
16977 \begin_layout Plain Layout
16984 \begin_inset Flex Code
16987 \begin_layout Plain Layout
16994 \begin_inset Flex Code
16997 \begin_layout Plain Layout
17006 \begin_inset Flex Code
17009 \begin_layout Plain Layout
17016 \begin_inset Flex Code
17019 \begin_layout Plain Layout
17026 \begin_inset Flex Code
17029 \begin_layout Plain Layout
17036 \begin_inset Flex Code
17039 \begin_layout Plain Layout
17046 \begin_inset Flex Code
17049 \begin_layout Plain Layout
17058 \begin_layout Subsection
17059 \begin_inset CommandInset label
17061 name "sub:Citation-format-description"
17065 Citation format description
17068 \begin_layout Standard
17070 \begin_inset Flex Code
17073 \begin_layout Plain Layout
17079 blocks are used to describe how bibliographic information should be displayed,
17080 both within LyX itself (in the citation dialog and in tooltips, for example)
17081 and in XHTML output.
17082 Such a block might look like this:
17085 \begin_layout LyX-Code
17089 \begin_layout LyX-Code
17093 \begin_layout LyX-Code
17097 \begin_layout LyX-Code
17101 \begin_layout Standard
17102 The individual lines define how the bibliographic information associated
17103 with an article or book, respectively, is to be displayed, and such a definitio
17104 n can be given for any `entry type' that might be present in a BibTeX file.
17105 LyX defines a default format in the source code that will be used if no
17106 specific definition has been given.
17107 LyX predefines several formats in the file
17108 \begin_inset Flex Code
17111 \begin_layout Plain Layout
17117 , which is included in most of LyX's document classes.
17120 \begin_layout Standard
17121 The definitions use a simple language that allows BibTeX keys to be replaced
17123 Keys should be enclosed in
17124 \begin_inset Flex Code
17127 \begin_layout Plain Layout
17134 \begin_inset Flex Code
17137 \begin_layout Plain Layout
17144 So a simple definition might look like this:
17147 \begin_layout LyX-Code
17149 \begin_inset Quotes eld
17153 \begin_inset Quotes erd
17159 \begin_layout Standard
17160 This would print the author, followed by a comma, followed by the title,
17161 in quotes, followed by a period.
17164 \begin_layout Standard
17165 Of course, sometimes you may want to print a key only if it exists.
17166 This can be done by using a conditional construction, such as:
17167 \begin_inset Flex Code
17170 \begin_layout Plain Layout
17172 \begin_inset space ~
17182 \begin_inset Flex Code
17185 \begin_layout Plain Layout
17191 key exists, then print
17192 \begin_inset Quotes eld
17196 \begin_inset space ~
17200 \begin_inset Quotes erd
17203 followed by the volume key.
17204 It is also possible to have an else clause in the conditional, such as:
17206 \begin_inset Flex Code
17209 \begin_layout Plain Layout
17210 {%author%[[%author%]][[%editor%, ed.]]}
17217 \begin_inset Flex Code
17220 \begin_layout Plain Layout
17226 key is printed if it exists; otherwise, the editor key is printed, followed
17228 \begin_inset Quotes eld
17232 \begin_inset space ~
17236 \begin_inset Quotes erd
17239 Note that the key is again enclosed in
17240 \begin_inset Flex Code
17243 \begin_layout Plain Layout
17249 signs; the entire conditional is enclosed in braces; and the if and else
17250 clauses are enclosed in double brackets,
17251 \begin_inset Quotes eld
17255 \begin_inset Flex Code
17258 \begin_layout Plain Layout
17265 \begin_inset Quotes eld
17269 \begin_inset Quotes eld
17273 \begin_inset Flex Code
17276 \begin_layout Plain Layout
17283 \begin_inset Quotes erd
17287 There must be no space between any of these.
17290 \begin_layout Standard
17291 There is one other piece of syntax available in definitions, which looks
17293 \begin_inset Flex Code
17296 \begin_layout Plain Layout
17303 This defines a piece of formatting information that is to be used when
17305 \begin_inset Quotes eld
17309 \begin_inset Quotes erd
17313 Obviously, we do not want to output HTML tags when writing plain text,
17314 so they should be wrapped in
17315 \begin_inset Quotes eld
17319 \begin_inset Quotes erd
17323 \begin_inset Quotes eld
17327 \begin_inset Quotes erd
17333 \begin_layout Standard
17334 Two special sorts of definitions are also possible in a
17335 \begin_inset Flex Code
17338 \begin_layout Plain Layout
17345 An example of the first would be:
17348 \begin_layout LyX-Code
17350 \begin_inset Quotes eld
17354 \begin_inset Quotes erd
17360 \begin_layout Standard
17361 This is an abbreviation, or macro, and it can be used by treating it as
17363 \begin_inset Flex Code
17366 \begin_layout Plain Layout
17374 \begin_inset Flex Code
17377 \begin_layout Plain Layout
17383 exactly as it would treat its definition.
17384 So, let us issue the obvious
17392 \begin_layout LyX-Code
17396 \begin_layout Standard
17397 or anything like it.
17398 LyX shouldn't go into an infinite loop, but it may go into a long one before
17402 \begin_layout Standard
17403 The second sort of special definition might look like this:
17406 \begin_layout LyX-Code
17410 \begin_layout Standard
17411 This defines a translatable piece of text, which allows relevant parts of
17412 the bibliography to be translated.
17413 It can be included in a definition by treating it as a key:
17414 \begin_inset Flex Code
17417 \begin_layout Plain Layout
17424 Several of these are predefined in
17425 \begin_inset Flex Code
17428 \begin_layout Plain Layout
17435 Note that these are not macros, in the sense just defined.
17436 They will not be expanded.
17439 \begin_layout Standard
17440 So here then is an example that use all these features:
17443 \begin_layout LyX-Code
17444 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
17447 \begin_layout Standard
17448 This defines a macro that prints the author, followed by a comma, if the
17450 \begin_inset Flex Code
17453 \begin_layout Plain Layout
17459 key is defined, or else prints the name of the editor, followed by the
17461 \begin_inset Flex Code
17464 \begin_layout Plain Layout
17470 or its translation (it is by default
17471 \begin_inset Quotes eld
17475 \begin_inset Quotes erd
17479 \begin_inset Flex Code
17482 \begin_layout Plain Layout
17489 Note that this is in fact defined in
17490 \begin_inset Flex Code
17493 \begin_layout Plain Layout
17499 , so you can use it in your own definitions, or re-definitions, if you load
17503 \begin_layout Section
17504 \begin_inset CommandInset label
17506 name "sec:Tags-for-XHTML"
17510 Tags for XHTML output
17513 \begin_layout Standard
17514 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
17515 by layout information.
17516 In general, LyX provides sensible defaults and, as mentioned earlier, it
17517 will even construct default CSS style rules from the other layout tags.
17518 For example, LyX will attempt to use the information provided in the
17519 \begin_inset Flex Code
17522 \begin_layout Plain Layout
17528 declaration for the Chapter style to write CSS that will appropriately
17529 format chapter headings.
17532 \begin_layout Standard
17533 In many cases, then, you may not have to do anything at all to get acceptable
17534 XHTML output for your own environments, custom insets, and so forth.
17535 But in some cases you will, and so LyX provides a number of layout tags
17536 that can be used to customize the XHTML and CSS that are generated.
17539 \begin_layout Standard
17540 Note that there are two tags,
17541 \begin_inset Flex Code
17544 \begin_layout Plain Layout
17551 \begin_inset Flex Code
17554 \begin_layout Plain Layout
17560 that may appear outside style and inset declarations.
17562 \begin_inset CommandInset ref
17564 reference "sub:General-text-class"
17568 for details on these.
17571 \begin_layout Subsection
17572 \begin_inset CommandInset label
17574 name "sub:Paragraph-Style-XHTML"
17581 \begin_layout Standard
17582 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
17583 dealing with a normal paragraph, a command, or an environment, where this
17584 is itself determined by the contents of the corresponding
17585 \begin_inset Flex Code
17588 \begin_layout Plain Layout
17598 \begin_layout Standard
17599 For a command or normal paragraph, the output XHTML has the following form:
17602 \begin_layout LyX-Code
17604 \begin_inset Quotes erd
17608 \begin_inset Quotes erd
17614 \begin_layout LyX-Code
17616 \begin_inset Quotes erd
17620 \begin_inset Quotes erd
17626 \begin_layout LyX-Code
17627 Contents of the paragraph.
17630 \begin_layout LyX-Code
17634 \begin_layout Standard
17635 The label tags are of course omitted if the paragraph does not have a label.
17638 \begin_layout Standard
17639 For an environment that is not some sort of list, the XHTML takes this form:
17642 \begin_layout LyX-Code
17644 \begin_inset Quotes erd
17648 \begin_inset Quotes erd
17654 \begin_layout LyX-Code
17656 \begin_inset Quotes erd
17660 \begin_inset Quotes erd
17664 \begin_inset Quotes erd
17668 \begin_inset Quotes erd
17671 >Environment Label</labeltag>First paragraph.</itemtag>
17674 \begin_layout LyX-Code
17675 <itemtag>Second paragraph.</itemtag>
17678 \begin_layout LyX-Code
17682 \begin_layout Standard
17683 Note that the label is output only for the first paragraph, as it should
17684 be for a theorem, for example.
17688 \begin_layout Standard
17689 For a list, we have one of these forms:
17692 \begin_layout LyX-Code
17694 \begin_inset Quotes erd
17698 \begin_inset Quotes erd
17704 \begin_layout LyX-Code
17706 \begin_inset Quotes erd
17710 \begin_inset Quotes erd
17714 \begin_inset Quotes erd
17718 \begin_inset Quotes erd
17721 >List Label</labeltag>First item.</itemtag>
17724 \begin_layout LyX-Code
17726 \begin_inset Quotes erd
17730 \begin_inset Quotes erd
17734 \begin_inset Quotes erd
17738 \begin_inset Quotes erd
17741 >List Label</labeltag>Second item.</itemtag>
17744 \begin_layout LyX-Code
17748 \begin_layout LyX-Code
17752 \begin_layout LyX-Code
17754 \begin_inset Quotes erd
17758 \begin_inset Quotes erd
17764 \begin_layout LyX-Code
17766 \begin_inset Quotes erd
17770 \begin_inset Quotes erd
17773 >List Label</labeltag><itemtag attr=
17774 \begin_inset Quotes erd
17778 \begin_inset Quotes erd
17781 >First item.</itemtag>
17784 \begin_layout LyX-Code
17786 \begin_inset Quotes erd
17790 \begin_inset Quotes erd
17793 >List Label</labeltag><itemtag attr=
17794 \begin_inset Quotes erd
17798 \begin_inset Quotes erd
17801 >Second item.</itemtag>
17804 \begin_layout LyX-Code
17808 \begin_layout Standard
17809 Note the different orders of
17810 \begin_inset Flex Code
17813 \begin_layout Plain Layout
17820 \begin_inset Flex Code
17823 \begin_layout Plain Layout
17830 Which order we get depends upon the setting of
17831 \begin_inset Flex Code
17834 \begin_layout Plain Layout
17841 \begin_inset Flex Code
17844 \begin_layout Plain Layout
17850 is false (the default), you get the first of these, with the label within
17851 the item; if true, you get the second, with the label outside the item.
17854 \begin_layout Standard
17855 The specific tags and attributes output for each paragraph type can be controlle
17856 d by means of the layout tags we are about to describe.
17857 As mentioned earlier, however, LyX uses sensible defaults for many of these,
17858 so you often may not need to do very much to get good XHTML output.
17859 Think of the available tags as there so you can tweak things to your liking.
17862 \begin_layout Description
17863 \begin_inset Flex Code
17866 \begin_layout Plain Layout
17873 \begin_inset Flex Code
17876 \begin_layout Plain Layout
17882 ] Specifies attribute information to be output with the main tag.
17884 \begin_inset Quotes eld
17888 \begin_inset Flex Code
17891 \begin_layout Plain Layout
17898 \begin_inset Quotes erd
17902 By default, LyX will output
17903 \begin_inset Quotes eld
17907 \begin_inset Flex Code
17910 \begin_layout Plain Layout
17917 \begin_inset Quotes erd
17921 \begin_inset Flex Code
17924 \begin_layout Plain Layout
17930 is the LyX name of the layout, made lowercase, for example: chapter.
17935 contain any style information.
17937 \begin_inset Flex Code
17940 \begin_layout Plain Layout
17949 \begin_layout Description
17950 \begin_inset Flex Code
17953 \begin_layout Plain Layout
17960 \begin_inset Flex Code
17963 \begin_layout Plain Layout
17973 ] Whether to output the default CSS information LyX generates for this layout,
17974 even if additional information is explicitly provided via
17975 \begin_inset Flex Code
17978 \begin_layout Plain Layout
17986 \begin_inset Flex Code
17989 \begin_layout Plain Layout
17995 allows you to alter or augment the generated CSS, rather than to override
17998 \begin_inset Flex Code
18001 \begin_layout Plain Layout
18010 \begin_layout Description
18011 \begin_inset Flex Code
18014 \begin_layout Plain Layout
18021 \begin_inset Flex Code
18024 \begin_layout Plain Layout
18030 ] The tag to be used for individual paragraphs of environments, replacing
18032 \begin_inset Flex Code
18035 \begin_layout Plain Layout
18041 in the examples above.
18043 \begin_inset Flex Code
18046 \begin_layout Plain Layout
18055 \begin_layout Description
18056 \begin_inset Flex Code
18059 \begin_layout Plain Layout
18066 \begin_inset Flex Code
18069 \begin_layout Plain Layout
18075 ] Attributes for the item tag.
18077 \begin_inset Quotes eld
18081 \begin_inset Flex Code
18084 \begin_layout Plain Layout
18085 class=`layoutname_item'
18091 \begin_inset Quotes erd
18099 contain any style information.
18101 \begin_inset Flex Code
18104 \begin_layout Plain Layout
18113 \begin_layout Description
18114 \begin_inset Flex Code
18117 \begin_layout Plain Layout
18124 \begin_inset Flex Code
18127 \begin_layout Plain Layout
18133 ] The tag to be used for paragraph and item labels, replacing
18134 \begin_inset Flex Code
18137 \begin_layout Plain Layout
18143 in the examples above.
18145 \begin_inset Flex Code
18148 \begin_layout Plain Layout
18155 \begin_inset Flex Code
18158 \begin_layout Plain Layout
18165 \begin_inset Flex Code
18168 \begin_layout Plain Layout
18175 \begin_inset Flex Code
18178 \begin_layout Plain Layout
18179 Centered_Top_Environment
18184 , in which case it defaults to
18185 \begin_inset Flex Code
18188 \begin_layout Plain Layout
18197 \begin_layout Description
18198 \begin_inset Flex Code
18201 \begin_layout Plain Layout
18208 \begin_inset Flex Code
18211 \begin_layout Plain Layout
18217 ] Attributes for the label tag.
18219 \begin_inset Quotes eld
18223 \begin_inset Flex Code
18226 \begin_layout Plain Layout
18227 class=`layoutname_label'
18233 \begin_inset Quotes erd
18241 contain any style information.
18243 \begin_inset Flex Code
18246 \begin_layout Plain Layout
18255 \begin_layout Description
18256 \begin_inset Flex Code
18259 \begin_layout Plain Layout
18266 \begin_inset Flex Code
18269 \begin_layout Plain Layout
18279 ] Meaningful only for list-like environments, this tag controls whether
18280 the label tag is output before or inside the item tag.
18281 This is used, for example, in the description environment, where we want
18283 \begin_inset Flex Code
18286 \begin_layout Plain Layout
18287 <dt>\SpecialChar \ldots{}
18288 </dt><dd>\SpecialChar \ldots{}
18296 \begin_inset Flex Code
18299 \begin_layout Plain Layout
18305 : The label tag is output inside the item tag.
18308 \begin_layout Description
18309 \begin_inset Flex Code
18312 \begin_layout Plain Layout
18318 Information to be output in the
18319 \begin_inset Flex Code
18322 \begin_layout Plain Layout
18328 section when this style is used.
18329 This might, for example, be used to include a
18330 \begin_inset Flex Code
18333 \begin_layout Plain Layout
18340 \begin_inset Flex Code
18343 \begin_layout Plain Layout
18352 \begin_layout Description
18353 \begin_inset Flex Code
18356 \begin_layout Plain Layout
18362 CSS style information to be included when this style is used.
18363 Note that this will automatically be wrapped in a layout-generated
18364 \begin_inset Flex Code
18367 \begin_layout Plain Layout
18373 block, so only the CSS itself need be included.
18376 \begin_layout Description
18377 \begin_inset Flex Code
18380 \begin_layout Plain Layout
18387 \begin_inset Flex Code
18390 \begin_layout Plain Layout
18396 ] The tag to be used for the main label, replacing
18397 \begin_inset Flex Code
18400 \begin_layout Plain Layout
18406 in the examples above.
18408 \begin_inset Flex Code
18411 \begin_layout Plain Layout
18420 \begin_layout Description
18421 \begin_inset Flex Code
18424 \begin_layout Plain Layout
18431 \begin_inset Flex Code
18434 \begin_layout Plain Layout
18444 ] Marks this style as the one to be used to generate the
18445 \begin_inset Flex Code
18448 \begin_layout Plain Layout
18454 tag for the XHTML file.
18455 By default, it is false.
18457 \begin_inset Flex Code
18460 \begin_layout Plain Layout
18466 file sets it to true for the
18467 \begin_inset Flex Code
18470 \begin_layout Plain Layout
18480 \begin_layout Subsection
18484 \begin_layout Standard
18485 The XHTML output of insets can also be controlled by information in layout
18490 \begin_layout Plain Layout
18491 At present, this is true only for
18492 \begin_inset Quotes eld
18496 \begin_inset Quotes erd
18499 insets (insets you can type into) and is not true for
18500 \begin_inset Quotes eld
18504 \begin_inset Quotes erd
18507 insets (insets that are associated with dialog boxes).
18512 Here, too, LyX tries to provide sensible defaults, and it constructs default
18514 But everything can be customized.
18517 \begin_layout Standard
18518 The XHTML LyX outputs for an inset has the following form:
18521 \begin_layout LyX-Code
18523 \begin_inset Quotes erd
18527 \begin_inset Quotes erd
18533 \begin_layout LyX-Code
18534 <labeltag>Label</labeltag>
18537 \begin_layout LyX-Code
18539 \begin_inset Quotes erd
18543 \begin_inset Quotes erd
18546 >Contents of the inset.</innertag>
18549 \begin_layout LyX-Code
18553 \begin_layout Standard
18554 If the inset permits multiple paragraphs---that is, if
18555 \begin_inset Flex Code
18558 \begin_layout Plain Layout
18564 is true---then the contents of the inset will itself be output as paragraphs
18565 formatted according to the styles used for those paragraphs (standard,
18566 quote, and the like).
18567 The label tag is of course omitted if the paragraph does not have a label
18568 and, at present, is always
18569 \begin_inset Flex Code
18572 \begin_layout Plain Layout
18579 The inner tag is optional and, by default, does not appear.
18582 \begin_layout Standard
18583 The specific tags and attributes output for each inset can be controlled
18584 by means of the following layout tags.
18587 \begin_layout Description
18588 \begin_inset Flex Code
18591 \begin_layout Plain Layout
18598 \begin_inset Flex Code
18601 \begin_layout Plain Layout
18607 ] Specifies attribute information to be output with the main tag.
18609 \begin_inset Quotes eld
18613 \begin_inset Flex Code
18616 \begin_layout Plain Layout
18617 class=`myinset' onclick=`\SpecialChar \ldots{}
18624 \begin_inset Quotes erd
18628 By default, LyX will output
18629 \begin_inset Quotes eld
18633 \begin_inset Flex Code
18636 \begin_layout Plain Layout
18643 \begin_inset Quotes erd
18647 \begin_inset Flex Code
18650 \begin_layout Plain Layout
18656 is the LyX name of the inset, made lowercase and with non-alphanumeric
18657 characters converted to underscores, for example: footnote.
18660 \begin_layout Description
18661 \begin_inset Flex Code
18664 \begin_layout Plain Layout
18671 \begin_inset Flex Code
18674 \begin_layout Plain Layout
18684 ] Whether to output the default CSS information LyX generates for this layout,
18685 even if additional information is explicitly provided via
18686 \begin_inset Flex Code
18689 \begin_layout Plain Layout
18697 \begin_inset Flex Code
18700 \begin_layout Plain Layout
18706 allows you to alter or augment the generated CSS, rather than to override
18711 \begin_layout Description
18712 \begin_inset Flex Code
18715 \begin_layout Plain Layout
18722 \begin_inset Flex Code
18725 \begin_layout Plain Layout
18731 ] Attributes for the inner tag.
18733 \begin_inset Quotes eld
18737 \begin_inset Flex Code
18740 \begin_layout Plain Layout
18741 class=`insetname_inner'
18747 \begin_inset Quotes erd
18753 \begin_layout Description
18754 \begin_inset Flex Code
18757 \begin_layout Plain Layout
18764 \begin_inset Flex Code
18767 \begin_layout Plain Layout
18773 ] The inner tag, replacing
18774 \begin_inset Flex Code
18777 \begin_layout Plain Layout
18783 in the examples above.
18784 By default, there is none.
18787 \begin_layout Description
18788 \begin_inset Flex Code
18791 \begin_layout Plain Layout
18798 \begin_inset Flex Code
18801 \begin_layout Plain Layout
18809 ] Whether this inset represents a standalone block of text (such as a footnote)
18810 or instead represents material that is included in the surrounding text
18811 (such as a branch).
18815 \begin_layout Description
18816 \begin_inset Flex Code
18819 \begin_layout Plain Layout
18826 \begin_inset Flex Code
18829 \begin_layout Plain Layout
18835 ] A label for this inset, possibly including a reference to a counter.
18836 For example, for footnote, it might be:
18837 \begin_inset Flex Code
18840 \begin_layout Plain Layout
18849 This is optional, and there is no default.
18852 \begin_layout Description
18853 \begin_inset Flex Code
18856 \begin_layout Plain Layout
18862 Information to be output in the
18863 \begin_inset Flex Code
18866 \begin_layout Plain Layout
18872 section when this style is used.
18873 This might, for example, be used to include a
18874 \begin_inset Flex Code
18877 \begin_layout Plain Layout
18884 \begin_inset Flex Code
18887 \begin_layout Plain Layout
18896 \begin_layout Description
18897 \begin_inset Flex Code
18900 \begin_layout Plain Layout
18906 CSS style information to be included when this style is used.
18907 Note that this will automatically be wrapped in a layout-generated
18908 \begin_inset Flex Code
18911 \begin_layout Plain Layout
18917 block, so only the CSS itself need be included.
18920 \begin_layout Description
18921 \begin_inset Flex Code
18924 \begin_layout Plain Layout
18931 \begin_inset Flex Code
18934 \begin_layout Plain Layout
18940 ] The tag to be used for the main label, replacing
18941 \begin_inset Flex Code
18944 \begin_layout Plain Layout
18950 in the examples above.
18951 The default depends upon the setting of
18952 \begin_inset Flex Code
18955 \begin_layout Plain Layout
18962 \begin_inset Flex Code
18965 \begin_layout Plain Layout
18971 is true, the default is
18972 \begin_inset Flex Code
18975 \begin_layout Plain Layout
18981 ; if it is false, the default is
18982 \begin_inset Flex Code
18985 \begin_layout Plain Layout
18994 \begin_layout Subsection
18998 \begin_layout Standard
18999 The XHTML output for floats too can be controlled by layout information.
19000 The output has the following form:
19003 \begin_layout LyX-Code
19005 \begin_inset Quotes erd
19009 \begin_inset Quotes erd
19015 \begin_layout LyX-Code
19016 Contents of the float.
19019 \begin_layout LyX-Code
19023 \begin_layout Standard
19024 The caption, if there is one, is a separate inset and will be output as
19026 Its appearance can be controlled via the InsetLayout for caption insets.
19030 \begin_layout Description
19031 \begin_inset Flex Code
19034 \begin_layout Plain Layout
19041 \begin_inset Flex Code
19044 \begin_layout Plain Layout
19050 ] Specifies attribute information to be output with the main tag.
19052 \begin_inset Quotes eld
19056 \begin_inset Flex Code
19059 \begin_layout Plain Layout
19060 class=`myfloat' onclick=`\SpecialChar \ldots{}
19067 \begin_inset Quotes erd
19071 By default, LyX will output
19072 \begin_inset Quotes eld
19076 \begin_inset Flex Code
19079 \begin_layout Plain Layout
19080 class=`float float-floattype'
19086 \begin_inset Quotes erd
19090 \begin_inset Flex Code
19093 \begin_layout Plain Layout
19099 is LyX's name for this type of float, as determined by the float declaration
19101 \begin_inset CommandInset ref
19103 reference "sub:Floats"
19107 ), though made lowercase and with non-alphanumeric characters converted
19108 to underscores, for example: float-table.
19111 \begin_layout Description
19112 \begin_inset Flex Code
19115 \begin_layout Plain Layout
19121 CSS style information to be included when this float is used.
19122 Note that this will automatically be wrapped in a layout-generated
19123 \begin_inset Flex Code
19126 \begin_layout Plain Layout
19132 block, so only the CSS itself need be included.
19135 \begin_layout Description
19136 \begin_inset Flex Code
19139 \begin_layout Plain Layout
19146 \begin_inset Flex Code
19149 \begin_layout Plain Layout
19155 ] The tag to be used for this float, replacing
19156 \begin_inset Quotes eld
19160 \begin_inset Flex Code
19163 \begin_layout Plain Layout
19170 \begin_inset Quotes erd
19173 in the example above.
19175 \begin_inset Flex Code
19178 \begin_layout Plain Layout
19184 and will rarely need changing.
19187 \begin_layout Subsection
19188 Bibliography formatting
19191 \begin_layout Standard
19192 The bibliography can be formatted using
19193 \begin_inset Flex Code
19196 \begin_layout Plain Layout
19204 \begin_inset CommandInset ref
19206 reference "sub:Citation-format-description"
19213 \begin_layout Subsection
19217 \begin_layout Standard
19218 We have several times mentioned that LyX will generate default CSS style
19219 rules for both insets and paragraph styles, based upon the other layout
19220 information that is provided.
19221 In this section, we shall say a word about which layout information LyX
19225 \begin_layout Standard
19226 At present, LyX auto-generates CSS only for font information, making use
19228 \begin_inset Flex Code
19231 \begin_layout Plain Layout
19238 \begin_inset Flex Code
19241 \begin_layout Plain Layout
19248 \begin_inset Flex Code
19251 \begin_layout Plain Layout
19258 \begin_inset Flex Code
19261 \begin_layout Plain Layout
19268 \begin_inset Flex Code
19271 \begin_layout Plain Layout
19279 \begin_inset CommandInset ref
19281 reference "sub:Font-description"
19285 .) The translation is mostly straightforward and obvious.
19287 \begin_inset Quotes eld
19291 \begin_inset Flex Code
19294 \begin_layout Plain Layout
19301 \begin_inset Quotes erd
19305 \begin_inset Quotes eld
19309 \begin_inset Flex Code
19312 \begin_layout Plain Layout
19313 font-family: sans-serif;
19319 \begin_inset Quotes erd
19323 The correspondence of LyX sizes and CSS sizes is a little less obvious
19324 but nonetheless intuitive.
19326 \begin_inset Flex Code
19329 \begin_layout Plain Layout
19336 \begin_inset Flex URL
19339 \begin_layout Plain Layout
19349 \begin_layout Chapter
19350 Including External Material
19353 \begin_layout Standard
19354 \begin_inset Box Shadowbox
19364 height_special "totalheight"
19367 \begin_layout Plain Layout
19368 WARNING: This portion of the documentation has not been updated for some
19370 We certainly hope that it is still accurate, but there are no guarantees.
19378 \begin_layout Standard
19379 The use of material from sources external to LyX is covered in detail in
19385 This part of the manual covers what needs to happen behind the scenes for
19386 new sorts of material to be included.
19389 \begin_layout Section
19393 \begin_layout Standard
19394 The external material feature is based on the concept of a
19399 A template is a specification of how LyX should interface with a certain
19401 As bundled, LyX comes with predefined templates for Xfig figures, various
19402 raster format images, chess diagrams, and LilyPond music notation.
19403 You can check the actual list by using the menu
19404 \begin_inset Flex MenuItem
19407 \begin_layout Plain Layout
19408 Insert\SpecialChar \menuseparator
19409 File\SpecialChar \menuseparator
19416 Furthermore, it is possible to roll your own template to support a specific
19418 Later we'll describe in more detail what is involved, and hopefully you
19419 will submit all the templates you create so we can include them in a later
19423 \begin_layout Standard
19424 Another basic idea of the external material feature is to distinguish between
19425 the original file that serves as a base for final material and the produced
19426 file that is included in your exported or printed document.
19427 For example, consider the case of a figure produced with
19428 \begin_inset Flex Code
19431 \begin_layout Plain Layout
19438 The Xfig application itself works on an original file with the
19439 \begin_inset Flex Code
19442 \begin_layout Plain Layout
19449 Within Xfig, you create and change your figure, and when you are done,
19451 \begin_inset Flex Code
19454 \begin_layout Plain Layout
19461 When you want to include the figure in your document, you invoke
19462 \begin_inset Flex Code
19465 \begin_layout Plain Layout
19471 in order to create a PostScript file that can readily be included in your
19474 \begin_inset Flex Code
19477 \begin_layout Plain Layout
19483 file is the original file, and the PostScript file is the produced file.
19486 \begin_layout Standard
19487 This distinction is important in order to allow updating of the material
19488 while you are in the process of writing the document.
19489 Furthermore, it provides us with the flexibility that is needed to support
19490 multiple export formats.
19491 For instance, in the case of a plain text file, it is not exactly an award-winn
19492 ing idea to include the figure as raw PostScript.
19493 Instead, you would either prefer to just include a reference to the figure
19494 or try to invoke some graphics to ASCII converter to make the final result
19495 look similar to the real graphics.
19496 The external material management allows you to do this, because it is parametri
19497 zed on the different export formats that LyX supports.
19500 \begin_layout Standard
19501 Besides supporting the production of different products according to the
19502 exported format, it supports tight integration with editing and viewing
19504 In the case of an Xfig figure, you are able to invoke Xfig on the original
19505 file with a single click from within the external material dialog in LyX,
19506 and also preview the produced PostScript file with Ghostview with another
19508 No more fiddling around with the command line and/or file browsers to locate
19509 and manipulate the original or produced files.
19510 In this way, you are finally able to take full advantage of the many different
19511 applications that are relevant to use when you write your documents, and
19512 ultimately be more productive.
19515 \begin_layout Section
19516 The external template configuration file
19519 \begin_layout Standard
19520 It is relatively easy to add custom external template definitions to LyX.
19521 However, be aware that doing this in an careless manner most probably
19525 introduce an easily exploitable security hole.
19526 So before you do this, please read the discussion about security in section
19528 \begin_inset CommandInset ref
19530 reference "sec:Security-discussion"
19537 \begin_layout Standard
19538 Having said that, we encourage you to submit any interesting templates that
19543 \begin_layout Standard
19544 The external templates are defined in the
19545 \begin_inset Flex Code
19548 \begin_layout Plain Layout
19549 LyXDir/lib/external_templates
19555 You can place your own version in
19556 \begin_inset Flex Code
19559 \begin_layout Plain Layout
19560 UserDir/external_templates
19568 \begin_layout Standard
19569 A typical template looks like this:
19572 \begin_layout LyX-Code
19576 \begin_layout LyX-Code
19577 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
19580 \begin_layout LyX-Code
19584 \begin_layout LyX-Code
19588 \begin_layout LyX-Code
19592 \begin_layout LyX-Code
19596 \begin_layout LyX-Code
19600 \begin_layout LyX-Code
19601 AutomaticProduction true
19604 \begin_layout LyX-Code
19608 \begin_layout LyX-Code
19612 \begin_layout LyX-Code
19616 \begin_layout LyX-Code
19617 TransformCommand Rotate RotationLatexCommand
19620 \begin_layout LyX-Code
19621 TransformCommand Resize ResizeLatexCommand
19624 \begin_layout LyX-Code
19625 Product "$$RotateFront$$ResizeFront
19628 \begin_layout LyX-Code
19633 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
19636 \begin_layout LyX-Code
19637 $$ResizeBack$$RotateBack"
19640 \begin_layout LyX-Code
19644 \begin_layout LyX-Code
19645 UpdateResult "$$AbsPath$$Basename.pstex_t"
19648 \begin_layout LyX-Code
19649 Requirement "graphicx"
19652 \begin_layout LyX-Code
19653 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
19656 \begin_layout LyX-Code
19657 ReferencedFile latex "$$AbsPath$$Basename.eps"
19660 \begin_layout LyX-Code
19661 ReferencedFile dvi "$$AbsPath$$Basename.eps"
19664 \begin_layout LyX-Code
19668 \begin_layout LyX-Code
19672 \begin_layout LyX-Code
19673 TransformCommand Rotate RotationLatexCommand
19676 \begin_layout LyX-Code
19677 TransformCommand Resize ResizeLatexCommand
19680 \begin_layout LyX-Code
19681 Product "$$RotateFront$$ResizeFront
19684 \begin_layout LyX-Code
19689 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
19692 \begin_layout LyX-Code
19693 $$ResizeBack$$RotateBack"
19696 \begin_layout LyX-Code
19697 UpdateFormat pdftex
19700 \begin_layout LyX-Code
19701 UpdateResult "$$AbsPath$$Basename.pdftex_t"
19704 \begin_layout LyX-Code
19705 Requirement "graphicx"
19708 \begin_layout LyX-Code
19709 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
19712 \begin_layout LyX-Code
19713 ReferencedFile latex "$$AbsPath$$Basename.pdf"
19716 \begin_layout LyX-Code
19720 \begin_layout LyX-Code
19724 \begin_layout LyX-Code
19725 Product "$$Contents(
19727 "$$AbsPath$$Basename.asc
19732 \begin_layout LyX-Code
19733 UpdateFormat asciixfig
19736 \begin_layout LyX-Code
19737 UpdateResult "$$AbsPath$$Basename.asc"
19740 \begin_layout LyX-Code
19744 \begin_layout LyX-Code
19748 \begin_layout LyX-Code
19749 Product "<graphic fileref=
19751 "$$AbsOrRelPathMaster$$Basename.eps
19756 \begin_layout LyX-Code
19760 \begin_layout LyX-Code
19764 \begin_layout LyX-Code
19765 UpdateResult "$$AbsPath$$Basename.eps"
19768 \begin_layout LyX-Code
19769 ReferencedFile docbook "$$AbsPath$$Basename.eps"
19772 \begin_layout LyX-Code
19773 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
19776 \begin_layout LyX-Code
19780 \begin_layout LyX-Code
19781 Product "[XFig: $$FName]"
19784 \begin_layout LyX-Code
19788 \begin_layout LyX-Code
19792 \begin_layout Standard
19793 As you can see, the template is enclosed in
19794 \begin_inset Flex Code
19797 \begin_layout Plain Layout
19803 \SpecialChar \ldots{}
19805 \begin_inset Flex Code
19808 \begin_layout Plain Layout
19815 It contains a header specifying some general settings and, for each supported
19816 primary document file format, a section
19817 \begin_inset Flex Code
19820 \begin_layout Plain Layout
19826 \SpecialChar \ldots{}
19828 \begin_inset Flex Code
19831 \begin_layout Plain Layout
19840 \begin_layout Subsection
19841 The template header
19844 \begin_layout Description
19845 \begin_inset Flex Code
19848 \begin_layout Plain Layout
19849 AutomaticProduction
19850 \begin_inset space ~
19858 Whether the file represented by the template must be generated by LyX.
19859 This command must occur exactly once.
19862 \begin_layout Description
19863 \begin_inset Flex Code
19866 \begin_layout Plain Layout
19868 \begin_inset space ~
19876 A glob pattern that is used in the file dialog to filter out the desired
19878 If there is more than one possible file extension (e.
19879 \begin_inset space \thinspace{}
19883 \begin_inset space \space{}
19887 \begin_inset Flex Code
19890 \begin_layout Plain Layout
19897 \begin_inset Flex Code
19900 \begin_layout Plain Layout
19906 ), use something like
19907 \begin_inset Flex Code
19910 \begin_layout Plain Layout
19917 This command must occur exactly once.
19920 \begin_layout Description
19921 \begin_inset Flex Code
19924 \begin_layout Plain Layout
19926 \begin_inset space ~
19934 The text that is displayed on the button.
19935 This command must occur exactly once.
19938 \begin_layout Description
19939 \begin_inset Flex Code
19942 \begin_layout Plain Layout
19944 \begin_inset space ~
19948 \begin_inset space ~
19956 The help text that is used in the External dialog.
19957 Provide enough information to explain to the user just what the template
19958 can provide him with.
19959 This command must occur exactly once.
19962 \begin_layout Description
19963 \begin_inset Flex Code
19966 \begin_layout Plain Layout
19968 \begin_inset space ~
19976 The file format of the original file.
19977 This must be the name of a format that is known to LyX (see section
19978 \begin_inset space ~
19982 \begin_inset CommandInset ref
19984 reference "sec:Formats"
19990 \begin_inset Quotes eld
19994 \begin_inset Flex Code
19997 \begin_layout Plain Layout
20004 \begin_inset Quotes erd
20007 if the template can handle original files of more than one format.
20008 LyX will attempt to interrogate the file itself in order to deduce its
20009 format in this case.
20010 This command must occur exactly once.
20013 \begin_layout Description
20014 \begin_inset Flex Code
20017 \begin_layout Plain Layout
20019 \begin_inset space ~
20027 A unique name for the template.
20028 It must not contain substitution macros (see below).
20031 \begin_layout Description
20032 \begin_inset Flex Code
20035 \begin_layout Plain Layout
20037 \begin_inset space ~
20040 Rotate|Resize|Clip|Extra
20045 This command specifies which transformations are supported by this template.
20046 It may occur zero or more times.
20047 This command enables the corresponding tabs in the external dialog.
20049 \begin_inset Flex Code
20052 \begin_layout Plain Layout
20058 command must have either a corresponding
20059 \begin_inset Flex Code
20062 \begin_layout Plain Layout
20069 \begin_inset Flex Code
20072 \begin_layout Plain Layout
20079 \begin_inset Flex Code
20082 \begin_layout Plain Layout
20089 Otherwise the transformation will not be supported by that format.
20092 \begin_layout Subsection
20096 \begin_layout Description
20097 \begin_inset Flex Code
20100 \begin_layout Plain Layout
20102 \begin_inset space ~
20105 LaTeX|PDFLaTeX|PlainText|DocBook
20110 The primary document file format that this format definition is for.
20111 Not every template has a sensible representation in all document file formats.
20112 Please define nevertheless a
20113 \begin_inset Flex Code
20116 \begin_layout Plain Layout
20122 section for all templates.
20123 Use a dummy text when no representation is available.
20124 Then you can at least see a reference to the external material in the exported
20128 \begin_layout Description
20129 \begin_inset Flex Code
20132 \begin_layout Plain Layout
20134 \begin_inset space ~
20138 \begin_inset space ~
20146 This command defines an additional macro
20147 \begin_inset Flex Code
20150 \begin_layout Plain Layout
20156 for substitution in
20157 \begin_inset Flex Code
20160 \begin_layout Plain Layout
20168 \begin_inset Flex Code
20171 \begin_layout Plain Layout
20177 itself may contain substitution macros.
20178 The advantage over using
20179 \begin_inset Flex Code
20182 \begin_layout Plain Layout
20189 \begin_inset Flex Code
20192 \begin_layout Plain Layout
20198 is that the substituted value of
20199 \begin_inset Flex Code
20202 \begin_layout Plain Layout
20208 is sanitized so that it is a valid optional argument in the document format.
20209 This command may occur zero or more times.
20212 \begin_layout Description
20213 \begin_inset Flex Code
20216 \begin_layout Plain Layout
20218 \begin_inset space ~
20226 The text that is inserted in the exported document.
20227 This is actually the most important command and can be quite complex.
20228 This command must occur exactly once.
20231 \begin_layout Description
20232 \begin_inset Flex Code
20235 \begin_layout Plain Layout
20237 \begin_inset space ~
20245 This command specifies a preamble snippet that will be included in the
20247 It has to be defined using
20248 \begin_inset Flex Code
20251 \begin_layout Plain Layout
20257 \SpecialChar \ldots{}
20259 \begin_inset Flex Code
20262 \begin_layout Plain Layout
20269 This command may occur zero or more times.
20272 \begin_layout Description
20273 \begin_inset Flex Code
20276 \begin_layout Plain Layout
20278 \begin_inset space ~
20282 \begin_inset space ~
20290 This command denotes files that are created by the conversion process and
20291 are needed for a particular export format.
20292 If the filename is relative, it is interpreted relative to the master document.
20293 This command may be given zero or more times.
20296 \begin_layout Description
20297 \begin_inset Flex Code
20300 \begin_layout Plain Layout
20302 \begin_inset space ~
20310 The name of a required LaTeX package.
20311 The package is included via
20312 \begin_inset Flex Code
20315 \begin_layout Plain Layout
20323 in the LaTeX preamble.
20324 This command may occur zero or more times.
20327 \begin_layout Description
20328 \begin_inset Flex Code
20331 \begin_layout Plain Layout
20333 \begin_inset space ~
20337 \begin_inset space ~
20340 RotationLatexCommand
20345 This command specifies that the built in LaTeX command should be used for
20347 This command may occur once or not at all.
20350 \begin_layout Description
20351 \begin_inset Flex Code
20354 \begin_layout Plain Layout
20356 \begin_inset space ~
20360 \begin_inset space ~
20368 This command specifies that the built in LaTeX command should be used for
20370 This command may occur once or not at all.
20373 \begin_layout Description
20374 \begin_inset Flex Code
20377 \begin_layout Plain Layout
20379 \begin_inset space ~
20383 \begin_inset space ~
20386 RotationLatexOption
20391 This command specifies that rotation is done via an optional argument.
20392 This command may occur once or not at all.
20395 \begin_layout Description
20396 \begin_inset Flex Code
20399 \begin_layout Plain Layout
20401 \begin_inset space ~
20405 \begin_inset space ~
20413 This command specifies that resizing is done via an optional argument.
20414 This command may occur once or not at all.
20417 \begin_layout Description
20418 \begin_inset Flex Code
20421 \begin_layout Plain Layout
20423 \begin_inset space ~
20427 \begin_inset space ~
20435 This command specifies that clipping is done via an optional argument.
20436 This command may occur once or not at all.
20439 \begin_layout Description
20440 \begin_inset Flex Code
20443 \begin_layout Plain Layout
20445 \begin_inset space ~
20449 \begin_inset space ~
20457 This command specifies that an extra optional argument is used.
20458 This command may occur once or not at all.
20461 \begin_layout Description
20462 \begin_inset Flex Code
20465 \begin_layout Plain Layout
20467 \begin_inset space ~
20475 The file format of the converted file.
20476 This must be the name of a format that is known to LyX (see the
20477 \begin_inset Flex MenuItem
20480 \begin_layout Plain Layout
20485 ools\SpecialChar \menuseparator
20490 references\SpecialChar \menuseparator
20491 File Handling\SpecialChar \menuseparator
20498 This command must occur exactly once.
20501 \begin_layout Description
20502 \begin_inset Flex Code
20505 \begin_layout Plain Layout
20507 \begin_inset space ~
20515 The file name of the converted file.
20516 The file name must be absolute.
20517 This command must occur exactly once.
20520 \begin_layout Subsection
20521 Preamble definitions
20524 \begin_layout Standard
20525 The external template configuration file may contain additional preamble
20526 definitions enclosed by
20527 \begin_inset Flex Code
20530 \begin_layout Plain Layout
20536 \SpecialChar \ldots{}
20538 \begin_inset Flex Code
20541 \begin_layout Plain Layout
20548 They can be used by the templates in the
20549 \begin_inset Flex Code
20552 \begin_layout Plain Layout
20561 \begin_layout Section
20562 The substitution mechanism
20565 \begin_layout Standard
20566 When the external material facility invokes an external program, it is done
20567 on the basis of a command defined in the template configuration file.
20568 These commands can contain various macros that are expanded before execution.
20569 Execution always take place in the directory of the containing document.
20572 \begin_layout Standard
20573 Also, whenever external material is to be displayed, the name will be produced
20574 by the substitution mechanism, and most other commands in the template
20575 definition support substitution as well.
20578 \begin_layout Standard
20579 The available macros are the following:
20582 \begin_layout Description
20583 \begin_inset Flex Code
20586 \begin_layout Plain Layout
20587 $$AbsOrRelPathMaster
20592 The file path, absolute or relative to the master LyX document.
20595 \begin_layout Description
20596 \begin_inset Flex Code
20599 \begin_layout Plain Layout
20600 $$AbsOrRelPathParent
20605 The file path, absolute or relative to the LyX document.
20608 \begin_layout Description
20609 \begin_inset Flex Code
20612 \begin_layout Plain Layout
20618 The absolute file path.
20621 \begin_layout Description
20622 \begin_inset Flex Code
20625 \begin_layout Plain Layout
20631 The filename without path and without the extension.
20634 \begin_layout Description
20635 \begin_inset Flex Code
20638 \begin_layout Plain Layout
20640 \begin_inset Quotes eld
20644 \begin_inset Quotes erd
20652 This macro will expand to the contents of the file with the name
20653 \begin_inset Flex Code
20656 \begin_layout Plain Layout
20665 \begin_layout Description
20666 \begin_inset Flex Code
20669 \begin_layout Plain Layout
20675 The file extension (including the dot).
20678 \begin_layout Description
20679 \begin_inset Flex Code
20682 \begin_layout Plain Layout
20688 The filename of the file specified in the external material dialog.
20689 This is either an absolute name, or it is relative to the LyX document.
20692 \begin_layout Description
20693 \begin_inset Flex Code
20696 \begin_layout Plain Layout
20703 \begin_inset Flex Code
20706 \begin_layout Plain Layout
20712 (absolute name or relative to the LyX document).
20715 \begin_layout Description
20716 \begin_inset Flex Code
20719 \begin_layout Plain Layout
20725 The file path, relative to the master LyX document.
20728 \begin_layout Description
20729 \begin_inset Flex Code
20732 \begin_layout Plain Layout
20738 The file path, relative to the LyX document.
20741 \begin_layout Description
20742 \begin_inset Flex Code
20745 \begin_layout Plain Layout
20751 This macro will expand to the absolute path of the system directory.
20752 This is typically used to point to the various helper scripts that are
20756 \begin_layout Description
20757 \begin_inset Flex Code
20760 \begin_layout Plain Layout
20766 A name and full path to a temporary file which will be automatically deleted
20767 whenever the containing document is closed, or the external material insertion
20771 \begin_layout Standard
20772 All path macros contain a trailing directory separator, so you can construct
20774 \begin_inset space \thinspace{}
20778 \begin_inset space \space{}
20781 the absolute filename with
20782 \begin_inset Flex Code
20785 \begin_layout Plain Layout
20786 $$AbsPath$$Basename$$Extension
20794 \begin_layout Standard
20795 The macros above are substituted in all commands unless otherwise noted.
20797 \begin_inset Flex Code
20800 \begin_layout Plain Layout
20806 supports additionally the following substitutions if they are enabled by
20808 \begin_inset Flex Code
20811 \begin_layout Plain Layout
20818 \begin_inset Flex Code
20821 \begin_layout Plain Layout
20830 \begin_layout Description
20831 \begin_inset Flex Code
20834 \begin_layout Plain Layout
20840 The front part of the resize command.
20843 \begin_layout Description
20844 \begin_inset Flex Code
20847 \begin_layout Plain Layout
20853 The back part of the resize command.
20856 \begin_layout Description
20857 \begin_inset Flex Code
20860 \begin_layout Plain Layout
20866 The front part of the rotation command.
20869 \begin_layout Description
20870 \begin_inset Flex Code
20873 \begin_layout Plain Layout
20879 The back part of the rotation command.
20882 \begin_layout Standard
20883 The value string of the
20884 \begin_inset Flex Code
20887 \begin_layout Plain Layout
20893 command supports additionally the following substitutions if they are enabled
20895 \begin_inset Flex Code
20898 \begin_layout Plain Layout
20905 \begin_inset Flex Code
20908 \begin_layout Plain Layout
20917 \begin_layout Description
20918 \begin_inset Flex Code
20921 \begin_layout Plain Layout
20930 \begin_layout Description
20931 \begin_inset Flex Code
20934 \begin_layout Plain Layout
20943 \begin_layout Description
20944 \begin_inset Flex Code
20947 \begin_layout Plain Layout
20956 \begin_layout Description
20957 \begin_inset Flex Code
20960 \begin_layout Plain Layout
20966 The rotation option.
20969 \begin_layout Standard
20970 You may ask why there are so many path macros.
20971 There are mainly two reasons:
20974 \begin_layout Enumerate
20975 Relative and absolute file names should remain relative or absolute, respectivel
20977 Users may have reasons to prefer either form.
20978 Relative names are useful for portable documents that should work on different
20979 machines, for example.
20980 Absolute names may be required by some programs.
20983 \begin_layout Enumerate
20984 LaTeX treats relative file names differently than LyX and other programs
20985 in nested included files.
20986 For LyX, a relative file name is always relative to the document that contains
20988 For LaTeX, it is always relative to the master document.
20989 These two definitions are identical if you have only one document, but
20990 differ if you have a master document that includes part documents.
20991 That means that relative filenames must be transformed when presented to
20993 Fortunately LyX does this automatically for you if you choose the right
20997 \begin_layout Standard
20998 So which path macro should be used in new template definitions? The rule
21002 \begin_layout Itemize
21004 \begin_inset Flex Code
21007 \begin_layout Plain Layout
21013 if an absolute path is required.
21016 \begin_layout Itemize
21018 \begin_inset Flex Code
21021 \begin_layout Plain Layout
21022 $$AbsOrRelPathMaster
21027 if the substituted string is some kind of LaTeX input.
21030 \begin_layout Itemize
21032 \begin_inset Flex Code
21035 \begin_layout Plain Layout
21036 $$AbsOrRelPathParent
21041 in order to preserve the user's choice.
21044 \begin_layout Standard
21045 There are special cases where this rule does not work and e.
21046 \begin_inset space \thinspace{}
21050 \begin_inset space \space{}
21053 relative names are needed, but normally it will work just fine.
21054 One example for such a case is the command
21055 \begin_inset Flex Code
21058 \begin_layout Plain Layout
21059 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
21064 in the XFig template above: We can't use the absolute name because the
21066 \begin_inset Flex Code
21069 \begin_layout Plain Layout
21075 files needs the relative name in order to rewrite the file content.
21078 \begin_layout Section
21079 Security discussion
21080 \begin_inset CommandInset label
21082 name "sec:Security-discussion"
21089 \begin_layout Standard
21090 The external material feature interfaces with a lot of external programs
21091 and does so automatically, so we have to consider the security implications
21093 In particular, since you have the option of including your own filenames
21094 and/or parameter strings and those are expanded into a command, it seems
21095 that it would be possible to create a malicious document which executes
21096 arbitrary commands when a user views or prints the document.
21097 This is something we definitely want to avoid.
21100 \begin_layout Standard
21101 However, since the external program commands are specified in the template
21102 configuration file only, there are no security issues if LyX is properly
21103 configured with safe templates only.
21104 This is so because the external programs are invoked with the
21105 \begin_inset Flex Code
21108 \begin_layout Plain Layout
21114 -system call rather than the
21115 \begin_inset Flex Code
21118 \begin_layout Plain Layout
21124 system-call, so it's not possible to execute arbitrary commands from the
21125 filename or parameter section via the shell.
21128 \begin_layout Standard
21129 This also implies that you are restricted in what command strings you can
21130 use in the external material templates.
21131 In particular, pipes and redirection are not readily available.
21132 This has to be so if LyX should remain safe.
21133 If you want to use some of the shell features, you should write a safe
21134 script to do this in a controlled manner, and then invoke the script from
21135 the command string.
21139 \begin_layout Standard
21140 It is possible to design a template that interacts directly with the shell,
21141 but since this would allow a malicious user to execute arbitrary commands
21142 by writing clever filenames and/or parameters, we generally recommend that
21143 you only use safe scripts that work with the
21144 \begin_inset Flex Code
21147 \begin_layout Plain Layout
21153 system call in a controlled manner.
21154 Of course, for use in a controlled environment, it can be tempting to just
21155 fall back to use ordinary shell scripts.
21156 If you do so, be aware that you
21160 provide an easily exploitable security hole in your system.
21161 Of course it stands to reason that such unsafe templates will never be
21162 included in the standard LyX distribution, although we do encourage people
21163 to submit new templates in the open source tradition.
21164 But LyX as shipped from the official distribution channels will never have
21168 \begin_layout Standard
21169 Including external material provides a lot of power, and you have to be
21170 careful not to introduce security hazards with this power.
21171 A subtle error in a single line in an innocent looking script can open
21172 the door to huge security problems.
21173 So if you do not fully understand the issues, we recommend that you consult
21174 a knowledgeable security professional or the LyX development team if you
21175 have any questions about whether a given template is safe or not.
21176 And do this before you use it in an uncontrolled environment.