1 #LyX 2.0 created this file. For more info see http://www.lyx.org/
7 % DO NOT ALTER THIS PREAMBLE!!!
9 % This preamble is designed to ensure that this document prints
10 % out as advertised. If you mess with this preamble,
11 % parts of this document may not print out as expected. If you
12 % have problems LaTeXing this file, please contact
13 % the documentation team
14 % email: lyx-docs@lists.lyx.org
16 \usepackage{ifpdf} % part of the hyperref bundle
17 \ifpdf % if pdflatex is used
19 % set fonts for nicer pdf view
20 \IfFileExists{lmodern.sty}
21 {\usepackage{lmodern}}{}
23 \fi % end if pdflatex is used
25 % the pages of the TOC is numbered roman
26 % and a pdf-bookmark for the TOC is added
27 \let\myTOC\tableofcontents
28 \renewcommand\tableofcontents{%
30 \pdfbookmark[1]{\contentsname}{}
34 % redefine the \LyX macro for PDF bookmarks
35 \def\LyX{\texorpdfstring{%
36 L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
39 % used for multi-column text
42 \options fleqn,bibliography=totoc,index=totoc,BCOR7.5mm,titlepage,captions=tableheading
43 \use_default_options false
47 \maintain_unincluded_children false
50 InsetLayout CharStyle:MenuItem
59 \newcommand*{\menuitem}[1]{{\sffamily #1}}
62 # In case we need to do with sans...
63 #InsetLayout CharStyle:Code
68 #\renewcommand{\code}[1]{{\sffamily #1}}
73 \language_package default
78 \font_typewriter default
79 \font_default_family default
80 \use_non_tex_fonts false
87 \default_output_format default
89 \bibtex_command default
90 \index_command default
94 \pdf_title "LyX Configuration Manual"
95 \pdf_author "LyX Team"
96 \pdf_subject "LyX-documentation Customization"
97 \pdf_keywords "LyX, documentation, customization"
99 \pdf_bookmarksnumbered true
100 \pdf_bookmarksopen true
101 \pdf_bookmarksopenlevel 1
102 \pdf_breaklinks false
106 \pdf_pdfusetitle false
107 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true, pdfstartview=XYZ, plainpages=false"
117 \paperorientation portrait
131 \paragraph_separation indent
132 \paragraph_indentation default
133 \quotes_language english
136 \paperpagestyle headings
137 \tracking_changes false
138 \output_changes false
142 \author 34634807 "Jean-Pierre"
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.
991 \begin_layout Section
992 Your local configuration directory
995 \begin_layout Standard
996 Even if you are using LyX as an unprivileged user, you might want to change
997 LyX configuration for your own use.
999 \begin_inset Flex Code
1002 \begin_layout Plain Layout
1008 directory contains all your personal configuration files.
1009 This is the directory described as
1010 \begin_inset Quotes eld
1014 \begin_inset Quotes erd
1018 \begin_inset Flex MenuItem
1021 \begin_layout Plain Layout
1022 Help\SpecialChar \menuseparator
1024 \begin_inset space ~
1033 This directory is used as a mirror of
1034 \begin_inset Flex Code
1037 \begin_layout Plain Layout
1043 , which means that every file in
1044 \begin_inset Flex Code
1047 \begin_layout Plain Layout
1053 is a replacement for the corresponding file in
1054 \begin_inset Flex Code
1057 \begin_layout Plain Layout
1064 Any configuration file described in the above sections can be placed either
1065 in the system-wide directory, in which case it will affect all users, or
1066 in your local directory for your own use.
1069 \begin_layout Standard
1070 To make things clearer, let's provide a few examples:
1073 \begin_layout Itemize
1074 The preferences set in the
1075 \begin_inset Flex MenuItem
1078 \begin_layout Plain Layout
1079 Tools\SpecialChar \menuseparator
1085 dialog are saved to a file
1086 \begin_inset Flex Code
1089 \begin_layout Plain Layout
1096 \begin_inset Flex Code
1099 \begin_layout Plain Layout
1108 \begin_layout Itemize
1109 When you reconfigure using
1110 \begin_inset Flex MenuItem
1113 \begin_layout Plain Layout
1114 Tools\SpecialChar \menuseparator
1121 \begin_inset Flex Code
1124 \begin_layout Plain Layout
1130 script, and the resulting files are written in your local configuration
1132 This means that any additional text class file that you might have added
1134 \begin_inset Flex Code
1137 \begin_layout Plain Layout
1143 will be added to the list of classes in the
1144 \begin_inset Flex MenuItem
1147 \begin_layout Plain Layout
1148 Document\SpecialChar \menuseparator
1157 \begin_layout Itemize
1158 If you get some updated documentation from LyX ftp site and cannot install
1159 it because you do not have sysadmin rights on your system, you can just
1161 \begin_inset Flex Code
1164 \begin_layout Plain Layout
1170 and the items in the
1171 \begin_inset Flex MenuItem
1174 \begin_layout Plain Layout
1180 menu will open them!
1183 \begin_layout Section
1184 Running LyX with multiple configurations
1187 \begin_layout Standard
1188 The configuration freedom of the local configuration directory may not suffice
1189 if you want to have more than one configuration at your disposal.
1190 For example, you may want to be use different key bindings or printer settings
1192 You can achieve this by having several such directories.
1193 You then specify which directory to use at run-time.
1196 \begin_layout Standard
1197 Invoking LyX with the command line switch
1198 \begin_inset Flex Code
1201 \begin_layout Plain Layout
1211 instructs the program to read the configuration from that directory, and
1212 not from the default directory.
1213 (You can determine the default directory by running LyX without the
1214 \begin_inset Flex Code
1217 \begin_layout Plain Layout
1223 switch.) If the specified directory does not exist, LyX offers to create
1224 it for you, just like it does for the default directory on the first time
1225 you run the program.
1226 You can modify the configuration options in this additional user directory
1227 exactly as you would for the default directory.
1228 These directories are completely independent (but read on).
1229 Note that setting the environment variable
1230 \begin_inset Flex Code
1233 \begin_layout Plain Layout
1239 to some value has exactly the same effect.
1242 \begin_layout Standard
1243 Having several configurations also requires more maintenance: if you want
1244 to add a new layout to
1245 \begin_inset Flex Code
1248 \begin_layout Plain Layout
1254 which you want available from all your configurations, you must add it
1255 to each directory separately.
1256 You can avoid this with the following trick: after LyX creates the additional
1257 directory, most of the subdirectories (see above) are empty.
1258 If you want the new configuration to mirror an existing one, replace the
1259 empty subdirectory with a symbolic link to the matching subdirectory in
1260 the existing configuration.
1262 \begin_inset Flex Code
1265 \begin_layout Plain Layout
1271 subdirectory, however, since it contains a file written by the configuration
1272 script (also accessible through
1273 \begin_inset Flex MenuItem
1276 \begin_layout Plain Layout
1277 Tools\SpecialChar \menuseparator
1283 ) which is configuration-specific.
1286 \begin_layout Chapter
1287 The Preferences dialog
1290 \begin_layout Standard
1291 All options of the preferences dialog are described in the Appendix
1293 The Preferences Dialog
1300 For some options you might find here more details.
1303 \begin_layout Section
1305 \begin_inset CommandInset label
1314 \begin_layout Standard
1315 The first step is to define your file formats if they are not already defined.
1317 \begin_inset Flex MenuItem
1320 \begin_layout Plain Layout
1321 Tools\SpecialChar \menuseparator
1329 \begin_inset Flex MenuItem
1332 \begin_layout Plain Layout
1333 File Handling\SpecialChar \menuseparator
1340 \begin_inset Flex MenuItem
1343 \begin_layout Plain Layout
1344 New\SpecialChar \ldots{}
1350 button to define your new format.
1352 \begin_inset Flex MenuItem
1355 \begin_layout Plain Layout
1361 field contains the name used to identify the format in the GUI.
1363 \begin_inset Flex MenuItem
1366 \begin_layout Plain Layout
1372 is used to identify the format internally.
1373 You will also need to enter a file extension.
1374 These are all required.
1376 \begin_inset Flex MenuItem
1379 \begin_layout Plain Layout
1385 field is used to provide a keyboard shortcut on the menus.
1386 (For example, pressing
1387 \begin_inset Flex MenuItem
1390 \begin_layout Plain Layout
1397 \begin_inset Flex MenuItem
1400 \begin_layout Plain Layout
1401 View\SpecialChar \menuseparator
1402 View (Other Formats)\SpecialChar \menuseparator
1411 \begin_layout Standard
1413 \begin_inset Flex MenuItem
1416 \begin_layout Plain Layout
1423 \begin_inset Flex MenuItem
1426 \begin_layout Plain Layout
1433 For example, you might want to use
1434 \begin_inset Flex MenuItem
1437 \begin_layout Plain Layout
1443 to view PostScript files.
1444 You can enter the command needed to start the program in the corresponding
1446 In defining this command, you can use the four variables listed in the
1448 The viewer is launched when you view an image in LyX or use the
1449 \begin_inset Flex MenuItem
1452 \begin_layout Plain Layout
1459 The editor is for example launched when you right-click on an image and
1461 \begin_inset Flex MenuItem
1464 \begin_layout Plain Layout
1470 in the appearing context menu.
1473 \begin_layout Standard
1475 \begin_inset Flex MenuItem
1478 \begin_layout Plain Layout
1484 option tells LyX that a format is suitable for document export.
1485 If this is set and if a suitable conversion route exists (see sec.
1486 \begin_inset space \thinspace{}
1490 \begin_inset CommandInset ref
1492 reference "sec:Converters"
1496 ), the format will appear in the
1497 \begin_inset Flex MenuItem
1500 \begin_layout Plain Layout
1501 File\SpecialChar \menuseparator
1508 The format will also appear in the
1509 \begin_inset Flex MenuItem
1512 \begin_layout Plain Layout
1518 menu if a viewer is specified for the format.
1519 Pure image formats, such as
1520 \begin_inset Flex Code
1523 \begin_layout Plain Layout
1529 , should not use this option.
1530 Formats that can both represent vector graphics and documents like
1531 \begin_inset Flex Code
1534 \begin_layout Plain Layout
1543 \begin_layout Standard
1545 \begin_inset Flex MenuItem
1548 \begin_layout Plain Layout
1549 Vector graphics format
1554 tells LyX that a format can contain vector graphics.
1555 This information is used to determine the target format of included graphics
1557 \begin_inset Flex MenuItem
1560 \begin_layout Plain Layout
1567 Included graphics may need to be converted to either
1568 \begin_inset Flex MenuItem
1571 \begin_layout Plain Layout
1578 \begin_inset Flex MenuItem
1581 \begin_layout Plain Layout
1588 \begin_inset Flex MenuItem
1591 \begin_layout Plain Layout
1598 \begin_inset Flex MenuItem
1601 \begin_layout Plain Layout
1607 cannot handle other image formats.
1608 If an included graphic is not already in
1609 \begin_inset Flex MenuItem
1612 \begin_layout Plain Layout
1619 \begin_inset Flex MenuItem
1622 \begin_layout Plain Layout
1629 \begin_inset Flex MenuItem
1632 \begin_layout Plain Layout
1638 format, it is converted to
1639 \begin_inset Flex MenuItem
1642 \begin_layout Plain Layout
1648 if the vector format option is set, and otherwise to
1649 \begin_inset Flex MenuItem
1652 \begin_layout Plain Layout
1661 \begin_layout Section
1665 \begin_layout Standard
1666 Since all conversions from one format to another take place in LyX's temporary
1667 directory, it is sometimes necessary to modify a file before copying it
1668 to the temporary directory in order that the conversion may be performed.
1672 \begin_layout Plain Layout
1673 For example, the file may refer to other files—images, for example—using
1674 relative file names, and these may become invalid when the file is copied
1675 to the temporary directory.
1680 This is done by a Copier: It copies a file to (or from) the temporary directory
1681 and may modify it in the process.
1684 \begin_layout Standard
1685 The definitions of the copiers may use four variables:
1688 \begin_layout Labeling
1689 \labelwidthstring 00.00.0000
1690 \begin_inset Flex Code
1693 \begin_layout Plain Layout
1699 The LyX system directory (e.
1700 \begin_inset space \thinspace{}
1704 \begin_inset space \space{}
1708 \begin_inset Flex MenuItem
1711 \begin_layout Plain Layout
1720 \begin_layout Labeling
1721 \labelwidthstring 00.00.0000
1722 \begin_inset Flex Code
1725 \begin_layout Plain Layout
1734 \begin_layout Labeling
1735 \labelwidthstring 00.00.0000
1736 \begin_inset Flex Code
1739 \begin_layout Plain Layout
1748 \begin_layout Labeling
1749 \labelwidthstring 00.00.0000
1750 \begin_inset Flex Code
1753 \begin_layout Plain Layout
1762 \begin_layout Standard
1763 The latter should be the filename as it would be used in a LaTeX's
1770 It is relevant only when exporting files suitable for such inclusion.
1773 \begin_layout Standard
1774 Copiers can be used to do almost anything with output files.
1775 For example, suppose you want generated pdf files to be copied to a special
1777 \begin_inset Flex Code
1780 \begin_layout Plain Layout
1787 Then you could write a shell script such as this one:
1790 \begin_layout Standard
1791 \begin_inset listings
1795 \begin_layout Plain Layout
1800 \begin_layout Plain Layout
1805 \begin_layout Plain Layout
1807 TOFILE=`basename $2`
1810 \begin_layout Plain Layout
1812 cp $FROMFILE /home/you/pdf/$TOFILE
1817 Save it in your local LyX directory—say,
1818 \begin_inset Flex Code
1821 \begin_layout Plain Layout
1822 /home/you/.lyx/scripts/pdfcopier.sh
1827 —and make it executable, if you need to do so on your platform.
1829 \begin_inset Flex MenuItem
1832 \begin_layout Plain Layout
1833 Tools\SpecialChar \menuseparator
1839 dialog, select under
1840 \begin_inset Flex MenuItem
1843 \begin_layout Plain Layout
1844 File Handling\SpecialChar \menuseparator
1851 \begin_inset Flex MenuItem
1854 \begin_layout Plain Layout
1860 format—or one of the other pdf formats—and enter
1861 \begin_inset Flex Code
1864 \begin_layout Plain Layout
1865 pdfcopier.sh $$i $$o
1871 \begin_inset Flex MenuItem
1874 \begin_layout Plain Layout
1884 \begin_layout Standard
1885 Copiers are used by LyX in various of its own conversions.
1886 For example, if appropriate programs are found, LyX will automatically
1887 install copiers for the
1888 \begin_inset Flex MenuItem
1891 \begin_layout Plain Layout
1898 \begin_inset Flex MenuItem
1901 \begin_layout Plain Layout
1903 \begin_inset space ~
1912 When these formats are exported, the copier sees that not just the main
1913 HTML file but various associated files (style files, images, etc.) are also
1915 All these files are written to a subdirectory of the directory in which
1916 the original LyX file was found.
1920 \begin_layout Plain Layout
1921 This copier can be customized.
1923 \begin_inset Quotes eld
1927 \begin_inset Quotes erd
1930 argument takes a comma-separated list of extensions to be copied; if it
1931 is omitted, all files will be copied.
1933 \begin_inset Quotes eld
1937 \begin_inset Quotes erd
1940 argument determines the extension added to the generated directory.
1942 \begin_inset Quotes eld
1946 \begin_inset Flex MenuItem
1949 \begin_layout Plain Layout
1956 \begin_inset Quotes erd
1959 , so HTML generated from
1960 \begin_inset Flex MenuItem
1963 \begin_layout Plain Layout
1964 /path/to/filename.lyx
1970 \begin_inset Flex MenuItem
1973 \begin_layout Plain Layout
1974 /path/to/filename.html.LyXconv
1988 \begin_layout Section
1990 \begin_inset CommandInset label
1992 name "sec:Converters"
1999 \begin_layout Standard
2000 You can define your own Converters to convert files between different formats.
2002 \begin_inset Flex MenuItem
2005 \begin_layout Plain Layout
2006 Tools\SpecialChar \menuseparator
2007 Preferences\SpecialChar \menuseparator
2008 File Handling\SpecialChar \menuseparator
2017 \begin_layout Standard
2018 To define a new converter, select the
2019 \begin_inset Flex MenuItem
2022 \begin_layout Plain Layout
2024 \begin_inset space ~
2033 \begin_inset Flex MenuItem
2036 \begin_layout Plain Layout
2038 \begin_inset space ~
2046 from the drop-down lists, enter the command needed for the conversion,
2048 \begin_inset Flex MenuItem
2051 \begin_layout Plain Layout
2058 Several variables can be used in the definition of converters:
2061 \begin_layout Labeling
2062 \labelwidthstring 00.00.0000
2063 \begin_inset Flex Code
2066 \begin_layout Plain Layout
2072 The LyX system directory
2075 \begin_layout Labeling
2076 \labelwidthstring 00.00.0000
2077 \begin_inset Flex Code
2080 \begin_layout Plain Layout
2089 \begin_layout Labeling
2090 \labelwidthstring 00.00.0000
2091 \begin_inset Flex Code
2094 \begin_layout Plain Layout
2103 \begin_layout Labeling
2104 \labelwidthstring 00.00.0000
2105 \begin_inset Flex Code
2108 \begin_layout Plain Layout
2114 The base filename of the input file (i.
2115 \begin_inset space \thinspace{}
2118 g., without the extension)
2121 \begin_layout Labeling
2122 \labelwidthstring 00.00.0000
2123 \begin_inset Flex Code
2126 \begin_layout Plain Layout
2132 The path to the input file
2135 \begin_layout Labeling
2136 \labelwidthstring 00.00.0000
2137 \begin_inset Flex Code
2140 \begin_layout Plain Layout
2146 The path to the original input file (this is different from $$p when a
2147 chain of converters is called)
2150 \begin_layout Labeling
2151 \labelwidthstring 00.00.0000
2152 \begin_inset Flex Code
2155 \begin_layout Plain Layout
2161 The iconv name for the encoding of the document.
2164 \begin_layout Standard
2166 \begin_inset Flex MenuItem
2169 \begin_layout Plain Layout
2171 \begin_inset space ~
2179 field you can enter the following flags, separated by commas:
2182 \begin_layout Labeling
2183 \labelwidthstring 00.00.0000
2184 \begin_inset Flex Code
2187 \begin_layout Plain Layout
2193 This converter runs some form of LaTeX.
2194 This will make LyX's LaTeX error logs available.
2197 \begin_layout Labeling
2198 \labelwidthstring 00.00.0000
2199 \begin_inset Flex Code
2202 \begin_layout Plain Layout
2209 \begin_inset Flex MenuItem
2212 \begin_layout Plain Layout
2218 file for the conversion.
2221 \begin_layout Labeling
2222 \labelwidthstring 00.00.0000
2223 \begin_inset Flex Code
2226 \begin_layout Plain Layout
2235 \begin_layout Standard
2236 The following three flags are not really flags at all because they take
2238 \begin_inset Flex MenuItem
2241 \begin_layout Plain Layout
2243 \begin_inset space ~
2247 \begin_inset space ~
2258 \begin_layout Labeling
2259 \labelwidthstring 00.00.0000
2260 \begin_inset Flex Code
2263 \begin_layout Plain Layout
2269 If set, the converter's standard error will be redirected to a file
2270 \begin_inset Flex Code
2273 \begin_layout Plain Layout
2279 , and the script given as argument will be run as:
2280 \begin_inset Flex Code
2283 \begin_layout Plain Layout
2284 script < infile.out > infile.log
2290 The argument may contain
2291 \begin_inset Flex Code
2294 \begin_layout Plain Layout
2303 \begin_layout Labeling
2304 \labelwidthstring 00.00.0000
2305 \begin_inset Flex Code
2308 \begin_layout Plain Layout
2314 The name of the directory in which the converter will dump the generated
2316 LyX will not create this directory, and it does not copy anything into
2317 it, though it will copy this directory to the destination.
2318 The argument may contain
2319 \begin_inset Flex Code
2322 \begin_layout Plain Layout
2328 , which will be replaced by the base name of the input and output files,
2329 respectively, when the directory is copied.
2330 \begin_inset Newline newline
2333 Note that resultdir and usetempdir make no sense together.
2334 The latter will be ignored if the former is given.
2337 \begin_layout Labeling
2338 \labelwidthstring 00.00.0000
2339 \begin_inset Flex Code
2342 \begin_layout Plain Layout
2348 Determines the output file name and may, contain
2349 \begin_inset Flex Code
2352 \begin_layout Plain Layout
2359 Sensible only with resultdir and optional even then; if not given, it defaults
2363 \begin_layout Standard
2364 None of these last three are presently used in any of the converters that
2365 are installed with LyX.
2369 \begin_layout Standard
2370 You do not have to define converters for all formats between which you want
2372 For example, you will note that there is no `LyX to PostScript' converter,
2373 but LyX will export PostScript.
2374 It does so by first creating a LaTeX file (no converter needs to be defined
2375 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2376 and finally converting the resulting DVI file to PostScript.
2377 LyX finds such `chains' of converters automatically, and it will always
2378 choose the shortest possible chain.
2379 You can, though, still define multiple conversion methods between file
2381 For example, the standard LyX configuration provides three ways to convert
2382 LaTeX to PDF: Directly, using
2383 \begin_inset Flex MenuItem
2386 \begin_layout Plain Layout
2392 ; via (DVI and) PostScript, using
2393 \begin_inset Flex MenuItem
2396 \begin_layout Plain Layout
2403 \begin_inset Flex MenuItem
2406 \begin_layout Plain Layout
2413 To define such alternate chains, you must define multiple target `file
2414 formats', as described in section
2415 \begin_inset CommandInset ref
2417 reference "sec:Formats"
2422 For example, in the standard configuration, the formats named
2423 \begin_inset Flex MenuItem
2426 \begin_layout Plain Layout
2433 \begin_inset Flex MenuItem
2436 \begin_layout Plain Layout
2443 \begin_inset Flex MenuItem
2446 \begin_layout Plain Layout
2452 are defined, all of which share the extension
2453 \begin_inset Flex MenuItem
2456 \begin_layout Plain Layout
2462 , and which correspond to the conversion methods just mentioned.
2465 \begin_layout Chapter
2466 Internationalizing LyX
2467 \begin_inset CommandInset label
2469 name "cha:Internationalizing-LyX"
2476 \begin_layout Standard
2477 LyX supports using a translated interface.
2478 Last time we checked, LyX provided text in thirty languages.
2479 The language of choice is called your
2484 (For further reading on locale settings, see also the documentation for
2485 locale that comes with your operating system.
2486 For Linux, the manual page for
2487 \begin_inset Flex Code
2490 \begin_layout Plain Layout
2496 could be a good place to start).
2499 \begin_layout Standard
2500 Notice that these translations will work, but do contain a few flaws.
2501 In particular, all dialogs have been designed with the English text in
2502 mind, which means that some of the translated text will be too large to
2503 fit within the space allocated.
2504 This is only a display problem and will not cause any harm.
2505 Also, you will find that some of the translations do not define shortcut
2506 keys for everything.
2507 Sometimes, there are simply not enough free letters to do it.
2508 Other times, the translator just hasn't got around to doing it yet.
2509 Our localization team, which you may wish to join,
2513 \begin_layout Plain Layout
2514 If you are a fluent speaker of a language other than English, joining these
2515 teams is a great way to give back to the LyX community!
2520 will of course try to fix these shortcomings in future versions of LyX.
2523 \begin_layout Section
2527 \begin_layout Subsection
2528 Translating the graphical user interface (text messages).
2531 \begin_layout Standard
2533 \begin_inset Flex Code
2536 \begin_layout Plain Layout
2542 library to handle the internationalization of the interface.
2543 To have LyX speak your favorite language in all menus and dialogs, you
2545 \begin_inset Flex Code
2548 \begin_layout Plain Layout
2554 -file for that language.
2555 When this is available, you'll have to generate a
2556 \begin_inset Flex Code
2559 \begin_layout Plain Layout
2565 -file from it and install the
2566 \begin_inset Flex Code
2569 \begin_layout Plain Layout
2576 The process of doing all of this is explained in the documentation for
2578 \begin_inset Flex Code
2581 \begin_layout Plain Layout
2588 It is possible to do this just for yourself, but if you're going to do
2589 it, you might as well share the results of your labors with the rest of
2591 Send a message to the LyX developers' list for more information about how
2595 \begin_layout Standard
2596 In short, this is what you should do (xx denotes the language code):
2599 \begin_layout Itemize
2600 Check out the LyX source code.
2602 \begin_inset CommandInset href
2604 name "information on the web"
2605 target "http://www.lyx.org/HowToUseSVN"
2612 \begin_layout Itemize
2614 \begin_inset Flex Code
2617 \begin_layout Plain Layout
2623 to the folder of the
2624 \begin_inset Flex Code
2627 \begin_layout Plain Layout
2635 \begin_inset Flex Code
2638 \begin_layout Plain Layout
2646 \begin_inset Flex Code
2649 \begin_layout Plain Layout
2655 doesn't exist anywhere, it can be remade with the console command
2656 \begin_inset Flex Code
2659 \begin_layout Plain Layout
2665 in that directory, or you can use an existing po-file for some other language
2669 \begin_layout Itemize
2671 \begin_inset Flex Code
2674 \begin_layout Plain Layout
2684 \begin_layout Plain Layout
2685 This is just a text file, so it can be edited in any text editor.
2686 But there are also specialized programs that support such editing, such
2691 (for all platforms) or
2700 contains a `mode' for editing
2701 \begin_inset Flex Code
2704 \begin_layout Plain Layout
2715 For some menu- and widget-labels, there are also shortcut keys that should
2717 Those keys are marked after a `|', and should be translated according to
2718 the words and phrases of the language.
2719 You should also fill also out the information at the beginning of the new
2721 \begin_inset Flex Code
2724 \begin_layout Plain Layout
2730 -file with your email-address, etc., so people know where to reach you with
2731 suggestions and entertaining flames.
2734 \begin_layout Standard
2735 If you are just doing this on your own, then:
2738 \begin_layout Itemize
2740 \begin_inset Flex Code
2743 \begin_layout Plain Layout
2750 This can be done with
2751 \begin_inset Flex Code
2754 \begin_layout Plain Layout
2755 msgfmt -o xx.mo < xx.po
2763 \begin_layout Itemize
2765 \begin_inset Flex Code
2768 \begin_layout Plain Layout
2774 -file to your locale-tree, at the correct directory for application messages
2779 xx, and under the name
2780 \begin_inset Flex Code
2783 \begin_layout Plain Layout
2790 \begin_inset space \thinspace{}
2794 \begin_inset space \space{}
2798 \begin_inset Flex Code
2801 \begin_layout Plain Layout
2802 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2812 \begin_layout Standard
2813 As said, however, it would be best if the new
2814 \begin_inset Flex Code
2817 \begin_layout Plain Layout
2823 -file could be added to the LyX distribution, so others can use it.
2824 Adding it involves making additional changes to LyX.
2825 So send an email to the developers' mailing list if you're interested in
2829 \begin_layout Subsubsection
2833 \begin_layout Standard
2834 Sometimes it turns out that one English message needs to be translated into
2835 different messages in the target language.
2836 One example is the message
2837 \begin_inset Flex Code
2840 \begin_layout Plain Layout
2846 which has the German translation
2854 , depending upon exactly what the English
2855 \begin_inset Quotes eld
2859 \begin_inset Quotes erd
2864 \begin_inset Flex Code
2867 \begin_layout Plain Layout
2873 does not handle such ambiguous translations.
2874 Therefore you have to add some context information to the message: Instead
2876 \begin_inset Flex Code
2879 \begin_layout Plain Layout
2886 \begin_inset Flex Code
2889 \begin_layout Plain Layout
2890 To[[as in 'From format x to format y']]
2896 \begin_inset Flex Code
2899 \begin_layout Plain Layout
2900 To[[as in 'From page x to page y']].
2905 Now the two occurrences of
2906 \begin_inset Flex Code
2909 \begin_layout Plain Layout
2916 \begin_inset Flex Code
2919 \begin_layout Plain Layout
2925 and can be translated correctly to
2936 \begin_layout Standard
2937 Of course the context information needs to be stripped off the original
2938 message when no translation is used.
2939 Therefore you have to put it in double square brackets at the end of the
2940 message (see the example above).
2941 The translation mechanism of LyX ensures that everything in double square
2942 brackets at the end of messages is removed before displaying the message.
2945 \begin_layout Subsection
2946 Translating the documentation.
2949 \begin_layout Standard
2950 The online documentation (in the
2951 \begin_inset Flex MenuItem
2954 \begin_layout Plain Layout
2960 -menu) can (and should!) be translated.
2961 If there are translated versions of the documentation available
2965 \begin_layout Plain Layout
2966 As of March 2008, at least some of the documents have been translated into
2967 fourteen languages, with the Tutorial available in a few more.
2972 and the locale is set accordingly, these will be used automagically by
2974 LyX looks for translated versions as
2975 \begin_inset Flex Code
2978 \begin_layout Plain Layout
2979 LyXDir/doc/xx/DocName.lyx
2985 \begin_inset Flex Code
2988 \begin_layout Plain Layout
2994 is the code for the language currently in use.
2995 If there are no translated documents, the default English versions will
2997 Note that the translated versions must have the same filenames (
2998 \begin_inset Flex Code
3001 \begin_layout Plain Layout
3007 above) as the original.
3008 If you feel up to translating the documentation (an excellent way to proof-read
3009 the original documentation by the way!), there are a few things you should
3013 \begin_layout Itemize
3014 Check out the documentation translation web page at
3015 \begin_inset CommandInset href
3017 name "http://www.lyx.org/Translation"
3018 target "http://www.lyx.org/Translation"
3023 That way, you can find out which (if any) documents have already been translate
3024 d into your language.
3025 You can also find out who (if anyone) is organizing the effort to translate
3026 the documentation into your language.
3027 If no one is organizing the effort, please let us know that you're interested.
3030 \begin_layout Standard
3031 Once you get to actually translating, here's a few hints for you that may
3035 \begin_layout Itemize
3036 Join the documentation team! There is information on how to do that in
3037 \begin_inset Flex Code
3040 \begin_layout Plain Layout
3047 \begin_inset Flex MenuItem
3050 \begin_layout Plain Layout
3051 Help\SpecialChar \menuseparator
3057 ), which by the way is the first document you should translate.
3060 \begin_layout Itemize
3061 Learn the typographic conventions for the language you are translating to.
3062 Typography is an ancient art and over the centuries, a great variety of
3063 conventions have developed throughout different parts of the world.
3064 Also study the professional terminology amongst typographers in your country.
3065 Inventing your own terminology will only confuse the users.
3068 (Warning! Typography is addictive!)
3071 \begin_layout Itemize
3072 Make a copy of the document.
3073 This will be your working copy.
3074 You can use this as your personal translated help-file by placing it in
3076 \begin_inset Flex Code
3079 \begin_layout Plain Layout
3088 \begin_layout Itemize
3089 Sometimes the original document (from the LyX-team) will be updated.
3090 Use the source viewer at
3091 \begin_inset CommandInset href
3093 name "http://www.lyx.org/trac/timeline"
3094 target "http://www.lyx.org/trac/timeline"
3098 to see what has been changed.
3099 That way you can easily see which parts of the translated document need
3103 \begin_layout Standard
3104 If you ever find an error in the original document, fix it and notify the
3105 rest of the documentation team of the changes! (You didn't forget to join
3106 the documentation team, did you?)
3109 \begin_layout Standard
3110 \begin_inset Branch OutDated
3113 \begin_layout Section
3114 International Keyboard Support
3117 \begin_layout Standard
3120 [Editor's Note: The following section is by
3128 It needs to be fixed to conform to the new Documentation Style sheet and
3129 to make use of the new v1.0 features.
3130 The whole thing also needs to be merged with the section following it.-jw
3131 It may also be badly out of date.-rh (2008)]
3134 \begin_layout Subsection
3135 Defining Own Keymaps: Keymap File Format
3138 \begin_layout Standard
3139 Let's look at a keyboard definition file a little closer.
3140 It is a plain text file defining
3143 \begin_layout Itemize
3144 key-to-key or key-to-string translations
3147 \begin_layout Itemize
3151 \begin_layout Itemize
3152 dead keys exceptions
3155 \begin_layout Standard
3156 To define key-to-key or key-to-string translation, use this command:
3159 \begin_layout Quotation
3160 \begin_inset Flex Code
3163 \begin_layout Plain Layout
3172 \begin_inset Flex Code
3175 \begin_layout Plain Layout
3184 \begin_layout Standard
3186 \begin_inset Flex Code
3189 \begin_layout Plain Layout
3195 is the key to be translated and
3196 \begin_inset Flex Code
3199 \begin_layout Plain Layout
3205 is the string to be inserted into the document.
3206 To define dead keys, use:
3209 \begin_layout Quotation
3210 \begin_inset Flex Code
3213 \begin_layout Plain Layout
3222 \begin_inset Flex Code
3225 \begin_layout Plain Layout
3234 \begin_layout Standard
3236 \begin_inset Flex Code
3239 \begin_layout Plain Layout
3245 is a keyboard key and
3246 \begin_inset Flex Code
3249 \begin_layout Plain Layout
3256 The following dead keys are supported (shortcut name is in parentheses):
3259 \begin_layout Quotation
3263 \begin_inset space \hfill{}
3269 \begin_layout Quotation
3271 \begin_inset space \hfill{}
3277 \begin_layout Quotation
3279 \begin_inset space \hfill{}
3285 \begin_layout Quotation
3287 \begin_inset space \hfill{}
3293 \begin_layout Quotation
3295 \begin_inset space \hfill{}
3301 \begin_layout Quotation
3303 \begin_inset space \hfill{}
3310 \begin_layout Plain Layout
3322 \begin_layout Quotation
3324 \begin_inset space \hfill{}
3330 \begin_layout Quotation
3332 \begin_inset space \hfill{}
3339 \begin_layout Plain Layout
3351 \begin_layout Quotation
3353 \begin_inset space \hfill{}
3359 \begin_layout Quotation
3361 \begin_inset space \hfill{}
3367 \begin_layout Quotation
3369 \begin_inset space \hfill{}
3376 \begin_layout Plain Layout
3388 \begin_layout Quotation
3390 \begin_inset space \hfill{}
3397 \begin_layout Plain Layout
3409 \begin_layout Quotation
3411 \begin_inset space \hfill{}
3417 \begin_layout Quotation
3418 hungarian umlaut (hug)
3419 \begin_inset space \hfill{}
3425 \begin_layout Quotation
3427 \begin_inset space \hfill{}
3433 \begin_layout Quotation
3435 \begin_inset space \hfill{}
3442 \begin_layout Plain Layout
3454 \begin_layout Standard
3455 Since in many international keyboards there are exceptions to what some
3456 dead keys should do, you can define them using
3459 \begin_layout Quotation
3460 \begin_inset Flex Code
3463 \begin_layout Plain Layout
3471 deadkey key outstring
3474 \begin_layout Standard
3475 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3479 \begin_layout Quotation
3480 \begin_inset Flex Code
3483 \begin_layout Plain Layout
3496 \begin_layout Standard
3497 to make it work correctly.
3498 Also, you have to define as exceptions dead keys over i and j, to remove
3499 the dot from them before inserting an accent mark.
3500 I will change this when the time comes, but so far I haven't had time.
3503 \begin_layout Standard
3504 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3507 \begin_inset Flex Code
3510 \begin_layout Plain Layout
3516 have different meaning.
3518 \begin_inset Flex Code
3521 \begin_layout Plain Layout
3527 marks comments, quotes start and end LaTeX-style commands.
3528 To enter quote, you'll need to use
3529 \begin_inset Flex Code
3532 \begin_layout Plain Layout
3541 \begin_inset Flex Code
3544 \begin_layout Plain Layout
3551 \begin_inset Flex Code
3554 \begin_layout Plain Layout
3565 \begin_layout Standard
3566 If you make a keyboard description file that works for your language, please
3567 mail it to me, so I can include it in the next keymap distribution.
3570 \begin_layout Standard
3571 More keywords will be supported in keymap configuration file in future,
3575 \begin_layout Itemize
3576 \begin_inset Flex Code
3579 \begin_layout Plain Layout
3590 \begin_inset space \hfill{}
3594 \begin_inset Flex Code
3597 \begin_layout Plain Layout
3606 \begin_layout Itemize
3607 \begin_inset Flex Code
3610 \begin_layout Plain Layout
3621 \begin_inset space \hfill{}
3625 \begin_inset Flex Code
3628 \begin_layout Plain Layout
3634 an external keymap translation program
3637 \begin_layout Standard
3638 Also, it should look into
3639 \begin_inset Flex Code
3642 \begin_layout Plain Layout
3648 file for defaults, too (for example, a
3649 \begin_inset Flex Code
3652 \begin_layout Plain Layout
3660 option to include default keyboard).
3668 \begin_layout Section
3669 International Keymap Stuff
3670 \begin_inset CommandInset label
3672 name "sec:International-Keymap-Stuff"
3679 \begin_layout Standard
3680 \begin_inset Note Note
3683 \begin_layout Plain Layout
3684 In doing the revisions on this document in March 2008, I did not look over
3685 this stuff, as I do not understand it.
3686 It would be good if someone else could do so.
3695 \begin_layout Standard
3696 The next two sections describe the
3697 \begin_inset Flex Code
3700 \begin_layout Plain Layout
3709 \begin_inset Flex Code
3712 \begin_layout Plain Layout
3720 file syntax in detail.
3721 These sections should help you design your own key map if the ones provided
3722 do not meet your needs.
3725 \begin_layout Subsection
3729 \begin_layout Standard
3733 \begin_inset Flex Code
3736 \begin_layout Plain Layout
3742 file maps keystrokes to characters or strings.
3743 As the name suggests, it sets a keyboard mapping.
3745 \begin_inset Flex Code
3748 \begin_layout Plain Layout
3759 \begin_inset Flex Code
3762 \begin_layout Plain Layout
3777 \begin_inset Flex Code
3780 \begin_layout Plain Layout
3793 \begin_inset Flex Code
3796 \begin_layout Plain Layout
3805 \begin_inset Flex Code
3808 \begin_layout Plain Layout
3816 are described in this section.
3819 \begin_layout Labeling
3820 \labelwidthstring 00.00.0000
3821 \begin_inset Flex Code
3824 \begin_layout Plain Layout
3832 Map a character to a string
3835 \begin_layout LyX-Code
3850 \begin_layout Standard
3883 the double-quote (")
3900 must be escaped with a preceding backslash (
3911 \begin_layout Standard
3913 \begin_inset Flex MenuItem
3916 \begin_layout Plain Layout
3924 statement to cause the symbol
3925 \begin_inset Flex MenuItem
3928 \begin_layout Plain Layout
3936 to be output for the keystroke
3937 \begin_inset Flex MenuItem
3940 \begin_layout Plain Layout
3951 \begin_layout LyX-Code
3957 \begin_layout Labeling
3958 \labelwidthstring 00.00.0000
3959 \begin_inset Flex Code
3962 \begin_layout Plain Layout
3970 Specify an accent character
3973 \begin_layout LyX-Code
3982 \begin_layout Standard
3983 This will make the cha
4021 This is the dead key
4025 \begin_layout Plain Layout
4032 refers to a key that does not produce a character by itself, but when followed
4033 with another key, produces the desired accent character.
4034 For example, a German characte
4036 r with an umlaut like
4046 can be produced in this manner.
4055 \begin_layout Standard
4068 and then another key not in
4085 followed by the other, not allowed key, as output.
4089 \begin_inset Flex MenuItem
4092 \begin_layout Plain Layout
4100 cancels a dead key, so if
4111 \begin_inset Flex MenuItem
4114 \begin_layout Plain Layout
4123 , the cursor will not go one position backwards but will instead cancel
4139 might have had on the next keystroke.
4143 \begin_layout Standard
4144 The following example specifies that the character ' is to be an acute accent,
4145 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4148 \begin_layout LyX-Code
4151 kmod ' acute aeiouAEIOU
4154 \begin_layout Labeling
4155 \labelwidthstring 00.00.0000
4156 \begin_inset Flex Code
4159 \begin_layout Plain Layout
4165 Specify an exception to the accent character
4168 \begin_layout LyX-Code
4177 \begin_layout Standard
4178 This defines an exce
4219 have been assigned a keystroke with a previous
4222 \begin_inset Flex Code
4225 \begin_layout Plain Layout
4249 must not belong in the
4296 If such a declaration does not exist in
4304 \begin_inset Flex Code
4307 \begin_layout Plain Layout
4341 \begin_inset Flex Code
4344 \begin_layout Plain Layout
4358 \begin_layout Standard
4359 The following command produces causes äi to be produced when you enter acute-i
4363 \begin_layout LyX-Code
4377 \begin_layout Labeling
4378 \labelwidthstring 00.00.0000
4379 \begin_inset Flex Code
4382 \begin_layout Plain Layout
4388 Combine two accent characters
4391 \begin_layout LyX-Code
4397 accent1 accent2 allowed
4400 \begin_layout Standard
4401 This one is getting pretty esoteric.
4402 It allows you to combine the effect
4458 \begin_inset Flex Code
4461 \begin_layout Plain Layout
4489 \begin_layout Standard
4490 Consider this example from the
4491 \begin_inset Flex Code
4494 \begin_layout Plain Layout
4505 \begin_layout LyX-Code
4508 kmod ; acute aeioyvhAEIOYVH
4512 kcomb acute umlaut iyIY
4515 \begin_layout Standard
4516 This allows you to press
4517 \begin_inset Flex MenuItem
4520 \begin_layout Plain Layout
4528 and get the effect of
4529 \begin_inset Flex Code
4532 \begin_layout Plain Layout
4551 in this case cancels the last dead key, so if you press
4552 \begin_inset Flex MenuItem
4555 \begin_layout Plain Layout
4564 \begin_inset Flex Code
4567 \begin_layout Plain Layout
4580 \begin_layout Subsection
4584 \begin_layout Standard
4586 \begin_inset Flex Code
4589 \begin_layout Plain Layout
4597 mapping is performed, a
4598 \begin_inset Flex Code
4601 \begin_layout Plain Layout
4611 file maps the strings that the symbols generate to characters in the current
4613 The LyX distribution currently includes at least the
4614 \begin_inset Flex Code
4617 \begin_layout Plain Layout
4626 \begin_inset Flex Code
4629 \begin_layout Plain Layout
4640 \begin_layout Standard
4642 \begin_inset Flex Code
4645 \begin_layout Plain Layout
4653 file is a sequence of declarations of the form
4656 \begin_layout LyX-Code
4669 \begin_layout Standard
4670 For example, in order to map
4671 \begin_inset Flex MenuItem
4674 \begin_layout Plain Layout
4684 to the corresponding character in the iso-8859-1 set (233), the following
4688 \begin_layout LyX-Code
4696 \begin_layout Standard
4698 \begin_inset Flex Code
4701 \begin_layout Plain Layout
4710 \begin_inset Flex Code
4713 \begin_layout Plain Layout
4731 the same character can apply to more than one string.
4733 \begin_inset Flex Code
4736 \begin_layout Plain Layout
4747 \begin_layout LyX-Code
4759 \begin_inset Newline newline
4775 \begin_layout Standard
4776 If LyX cannot find a mapping for the string produced by the keystroke or
4777 a deadkey sequence, it will check if it looks like an accented char and
4778 try to draw an accent over the character on screen.
4781 \begin_layout Subsection
4785 \begin_layout Standard
4786 There is a second way to add support for international characters through
4787 so-called dead-keys.
4788 A dead-key works in combination with a letter to produce an accented character.
4789 Here, we'll explain how to create a really simple dead-key to illustrate
4793 \begin_layout Standard
4794 Suppose you happen to need the circumflex character,
4795 \begin_inset Quotes eld
4799 \begin_inset Quotes erd
4804 \begin_inset Flex MenuItem
4807 \begin_layout Plain Layout
4814 \begin_inset space ~
4818 \begin_inset Flex MenuItem
4821 \begin_layout Plain Layout
4827 ] to the LyX command
4828 \begin_inset Flex Code
4831 \begin_layout Plain Layout
4838 \begin_inset Flex Code
4841 \begin_layout Plain Layout
4848 Now, whenever you type the
4849 \begin_inset Flex MenuItem
4852 \begin_layout Plain Layout
4858 -key followed by a letter, that letter will have a circumflex accent on
4860 For example, the sequence
4861 \begin_inset Quotes eld
4865 \begin_inset Flex MenuItem
4868 \begin_layout Plain Layout
4875 \begin_inset Quotes erd
4878 produces the letter:
4879 \begin_inset Quotes eld
4883 \begin_inset Quotes erd
4887 If you tried to type
4888 \begin_inset Quotes eld
4892 \begin_inset Flex MenuItem
4895 \begin_layout Plain Layout
4902 \begin_inset Quotes erd
4905 , however, LyX will complain with a beep, since a
4906 \begin_inset Quotes eld
4910 \begin_inset Flex MenuItem
4913 \begin_layout Plain Layout
4920 \begin_inset Quotes erd
4923 never takes a circumflex accent.
4925 \begin_inset Flex MenuItem
4928 \begin_layout Plain Layout
4934 after a dead-key produces the bare-accent.
4935 Please note this last point! If you bind a key to a dead-key, you'll need
4936 to rebind the character on that key to yet another key.
4938 \begin_inset Flex MenuItem
4941 \begin_layout Plain Layout
4947 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
4950 \begin_layout Standard
4951 One common way to bind dead-keys is to use
4952 \begin_inset Flex MenuItem
4955 \begin_layout Plain Layout
4962 \begin_inset Flex MenuItem
4965 \begin_layout Plain Layout
4972 \begin_inset Flex MenuItem
4975 \begin_layout Plain Layout
4981 in combination with an accent, like
4982 \begin_inset Quotes eld
4986 \begin_inset Flex MenuItem
4989 \begin_layout Plain Layout
4996 \begin_inset Quotes erd
5000 \begin_inset Quotes eld
5004 \begin_inset Flex MenuItem
5007 \begin_layout Plain Layout
5014 \begin_inset Quotes erd
5018 \begin_inset Quotes eld
5022 \begin_inset Flex MenuItem
5025 \begin_layout Plain Layout
5032 \begin_inset Quotes erd
5036 Another way involves using
5037 \begin_inset Flex Code
5040 \begin_layout Plain Layout
5047 \begin_inset Flex Code
5050 \begin_layout Plain Layout
5056 to set up the special
5057 \begin_inset Flex Code
5060 \begin_layout Plain Layout
5068 \begin_inset Flex Code
5071 \begin_layout Plain Layout
5077 acts in some ways just like
5078 \begin_inset Flex MenuItem
5081 \begin_layout Plain Layout
5087 and permits you to bind keys to accented characters.
5088 You can also turn keys into dead-keys by binding them to something like
5090 \begin_inset Flex Code
5093 \begin_layout Plain Layout
5099 and then binding this symbolic key to the corresponding LyX command.
5103 \begin_layout Plain Layout
5108 : This is exactly what I do in my
5109 \begin_inset Flex Code
5112 \begin_layout Plain Layout
5119 \begin_inset Flex Code
5122 \begin_layout Plain Layout
5130 \begin_inset Flex MenuItem
5133 \begin_layout Plain Layout
5135 \begin_inset space ~
5144 \begin_inset Flex Code
5147 \begin_layout Plain Layout
5153 and a bunch of these
5154 \begin_inset Quotes eld
5158 \begin_inset Flex Code
5161 \begin_layout Plain Layout
5168 \begin_inset Quotes erd
5171 symbolic keys bound such things as
5172 \begin_inset Flex MenuItem
5175 \begin_layout Plain Layout
5177 \begin_inset space ~
5186 \begin_inset Flex MenuItem
5189 \begin_layout Plain Layout
5191 \begin_inset space ~
5200 This is how I produce my accented characters.
5205 You can make just about anything into the
5206 \begin_inset Flex Code
5209 \begin_layout Plain Layout
5216 \begin_inset Flex MenuItem
5219 \begin_layout Plain Layout
5225 keys, a spare function key, etc.
5226 As for the LyX commands that produce accents, check the entry for
5227 \begin_inset Flex Code
5230 \begin_layout Plain Layout
5241 You'll find the complete list there.
5244 \begin_layout Subsection
5245 Saving your Language Configuration
5248 \begin_layout Standard
5249 You can edit your preferences so that your desired language environment
5250 is automatically configured when LyX starts up, via the
5251 \begin_inset Flex MenuItem
5254 \begin_layout Plain Layout
5255 Edit\SpecialChar \menuseparator
5264 \begin_layout Chapter
5265 Installing New Document Classes, Layouts, and Templates
5266 \begin_inset CommandInset label
5268 name "cha:Installing-New-Document"
5273 \begin_inset Argument
5276 \begin_layout Plain Layout
5277 Installing New Document Classes
5285 \begin_layout Standard
5286 In this chapter, we describe the procedures for creating and installing
5287 new LyX layout and template files, as well as offer a refresher on correctly
5288 installing new LaTeX document classes.
5292 \begin_layout Standard
5293 First, let us a say a few words about how one ought to think about the relation
5294 between LyX and LaTeX.
5295 The thing to understand is that, in a certain sense, LyX doesn't know anything
5297 Indeed, from LyX's point of view, LaTeX is just one of several
5298 \begin_inset Quotes eld
5302 \begin_inset Quotes erd
5305 in which it is capable of producing output.
5306 Other such formats are DocBook, plaintext, and XHTML.
5307 LaTeX is, of course, a particularly important format, but very little of
5308 the information LyX has about LaTeX is actually contained in the program
5313 \begin_layout Plain Layout
5314 Some commands are sufficiently complex that they are
5315 \begin_inset Quotes eld
5319 \begin_inset Quotes erd
5323 But the developers generally regard this as a Bad Thing.
5328 Rather, that information, even for the standard classes like
5329 \begin_inset Flex Code
5332 \begin_layout Plain Layout
5338 , is contained in `layout files'.
5339 Similarly, LyX itself does not know much about DocBook or XHTML.
5340 What it knows is contained in layout files.
5343 \begin_layout Standard
5344 You can think of the layout file for a given document class as a translation
5345 manual between LyX constructs---paragraphs with their corresponding styles,
5346 certain sorts of insets, etc---and the corresponding LaTeX, DocBook, or
5348 Almost everything LyX knows about
5349 \begin_inset Flex Code
5352 \begin_layout Plain Layout
5358 , for example, is contained in the file
5359 \begin_inset Flex Code
5362 \begin_layout Plain Layout
5368 and in various other files it includes.
5369 For this reason, anyone intending to write layout files should plan to
5370 study the existing files.
5371 A good place to start is with
5372 \begin_inset Flex Code
5375 \begin_layout Plain Layout
5381 , which is included in
5382 \begin_inset Flex Code
5385 \begin_layout Plain Layout
5392 \begin_inset Flex Code
5395 \begin_layout Plain Layout
5401 , and many of the other layout files for document classes.
5402 This file is where sections and the like are defined:
5403 \begin_inset Flex Code
5406 \begin_layout Plain Layout
5412 tells LyX how paragraphs that are marked with the Section, Subsection,
5413 etc, styles can be translated into corresponding LaTeX, DocBook, and XHTML
5416 \begin_inset Flex Code
5419 \begin_layout Plain Layout
5425 file basically just includes several of these
5426 \begin_inset Flex Code
5429 \begin_layout Plain Layout
5438 \begin_layout Standard
5439 Defining the LyX--LaTeX correspondence is not the only thing layout files
5441 Their other job is to define how the LyX constructs themselves will appear
5443 The fact that layout files have these two jobs is often a source of confusion,
5444 because they are completely separate.
5445 Telling LyX how to translate a certain paragraph style into LaTeX does
5446 not tell LyX how to display it; conversely, telling LyX how to display
5447 a certain paragraph style does not tell LyX how to translate it into LaTeX
5448 (let alone tell LaTeX how to display it).
5449 So, in general, when you define a new LyX construct, you must always do
5450 two quite separate things: (i)
5451 \begin_inset space ~
5454 tell LyX how to translate it into LaTeX and (ii)
5455 \begin_inset space ~
5458 tell LyX how to display it.
5461 \begin_layout Standard
5462 Much the same is true, of course, as regards LyX's other backend formats,
5463 though XHTML is in some ways different, because in that case LyX
5467 able, to some extent, to use information about how it should display a
5468 paragraph on the screen to output information (in the form of CSS) about
5469 how the paragraph should be displayed in a browser.
5470 Even in this case, however, the distinction between what LyX does internally
5471 and how things are rendered externally remains in force, and the two can
5472 be controlled separately.
5474 \begin_inset CommandInset ref
5476 reference "sec:Tags-for-XHTML"
5483 \begin_layout Section
5484 Installing new LaTeX files
5487 \begin_layout Standard
5488 Some installations may not include a LaTeX package or class file that you
5489 would like to use within LyX.
5490 For example, you might need FoilTeX, a package for preparing slides for
5491 overhead projectors.
5492 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5493 a user interface for installing such packages.
5494 For example, with MiKTeX, you start the program
5495 \begin_inset Quotes eld
5499 \begin_inset space ~
5503 \begin_inset Quotes erd
5506 to get a list of available packages.
5507 To install one of them, right click on it or use the corresponding toolbar
5511 \begin_layout Standard
5512 If your LaTeX distribution does not provide such a `package manager', or
5513 if the package is not available from your distribution, then follow these
5514 steps to install it manually:
5517 \begin_layout Enumerate
5518 Get the package from
5519 \begin_inset CommandInset href
5522 target "http://www.ctan.org/"
5529 \begin_layout Enumerate
5530 If the package contains a file with the ending
5531 \begin_inset Quotes eld
5535 \begin_inset Flex Code
5538 \begin_layout Plain Layout
5545 \begin_inset Quotes erd
5548 (is the case for FoilTeX) then open a console, change to the folder of
5549 this file and execute the command
5550 \begin_inset Flex Code
5553 \begin_layout Plain Layout
5560 You have now unpacked the package and have all files to install it.
5561 Most LaTeX-packages are not packed and you can skip this step.
5564 \begin_layout Enumerate
5565 Now you need to decide if the package should be available for all users
5570 \begin_layout Enumerate
5571 On *nix systems (Linux, OSX, etc.), if you want the new package to be available
5572 for all users on your system, then install it in your `local' TeX tree,
5573 otherwise install it in your own `user' TeX tree.
5574 Where these trees should be created, if they do not already exist, depends
5576 To find this out, look in the file
5577 \begin_inset Flex Code
5580 \begin_layout Plain Layout
5590 \begin_layout Plain Layout
5591 This is usually in the directory
5592 \begin_inset Flex Code
5595 \begin_layout Plain Layout
5601 , though you can execute the command
5602 \begin_inset Flex Code
5605 \begin_layout Plain Layout
5616 The location of the `local' TeX tree is defined by the
5617 \begin_inset Flex Code
5620 \begin_layout Plain Layout
5626 variable; this is usually somewhere like
5627 \begin_inset Flex Code
5630 \begin_layout Plain Layout
5631 /usr/local/share/texmf
5637 The location of the `user' TeX tree is defined by
5638 \begin_inset Flex Code
5641 \begin_layout Plain Layout
5648 \begin_inset Flex Code
5651 \begin_layout Plain Layout
5658 (If these variables are not predefined, you have to define them.) You'll
5659 probably need root permissions to create or modify the `local' tree, but
5660 not for your `user' tree.
5661 \begin_inset Newline newline
5664 In general, it is recommended to install in the user tree because your user
5665 will not be modified or even overwritten when you upgrade your system.
5666 It will typically also be backed up together with everything else when
5667 you backup your home directory (which, of course, you do on a regular basis).
5670 \begin_layout Enumerate
5671 On Windows, if you want the new package to be available for all users on
5672 your system, change to the folder where LaTeX is installed and then change
5674 \begin_inset Flex Code
5677 \begin_layout Plain Layout
5688 (For MiKTeX, this would be by default the folder
5689 \begin_inset Flex Code
5692 \begin_layout Plain Layout
5710 \begin_layout Plain Layout
5711 Note that this will be the correct path only on English installations.
5712 On a German one, it would be
5713 \begin_inset Flex Code
5716 \begin_layout Plain Layout
5730 , and similarly for other languages.
5735 Create there a new folder
5736 \begin_inset Flex Code
5739 \begin_layout Plain Layout
5745 and copy all files of the package into it.
5747 \begin_inset Newline newline
5750 If the package should only available for you or you don't have admin permissions
5751 , do the same, but in the local LaTeX folder.
5753 \begin_inset space \thinspace{}
5757 \begin_inset space ~
5760 2.8 under Windows XP, this would be the folder:
5761 \begin_inset Newline newline
5767 \begin_inset Flex Code
5770 \begin_layout Plain Layout
5773 Documents and Settings
5785 \begin_inset Newline newline
5791 \begin_inset Phantom HPhantom
5794 \begin_layout Plain Layout
5805 \begin_inset Flex Code
5808 \begin_layout Plain Layout
5821 \begin_inset Newline newline
5824 On Vista, it would be:
5825 \begin_inset Newline newline
5829 \begin_inset Flex Code
5832 \begin_layout Plain Layout
5858 \begin_layout Enumerate
5859 Now one only need to tell LaTeX that there are new files.
5860 This depends on the used LaTeX-Distribution:
5864 \begin_layout Enumerate
5865 For TeXLive execute the command
5866 \begin_inset Flex Code
5869 \begin_layout Plain Layout
5876 If you installed the package for all users, then you will probably need
5877 to have root permissions for that.
5880 \begin_layout Enumerate
5881 For MiKTeX, if you have installed the package for all users, start the program
5883 \begin_inset Quotes eld
5887 \begin_inset space ~
5891 \begin_inset Quotes erd
5894 and press the button marked
5895 \begin_inset Quotes eld
5899 \begin_inset Quotes erd
5903 Otherwise start the program
5904 \begin_inset Quotes eld
5908 \begin_inset Quotes erd
5915 \begin_layout Enumerate
5916 Finally, you need to tell LyX that there are new packages available.
5917 So, in LyX, use the menu
5918 \begin_inset Flex MenuItem
5921 \begin_layout Plain Layout
5924 \SpecialChar \menuseparator
5930 and then restart LyX.
5933 \begin_layout Standard
5934 Now the package is installed.
5935 In our example, the document class
5936 \begin_inset Flex Code
5939 \begin_layout Plain Layout
5941 \begin_inset space ~
5948 \begin_layout Plain Layout
5960 will now be available under
5961 \begin_inset Flex MenuItem
5964 \begin_layout Plain Layout
5965 Document\SpecialChar \menuseparator
5966 Settings\SpecialChar \menuseparator
5976 \begin_layout Standard
5977 If you would like to use a LaTeX document class that is not even listed
5979 \begin_inset Flex MenuItem
5982 \begin_layout Plain Layout
5983 Document\SpecialChar \menuseparator
5984 Settings\SpecialChar \menuseparator
5990 , then you need to create a `layout' file for it.
5991 That is the topic of the next section.
5994 \begin_layout Section
5995 Types of layout files
5998 \begin_layout Standard
5999 This section describes the various sorts of LyX files that contain layout
6001 These files describe various paragraph and character styles, determining
6002 how LyX should display them and how they should be translated into LaTeX,
6003 DocBook, XHTML, or whatever output format is being used.
6007 \begin_layout Standard
6008 We shall try to provide a thorough description of the process of writing
6010 However, there are so many different types of documents supported even
6011 by just LaTeX that we can't hope to cover every different possibility or
6012 problem you might encounter.
6013 The LyX users' list is frequented by people with lots of experience with
6014 layout design who are willing to share what they've learned, so please
6015 feel free to ask questions there.
6018 \begin_layout Standard
6019 As you prepare to write a new layout, it is extremely helpful to look at
6020 the layouts distributed with LyX.
6021 If you write a LyX layout for a LaTeX document class that might also be
6022 used by others, or write a module that might be useful to others, then
6023 you should consider posting your layout to the
6024 \begin_inset CommandInset href
6026 name "layout section on the LyX wiki"
6027 target "http://wiki.lyx.org/Layouts/Layouts"
6031 or even to the LyX developers' list, so that it might be included in LyX
6036 \begin_layout Plain Layout
6037 Note that LyX is licensed under the General Public License, so any material
6038 that is contributed to LyX must be similarly licensed.
6046 \begin_layout Subsection
6048 \begin_inset CommandInset label
6050 name "sub:Layout-modules"
6057 \begin_layout Standard
6058 We have spoken to this point about `layout files'.
6059 But there are different sorts of files that contain layout information.
6060 Layout files, strictly so called, have the
6061 \begin_inset Flex Code
6064 \begin_layout Plain Layout
6070 extension and provide LyX with information about document classes.
6071 As of LyX 1.6, however, layout information can also be contained in layout
6077 \begin_inset Flex Code
6080 \begin_layout Plain Layout
6087 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
6088 some modules—such as the
6089 \begin_inset Flex Code
6092 \begin_layout Plain Layout
6098 module—specifically provide support for one package.
6099 In a sense, layout modules are similar to included
6103 \begin_layout Plain Layout
6104 These can have any extension, but by convention have the
6105 \begin_inset Flex Code
6108 \begin_layout Plain Layout
6120 \begin_inset Flex Code
6123 \begin_layout Plain Layout
6129 —in that modules are not specific to a given document class but may be used
6130 with many different classes.
6131 The difference is that using an included file with
6132 \begin_inset Flex Code
6135 \begin_layout Plain Layout
6141 requires editing that file.
6142 Modules, by contrast, are selected in the
6143 \begin_inset Flex MenuItem
6146 \begin_layout Plain Layout
6147 Document\SpecialChar \menuseparator
6156 \begin_layout Standard
6157 Building modules is the easiest way to get started with layout editing,
6158 since it can be as simple as adding a single new paragraph style or flex
6160 But modules may, in principle, contain anything a layout file can contain.
6163 \begin_layout Standard
6164 After creating a new module and copying it to the
6165 \begin_inset Flex Code
6168 \begin_layout Plain Layout
6174 folder, you will need to reconfigure and then restart LyX for the module
6175 to appear in the menu.
6176 However, changes you make to the module will be seen immediately, if you
6178 \begin_inset Flex MenuItem
6181 \begin_layout Plain Layout
6182 Document\SpecialChar \menuseparator
6188 , highlight something, and then hit
6189 \begin_inset Quotes eld
6193 \begin_inset Quotes erd
6199 It is strongly recommended that you save your work before doing this
6204 it is strongly recommended that you not attempt to edit modules while simultaneo
6205 usly working on actual documents
6208 Though of course the developers strive to keep LyX stable in such situations,
6209 syntax errors and the like in your module file could cause strange behavior.
6212 \begin_layout Subsection
6214 \begin_inset Flex MenuItem
6217 \begin_layout Plain Layout
6226 \begin_layout Standard
6227 There are two situations you are likely to encounter when wanting to support
6228 a new LaTeX document class, involving style (
6229 \begin_inset Flex Code
6232 \begin_layout Plain Layout
6238 ) files and LaTeX2e class (
6239 \begin_inset Flex Code
6242 \begin_layout Plain Layout
6249 Supporting a style file is usually fairly easy.
6250 Supporting a new class file is a bit harder.
6251 We'll discuss the former in this section and the latter in the next.
6252 Similar remarks apply, of course, if you want to support a new DocBook
6256 \begin_layout Standard
6257 The easier case is the one in which your new document class is provided
6258 as a style file that is to be used in conjunction with an already supported
6260 For the sake of the example, we'll assume that the style file is called
6262 \begin_inset Flex MenuItem
6265 \begin_layout Plain Layout
6271 and that it is meant to be used with
6272 \begin_inset Flex MenuItem
6275 \begin_layout Plain Layout
6281 , which is a standard class.
6285 \begin_layout Standard
6286 Start by copying the existing class's layout file into your local directory:
6290 \begin_layout Plain Layout
6291 Of course, which directory is your local directory will vary by platform,
6292 and LyX allows you to specify your local directory on startup, too, using
6294 \begin_inset Flex Code
6297 \begin_layout Plain Layout
6311 \begin_layout LyX-Code
6312 cp report.layout ~/.lyx/layouts/myclass.layout
6315 \begin_layout Standard
6317 \begin_inset Flex Code
6320 \begin_layout Plain Layout
6326 and change the line:
6329 \begin_layout LyX-Code
6332 DeclareLaTeXClass{report}
6335 \begin_layout Standard
6339 \begin_layout LyX-Code
6342 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6345 \begin_layout Standard
6349 \begin_layout LyX-Code
6351 \begin_inset Newline newline
6357 \begin_inset Newline newline
6363 \begin_layout Standard
6364 near the top of the file.
6367 \begin_layout Standard
6368 Start LyX and select
6369 \begin_inset Flex MenuItem
6372 \begin_layout Plain Layout
6373 Tools\SpecialChar \menuseparator
6380 Then restart LyX and try creating a new document.
6382 \begin_inset Flex MenuItem
6385 \begin_layout Plain Layout
6391 " as a document class option in the
6392 \begin_inset Flex MenuItem
6395 \begin_layout Plain Layout
6396 Document\SpecialChar \menuseparator
6403 It is likely that some of the sectioning commands and such in your new
6404 class will work differently from how they worked in the base class—
6405 \begin_inset Flex Code
6408 \begin_layout Plain Layout
6414 in this example—so you can fiddle around with the settings for the different
6415 sections if you wish.
6416 The layout information for sections is contained in
6417 \begin_inset Flex Code
6420 \begin_layout Plain Layout
6426 , but you do not need to copy and change this file.
6427 Instead, you can simply add your changes to your layout file, after the
6429 \begin_inset Flex Code
6432 \begin_layout Plain Layout
6438 , which itself includes
6439 \begin_inset Flex Code
6442 \begin_layout Plain Layout
6449 For example, you might add these lines:
6452 \begin_layout LyX-Code
6456 \begin_layout LyX-Code
6460 \begin_layout LyX-Code
6464 \begin_layout LyX-Code
6468 \begin_layout LyX-Code
6472 \begin_layout Standard
6473 to change the font for chapter headings to sans-serif.
6474 This will override (or, in this case, add to) the existing declaration
6475 for the Chapter style.
6479 \begin_layout Standard
6480 Your new package may also provide commands or environments not present in
6482 In this case, you will want to add these to the layout file.
6484 \begin_inset CommandInset ref
6486 reference "sec:TextClass"
6490 for information on how to do so.
6493 \begin_layout Standard
6495 \begin_inset Flex MenuItem
6498 \begin_layout Plain Layout
6504 can be used with several different document classes, and even if it cannot,
6505 you might find it easiest just to write a module that you can load with
6507 The simplest possible such module would be:
6510 \begin_layout LyX-Code
6513 DeclareLyXModule{My Package}
6516 \begin_layout LyX-Code
6520 \begin_layout LyX-Code
6521 #Support for mypkg.sty.
6524 \begin_layout LyX-Code
6526 \begin_inset Newline newline
6532 \begin_layout LyX-Code
6534 \begin_inset Newline newline
6540 \begin_layout LyX-Code
6542 \begin_inset Newline newline
6548 \begin_inset Newline newline
6554 \begin_layout Standard
6555 A more complex module might modify the behavior of some existing constructs
6556 or define some new ones.
6558 \begin_inset CommandInset ref
6560 reference "sec:TextClass"
6567 \begin_layout Subsection
6569 \begin_inset Flex MenuItem
6572 \begin_layout Plain Layout
6581 \begin_layout Standard
6582 There are two possibilities here.
6583 One is that the class file is itself based upon an existing document class.
6584 For example, many thesis classes are based upon
6585 \begin_inset Flex MenuItem
6588 \begin_layout Plain Layout
6595 To see whether yours is, look for a line like
6598 \begin_layout LyX-Code
6604 \begin_layout Standard
6606 If so, then you may proceed largely as in the previous section, though
6608 \begin_inset Flex Code
6611 \begin_layout Plain Layout
6617 line will be different.
6618 If your new class is
6619 \begin_inset Flex Code
6622 \begin_layout Plain Layout
6628 and it is based upon
6629 \begin_inset Flex Code
6632 \begin_layout Plain Layout
6638 , then the line should read:
6642 \begin_layout Plain Layout
6643 And it will be easiest if you save the file to
6644 \begin_inset Flex Code
6647 \begin_layout Plain Layout
6653 : LyX assumes that the document class has the same name as the layout file.
6662 \begin_layout LyX-Code
6665 DeclareLaTeXClass[thesis,book]{thesis}
6668 \begin_layout Standard
6669 If, on the other hand, the new class is not based upon an existing class,
6670 you will probably have to
6671 \begin_inset Quotes eld
6675 \begin_inset Quotes erd
6679 We strongly suggest copying an existing layout file which uses a similar
6680 LaTeX class and then modifying it, if you can do so.
6681 At least use an existing file as a starting point so you can find out what
6682 items you need to worry about.
6683 Again, the specifics are covered below.
6686 \begin_layout Subsection
6688 \begin_inset CommandInset label
6690 name "sub:Creating-Templates"
6697 \begin_layout Standard
6698 Once you have written a layout file for a new document class, you might
6699 want to consider writing a
6704 A template acts as a kind of tutorial for your layout, showing how it might
6705 be used, though containing dummy content.
6706 You can of course look at the various templates included with LyX for ideas.
6709 \begin_layout Standard
6710 Templates are created just like usual documents: using LyX.
6711 The only difference is that usual documents contain all possible settings,
6712 including the font scheme and the paper size.
6713 Usually a user doesn't want a template to overwrite his preferred settings
6714 for such parameters.
6715 For that reason, the designer of a template should remove the corresponding
6717 \begin_inset Flex Code
6720 \begin_layout Plain Layout
6729 \begin_inset Flex Code
6732 \begin_layout Plain Layout
6740 from the template LyX file.
6741 This can be done with any simple text-editor, for example
6742 \begin_inset Flex Code
6745 \begin_layout Plain Layout
6752 \begin_inset Flex Code
6755 \begin_layout Plain Layout
6765 \begin_layout Standard
6766 Put the edited template files you create in
6767 \begin_inset Flex Code
6770 \begin_layout Plain Layout
6776 , copy the ones you use from the global template directory in
6777 \begin_inset Flex Code
6780 \begin_layout Plain Layout
6786 to the same place, and redefine the template path in the
6787 \begin_inset Flex MenuItem
6790 \begin_layout Plain Layout
6791 Tools\SpecialChar \menuseparator
6792 Preferences\SpecialChar \menuseparator
6801 \begin_layout Standard
6802 Note, by the way, that there is a template which has a particular meaning:
6804 \begin_inset Flex Code
6807 \begin_layout Plain Layout
6814 This template is loaded every time you create a new document with
6815 \begin_inset Flex MenuItem
6818 \begin_layout Plain Layout
6819 File\SpecialChar \menuseparator
6825 in order to provide useful defaults.
6826 To create this template from inside LyX, all you have to do is to open
6827 a document with the correct settings, and use the
6828 \begin_inset Flex MenuItem
6831 \begin_layout Plain Layout
6832 Save as Document Defaults
6840 \begin_layout Subsection
6841 Upgrading old layout files
6844 \begin_layout Standard
6845 The format of layout files changes with each LyX release, so old layout
6846 files need to be converted to the new format.
6847 This process has been automated since LyX 1.4: If LyX reads a layout file
6848 in an older format, it automatically calls the script
6849 \begin_inset Flex Code
6852 \begin_layout Plain Layout
6858 to convert it to a temporary file in current format.
6859 The original file is left untouched.
6860 If you use the layout file often, then, you may want to convert it permanently,
6861 so that LyX does not have to do so itself every time.
6862 To do this, you can call the converter manually:
6865 \begin_layout LyX-Code
6866 mv myclass.layout myclass.old
6869 \begin_layout LyX-Code
6870 python LyXDir/scripts/layout2layout.py myclass.old myclass.layout
6873 \begin_layout Standard
6875 \begin_inset Flex Code
6878 \begin_layout Plain Layout
6884 with the name of your LyX system directory, of course.
6887 \begin_layout Standard
6888 Note that manual conversion does not affect included files, so these will
6889 have to be converted separately.
6892 \begin_layout Section
6893 \begin_inset CommandInset label
6895 name "sec:TextClass"
6899 The layout file format
6902 \begin_layout Standard
6903 When it's finally time to get your hands dirty and create or edit your own
6904 layout file, the following sections describe what you're up against.
6905 Our advice is to go slowly, save and test often, listen to soothing music,
6906 and enjoy one or two of your favorite adult beverages; more if you are
6907 getting particularly stuck.
6908 It's really not that hard, except that the multitude of options can become
6909 overwhelming if you try to do too much in one sitting.
6910 Go have another adult beverage, just for good measure.
6913 \begin_layout Standard
6914 Note that all the tags used in layout files are case-insensitive.
6916 \begin_inset Flex Code
6919 \begin_layout Plain Layout
6926 \begin_inset Flex Code
6929 \begin_layout Plain Layout
6936 \begin_inset Flex Code
6939 \begin_layout Plain Layout
6945 are really the same tag.
6946 The possible values are printed in brackets after the feature's name.
6947 The default value if a feature isn't specified inside a text class-description
6949 \begin_inset Flex Code
6952 \begin_layout Plain Layout
6961 If the argument has a data type like
6962 \begin_inset Quotes eld
6966 \begin_inset Quotes erd
6970 \begin_inset Quotes eld
6974 \begin_inset Quotes erd
6977 , the default is shown like this:
6978 \begin_inset Flex Code
6981 \begin_layout Plain Layout
6992 \begin_layout Subsection
6993 The document class declaration
6996 \begin_layout Standard
6997 Lines in a layout file which begin with
6998 \begin_inset Flex Code
7001 \begin_layout Plain Layout
7008 There is one exception to this rule.
7010 \begin_inset Flex Code
7013 \begin_layout Plain Layout
7019 files should begin with a line like:
7022 \begin_layout LyX-Code
7025 #% Do not delete the line below; configure depends on this
7028 \begin_layout LyX-Code
7033 DeclareLaTeXClass{article}
7036 \begin_layout Standard
7037 The second line is used when you (re)configure LyX.
7038 The layout file is read by the LaTeX script
7039 \begin_inset Flex Code
7042 \begin_layout Plain Layout
7048 , in a special mode where
7049 \begin_inset Flex Code
7052 \begin_layout Plain Layout
7059 The first line is just a LaTeX comment, and the second one contains the
7060 declaration of the text class.
7061 If these lines appear in a file named
7062 \begin_inset Flex Code
7065 \begin_layout Plain Layout
7071 , then they define a text class of name
7072 \begin_inset Flex Code
7075 \begin_layout Plain Layout
7081 (the name of the layout file) which uses the LaTeX document class
7082 \begin_inset Flex Code
7085 \begin_layout Plain Layout
7091 (the default is to use the same name as the layout).
7093 \begin_inset Quotes eld
7097 \begin_inset Quotes erd
7100 that appears above is used as a description of the text class in the
7101 \begin_inset Flex MenuItem
7104 \begin_layout Plain Layout
7105 Document\SpecialChar \menuseparator
7114 \begin_layout Standard
7115 Let's assume that you wrote your own text class that uses the
7116 \begin_inset Flex Code
7119 \begin_layout Plain Layout
7125 document class, but where you changed the appearance of the section headings.
7126 If you put it in a file
7127 \begin_inset Flex Code
7130 \begin_layout Plain Layout
7136 , the header of this file should be:
7139 \begin_layout LyX-Code
7142 #% Do not delete the line below; configure depends on this
7145 \begin_layout LyX-Code
7150 DeclareLaTeXClass[article]{article (with my own headings)}
7153 \begin_layout Standard
7154 This declares a text class
7155 \begin_inset Flex Code
7158 \begin_layout Plain Layout
7164 , associated with the LaTeX document class
7165 \begin_inset Flex Code
7168 \begin_layout Plain Layout
7175 \begin_inset Quotes eld
7178 article (with my own headings)
7179 \begin_inset Quotes erd
7183 If your text class depends on several packages, you can declare it as:
7186 \begin_layout LyX-Code
7189 #% Do not delete the line below; configure depends on this
7192 \begin_layout LyX-Code
7197 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
7200 \begin_layout Standard
7201 This indicates that your text class uses the
7202 \begin_inset Flex Code
7205 \begin_layout Plain Layout
7212 Finally, it is also possible to declare classes for DocBook code.
7213 Typical declarations will look like:
7216 \begin_layout LyX-Code
7219 #% Do not delete the line below; configure depends on this
7222 \begin_layout LyX-Code
7227 DeclareDocBookClass[article]{SGML (DocBook article)}
7230 \begin_layout Standard
7231 Note that these declarations can also be given an optional parameter declaring
7232 the name of the document class (but not a list).
7235 \begin_layout Standard
7236 So, to be as explicit as possible, the form of the layout declaration is:
7239 \begin_layout LyX-Code
7244 DeclareLaTeXClass[class,package.sty]{layout description}
7247 \begin_layout Standard
7248 The class need only be specified if the name of the LaTeX class file and
7249 the name of the layout file are different or if there are packages to load.
7250 If the name of the class file is not specified, then LyX will simply assume
7251 that it is the same as the name of the layout file.
7254 \begin_layout Standard
7255 When the text class has been modified to your taste, all you have to do
7256 is to copy it either to
7257 \begin_inset Flex Code
7260 \begin_layout Plain Layout
7267 \begin_inset Flex Code
7270 \begin_layout Plain Layout
7277 \begin_inset Flex MenuItem
7280 \begin_layout Plain Layout
7281 Tools\SpecialChar \menuseparator
7287 , exit LyX and restart.
7288 Then your new text class should be available along with the others.
7291 \begin_layout Standard
7292 Once the layout file is installed, you can edit it and see your changes
7293 without having to reconfigure or to restart LyX.
7298 \begin_layout Plain Layout
7299 In versions of LyX prior to 1.6, this was not true.
7300 As a result, editing layout files was very time consuming, since you had
7301 constantly to restart LyX to see changes.
7306 You can force a reload of the current layout by using the LyX function
7308 \begin_inset Flex MenuItem
7311 \begin_layout Plain Layout
7318 There is no default binding for this function—though, of course, you can
7319 bind it to a key yourself.
7320 But you will normally use this function simply by entering it in the mini-buffe
7325 \begin_layout Standard
7331 \begin_inset Flex MenuItem
7334 \begin_layout Plain Layout
7340 is very much an `advanced feature'.
7345 recommended that you save your work before using this function.
7350 recommended that you not attempt to edit layout information while simultaneousl
7351 y working on a document that you care about.
7352 Use a test document.
7353 Syntax errors and the like in your layout file could cause peculiar behavior.
7354 In particular, such errors could cause LyX to regard the current layout
7355 as invalid and to attempt to switch to some other layout.
7359 \begin_layout Plain Layout
7360 Really bad syntax errors may even caused LyX to exit.
7361 This is because certain sorts of errors may make LyX unable to read
7371 The LyX team strives to keep LyX stable in such situations, but safe is
7376 \begin_layout Plain Layout
7377 While we're giving advice: make regular backups.
7378 And be nice to your mother.
7386 \begin_layout Subsection
7387 The Module declaration
7390 \begin_layout Standard
7391 A module must begin with a line like the following:
7394 \begin_layout LyX-Code
7397 DeclareLyXModule[endnotes.sty]{Endnotes}
7400 \begin_layout Standard
7401 The mandatory argument, in curly brackets, is the name of the module, as
7403 \begin_inset Flex MenuItem
7406 \begin_layout Plain Layout
7407 Document\SpecialChar \menuseparator
7409 \change_inserted 34634807 1296981553
7410 \SpecialChar \menuseparator
7419 The argument in square brackets is optional: It declares any LaTeX packages
7420 on which the module depends.
7421 Please note that only packages about which LyX knows should be listed in
7422 the square brackets.
7426 \begin_layout Plain Layout
7427 The list of such packages is documented only in the source code.
7432 LyX will not check for arbitrary packages.
7433 It is also possible to use the form
7434 \begin_inset Flex MenuItem
7437 \begin_layout Plain Layout
7443 as an optional argument, which declares that the module can only be used
7444 when there exists a conversion chain between the formats `
7445 \begin_inset Flex Code
7448 \begin_layout Plain Layout
7455 \begin_inset Flex Code
7458 \begin_layout Plain Layout
7467 \begin_layout Standard
7468 The module declaration should then be followed by lines like the following
7469 \change_inserted 34634807 1296981696
7474 \begin_layout Plain Layout
7476 \change_inserted 34634807 1296981696
7477 Preferably in English if the module should be published with LyX.
7478 This description will appear in the list of messages to be translated and
7479 will be thus translated with the next interface update.
7489 \begin_layout LyX-Code
7493 \begin_layout LyX-Code
7494 #Adds an endnote command, in addition to footnotes.
7498 \begin_layout LyX-Code
7499 #You will need to add
7501 theendnotes in TeX code where you
7504 \begin_layout LyX-Code
7505 #want the endnotes to appear.
7509 \begin_layout LyX-Code
7513 \begin_layout LyX-Code
7514 #Requires: somemodule | othermodule
7517 \begin_layout LyX-Code
7518 #Excludes: badmodule
7521 \begin_layout Standard
7522 The description is used in
7523 \begin_inset Flex MenuItem
7526 \begin_layout Plain Layout
7527 Document\SpecialChar \menuseparator
7529 \change_inserted 34634807 1296981581
7530 \SpecialChar \menuseparator
7538 to provide the user with information about what the module does.
7540 \begin_inset Flex Code
7543 \begin_layout Plain Layout
7549 line is used to identify other modules with which this one must be used;
7551 \begin_inset Flex Code
7554 \begin_layout Plain Layout
7560 line is used to identify modules with which this one may not be used.
7561 Both are optional, and, as shown, multiple modules should be separated
7562 with the pipe symbol: |.
7563 Note that the required modules are treated disjunctively:
7567 of the required modules must be used.
7572 excluded module may be used.
7573 Note that modules are identified here by their
7578 \begin_inset Flex Code
7581 \begin_layout Plain Layout
7589 \begin_inset Flex Code
7592 \begin_layout Plain Layout
7599 \begin_inset Flex Code
7602 \begin_layout Plain Layout
7611 \begin_layout Subsection
7613 \change_inserted 34634807 1296981875
7615 \change_deleted 34634807 1296981874
7619 \change_inserted 34634807 1296981882
7625 \begin_layout Standard
7626 The first non-comment line of any layout file, included file, or module
7631 contain the file format number:
7634 \begin_layout Description
7635 \begin_inset Flex Code
7638 \begin_layout Plain Layout
7645 \begin_inset Flex Code
7648 \begin_layout Plain Layout
7654 ] The format of the layout file.
7657 \begin_layout Standard
7658 This tag was introduced with LyX 1.4.0.
7659 Layout files from LyX 1.3.x and earlier don't have an explicit file format
7660 and are considered to be of format 1.
7661 The format for the present version of LyX is format 21.
7662 But each version of LyX is capable of reading earlier versions' layout
7663 files, just as they are capable of reading files produced by earlier versions
7665 There is, however, no provision for converting to earlier formats.
7666 So LyX 1.6.x will not read layout files in format 21 but only files in format
7670 \begin_layout Subsection
7671 \begin_inset CommandInset label
7673 name "sub:General-text-class"
7677 General text class parameters
7680 \begin_layout Standard
7681 These are general parameters that govern the behavior of an entire document
7687 mean that they must appear in
7688 \begin_inset Flex Code
7691 \begin_layout Plain Layout
7697 files rather than in modules.
7698 A module can contain any layout tag.)
7701 \begin_layout Description
7702 \begin_inset Flex Code
7705 \begin_layout Plain Layout
7711 Adds information that will be output in the
7712 \begin_inset Flex Code
7715 \begin_layout Plain Layout
7721 block when this document class is output to XHTML.
7722 Typically, this would be used to output CSS style information, but it can
7723 be used for anything that can appear in
7724 \begin_inset Flex Code
7727 \begin_layout Plain Layout
7735 \begin_inset Quotes eld
7739 \begin_inset Flex Code
7742 \begin_layout Plain Layout
7749 \begin_inset Quotes erd
7755 \begin_layout Description
7756 \begin_inset Flex Code
7759 \begin_layout Plain Layout
7765 Adds information to the document preamble.
7767 \begin_inset Quotes eld
7771 \begin_inset Flex Code
7774 \begin_layout Plain Layout
7781 \begin_inset Quotes erd
7787 \begin_layout Description
7788 \begin_inset Flex Code
7791 \begin_layout Plain Layout
7797 Defines formats for use in the display of bibliographic information.
7799 \begin_inset CommandInset ref
7801 reference "sub:Citation-format-description"
7807 \begin_inset Quotes eld
7811 \begin_inset Flex Code
7814 \begin_layout Plain Layout
7821 \begin_inset Quotes erd
7827 \begin_layout Description
7828 \begin_inset Flex Code
7831 \begin_layout Plain Layout
7837 Describes various global options supported by the document class.
7839 \begin_inset space ~
7843 \begin_inset CommandInset ref
7845 reference "sub:ClassOptions"
7851 \begin_inset Quotes eld
7855 \begin_inset Flex Code
7858 \begin_layout Plain Layout
7865 \begin_inset Quotes erd
7871 \begin_layout Description
7872 \begin_inset Flex Code
7875 \begin_layout Plain Layout
7882 \begin_inset Flex Code
7885 \begin_layout Plain Layout
7894 \begin_inset Flex Code
7897 \begin_layout Plain Layout
7903 ] Whether the class should
7907 to having one or two columns.
7908 Can be changed in the
7909 \begin_inset Flex MenuItem
7912 \begin_layout Plain Layout
7913 Document\SpecialChar \menuseparator
7922 \begin_layout Description
7923 \begin_inset Flex Code
7926 \begin_layout Plain Layout
7933 \begin_inset Flex Code
7936 \begin_layout Plain Layout
7942 ] This sequence defines the properties for a counter.
7943 If the counter does not yet exist, it is created; if it does exist, it
7946 \begin_inset Quotes eld
7950 \begin_inset Flex Code
7953 \begin_layout Plain Layout
7960 \begin_inset Quotes erd
7964 \begin_inset Newline newline
7968 \begin_inset space ~
7972 \begin_inset CommandInset ref
7974 reference "sub:Counters"
7978 for details on counters.
7981 \begin_layout Description
7982 \begin_inset Flex Code
7985 \begin_layout Plain Layout
7991 Sets the default font used to display the document.
7993 \begin_inset space ~
7997 \begin_inset CommandInset ref
7999 reference "sub:Font-description"
8003 for how to declare fonts.
8005 \begin_inset Quotes eld
8009 \begin_inset Flex Code
8012 \begin_layout Plain Layout
8019 \begin_inset Quotes erd
8025 \begin_layout Description
8026 \begin_inset Flex Code
8029 \begin_layout Plain Layout
8036 \begin_inset Flex Code
8039 \begin_layout Plain Layout
8045 Specifies a module to be included by default with this document class.
8046 The module should be specified by filename without the
8047 \begin_inset Flex Code
8050 \begin_layout Plain Layout
8057 The user can still remove the module, but it will be active at the outset.
8058 (This applies only when new files are created, or when this class is chosen
8059 for an existing document.)
8062 \begin_layout Description
8063 \begin_inset Flex Code
8066 \begin_layout Plain Layout
8073 \begin_inset Flex Code
8076 \begin_layout Plain Layout
8082 ] This is the style that will be assigned to new paragraphs, usually
8083 \begin_inset Flex MenuItem
8086 \begin_layout Plain Layout
8093 This will default to the first defined style if not given, but you are
8094 encouraged to use this directive.
8097 \begin_layout Description
8098 \begin_inset Flex Code
8101 \begin_layout Plain Layout
8108 \begin_inset Flex Code
8111 \begin_layout Plain Layout
8117 ] This tag indicates that the module in question—which should be specified
8118 by filename without the
8119 \begin_inset Flex Code
8122 \begin_layout Plain Layout
8128 extension—cannot be used with this document class.
8129 This might be used in a journal-specific layout file to prevent, say, the
8131 \begin_inset Flex Code
8134 \begin_layout Plain Layout
8140 module that numbers theorems by section.
8145 be used in a module.
8146 Modules have their own way of excluding other modules (see
8147 \begin_inset CommandInset ref
8149 reference "sub:Layout-modules"
8156 \begin_layout Description
8157 \begin_inset Flex Code
8160 \begin_layout Plain Layout
8166 Defines a new float.
8168 \begin_inset space ~
8172 \begin_inset CommandInset ref
8174 reference "sub:Floats"
8180 \begin_inset Quotes eld
8184 \begin_inset Flex Code
8187 \begin_layout Plain Layout
8194 \begin_inset Quotes erd
8200 \begin_layout Description
8201 \begin_inset Flex Code
8204 \begin_layout Plain Layout
8210 Sets the information that will be output in the
8211 \begin_inset Flex Code
8214 \begin_layout Plain Layout
8220 block when this document class is output to XHTML.
8221 Note that this will completely override any prior
8222 \begin_inset Flex Code
8225 \begin_layout Plain Layout
8232 \begin_inset Flex Code
8235 \begin_layout Plain Layout
8243 \begin_inset Flex Code
8246 \begin_layout Plain Layout
8252 if you just want to add material to the preamble.) Must end with
8253 \begin_inset Quotes eld
8257 \begin_inset Flex Code
8260 \begin_layout Plain Layout
8267 \begin_inset Quotes erd
8273 \begin_layout Description
8274 \begin_inset Flex Code
8277 \begin_layout Plain Layout
8284 \begin_inset Flex Code
8287 \begin_layout Plain Layout
8293 ] The layout to use for the table of contents, bibliography, and so forth,
8294 when the document is output to HTML.
8295 For articles, this should normally be Section; for books, Chapter.
8296 If it is not given, then LyX will attempt to figure out which layout to
8300 \begin_layout Description
8301 \begin_inset Flex Code
8304 \begin_layout Plain Layout
8311 \begin_inset Flex Code
8314 \begin_layout Plain Layout
8320 ] Modifies the properties of the given counter.
8321 If the counter does not exist, the section is ignored.
8323 \begin_inset Quotes eld
8327 \begin_inset Flex Code
8330 \begin_layout Plain Layout
8337 \begin_inset Quotes erd
8341 \begin_inset Newline newline
8345 \begin_inset space ~
8349 \begin_inset CommandInset ref
8351 reference "sub:Counters"
8355 for details on counters.
8358 \begin_layout Description
8359 \begin_inset Flex Code
8362 \begin_layout Plain Layout
8369 \begin_inset Flex Code
8372 \begin_layout Plain Layout
8378 ] Modifies the properties of the given paragraph style.
8379 If the style does not exist, the section is ignored.
8381 \begin_inset Quotes eld
8385 \begin_inset Flex Code
8388 \begin_layout Plain Layout
8395 \begin_inset Quotes erd
8401 \begin_layout Description
8402 \begin_inset Flex Code
8405 \begin_layout Plain Layout
8411 As its name implies, this command allows you to include another layout
8412 definition file within yours to avoid duplicating commands.
8413 Common examples are the standard layout files, for example,
8414 \begin_inset Flex Code
8417 \begin_layout Plain Layout
8423 , which contains most of the basic layouts.
8426 \begin_layout Description
8427 \begin_inset Flex Code
8430 \begin_layout Plain Layout
8436 This section (re-)defines the layout of an inset.
8437 It can be applied to an existing inset or to a new, user-defined inset,
8438 e.g., a new character style.
8440 \begin_inset Quotes eld
8444 \begin_inset Flex Code
8447 \begin_layout Plain Layout
8454 \begin_inset Quotes erd
8458 \begin_inset Newline newline
8462 \begin_inset space ~
8466 \begin_inset CommandInset ref
8468 reference "sub:Flex-insets-and"
8472 for more information.
8476 \begin_layout Description
8477 \begin_inset Flex Code
8480 \begin_layout Plain Layout
8487 \begin_inset Flex Code
8490 \begin_layout Plain Layout
8496 ] A string that indicates the width of the left margin on the screen, for
8498 \begin_inset Quotes eld
8502 \begin_inset Quotes erd
8506 (Note that this is not a `length', like
8507 \begin_inset Quotes eld
8511 \begin_inset Quotes erd
8517 \begin_layout Description
8518 \begin_inset Flex Code
8521 \begin_layout Plain Layout
8528 \begin_inset Flex Code
8531 \begin_layout Plain Layout
8537 ] This command deletes an existing counter, usually one defined in an included
8541 \begin_layout Description
8542 \begin_inset Flex Code
8545 \begin_layout Plain Layout
8551 This command deletes an existing float.
8552 This is particularly useful when you want to suppress a float that has
8553 been defined in an input file.
8556 \begin_layout Description
8557 \begin_inset Flex Code
8560 \begin_layout Plain Layout
8566 This command deletes an existing style.
8567 This is particularly useful when you want to suppress a style that has
8568 be defined in an input file.
8571 \begin_layout Description
8572 \begin_inset Flex Code
8575 \begin_layout Plain Layout
8581 A string indicating the file format (as defined in the Preferences dialog)
8582 produced by this class.
8583 It is mainly useful when
8584 \begin_inset Flex Code
8587 \begin_layout Plain Layout
8593 is `literate' and one wants to define a new type of literate document.
8594 This string is reset to `docbook', `latex', or `literate' when the correspondin
8596 \begin_inset Flex Code
8599 \begin_layout Plain Layout
8605 parameter is encountered.
8608 \begin_layout Description
8609 \begin_inset Flex Code
8612 \begin_layout Plain Layout
8618 A string indicating what sort of output documents using this class will
8620 At present, the options are: `docbook', `latex', and `literate'.
8623 \begin_layout Description
8624 \begin_inset Flex Code
8627 \begin_layout Plain Layout
8634 \begin_inset Flex Code
8637 \begin_layout Plain Layout
8646 \begin_inset Flex Code
8649 \begin_layout Plain Layout
8656 \begin_inset Flex Code
8659 \begin_layout Plain Layout
8665 ] The default pagestyle.
8666 Can be changed in the
8667 \begin_inset Flex MenuItem
8670 \begin_layout Plain Layout
8671 Document\SpecialChar \menuseparator
8680 \begin_layout Description
8681 \begin_inset Flex Code
8684 \begin_layout Plain Layout
8690 Sets the preamble for the LaTeX document.
8691 Note that this will completely override any prior
8692 \begin_inset Flex Code
8695 \begin_layout Plain Layout
8702 \begin_inset Flex Code
8705 \begin_layout Plain Layout
8713 \begin_inset Flex Code
8716 \begin_layout Plain Layout
8722 if you just want to add material to the preamble.) Must end with
8723 \begin_inset Quotes eld
8727 \begin_inset Flex Code
8730 \begin_layout Plain Layout
8737 \begin_inset Quotes erd
8743 \begin_layout Description
8744 \begin_inset Flex Code
8747 \begin_layout Plain Layout
8754 \begin_inset Flex Code
8757 \begin_layout Plain Layout
8764 \begin_inset Flex Code
8767 \begin_layout Plain Layout
8776 \begin_inset Flex Code
8779 \begin_layout Plain Layout
8785 ] Whether the class already provides the feature
8786 \begin_inset Flex Code
8789 \begin_layout Plain Layout
8796 A feature is in general the name of a package (
8797 \begin_inset Flex Code
8800 \begin_layout Plain Layout
8807 \begin_inset Flex Code
8810 \begin_layout Plain Layout
8816 , \SpecialChar \ldots{}
8818 \begin_inset Flex Code
8821 \begin_layout Plain Layout
8828 \begin_inset Flex Code
8831 \begin_layout Plain Layout
8837 ,\SpecialChar \ldots{}
8838 ); the complete list of supported features is unfortunately not documented
8839 outside the LyX source code—but see
8840 \begin_inset Flex Code
8843 \begin_layout Plain Layout
8849 if you're interested.
8851 \begin_inset Flex MenuItem
8854 \begin_layout Plain Layout
8855 Help\SpecialChar \menuseparator
8861 also gives an overview of the supported packages.
8864 \begin_layout Description
8865 \begin_inset Flex Code
8868 \begin_layout Plain Layout
8875 \begin_inset Flex Code
8878 \begin_layout Plain Layout
8884 ] Indicates that this layout provides the functionality of the module mentioned,
8885 which should be specified by the filename without the
8886 \begin_inset Flex Code
8889 \begin_layout Plain Layout
8896 This will typically be used if the layout includes the module directly,
8897 rather than using the
8898 \begin_inset Flex Code
8901 \begin_layout Plain Layout
8907 tag to indicate that it ought to be used.
8908 It could also be used in a module that provided an alternate implementation
8909 of the same functionality.
8912 \begin_layout Description
8913 \begin_inset Flex Code
8916 \begin_layout Plain Layout
8923 \begin_inset Flex Code
8926 \begin_layout Plain Layout
8932 ] Whether the class requires the feature
8933 \begin_inset Flex Code
8936 \begin_layout Plain Layout
8943 Multiple features must be separated by commas.
8944 Note that you can only request supported features.
8946 \begin_inset Flex Code
8949 \begin_layout Plain Layout
8955 for a list of these.)
8958 \begin_layout Description
8959 \begin_inset Flex Code
8962 \begin_layout Plain Layout
8968 A string that indicates the width of the right margin on the screen, for
8970 \begin_inset Quotes eld
8974 \begin_inset Quotes erd
8980 \begin_layout Description
8981 \begin_inset Flex Code
8984 \begin_layout Plain Layout
8990 Sets which divisions get numbered.
8992 \begin_inset Flex Code
8995 \begin_layout Plain Layout
9004 \begin_layout Description
9005 \begin_inset Flex Code
9008 \begin_layout Plain Layout
9015 \begin_inset Flex Code
9018 \begin_layout Plain Layout
9027 \begin_inset Flex Code
9030 \begin_layout Plain Layout
9036 ] Whether the class-default should be printing on one or both sides of the
9038 Can be changed in the
9039 \begin_inset Flex MenuItem
9042 \begin_layout Plain Layout
9043 Document\SpecialChar \menuseparator
9052 \begin_layout Description
9053 \begin_inset Flex Code
9056 \begin_layout Plain Layout
9062 This sequence defines a paragraph style.
9063 If the style does not yet exist, it is created; if it does exist, its parameter
9066 \begin_inset Quotes eld
9070 \begin_inset Flex Code
9073 \begin_layout Plain Layout
9080 \begin_inset Quotes erd
9084 \begin_inset Newline newline
9088 \begin_inset space ~
9092 \begin_inset CommandInset ref
9094 reference "sub:Paragraph-Styles"
9098 for details on paragraph styles.
9101 \begin_layout Description
9102 \begin_inset Flex Code
9105 \begin_layout Plain Layout
9112 \begin_inset Flex Code
9115 \begin_layout Plain Layout
9121 ] The name of the command or environment to be used with
9122 \begin_inset Flex Code
9125 \begin_layout Plain Layout
9134 \begin_layout Description
9135 \begin_inset Flex Code
9138 \begin_layout Plain Layout
9145 \begin_inset Flex Code
9148 \begin_layout Plain Layout
9157 \begin_inset Flex Code
9160 \begin_layout Plain Layout
9166 ] Indicates what kind of markup is used to define the title of a document.
9168 \begin_inset Flex Code
9171 \begin_layout Plain Layout
9177 means that the macro with name
9178 \begin_inset Flex Code
9181 \begin_layout Plain Layout
9187 will be inserted after the last layout which has
9188 \begin_inset Quotes eld
9192 \begin_inset Flex Code
9195 \begin_layout Plain Layout
9202 \begin_inset Quotes erd
9207 \begin_inset Flex Code
9210 \begin_layout Plain Layout
9216 corresponds to the case where the block of paragraphs which have
9217 \begin_inset Quotes eld
9221 \begin_inset Flex Code
9224 \begin_layout Plain Layout
9231 \begin_inset Quotes erd
9234 should be enclosed into the
9235 \begin_inset Flex Code
9238 \begin_layout Plain Layout
9247 \begin_layout Description
9248 \begin_inset Flex Code
9251 \begin_layout Plain Layout
9257 Sets which divisions are included in the table of contents.
9259 \begin_inset Flex Code
9262 \begin_layout Plain Layout
9271 \begin_layout Subsection
9272 \begin_inset Flex Code
9275 \begin_layout Plain Layout
9282 \begin_inset CommandInset label
9284 name "sub:ClassOptions"
9291 \begin_layout Standard
9293 \begin_inset Flex Code
9296 \begin_layout Plain Layout
9302 section can contain the following entries:
9305 \begin_layout Description
9306 \begin_inset Flex Code
9309 \begin_layout Plain Layout
9316 \begin_inset Flex Code
9319 \begin_layout Plain Layout
9325 ] The list of available font sizes for the document's main font, separated
9327 \begin_inset Quotes eld
9331 \begin_inset Flex Code
9334 \begin_layout Plain Layout
9341 \begin_inset Quotes erd
9347 \begin_layout Description
9348 \begin_inset Flex Code
9351 \begin_layout Plain Layout
9357 Used to set the DTD line with XML-based output classes.
9359 \begin_inset space \thinspace{}
9363 \begin_inset Quotes eld
9366 -//OASIS//DTD DocBook V4.2//EN
9367 \begin_inset Quotes erd
9373 \begin_layout Description
9374 \begin_inset Flex Code
9377 \begin_layout Plain Layout
9384 \begin_inset Flex Code
9387 \begin_layout Plain Layout
9388 string="empty|plain|headings|fancy"
9393 ] The list of available page styles, separated by
9394 \begin_inset Quotes eld
9398 \begin_inset Flex Code
9401 \begin_layout Plain Layout
9408 \begin_inset Quotes erd
9414 \begin_layout Description
9415 \begin_inset Flex Code
9418 \begin_layout Plain Layout
9425 \begin_inset Flex Code
9428 \begin_layout Plain Layout
9434 ] Some document class options, separated by a comma, that will be added
9435 to the optional part of the
9436 \begin_inset Flex Code
9439 \begin_layout Plain Layout
9450 \begin_layout Standard
9452 \begin_inset Flex Code
9455 \begin_layout Plain Layout
9461 section must end with
9462 \begin_inset Quotes eld
9466 \begin_inset Flex Code
9469 \begin_layout Plain Layout
9476 \begin_inset Quotes erd
9482 \begin_layout Subsection
9484 \begin_inset CommandInset label
9486 name "sub:Paragraph-Styles"
9493 \begin_layout Standard
9494 A paragraph style description looks like this:
9498 \begin_layout Plain Layout
9499 Note that this will either define a new
9500 \change_deleted 34634807 1296982902
9502 \change_inserted 34634807 1296982902
9505 or modify an existing one.
9513 \begin_layout LyX-Code
9520 \begin_layout LyX-Code
9524 \begin_layout LyX-Code
9528 \begin_layout Standard
9529 where the following commands are allowed:
9532 \begin_layout Description
9533 \begin_inset Flex Code
9536 \begin_layout Plain Layout
9543 \begin_inset Flex Code
9546 \begin_layout Plain Layout
9551 , left, right, center
9556 ] Paragraph alignment.
9559 \begin_layout Description
9560 \begin_inset Flex Code
9563 \begin_layout Plain Layout
9570 \begin_inset Flex Code
9573 \begin_layout Plain Layout
9578 , left, right, center
9583 ] A comma separated list of permitted alignments.
9584 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
9586 For example a right-aligned or centered enumeration isn't possible.)
9589 \begin_layout Description
9590 \begin_inset Flex Code
9593 \begin_layout Plain Layout
9599 Note that this will completely override any prior
9600 \begin_inset Flex Code
9603 \begin_layout Plain Layout
9609 declaration for this style.
9611 \begin_inset Quotes eld
9615 \begin_inset Flex Code
9618 \begin_layout Plain Layout
9625 \begin_inset Quotes erd
9630 \begin_inset CommandInset ref
9632 reference "sub:I18n"
9636 for details on its use.
9639 \begin_layout Description
9640 \begin_inset Flex Code
9643 \begin_layout Plain Layout
9650 \begin_inset Flex Code
9653 \begin_layout Plain Layout
9663 \begin_layout Plain Layout
9664 Note that a `float' here is a real number, such as: 1.5.
9669 The vertical space with which the last of a chain of paragraphs with this
9671 \change_deleted 34634807 1296982906
9673 \change_inserted 34634807 1296982906
9676 is separated from the following paragraph.
9677 If the next paragraph has another
9678 \change_deleted 34634807 1296982915
9680 \change_inserted 34634807 1296982915
9683 , the separations are not simply added, but the maximum is taken.
9686 \begin_layout Description
9687 \begin_inset Flex Code
9690 \begin_layout Plain Layout
9697 \begin_inset Flex Code
9700 \begin_layout Plain Layout
9706 The category for this style.
9707 This is used to group related styles in the
9708 \change_deleted 34634807 1296982925
9710 \change_inserted 34634807 1296982925
9713 combobox on the toolbar.
9714 Any string can be used, but you may want to use existing categories with
9719 \begin_layout Description
9720 \begin_inset Flex Code
9723 \begin_layout Plain Layout
9729 Depth of XML command.
9730 Used only with XML-type formats.
9733 \begin_layout Description
9734 \begin_inset Flex Code
9737 \begin_layout Plain Layout
9744 \begin_inset CommandInset label
9746 name "des:CopyStyle"
9751 \begin_inset Flex Code
9754 \begin_layout Plain Layout
9760 Copies all the features of an existing style into the current one.
9764 \begin_layout Description
9765 \begin_inset Flex Code
9768 \begin_layout Plain Layout
9774 The name of a style whose preamble should be output
9779 This allows to ensure some ordering of the preamble snippets when macros
9780 definitions depend on one another.
9784 \begin_layout Plain Layout
9785 Note that, besides that functionality, there is no way to ensure any ordering
9787 The ordering that you see in a given version of LyX may change without
9788 warning in later versions.
9796 \begin_layout Description
9797 \begin_inset Flex Code
9800 \begin_layout Plain Layout
9807 \begin_inset Flex Code
9810 \begin_layout Plain Layout
9815 , Box, Filled_Box, Static
9820 ] The type of label that stands at the end of the paragraph (or sequence
9822 \begin_inset Flex Code
9825 \begin_layout Plain Layout
9832 \begin_inset Flex Code
9835 \begin_layout Plain Layout
9842 \begin_inset Flex Code
9845 \begin_layout Plain Layout
9852 \begin_inset Flex Code
9855 \begin_layout Plain Layout
9863 \begin_inset Flex Code
9866 \begin_layout Plain Layout
9873 \begin_inset Quotes eld
9877 \begin_inset Quotes erd
9881 \begin_inset Flex Code
9884 \begin_layout Plain Layout
9891 \begin_inset Flex Code
9894 \begin_layout Plain Layout
9895 \begin_inset space ~
9904 \begin_inset space ~
9907 black) square suitable for end of proof markers,
9908 \begin_inset Flex Code
9911 \begin_layout Plain Layout
9917 is an explicit text string.
9920 \begin_layout Description
9921 \begin_inset Flex Code
9924 \begin_layout Plain Layout
9931 \begin_inset Flex Code
9934 \begin_layout Plain Layout
9940 ] The string used for a label with a
9941 \begin_inset Flex Code
9944 \begin_layout Plain Layout
9951 \begin_inset Flex Code
9954 \begin_layout Plain Layout
9964 \begin_layout Description
9966 \change_deleted 34634807 1296982079
9967 \begin_inset Flex Code
9970 \begin_layout Plain Layout
9977 \begin_inset Flex Code
9980 \begin_layout Plain Layout
9991 \begin_inset Flex Code
9994 \begin_layout Plain Layout
10003 \begin_layout Description
10005 \change_deleted 34634807 1296982079
10006 \begin_inset Flex Code
10009 \begin_layout Plain Layout
10016 \begin_inset Flex Code
10019 \begin_layout Plain Layout
10029 ] With this parameter the
10030 \begin_inset Flex MenuItem
10033 \begin_layout Plain Layout
10040 \begin_inset Quotes eld
10043 Vertical space above
10044 \begin_inset Quotes erd
10048 \begin_inset Flex MenuItem
10051 \begin_layout Plain Layout
10052 Edit\SpecialChar \menuseparator
10054 \begin_inset space ~
10062 dialog can be set when initializing a paragraph with this style.
10068 \begin_layout Plain Layout
10071 Note from Jean-Marc:
10073 I'm not sure that this setting has much use, and it should probably be
10074 removed in later versions.
10080 \change_inserted 34634807 1296982107
10082 \begin_inset Note Note
10085 \begin_layout Plain Layout
10087 \change_inserted 34634807 1296982125
10089 \begin_inset Quotes eld
10092 Vertical space above
10093 \begin_inset Quotes erd
10097 \begin_inset Quotes eld
10100 Vertical space below
10101 \begin_inset Quotes erd
10104 in Edit\SpecialChar \menuseparator
10106 \begin_inset space ~
10109 Settings, so this seems obsolete, as Jean-Marc noticed (Note by J.P.
10121 \begin_layout Description
10122 \begin_inset Flex Code
10125 \begin_layout Plain Layout
10131 The font used for both the text body
10137 \begin_inset space ~
10141 \begin_inset CommandInset ref
10143 reference "sub:Font-description"
10148 Note that defining this font automatically defines the
10149 \begin_inset Flex Code
10152 \begin_layout Plain Layout
10159 So you should define this one first if you also want to define
10160 \begin_inset Flex Code
10163 \begin_layout Plain Layout
10172 \begin_layout Description
10173 \begin_inset Flex Code
10176 \begin_layout Plain Layout
10183 \begin_inset CommandInset label
10185 name "des:FreeSpacing"
10190 \begin_inset Flex Code
10193 \begin_layout Plain Layout
10202 \begin_inset Flex Code
10205 \begin_layout Plain Layout
10211 ] Usually LyX doesn't allow you to insert more than one space between words,
10212 since a space is considered as the separation between two words, not a
10213 character or symbol of its own.
10214 This is a very fine thing but sometimes annoying, for example, when typing
10215 program code or plain LaTeX code.
10217 \begin_inset Flex Code
10220 \begin_layout Plain Layout
10227 Note that LyX will create protected blanks for the additional blanks when
10228 in another mode than LaTeX-mode.
10231 \begin_layout Description
10232 \begin_inset Flex Code
10235 \begin_layout Plain Layout
10241 These tags are used with XHTML output.
10243 \begin_inset CommandInset ref
10245 reference "sub:Paragraph-Style-XHTML"
10252 \begin_layout Description
10253 \begin_inset Flex Code
10256 \begin_layout Plain Layout
10262 [[FIXME]] (Used only with XML-type formats.)
10265 \begin_layout Description
10266 \begin_inset Flex Code
10269 \begin_layout Plain Layout
10276 \begin_inset Flex Code
10279 \begin_layout Plain Layout
10286 \change_deleted 34634807 1296982928
10288 \change_inserted 34634807 1296982928
10291 as to be included in the document preamble rather than in the document
10293 This is useful for document classes that want such information as the title
10294 and author to appear in the preamble.
10295 Note that this works only for
10296 \change_deleted 34634807 1296982930
10298 \change_inserted 34634807 1296982930
10302 \begin_inset Flex Code
10305 \begin_layout Plain Layout
10312 \begin_inset Flex Code
10315 \begin_layout Plain Layout
10322 \begin_inset Flex Code
10325 \begin_layout Plain Layout
10334 \begin_layout Description
10335 \begin_inset Flex Code
10338 \begin_layout Plain Layout
10345 \begin_inset Flex Code
10348 \begin_layout Plain Layout
10355 \change_deleted 34634807 1296982932
10357 \change_inserted 34634807 1296982932
10360 as being part of a title block (see also the
10361 \begin_inset Flex Code
10364 \begin_layout Plain Layout
10371 \begin_inset Flex Code
10374 \begin_layout Plain Layout
10383 \begin_layout Description
10384 \begin_inset Flex Code
10387 \begin_layout Plain Layout
10394 \begin_inset Flex Code
10397 \begin_layout Plain Layout
10403 ] This provides extra space between paragraphs that have the same
10404 \change_deleted 34634807 1296982933
10406 \change_inserted 34634807 1296982933
10411 \change_deleted 34634807 1296982940
10413 \change_inserted 34634807 1296982940
10416 s into an environment, each is separated with the environment's
10417 \begin_inset Flex Code
10420 \begin_layout Plain Layout
10427 But the whole items of the environment are additionally separated with
10429 \begin_inset Flex Code
10432 \begin_layout Plain Layout
10439 Note that this is a
10444 \begin_layout Description
10445 \begin_inset Flex Code
10448 \begin_layout Plain Layout
10454 [[FIXME]] (Used only with XML-type formats.)
10457 \begin_layout Description
10458 \begin_inset Flex Code
10461 \begin_layout Plain Layout
10468 \begin_inset CommandInset label
10470 name "des:KeepEmpty"
10475 \begin_inset Flex Code
10478 \begin_layout Plain Layout
10487 \begin_inset Flex Code
10490 \begin_layout Plain Layout
10496 ] Usually LyX does not allow you to leave a paragraph empty, since it would
10497 lead to empty LaTeX output.
10498 There are some cases where this could be desirable however: in a letter
10499 template, the required fields can be provided as empty fields, so that
10500 people do not forget them; in some special classes, a
10501 \change_deleted 34634807 1296982945
10503 \change_inserted 34634807 1296982945
10506 can be used as some kind of break, which does not contain actual text.
10509 \begin_layout Description
10510 \begin_inset Flex Code
10513 \begin_layout Plain Layout
10519 [float=0] The vertical space between the label and the text body.
10520 Only used for labels that are above the text body (
10521 \begin_inset Flex Code
10524 \begin_layout Plain Layout
10531 \begin_inset Flex Code
10534 \begin_layout Plain Layout
10535 Centered_Top_Environment
10543 \begin_layout Description
10544 \begin_inset Flex Code
10547 \begin_layout Plain Layout
10554 \begin_inset Flex Code
10557 \begin_layout Plain Layout
10564 \begin_inset Newline newline
10567 The name of the counter for automatic numbering.
10569 \begin_inset Newline newline
10577 \begin_inset Flex Code
10580 \begin_layout Plain Layout
10587 \begin_inset Flex Code
10590 \begin_layout Plain Layout
10597 In that case, the counter will be stepped each time the
10598 \change_deleted 34634807 1296982948
10600 \change_inserted 34634807 1296982948
10605 \begin_inset Newline newline
10613 \begin_inset Flex Code
10616 \begin_layout Plain Layout
10623 \begin_inset Flex Code
10626 \begin_layout Plain Layout
10632 , though this case is a bit complicated.
10633 Suppose you declare
10634 \begin_inset Quotes eld
10638 \begin_inset Flex Code
10641 \begin_layout Plain Layout
10642 LabelCounter myenum
10648 \begin_inset Quotes erd
10652 Then the actual counters used are
10653 \begin_inset Flex Code
10656 \begin_layout Plain Layout
10663 \begin_inset Flex Code
10666 \begin_layout Plain Layout
10673 \begin_inset Flex Code
10676 \begin_layout Plain Layout
10683 \begin_inset Flex Code
10686 \begin_layout Plain Layout
10692 , much as in LaTeX.
10693 These counters must all be declared separately.
10694 \begin_inset Newline newline
10698 \begin_inset CommandInset ref
10700 reference "sub:Counters"
10704 for details on counters.
10707 \begin_layout Description
10708 \begin_inset Flex Code
10711 \begin_layout Plain Layout
10717 The font used for the label.
10719 \begin_inset space ~
10723 \begin_inset CommandInset ref
10725 reference "sub:Font-description"
10732 \begin_layout Description
10733 \begin_inset Flex Code
10736 \begin_layout Plain Layout
10742 Text that indicates how far a label should be indented.
10745 \begin_layout Description
10746 \begin_inset Flex Code
10749 \begin_layout Plain Layout
10756 \begin_inset Flex Code
10759 \begin_layout Plain Layout
10765 ] The horizontal space between the label and the text body.
10766 Only used for labels that are not above the text body.
10769 \begin_layout Description
10770 \begin_inset Flex Code
10773 \begin_layout Plain Layout
10780 \begin_inset Flex Code
10783 \begin_layout Plain Layout
10789 ] The string used for a label with a
10790 \begin_inset Flex Code
10793 \begin_layout Plain Layout
10801 \begin_inset Flex Code
10804 \begin_layout Plain Layout
10810 is set, this string can be contain the special formatting commands described
10812 \begin_inset CommandInset ref
10814 reference "sub:Counters"
10822 \begin_layout Plain Layout
10823 For the sake of backwards compatibility, the string
10824 \begin_inset Flex Code
10827 \begin_layout Plain Layout
10837 will be replaced by the expanded
10838 \begin_inset Flex Code
10841 \begin_layout Plain Layout
10848 \begin_inset Flex Code
10851 \begin_layout Plain Layout
10860 This feature is now obsolete and should be replaced by the mechanisms of
10862 \begin_inset CommandInset ref
10864 reference "sub:Counters"
10876 \begin_layout Description
10877 \begin_inset Flex Code
10880 \begin_layout Plain Layout
10881 LabelStringAppendix
10887 \begin_inset Flex Code
10890 \begin_layout Plain Layout
10896 ] This is used inside the appendix instead of
10897 \begin_inset Flex Code
10900 \begin_layout Plain Layout
10908 \begin_inset Flex Code
10911 \begin_layout Plain Layout
10918 \begin_inset Flex Code
10921 \begin_layout Plain Layout
10922 LabelStringAppendix
10930 \begin_layout Description
10931 \begin_inset Flex Code
10934 \begin_layout Plain Layout
10940 [FIXME] (Used only with XML-type formats.)
10943 \begin_layout Description
10944 \begin_inset Flex Code
10947 \begin_layout Plain Layout
10954 \begin_inset Flex Code
10957 \begin_layout Plain Layout
10962 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
10963 Enumerate, Itemize, Bibliography
10972 \begin_layout Itemize
10973 \begin_inset Flex Code
10976 \begin_layout Plain Layout
10982 means the label is the very first word (up to the first real blank).
10983 Use protected spaces (like
10984 \begin_inset space ~
10987 that one) if you want more than one word as the label.
10991 \begin_layout Itemize
10992 \begin_inset Flex Code
10995 \begin_layout Plain Layout
11001 means the label is simply whatever
11002 \begin_inset Flex Code
11005 \begin_layout Plain Layout
11012 Note that this really is `static'.
11015 \begin_layout Itemize
11016 \begin_inset Flex Code
11019 \begin_layout Plain Layout
11026 \begin_inset Flex Code
11029 \begin_layout Plain Layout
11030 Centered_Top_Environment
11035 are special cases of
11036 \begin_inset Flex Code
11039 \begin_layout Plain Layout
11046 The label will be printed above the paragraph, but only at the top of an
11047 environment or the top of a chain of paragraphs with this
11048 \change_deleted 34634807 1296982950
11050 \change_inserted 34634807 1296982950
11054 This might be used with the
11055 \begin_inset Flex MenuItem
11058 \begin_layout Plain Layout
11065 \change_deleted 34634807 1296982953
11067 \change_inserted 34634807 1296982953
11073 \begin_layout Itemize
11074 \begin_inset Flex Code
11077 \begin_layout Plain Layout
11083 is a special case for the caption-labels
11084 \begin_inset Quotes eld
11088 \begin_inset Quotes erd
11092 \begin_inset Quotes eld
11096 \begin_inset Quotes erd
11101 \begin_inset Flex Code
11104 \begin_layout Plain Layout
11110 means the (hardcoded) label string depends on the kind of float: It is
11111 hardcoded to be `FloatType N', where N is the value of the counter associated
11115 \begin_layout Itemize
11117 \begin_inset Flex Code
11120 \begin_layout Plain Layout
11126 label type defines automatically numbered labels.
11128 \begin_inset Flex Code
11131 \begin_layout Plain Layout
11137 will be expanded to resolve any counter references it contains: For example,
11139 \begin_inset Quotes eld
11143 \begin_inset Flex Code
11146 \begin_layout Plain Layout
11157 \begin_inset Quotes erd
11162 \begin_inset CommandInset ref
11164 reference "sub:Counters"
11168 for more information on counters.
11171 \begin_layout Itemize
11172 \begin_inset Flex Code
11175 \begin_layout Plain Layout
11181 produces the usual sort of enumeration labels.
11182 At present, it is hardcoded to use Arabic numerals, lowercase letters,
11183 small Roman numerals, and uppercase letters for the four possible depths.
11186 \begin_layout Itemize
11187 \begin_inset Flex Code
11190 \begin_layout Plain Layout
11196 produces various bullets at the different levels.
11197 It is also hardcoded.
11200 \begin_layout Itemize
11201 \begin_inset Flex Code
11204 \begin_layout Plain Layout
11210 is used internally by LyX and should be used only with
11211 \begin_inset Flex Code
11214 \begin_layout Plain Layout
11215 LatexType BibEnvironment
11224 \begin_layout Description
11225 \begin_inset Flex Code
11228 \begin_layout Plain Layout
11234 Note that this will completely override any prior
11235 \begin_inset Flex Code
11238 \begin_layout Plain Layout
11244 declaration for this style.
11246 \begin_inset Quotes eld
11250 \begin_inset Flex Code
11253 \begin_layout Plain Layout
11260 \begin_inset Quotes erd
11265 \begin_inset CommandInset ref
11267 reference "sub:I18n"
11271 for details on its use.
11274 \begin_layout Description
11275 \begin_inset Flex Code
11278 \begin_layout Plain Layout
11284 The name of the corresponding LaTeX stuff.
11285 Either the environment or command name.
11288 \begin_layout Description
11289 \begin_inset Flex Code
11292 \begin_layout Plain Layout
11298 An optional parameter for the corresponding
11299 \begin_inset Flex Code
11302 \begin_layout Plain Layout
11309 This parameter cannot be changed from within LyX.
11312 \begin_layout Description
11313 \begin_inset Flex Code
11316 \begin_layout Plain Layout
11323 \begin_inset CommandInset label
11325 name "des:LatexType"
11330 \begin_inset Flex Code
11333 \begin_layout Plain Layout
11338 , Command, Environment, Item_Environment,
11344 \begin_inset Flex Code
11347 \begin_layout Plain Layout
11348 List_Environment, Bib_Environment
11354 \change_deleted 34634807 1296982955
11356 \change_inserted 34634807 1296982955
11359 should be translated into LaTeX.
11363 \begin_layout Plain Layout
11364 \begin_inset Flex Code
11367 \begin_layout Plain Layout
11373 is perhaps a bit misleading, since these rules apply to SGML classes, too.
11374 Visit the SGML class files for specific examples.
11383 \begin_layout Itemize
11384 \begin_inset Flex Code
11387 \begin_layout Plain Layout
11393 means nothing special.
11397 \begin_layout Itemize
11398 \begin_inset Flex Code
11401 \begin_layout Plain Layout
11408 \begin_inset Flex Code
11411 \begin_layout Plain Layout
11418 {\SpecialChar \ldots{}
11427 \begin_layout Itemize
11428 \begin_inset Flex Code
11431 \begin_layout Plain Layout
11438 \begin_inset Flex Code
11441 \begin_layout Plain Layout
11448 }\SpecialChar \ldots{}
11464 \begin_layout Itemize
11465 \begin_inset Flex Code
11468 \begin_layout Plain Layout
11475 \begin_inset Flex Code
11478 \begin_layout Plain Layout
11485 \begin_inset Flex Code
11488 \begin_layout Plain Layout
11496 is generated for each paragraph of this environment.
11500 \begin_layout Itemize
11501 \begin_inset Flex Code
11504 \begin_layout Plain Layout
11511 \begin_inset Flex Code
11514 \begin_layout Plain Layout
11521 \begin_inset Flex Code
11524 \begin_layout Plain Layout
11530 is passed as an argument to the environment.
11532 \begin_inset Flex Code
11535 \begin_layout Plain Layout
11541 can be defined in the
11542 \begin_inset Flex MenuItem
11545 \begin_layout Plain Layout
11547 \change_deleted 34634807 1296982208
11553 \change_inserted 34634807 1296982209
11560 \SpecialChar \menuseparator
11566 \change_inserted 34634807 1296982216
11568 \begin_inset space ~
11582 \begin_layout Standard
11583 Putting the last few things together, the LaTeX output will be either:
11586 \begin_layout LyX-Code
11589 latexname[latexparam]{\SpecialChar \ldots{}
11593 \begin_layout Standard
11597 \begin_layout LyX-Code
11600 begin{latexname}[latexparam] \SpecialChar \ldots{}
11606 \begin_layout Standard
11607 depending upon the LaTeX type.
11611 \begin_layout Description
11612 \begin_inset Flex Code
11615 \begin_layout Plain Layout
11622 \begin_inset Flex Code
11625 \begin_layout Plain Layout
11632 \change_deleted 34634807 1296982960
11634 \change_inserted 34634807 1296982960
11637 s into environments, the leftmargins are not simply added, but added with
11639 \begin_inset Formula $\frac{4}{depth+4}$
11643 Note that this parameter is also used when the margin is defined as
11644 \begin_inset Flex Code
11647 \begin_layout Plain Layout
11654 \begin_inset Flex Code
11657 \begin_layout Plain Layout
11664 Then it is added to the manual or dynamic margin.
11666 \begin_inset Newline newline
11669 The argument is passed as a string.
11671 \begin_inset Quotes eld
11675 \begin_inset Flex Code
11678 \begin_layout Plain Layout
11685 \begin_inset Quotes erd
11688 means that the paragraph is indented with the width of
11689 \begin_inset Quotes eld
11693 \begin_inset Flex Code
11696 \begin_layout Plain Layout
11703 \begin_inset Quotes erd
11706 in the normal font.
11707 You can get a negative width by prefixing the string with
11708 \begin_inset Quotes eld
11712 \begin_inset Flex Code
11715 \begin_layout Plain Layout
11722 \begin_inset Quotes erd
11726 This way was chosen so that the look is the same with each used screen
11731 \begin_layout Description
11732 \begin_inset Flex Code
11735 \begin_layout Plain Layout
11742 \begin_inset Flex Code
11745 \begin_layout Plain Layout
11750 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11756 \begin_inset Newline newline
11759 The kind of margin that the
11760 \change_deleted 34634807 1296982962
11762 \change_inserted 34634807 1296982962
11765 has on the left side.
11767 \begin_inset Flex Code
11770 \begin_layout Plain Layout
11776 just means a fixed margin.
11778 \begin_inset Flex Code
11781 \begin_layout Plain Layout
11787 means that the left margin depends on the string entered in the
11788 \begin_inset Flex MenuItem
11791 \begin_layout Plain Layout
11792 Edit\SpecialChar \menuseparator
11794 \begin_inset space ~
11803 This is used to typeset nice lists without tabulators.
11805 \begin_inset Flex Code
11808 \begin_layout Plain Layout
11814 means that the margin depends on the size of the label.
11815 This is used for automatic enumerated headlines.
11816 It is obvious that the headline
11817 \begin_inset Quotes eld
11820 5.4.3.2.1 Very long headline
11821 \begin_inset Quotes erd
11824 must have a wider left margin (as wide as
11825 \begin_inset Quotes eld
11829 \begin_inset Quotes erd
11832 plus the space) than
11833 \begin_inset Quotes eld
11836 3.2 Very long headline
11837 \begin_inset Quotes erd
11841 \begin_inset Quotes eld
11845 \begin_inset Quotes erd
11848 are not able to do this.
11850 \begin_inset Flex Code
11853 \begin_layout Plain Layout
11859 is similar, but only the very first row of the paragraph is dynamic, while
11860 the others are static; this is used, for example, for descriptions.
11862 \begin_inset Flex Code
11865 \begin_layout Plain Layout
11871 means the margin is chosen in a way that the longest row of this paragraph
11872 fits to the right margin.
11873 This is used to typeset an address on the right edge of the page.
11876 \begin_layout Description
11877 \begin_inset Flex Code
11880 \begin_layout Plain Layout
11887 \begin_inset Flex Code
11890 \begin_layout Plain Layout
11899 \begin_inset Flex Code
11902 \begin_layout Plain Layout
11908 ] Whether fragile commands in this
11909 \change_deleted 34634807 1296982964
11911 \change_inserted 34634807 1296982964
11915 \begin_inset Flex Code
11918 \begin_layout Plain Layout
11931 whether this command should itself be protected.)
11934 \begin_layout Description
11935 \begin_inset Flex Code
11938 \begin_layout Plain Layout
11945 \begin_inset Flex Code
11948 \begin_layout Plain Layout
11955 \begin_inset Flex Code
11958 \begin_layout Plain Layout
11966 ] Whether newlines are translated into LaTeX newlines (
11967 \begin_inset Flex Code
11970 \begin_layout Plain Layout
11981 The translation can be switched off to allow more comfortable LaTeX editing
11985 \begin_layout Description
11986 \begin_inset Flex Code
11989 \begin_layout Plain Layout
11996 \begin_inset Flex Code
11999 \begin_layout Plain Layout
12006 \begin_inset Flex Code
12009 \begin_layout Plain Layout
12017 ] Whether the following Paragraph is allowed to indent its very first row.
12019 \begin_inset Flex Code
12022 \begin_layout Plain Layout
12028 means that it is not allowed to do so;
12029 \begin_inset Flex Code
12032 \begin_layout Plain Layout
12038 means it could do so if it wants to.
12041 \begin_layout Description
12042 \begin_inset Flex Code
12045 \begin_layout Plain Layout
12052 \change_deleted 34634807 1296982966
12054 \change_inserted 34634807 1296982966
12057 that has replaced this
12058 \change_deleted 34634807 1296982967
12060 \change_inserted 34634807 1296982967
12064 This is used to rename a
12065 \change_deleted 34634807 1296982969
12067 \change_inserted 34634807 1296982969
12070 , while keeping backward compatibility.
12073 \begin_layout Description
12074 \begin_inset Flex Code
12077 \begin_layout Plain Layout
12084 \begin_inset Flex Code
12087 \begin_layout Plain Layout
12093 ] The number of optional arguments that can be used with this
12094 \change_deleted 34634807 1296982970
12096 \change_inserted 34634807 1296982970
12100 This is useful for things like section headings, and only makes sense with
12102 Note that, on output, the optional arguments will all precede any required
12103 arguments (see below).
12104 So one can have constructs like:
12108 \begin_layout LyX-Code
12111 mycmd[opt1]{req1}{contents of paragraph}
12114 \begin_layout Standard
12115 but one cannot have things like:
12118 \begin_layout LyX-Code
12121 mycmd[opt1]{req1}[opt2]{contents of paragraph}
12124 \begin_layout Standard
12125 at least, not without ERT (with which you can have anything).
12130 \begin_layout Description
12131 \begin_inset Flex Code
12134 \begin_layout Plain Layout
12141 \begin_inset CommandInset label
12143 name "des:ParbreakIsNewline"
12148 \begin_inset Flex Code
12151 \begin_layout Plain Layout
12160 \begin_inset Flex Code
12163 \begin_layout Plain Layout
12169 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
12170 output, but only by a line break; together with
12171 \begin_inset Flex Code
12174 \begin_layout Plain Layout
12180 , this allows to emulate a plain text editor (like the ERT inset).
12183 \begin_layout Description
12184 \begin_inset Flex Code
12187 \begin_layout Plain Layout
12194 \begin_inset Flex Code
12197 \begin_layout Plain Layout
12203 ] The indent of the very first line of a paragraph.
12205 \begin_inset Flex Code
12208 \begin_layout Plain Layout
12214 will be fixed for a certain
12215 \change_deleted 34634807 1296982972
12217 \change_inserted 34634807 1296982972
12222 \change_deleted 34634807 1296982262
12224 \change_inserted 34634807 1296982262
12226 \begin_inset Flex Code
12229 \begin_layout Plain Layout
12231 \change_inserted 34634807 1296982262
12242 \change_deleted 34634807 1296982974
12244 \change_inserted 34634807 1296982974
12247 , since the indentation of a
12248 \change_deleted 34634807 1296982283
12250 \change_inserted 34634807 1296982283
12252 \begin_inset Flex Code
12255 \begin_layout Plain Layout
12257 \change_inserted 34634807 1296982283
12268 \change_deleted 34634807 1296982976
12270 \change_inserted 34634807 1296982976
12273 paragraph can be prohibited with
12274 \begin_inset Flex Code
12277 \begin_layout Plain Layout
12285 \change_deleted 34634807 1296982295
12287 \change_inserted 34634807 1296982295
12289 \begin_inset Flex Code
12292 \begin_layout Plain Layout
12294 \change_inserted 34634807 1296982295
12305 \change_deleted 34634807 1296982977
12307 \change_inserted 34634807 1296982977
12310 paragraphs inside environments use the
12311 \begin_inset Flex Code
12314 \begin_layout Plain Layout
12320 of the environment, not their native one.
12322 \change_deleted 34634807 1296982308
12324 \change_inserted 34634807 1296982308
12326 \begin_inset Flex Code
12329 \begin_layout Plain Layout
12331 \change_inserted 34634807 1296982308
12341 paragraphs inside an enumeration are not indented.
12344 \begin_layout Description
12345 \begin_inset Flex Code
12348 \begin_layout Plain Layout
12355 \begin_inset Flex Code
12358 \begin_layout Plain Layout
12364 ] The vertical space between two paragraphs of this
12365 \change_deleted 34634807 1296982979
12367 \change_inserted 34634807 1296982979
12373 \begin_layout Description
12374 \begin_inset Flex Code
12377 \begin_layout Plain Layout
12384 \begin_inset Flex Code
12387 \begin_layout Plain Layout
12393 ] LyX allows the user to choose either
12394 \begin_inset Quotes eld
12398 \begin_inset Quotes erd
12402 \begin_inset Quotes eld
12406 \begin_inset Quotes erd
12409 to typeset a document.
12411 \begin_inset Quotes eld
12415 \begin_inset Quotes erd
12418 is chosen, this value is completely ignored.
12420 \begin_inset Quotes eld
12424 \begin_inset Quotes erd
12427 is chosen, the parindent of a LaTeXtype
12428 \begin_inset Quotes eld
12432 \begin_inset Quotes erd
12436 \change_deleted 34634807 1296982981
12438 \change_inserted 34634807 1296982981
12441 is ignored and all paragraphs are separated by this parskip argument.
12442 The vertical space is calculated with
12443 \begin_inset Flex Code
12446 \begin_layout Plain Layout
12448 \begin_inset space ~
12457 \begin_inset Flex Code
12460 \begin_layout Plain Layout
12466 is the height of a row with the normal font.
12467 This way, the look stays the same with different screen fonts.
12470 \begin_layout Description
12471 \begin_inset Flex Code
12474 \begin_layout Plain Layout
12481 \begin_inset CommandInset label
12483 name "des:PassThru"
12488 \begin_inset Flex Code
12491 \begin_layout Plain Layout
12500 \begin_inset Flex Code
12503 \begin_layout Plain Layout
12509 ] Whether the contents of this paragraph should be output in raw form, meaning
12510 without special translations that LaTeX would require.
12513 \begin_layout Description
12514 \begin_inset Flex Code
12517 \begin_layout Plain Layout
12524 \begin_inset CommandInset label
12526 name "des:Preamble"
12530 Information to be included in the LaTeX preamble when this style is used.
12531 Used to define macros, load packages, etc., required by this particular
12534 \begin_inset Quotes eld
12538 \begin_inset Flex Code
12541 \begin_layout Plain Layout
12548 \begin_inset Quotes erd
12554 \begin_layout Description
12555 \begin_inset Flex Code
12558 \begin_layout Plain Layout
12565 \begin_inset Flex Code
12568 \begin_layout Plain Layout
12574 ] The prefix to use when creating labels referring to paragraphs of this
12576 This allows the use of formatted references.
12579 \begin_layout Description
12580 \begin_inset Flex Code
12583 \begin_layout Plain Layout
12590 \begin_inset Flex Code
12593 \begin_layout Plain Layout
12599 ] The number of required arguments that the LaTeX command or environment
12600 corresponding to this
12601 \change_deleted 34634807 1296982982
12603 \change_inserted 34634807 1296982982
12607 In the case of a command, these are required arguments
12611 that associated with the content of the paragraph itself.
12612 These do not actually have to be provided: LyX will output empty arguments
12614 Note that optional arguments will be output before required arguments.
12615 See the discussion of the
12616 \begin_inset Flex Code
12619 \begin_layout Plain Layout
12625 tag above for more information.
12628 \begin_layout Description
12629 \begin_inset Flex Code
12632 \begin_layout Plain Layout
12639 \begin_inset Flex Code
12642 \begin_layout Plain Layout
12649 \begin_inset CommandInset label
12651 name "des:Requires"
12656 \change_deleted 34634807 1296982984
12658 \change_inserted 34634807 1296982984
12661 requires the feature
12662 \begin_inset Flex Code
12665 \begin_layout Plain Layout
12672 See the description of
12673 \begin_inset Flex Code
12676 \begin_layout Plain Layout
12683 \begin_inset CommandInset ref
12684 LatexCommand pageref
12685 reference "des:FreeSpacing"
12689 ) for information on `features'.
12693 \begin_layout Description
12694 \begin_inset Flex Code
12697 \begin_layout Plain Layout
12704 \begin_inset Flex Code
12707 \begin_layout Plain Layout
12714 \begin_inset Flex Code
12717 \begin_layout Plain Layout
12726 \begin_layout Description
12727 \begin_inset Flex Code
12730 \begin_layout Plain Layout
12737 \begin_inset Flex Code
12740 \begin_layout Plain Layout
12745 , onehalf, double, other
12754 ] This defines what the default spacing should be in the
12755 \change_deleted 34634807 1296982985
12757 \change_inserted 34634807 1296982985
12762 \begin_inset Flex Code
12765 \begin_layout Plain Layout
12772 \begin_inset Flex Code
12775 \begin_layout Plain Layout
12782 \begin_inset Flex Code
12785 \begin_layout Plain Layout
12791 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
12792 If you specify the argument
12793 \begin_inset Flex Code
12796 \begin_layout Plain Layout
12802 , then you should also provide a numerical argument which will be the actual
12804 Note that, contrary to other parameters,
12805 \begin_inset Flex Code
12808 \begin_layout Plain Layout
12814 implies the generation of specific LaTeX code, using the package
12817 \begin_inset Flex Code
12820 \begin_layout Plain Layout
12829 \begin_layout Description
12830 \begin_inset Flex Code
12833 \begin_layout Plain Layout
12840 \begin_inset Flex Code
12843 \begin_layout Plain Layout
12850 \begin_inset Flex Code
12853 \begin_layout Plain Layout
12861 ] Spellcheck paragraphs of this style.
12865 \begin_layout Description
12866 \begin_inset Flex Code
12869 \begin_layout Plain Layout
12875 The font used for the text body .
12877 \begin_inset CommandInset ref
12879 reference "sub:Font-description"
12886 \begin_layout Description
12887 \begin_inset Flex Code
12890 \begin_layout Plain Layout
12899 \begin_inset Flex Code
12902 \begin_layout Plain Layout
12912 The level of the style in the table of contents.
12913 This is used for automatic numbering of section headings.
12916 \begin_layout Description
12917 \begin_inset Flex Code
12920 \begin_layout Plain Layout
12927 \begin_inset Flex Code
12930 \begin_layout Plain Layout
12936 ] The vertical space with which the very first of a chain of paragraphs
12938 \change_deleted 34634807 1296982986
12940 \change_inserted 34634807 1296982986
12943 is separated from the previous paragraph.
12944 If the previous paragraph has another
12945 \change_deleted 34634807 1296982988
12947 \change_inserted 34634807 1296982988
12950 , the separations are not simply added, but the maximum is taken.
12953 \begin_layout Subsection
12954 \begin_inset CommandInset label
12960 Internationalization of Paragraph Styles
12963 \begin_layout Standard
12964 LyX has long supported internationalization of layout information, but,
12965 until version 2.0, this applied only to the user interface and not to, say,
12967 Thus, French authors were forced to resort to ugly hacks if they wanted
12972 1' instead of `Theorem 1'.
12973 Thanks to Georg Baum, that is no longer the case.
12976 \begin_layout Standard
12978 \begin_inset Flex Code
12981 \begin_layout Plain Layout
12987 defines text that is to appear in the typeset document, it may use
12988 \begin_inset Flex Code
12991 \begin_layout Plain Layout
12998 \begin_inset Flex Code
13001 \begin_layout Plain Layout
13007 to support non-English and even multi-language documents correctly.
13008 The following excerpt (from the
13009 \begin_inset Flex Code
13012 \begin_layout Plain Layout
13018 file) shows how this works:
13021 \begin_layout LyX-Code
13026 \begin_layout LyX-Code
13029 theoremstyle{remark}
13032 \begin_layout LyX-Code
13035 newtheorem{claim}[thm]{
13042 \begin_layout LyX-Code
13046 \begin_layout LyX-Code
13050 \begin_layout LyX-Code
13055 claimname}{_(Claim)}
13058 \begin_layout LyX-Code
13062 \begin_layout LyX-Code
13066 \begin_layout LyX-Code
13075 claimname}{_(Claim)}}
13078 \begin_layout LyX-Code
13083 \begin_layout Standard
13084 In principle, any legal LaTeX may appear in the
13085 \begin_inset Flex Code
13088 \begin_layout Plain Layout
13095 \begin_inset Flex Code
13098 \begin_layout Plain Layout
13104 tags, but in practice they will typically look as they do here.
13105 The key to correct translation of the typeset text is the definition of
13107 \begin_inset Flex Code
13110 \begin_layout Plain Layout
13119 \begin_inset Flex Code
13122 \begin_layout Plain Layout
13134 \begin_layout Standard
13136 \begin_inset Flex Code
13139 \begin_layout Plain Layout
13145 tag provides for internationalization based upon the overall language of
13147 The contents of the tag will be included in the preamble, just as with
13149 \begin_inset Flex Code
13152 \begin_layout Plain Layout
13159 What makes it special is the use of the
13160 \begin_inset Quotes eld
13164 \begin_inset Quotes erd
13168 \begin_inset Flex Code
13171 \begin_layout Plain Layout
13177 , which will be replaced, when LyX produces LaTeX output, with the translation
13178 of its argument into the document language.
13181 \begin_layout Standard
13183 \begin_inset Flex Code
13186 \begin_layout Plain Layout
13192 tag is more complex, since it is meant to provide support for multi-language
13193 documents and so offers an interface to the
13194 \begin_inset Flex Code
13197 \begin_layout Plain Layout
13204 Its contents will be added to the preamble once for each language that
13205 appears in the document.
13206 In this case, the argument to
13207 \begin_inset Flex Code
13210 \begin_layout Plain Layout
13216 will be replaced with its translation into the language in question; the
13218 \begin_inset Flex Code
13221 \begin_layout Plain Layout
13227 is replaced by the language name (as used by the babel package).
13230 \begin_layout Standard
13231 A German document that also included a French section would thus have the
13232 following in the preamble:
13235 \begin_layout LyX-Code
13244 claimname}{Affirmation}}
13252 claimname}{Behauptung}}
13256 claimname}{Behauptung}
13259 \begin_layout Standard
13261 \begin_inset Flex Code
13264 \begin_layout Plain Layout
13270 will then conspire to produce the correct text in the output.
13273 \begin_layout Standard
13274 One important point to note here is that the translations are provided by
13275 LyX itself, through the same mechanism it uses for internationalization
13276 of the user interface.
13277 This means, in effect, that
13278 \begin_inset Flex Code
13281 \begin_layout Plain Layout
13288 \begin_inset Flex Code
13291 \begin_layout Plain Layout
13297 are really only of use in layout files that are provided with LyX, since
13298 text entered in user-created layout files will not be seen by LyX's internation
13299 alization routines.
13300 That said, however, any layout created with the intention that it will
13301 be included with LyX should use these tags where appropriate.
13304 \begin_layout Subsection
13306 \begin_inset CommandInset label
13315 \begin_layout Standard
13316 Since version 1.3.0 of LyX, it is has been both possible and necessary to
13317 define the floats (
13318 \begin_inset Flex MenuItem
13321 \begin_layout Plain Layout
13328 \begin_inset Flex MenuItem
13331 \begin_layout Plain Layout
13337 , \SpecialChar \ldots{}
13338 ) in the text class itself.
13339 Standard floats are included in the file
13340 \begin_inset Flex Code
13343 \begin_layout Plain Layout
13349 , so you may have to do no more than add
13352 \begin_layout LyX-Code
13353 Input stdfloats.inc
13356 \begin_layout Standard
13357 to your layout file.
13358 If you want to implement a text class that proposes some other float types
13359 (like the AGU class bundled with LyX), the information below will hopefully
13363 \begin_layout Description
13364 \begin_inset Flex Code
13367 \begin_layout Plain Layout
13374 \begin_inset Flex Code
13377 \begin_layout Plain Layout
13384 \begin_inset Quotes erd
13388 \begin_inset Quotes erd
13391 ] The file name extension of an auxiliary file for the list of figures (or
13393 LaTeX writes the captions to this file.
13396 \begin_layout Description
13397 \begin_inset Flex Code
13400 \begin_layout Plain Layout
13407 \begin_inset Flex Code
13410 \begin_layout Plain Layout
13417 \begin_inset Quotes erd
13421 \begin_inset Quotes erd
13424 ] The string that will be used in the menus and also for the caption.
13425 This is translated to the current language if babel is used.
13428 \begin_layout Description
13429 \begin_inset Flex Code
13432 \begin_layout Plain Layout
13438 These are used for XHTML output.
13440 \begin_inset CommandInset ref
13442 reference "sec:Tags-for-XHTML"
13449 \begin_layout Description
13450 \begin_inset Flex Code
13453 \begin_layout Plain Layout
13462 \begin_inset Flex Code
13465 \begin_layout Plain Layout
13474 \begin_inset Flex Code
13477 \begin_layout Plain Layout
13483 ] Indicates whether the float is already defined in the document class or
13484 if we instead need to load
13485 \begin_inset Flex Code
13488 \begin_layout Plain Layout
13494 and use what it provides to define it on-the-fly.
13496 \begin_inset Flex Code
13499 \begin_layout Plain Layout
13506 \begin_inset Flex Code
13509 \begin_layout Plain Layout
13516 It should be set to
13517 \begin_inset Flex Code
13520 \begin_layout Plain Layout
13526 if the float is already defined by the LaTeX document class.
13529 \begin_layout Description
13530 \begin_inset Flex Code
13533 \begin_layout Plain Layout
13540 \begin_inset Flex Code
13543 \begin_layout Plain Layout
13550 \begin_inset Quotes erd
13554 \begin_inset Quotes erd
13557 ] The command used to generate a list of floats of this type; the leading
13560 ' should be omitted.
13566 \begin_inset Flex Code
13569 \begin_layout Plain Layout
13575 is false, since there is no standard way to generate this command.
13577 \begin_inset Flex Code
13580 \begin_layout Plain Layout
13586 is true, since in that case there is a standard way to define the command.
13589 \begin_layout Description
13590 \begin_inset Flex Code
13593 \begin_layout Plain Layout
13600 \begin_inset Flex Code
13603 \begin_layout Plain Layout
13610 \begin_inset Quotes erd
13614 \begin_inset Quotes erd
13617 ] A title for a list of floats of this kind (list of figures, tables, or
13619 It is used for the screen label within LyX; it is passed to LaTeX for use
13620 as the title there; and it is used as the title in XHTML output.
13621 It will be translated to the document language.
13624 \begin_layout Description
13625 \begin_inset Flex Code
13628 \begin_layout Plain Layout
13635 \begin_inset Flex Code
13638 \begin_layout Plain Layout
13645 \begin_inset Quotes erd
13649 \begin_inset Quotes erd
13652 ] This (optional) argument determines whether floats of this class will
13653 be numbered within some sectional unit of the document.
13654 For example, if within is equal to
13655 \begin_inset Flex Code
13658 \begin_layout Plain Layout
13664 , the floats will be numbered within chapters.
13668 \begin_layout Description
13669 \begin_inset Flex Code
13672 \begin_layout Plain Layout
13679 \begin_inset Flex Code
13682 \begin_layout Plain Layout
13689 \begin_inset Quotes erd
13693 \begin_inset Quotes erd
13696 ] The default placement for the given class of floats.
13697 The string should be as in standard LaTeX:
13698 \begin_inset Flex Code
13701 \begin_layout Plain Layout
13708 \begin_inset Flex Code
13711 \begin_layout Plain Layout
13718 \begin_inset Flex Code
13721 \begin_layout Plain Layout
13728 \begin_inset Flex Code
13731 \begin_layout Plain Layout
13737 for top, bottom, page, and here, respectively.
13741 \begin_layout Plain Layout
13742 Note that the order of these letters in the string is irrelevant, like in
13748 On top of that there is a new type,
13749 \begin_inset Flex Code
13752 \begin_layout Plain Layout
13758 , which does not really correspond to a float, since it means: put it
13759 \begin_inset Quotes eld
13763 \begin_inset Quotes erd
13767 Note however that the
13768 \begin_inset Flex Code
13771 \begin_layout Plain Layout
13777 specifier is special and, because of implementation details, cannot be
13778 used in non-built in float types.
13779 If you do not understand what this means, just use
13780 \begin_inset Quotes eld
13784 \begin_inset Flex Code
13787 \begin_layout Plain Layout
13794 \begin_inset Quotes erd
13800 \begin_layout Description
13801 \begin_inset Flex Code
13804 \begin_layout Plain Layout
13811 \begin_inset Flex Code
13814 \begin_layout Plain Layout
13820 ] The prefix to use when creating labels referring to floats of this type.
13821 This allows the use of formatted references.
13822 Note that you can remove any
13823 \begin_inset Flex Code
13826 \begin_layout Plain Layout
13832 set by a copied style by using the special value
13833 \begin_inset Quotes eld
13837 \begin_inset Quotes erd
13840 , which must be all caps.
13843 \begin_layout Description
13844 \begin_inset Flex Code
13847 \begin_layout Plain Layout
13854 \begin_inset Flex Code
13857 \begin_layout Plain Layout
13864 \begin_inset Quotes erd
13868 \begin_inset Quotes erd
13871 ] The style used when defining the float using
13872 \begin_inset Flex Code
13875 \begin_layout Plain Layout
13886 \begin_layout Description
13887 \begin_inset Flex Code
13890 \begin_layout Plain Layout
13897 \begin_inset Flex Code
13900 \begin_layout Plain Layout
13907 \begin_inset Quotes erd
13911 \begin_inset Quotes erd
13915 \begin_inset Quotes eld
13919 \begin_inset Quotes erd
13922 of the new class of floats, like program or algorithm.
13923 After the appropriate
13924 \begin_inset Flex Code
13927 \begin_layout Plain Layout
13936 \begin_inset Flex Code
13939 \begin_layout Plain Layout
13948 \begin_inset Flex Code
13951 \begin_layout Plain Layout
13962 \begin_layout Description
13963 \begin_inset Flex Code
13966 \begin_layout Plain Layout
13973 \begin_inset Flex Code
13976 \begin_layout Plain Layout
13983 \begin_inset Flex Code
13986 \begin_layout Plain Layout
13994 ] Tells us whether this float is defined using the facilities provided by
13996 \begin_inset Flex Code
13999 \begin_layout Plain Layout
14005 , either by the class file or a package, or on-the-fly by LyX itself.
14008 \begin_layout Standard
14009 Note that defining a float with type
14010 \begin_inset Flex Code
14013 \begin_layout Plain Layout
14021 automatically defines the corresponding counter with name
14022 \begin_inset Flex Code
14025 \begin_layout Plain Layout
14036 \begin_layout Subsection
14037 Flex insets and InsetLayout
14038 \begin_inset CommandInset label
14040 name "sub:Flex-insets-and"
14047 \begin_layout Standard
14048 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
14049 these are called Flex insets.
14053 \begin_layout Standard
14054 Flex insets come in three different kinds:
14057 \begin_layout Itemize
14059 \begin_inset Flex Code
14062 \begin_layout Plain Layout
14068 ): These define semantic markup corresponding to such LaTeX commands as
14070 \begin_inset Flex Code
14073 \begin_layout Plain Layout
14082 \begin_inset Flex Code
14085 \begin_layout Plain Layout
14096 \begin_layout Itemize
14098 \begin_inset Flex Code
14101 \begin_layout Plain Layout
14107 ): These can be used to define custom collapsible insets, similar to TeX
14108 code, footnote, and the like.
14109 An obvious example is an endnote inset, which is defined in the
14110 \begin_inset Flex Code
14113 \begin_layout Plain Layout
14122 \begin_layout Itemize
14124 \begin_inset Flex Code
14127 \begin_layout Plain Layout
14133 ): For use with DocBook classes.
14136 \begin_layout Standard
14137 Flex insets are defined using the
14138 \begin_inset Flex Code
14141 \begin_layout Plain Layout
14147 tag, which shall be explained in a moment.
14150 \begin_layout Standard
14152 \begin_inset Flex Code
14155 \begin_layout Plain Layout
14161 tag also serves another function: It can be used to customize the general
14162 layout of many different types of insets.
14164 \begin_inset Flex Code
14167 \begin_layout Plain Layout
14173 can be used to customize the layout parameters for footnotes, marginal
14174 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
14175 boxes, tables, algorithms, URLs, and optional arguments, as well as to
14176 define Flex insets.
14179 \begin_layout Standard
14181 \begin_inset Flex Code
14184 \begin_layout Plain Layout
14190 definition must begin with a line of the form:
14193 \begin_layout LyX-Code
14197 \begin_layout Standard
14199 \begin_inset Flex Code
14202 \begin_layout Plain Layout
14208 indicates the inset whose layout is being defined, and here there are two
14212 \begin_layout Enumerate
14213 The layout for a pre-existing inset is being modified.
14214 In this case, can be
14215 \begin_inset Flex Code
14218 \begin_layout Plain Layout
14224 any one of the following:
14225 \begin_inset Flex Code
14228 \begin_layout Plain Layout
14235 \begin_inset Flex Code
14238 \begin_layout Plain Layout
14245 \begin_inset Flex Code
14248 \begin_layout Plain Layout
14255 \begin_inset Flex Code
14258 \begin_layout Plain Layout
14265 \begin_inset Flex Code
14268 \begin_layout Plain Layout
14275 \begin_inset Flex Code
14278 \begin_layout Plain Layout
14285 \begin_inset Flex Code
14288 \begin_layout Plain Layout
14295 \begin_inset Flex Code
14298 \begin_layout Plain Layout
14305 \begin_inset Flex Code
14308 \begin_layout Plain Layout
14315 \begin_inset Flex Code
14318 \begin_layout Plain Layout
14325 \begin_inset Flex Code
14328 \begin_layout Plain Layout
14335 \begin_inset Flex Code
14338 \begin_layout Plain Layout
14345 \begin_inset Flex Code
14348 \begin_layout Plain Layout
14355 \begin_inset Flex Code
14358 \begin_layout Plain Layout
14365 \begin_inset Flex Code
14368 \begin_layout Plain Layout
14375 \begin_inset Flex Code
14378 \begin_layout Plain Layout
14385 \begin_inset Flex Code
14388 \begin_layout Plain Layout
14395 \begin_inset Flex Code
14398 \begin_layout Plain Layout
14405 \begin_inset Flex Code
14408 \begin_layout Plain Layout
14415 \begin_inset Flex Code
14418 \begin_layout Plain Layout
14427 \begin_layout Enumerate
14428 The layout for a Flex inset is being defined.
14430 \begin_inset Flex Code
14433 \begin_layout Plain Layout
14439 may be be any valid identifier not used by a pre-existing inset.
14440 The identifier may include spaces, but in that case the whole thing must
14441 be wrapped in quotes.
14442 It may also include a namespace identifier, preceding a colon, such as
14444 \begin_inset Quotes eld
14448 \begin_inset Flex Code
14451 \begin_layout Plain Layout
14458 \begin_inset Quotes erd
14462 Note that the definition of a flex inset
14467 \begin_inset Flex Code
14470 \begin_layout Plain Layout
14476 entry, declaring which type of inset it defines.
14479 \begin_layout Standard
14481 \begin_inset Flex Code
14484 \begin_layout Plain Layout
14490 definition can contain the following entries:
14493 \begin_layout Description
14494 \begin_inset Flex Code
14497 \begin_layout Plain Layout
14503 The color for the inset's background.
14504 The valid colors are defined in
14505 \begin_inset Flex Code
14508 \begin_layout Plain Layout
14517 \begin_layout Description
14518 \begin_inset Flex Code
14521 \begin_layout Plain Layout
14528 \begin_inset Flex Code
14531 \begin_layout Plain Layout
14540 \begin_inset Flex Code
14543 \begin_layout Plain Layout
14549 ] Whether to use the content of the inset as the label, when the inset is
14554 \begin_layout Description
14555 \begin_inset Flex Code
14558 \begin_layout Plain Layout
14564 As with paragraph styles (see page
14565 \begin_inset CommandInset ref
14567 reference "des:CopyStyle"
14574 \begin_layout Description
14575 \begin_inset Flex Code
14578 \begin_layout Plain Layout
14585 \begin_inset Flex Code
14588 \begin_layout Plain Layout
14597 \begin_inset Flex Code
14600 \begin_layout Plain Layout
14606 ] Indicates whether the user may employ the Paragraph Settings dialog to
14607 customize the paragraph.
14610 \begin_layout Description
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
14641 \begin_inset Flex Code
14644 \begin_layout Plain Layout
14650 , describing the rendering style used for the inset's frame and buttons.
14651 Footnotes generally use
14652 \begin_inset Flex Code
14655 \begin_layout Plain Layout
14661 , ERT insets generally
14662 \begin_inset Flex Code
14665 \begin_layout Plain Layout
14671 , and character styles
14672 \begin_inset Flex Code
14675 \begin_layout Plain Layout
14684 \begin_layout Description
14685 \begin_inset Flex Code
14688 \begin_layout Plain Layout
14695 \begin_inset Flex Code
14698 \begin_layout Plain Layout
14705 \begin_inset Flex Code
14708 \begin_layout Plain Layout
14717 \begin_inset Flex Code
14720 \begin_layout Plain Layout
14727 \begin_inset Flex Code
14730 \begin_layout Plain Layout
14737 Indicates whether the environment will stand on its own in LaTeX output
14738 or will appear inline with the surrounding text.
14739 If set to false, it is supposed that the LaTeX environment ignores white
14740 space (including one newline character) after the
14741 \begin_inset Flex Code
14744 \begin_layout Plain Layout
14757 \begin_inset Flex Code
14760 \begin_layout Plain Layout
14776 \begin_layout Description
14777 \begin_inset Flex Code
14780 \begin_layout Plain Layout
14786 Required at the end of the InsetLayout declarations.
14789 \begin_layout Description
14790 \begin_inset Flex Code
14793 \begin_layout Plain Layout
14799 The font used for both the text body
14805 \begin_inset space ~
14809 \begin_inset CommandInset ref
14811 reference "sub:Font-description"
14816 Note that defining this font automatically defines the
14817 \begin_inset Flex Code
14820 \begin_layout Plain Layout
14826 to the same value, so define this first and define
14827 \begin_inset Flex Code
14830 \begin_layout Plain Layout
14836 later if you want them to be different.
14839 \begin_layout Description
14840 \begin_inset Flex Code
14843 \begin_layout Plain Layout
14850 \begin_inset Quotes eld
14854 \begin_inset Quotes erd
14857 language, leading to Left-to-Right (latin) output, e.
14858 \begin_inset space \thinspace{}
14862 \begin_inset space \space{}
14865 in TeX code or URL.
14869 \begin_layout Description
14870 \begin_inset Flex Code
14873 \begin_layout Plain Layout
14880 \begin_inset Flex Code
14883 \begin_layout Plain Layout
14892 \begin_inset Flex Code
14895 \begin_layout Plain Layout
14901 ] Indicates whether the
14902 \change_deleted 34634807 1296982392
14904 \change_inserted 34634807 1296982392
14906 \begin_inset Flex Code
14909 \begin_layout Plain Layout
14911 \change_inserted 34634807 1296982392
14921 should be used or, instead, the user can change the paragraph style used
14926 \begin_layout Description
14927 \begin_inset Flex Code
14930 \begin_layout Plain Layout
14936 As with paragraph styles (see page
14937 \begin_inset CommandInset ref
14938 LatexCommand pageref
14939 reference "des:FreeSpacing"
14947 \begin_layout Description
14948 \begin_inset Flex Code
14951 \begin_layout Plain Layout
14957 These tags control XHTML output.
14959 \begin_inset CommandInset ref
14961 reference "sec:Tags-for-XHTML"
14968 \begin_layout Description
14969 \begin_inset Flex Code
14972 \begin_layout Plain Layout
14979 \begin_inset Flex Code
14982 \begin_layout Plain Layout
14991 \begin_inset Flex Code
14994 \begin_layout Plain Layout
15000 ] Whether to include the contents of this inset in the strings generated
15001 for the `Outline' pane.
15002 One would not, for example, want the content of a footnote in a section
15003 header to be included in the TOC displayed in the outline, but one would
15004 normally want the content of a character style displayed.
15005 Default is false: not to include.
15008 \begin_layout Description
15009 \begin_inset Flex Code
15012 \begin_layout Plain Layout
15018 As with paragraph styles (see page
15019 \begin_inset CommandInset ref
15020 LatexCommand pageref
15021 reference "des:KeepEmpty"
15029 \begin_layout Description
15030 \begin_inset Flex Code
15033 \begin_layout Plain Layout
15039 The font used for the label.
15041 \begin_inset space ~
15045 \begin_inset CommandInset ref
15047 reference "sub:Font-description"
15052 Note that this definition can never appear before
15053 \begin_inset Flex Code
15056 \begin_layout Plain Layout
15062 , lest it be ineffective.
15065 \begin_layout Description
15066 \begin_inset Flex Code
15069 \begin_layout Plain Layout
15075 What will be displayed on the button or elsewhere as the inset label.
15077 \change_deleted 34634807 1296982426
15079 \change_inserted 34634807 1296982426
15081 \begin_inset Flex Code
15084 \begin_layout Plain Layout
15086 \change_inserted 34634807 1296982426
15097 \change_deleted 34634807 1296982433
15099 \change_inserted 34634807 1296982433
15101 \begin_inset Flex Code
15104 \begin_layout Plain Layout
15106 \change_inserted 34634807 1296982433
15116 ) modify this label on the fly.
15119 \begin_layout Description
15120 \begin_inset Flex Code
15123 \begin_layout Plain Layout
15129 The name of the corresponding LaTeX stuff.
15130 Either the environment or command name.
15133 \begin_layout Description
15134 \begin_inset Flex Code
15137 \begin_layout Plain Layout
15143 The optional parameter for the corresponding
15144 \begin_inset Flex Code
15147 \begin_layout Plain Layout
15153 stuff, including possible bracket pairs like
15154 \begin_inset Flex Code
15157 \begin_layout Plain Layout
15164 This parameter cannot be changed from within LyX.
15167 \begin_layout Description
15168 \begin_inset Flex Code
15171 \begin_layout Plain Layout
15177 As with paragraph styles (see page
15178 \begin_inset CommandInset ref
15179 LatexCommand pageref
15180 reference "des:LatexType"
15187 \begin_layout Description
15188 \begin_inset Flex Code
15191 \begin_layout Plain Layout
15198 \begin_inset Flex Code
15201 \begin_layout Plain Layout
15208 \begin_inset Flex Code
15211 \begin_layout Plain Layout
15218 \begin_inset Flex Code
15221 \begin_layout Plain Layout
15228 \begin_inset Flex Code
15231 \begin_layout Plain Layout
15237 (indicating a dummy definition ending definitions of charstyles, etc).
15238 This entry is required in and is only meaningful for Flex insets.
15239 Among other things, it determines on which menu this inset will appear.
15241 \begin_inset Flex Code
15244 \begin_layout Plain Layout
15251 \begin_inset Flex Code
15254 \begin_layout Plain Layout
15261 \begin_inset Flex Code
15264 \begin_layout Plain Layout
15272 \begin_inset Flex Code
15275 \begin_layout Plain Layout
15281 can be set to true for charstyle insets, if you wish, by setting it
15286 \begin_inset Flex Code
15289 \begin_layout Plain Layout
15298 \begin_layout Description
15299 \begin_inset Flex Code
15302 \begin_layout Plain Layout
15309 \begin_inset Flex Code
15312 \begin_layout Plain Layout
15321 \begin_inset Flex Code
15324 \begin_layout Plain Layout
15330 ] Whether multiple paragraphs are permitted in this inset.
15332 \begin_inset Flex Code
15335 \begin_layout Plain Layout
15341 to the same value and
15342 \begin_inset Flex Code
15345 \begin_layout Plain Layout
15351 to the opposite value.
15352 These can be reset to other values, if they are used
15357 \begin_inset Flex Code
15360 \begin_layout Plain Layout
15370 \begin_layout Description
15371 \begin_inset Flex Code
15374 \begin_layout Plain Layout
15381 \begin_inset Flex Code
15384 \begin_layout Plain Layout
15393 \begin_inset Flex Code
15396 \begin_layout Plain Layout
15402 ] Whether fragile commands in this
15403 \change_deleted 34634807 1296982465
15405 \change_inserted 34634807 1296982466
15409 \begin_inset Flex Code
15412 \begin_layout Plain Layout
15425 whether the command should itself be protected.) Default is false.
15428 \begin_layout Description
15429 \begin_inset Flex Code
15432 \begin_layout Plain Layout
15439 \begin_inset Flex Code
15442 \begin_layout Plain Layout
15451 \begin_inset Flex Code
15454 \begin_layout Plain Layout
15460 ] As with paragraph styles (see page
15461 \begin_inset CommandInset ref
15462 LatexCommand pageref
15463 reference "des:ParbreakIsNewline"
15471 \begin_layout Description
15472 \begin_inset Flex Code
15475 \begin_layout Plain Layout
15482 \begin_inset Flex Code
15485 \begin_layout Plain Layout
15494 \begin_inset Flex Code
15497 \begin_layout Plain Layout
15503 ] As with paragraph styles (see page
15504 \begin_inset CommandInset ref
15505 LatexCommand pageref
15506 reference "des:PassThru"
15514 \begin_layout Description
15515 \begin_inset Flex Code
15518 \begin_layout Plain Layout
15524 As with paragraph styles (see page
15525 \begin_inset CommandInset ref
15526 LatexCommand pageref
15527 reference "des:Preamble"
15534 \begin_layout Description
15535 \begin_inset Flex Code
15538 \begin_layout Plain Layout
15545 \begin_inset Flex Code
15548 \begin_layout Plain Layout
15554 ] The prefix to use when creating labels referring to insets of this type.
15555 This allows the use of formatted references.
15558 \begin_layout Description
15559 \begin_inset Flex Code
15562 \begin_layout Plain Layout
15569 \begin_inset Flex Code
15572 \begin_layout Plain Layout
15578 ] As with paragraph styles (see page
15579 \begin_inset CommandInset ref
15580 LatexCommand pageref
15581 reference "des:Requires"
15588 \begin_layout Description
15589 \begin_inset Flex Code
15592 \begin_layout Plain Layout
15599 \begin_inset Flex Code
15602 \begin_layout Plain Layout
15609 \begin_inset Flex Code
15612 \begin_layout Plain Layout
15620 ] Whether this inset should use the font of its surrounding environment
15622 Default is true: uses its own.
15625 \begin_layout Description
15626 \begin_inset Flex Code
15629 \begin_layout Plain Layout
15636 \begin_inset Flex Code
15639 \begin_layout Plain Layout
15646 \begin_inset Flex Code
15649 \begin_layout Plain Layout
15657 ] Spellcheck the contents of this inset.
15661 \begin_layout Subsection
15663 \begin_inset CommandInset label
15665 name "sub:Counters"
15672 \begin_layout Standard
15673 Since version 1.3.0 of LyX, it is both possible and necessary to define the
15675 \begin_inset Flex MenuItem
15678 \begin_layout Plain Layout
15685 \begin_inset Flex MenuItem
15688 \begin_layout Plain Layout
15694 , \SpecialChar \ldots{}
15695 ) in the text class itself.
15696 The standard counters are defined in the file
15697 \begin_inset Flex Code
15700 \begin_layout Plain Layout
15706 , so you may have to do no more than add
15709 \begin_layout LyX-Code
15710 Input stdcounters.inc
15713 \begin_layout Standard
15714 to your layout file to get them to work.
15715 But if you want to define custom counters, then you can do so.
15716 The counter declaration must begin with:
15719 \begin_layout LyX-Code
15720 Counter CounterName
15723 \begin_layout Standard
15725 \begin_inset Flex Code
15728 \begin_layout Plain Layout
15734 ' is replaced by the name of the counter.
15735 And it must end with
15736 \begin_inset Quotes eld
15740 \begin_inset Flex Code
15743 \begin_layout Plain Layout
15750 \begin_inset Quotes erd
15754 The following parameters can also be used:
15757 \begin_layout Description
15758 \begin_inset Flex Code
15761 \begin_layout Plain Layout
15768 \begin_inset Flex Code
15771 \begin_layout Plain Layout
15778 \begin_inset Quotes erd
15782 \begin_inset Quotes erd
15785 ] When defined, this string defines how the counter is displayed.
15786 Setting this value sets
15787 \begin_inset Flex Code
15790 \begin_layout Plain Layout
15791 LabelStringAppendix
15797 The following special constructs can be used in the string:
15801 \begin_layout Itemize
15802 \begin_inset Flex Code
15805 \begin_layout Plain Layout
15813 will be replaced by the expansion of the
15814 \begin_inset Flex Code
15817 \begin_layout Plain Layout
15824 \begin_inset Flex Code
15827 \begin_layout Plain Layout
15828 LabelStringAppendix
15834 \begin_inset Flex Code
15837 \begin_layout Plain Layout
15847 \begin_layout Itemize
15848 counter values can be expressed using LaTeX-like macros
15849 \begin_inset Flex Code
15852 \begin_layout Plain Layout
15869 \begin_inset Flex Code
15872 \begin_layout Plain Layout
15884 \begin_layout Plain Layout
15894 Actually, the situation is a bit more complicated: any
15913 other than those described below will produce arabic numerals.
15914 It would not be surprising to see this change in the future.
15920 \begin_inset Flex Code
15923 \begin_layout Plain Layout
15929 : 1, 2, 3,\SpecialChar \ldots{}
15931 \begin_inset Flex Code
15934 \begin_layout Plain Layout
15940 for lower-case letters: a, b, c, \SpecialChar \ldots{}
15942 \begin_inset Flex Code
15945 \begin_layout Plain Layout
15951 for upper-case letters: A, B, C, \SpecialChar \ldots{}
15953 \begin_inset Flex Code
15956 \begin_layout Plain Layout
15962 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
15964 \begin_inset Flex Code
15967 \begin_layout Plain Layout
15973 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
15975 \begin_inset Flex Code
15978 \begin_layout Plain Layout
15984 for hebrew numerals.
15988 \begin_layout Standard
15989 If LabelString is not defined, a default value is constructed as follows:
15990 if the counter has a master counter
15991 \begin_inset Flex Code
15994 \begin_layout Plain Layout
16001 \begin_inset Flex Code
16004 \begin_layout Plain Layout
16011 \begin_inset Flex Code
16014 \begin_layout Plain Layout
16024 is used; otherwise the string
16025 \begin_inset Flex Code
16028 \begin_layout Plain Layout
16039 \begin_layout Description
16040 \begin_inset Flex Code
16043 \begin_layout Plain Layout
16044 LabelStringAppendix
16050 \begin_inset Flex Code
16053 \begin_layout Plain Layout
16060 \begin_inset Quotes erd
16064 \begin_inset Quotes erd
16068 \begin_inset Flex Code
16071 \begin_layout Plain Layout
16077 , but for use in the Appendix.
16080 \begin_layout Description
16081 \begin_inset Flex Code
16084 \begin_layout Plain Layout
16091 \begin_inset Flex Code
16094 \begin_layout Plain Layout
16101 \begin_inset Quotes erd
16105 \begin_inset Quotes erd
16108 ] A format for use with formatted references to this counter.
16109 For example, one might want to have references to section numbers appear
16111 \begin_inset Quotes eld
16115 \begin_inset Quotes erd
16119 The string should contain
16120 \begin_inset Quotes eld
16124 \begin_inset Quotes erd
16128 This will be replaced by the counter number itself.
16129 So, for sections, it would be: Section ##.
16132 \begin_layout Description
16133 \begin_inset Flex Code
16136 \begin_layout Plain Layout
16143 \begin_inset Flex Code
16146 \begin_layout Plain Layout
16153 \begin_inset Quotes erd
16157 \begin_inset Quotes erd
16160 ] If this is set to the name of another counter, the present counter will
16161 be reset every time the other one is increased.
16163 \begin_inset Flex Code
16166 \begin_layout Plain Layout
16173 \begin_inset Flex Code
16176 \begin_layout Plain Layout
16185 \begin_layout Subsection
16187 \begin_inset CommandInset label
16189 name "sub:Font-description"
16196 \begin_layout Standard
16197 A font description looks like this:
16200 \begin_layout LyX-Code
16210 \begin_layout LyX-Code
16214 \begin_layout LyX-Code
16218 \begin_layout Standard
16219 The following commands are available:
16222 \begin_layout Description
16223 \begin_inset Flex Code
16226 \begin_layout Plain Layout
16233 \begin_inset Flex Code
16236 \begin_layout Plain Layout
16245 \begin_inset Flex Code
16248 \begin_layout Plain Layout
16255 \begin_inset Flex Code
16258 \begin_layout Plain Layout
16265 \begin_inset Flex Code
16268 \begin_layout Plain Layout
16275 \begin_inset Flex Code
16278 \begin_layout Plain Layout
16285 \begin_inset Flex Code
16288 \begin_layout Plain Layout
16295 \begin_inset Flex Code
16298 \begin_layout Plain Layout
16305 \begin_inset Flex Code
16308 \begin_layout Plain Layout
16315 \begin_inset Flex Code
16318 \begin_layout Plain Layout
16327 \begin_layout Description
16328 \begin_inset Flex Code
16331 \begin_layout Plain Layout
16338 \begin_inset Flex Code
16341 \begin_layout Plain Layout
16350 \begin_inset Flex Code
16353 \begin_layout Plain Layout
16360 \begin_inset Flex Code
16363 \begin_layout Plain Layout
16372 \begin_layout Description
16373 \begin_inset Flex Code
16376 \begin_layout Plain Layout
16383 \begin_inset Flex Code
16386 \begin_layout Plain Layout
16392 ] Valid arguments are:
16393 \begin_inset Flex Code
16396 \begin_layout Plain Layout
16403 \begin_inset Flex Code
16406 \begin_layout Plain Layout
16413 \begin_inset Flex Code
16416 \begin_layout Plain Layout
16423 \begin_inset Flex Code
16426 \begin_layout Plain Layout
16433 \begin_inset Flex Code
16436 \begin_layout Plain Layout
16443 \begin_inset Flex Code
16446 \begin_layout Plain Layout
16453 Each of these turns on or off the corresponding attribute.
16455 \begin_inset Flex Code
16458 \begin_layout Plain Layout
16464 turns on emphasis, and
16465 \begin_inset Flex Code
16468 \begin_layout Plain Layout
16476 \begin_inset Newline newline
16479 If the latter seems puzzling, remember that the font settings for the present
16480 context are generally inherited from the surrounding context.
16482 \begin_inset Flex Code
16485 \begin_layout Plain Layout
16491 would turn off the emphasis that was anyway in effect, say, in a theorem
16495 \begin_layout Description
16496 \begin_inset Flex Code
16499 \begin_layout Plain Layout
16506 \begin_inset Flex Code
16509 \begin_layout Plain Layout
16518 \begin_inset Flex Code
16521 \begin_layout Plain Layout
16530 \begin_layout Description
16531 \begin_inset Flex Code
16534 \begin_layout Plain Layout
16541 \begin_inset Flex Code
16544 \begin_layout Plain Layout
16553 \begin_inset Flex Code
16556 \begin_layout Plain Layout
16563 \begin_inset Flex Code
16566 \begin_layout Plain Layout
16573 \begin_inset Flex Code
16576 \begin_layout Plain Layout
16585 \begin_layout Description
16586 \begin_inset Flex Code
16589 \begin_layout Plain Layout
16596 \begin_inset Flex Code
16599 \begin_layout Plain Layout
16606 \begin_inset Flex Code
16609 \begin_layout Plain Layout
16616 \begin_inset Flex Code
16619 \begin_layout Plain Layout
16628 \begin_inset Flex Code
16631 \begin_layout Plain Layout
16638 \begin_inset Flex Code
16641 \begin_layout Plain Layout
16648 \begin_inset Flex Code
16651 \begin_layout Plain Layout
16658 \begin_inset Flex Code
16661 \begin_layout Plain Layout
16668 \begin_inset Flex Code
16671 \begin_layout Plain Layout
16680 \begin_layout Subsection
16681 \begin_inset CommandInset label
16683 name "sub:Citation-format-description"
16687 Citation format description
16690 \begin_layout Standard
16692 \begin_inset Flex Code
16695 \begin_layout Plain Layout
16701 blocks are used to describe how bibliographic information should be displayed,
16702 both within LyX itself (in the citation dialog and in tooltips, for example)
16703 and in XHTML output.
16704 Such a block might look like this:
16707 \begin_layout LyX-Code
16711 \begin_layout LyX-Code
16715 \begin_layout LyX-Code
16719 \begin_layout LyX-Code
16723 \begin_layout Standard
16724 The individual lines define how the bibliographic information associated
16725 with an article or book, respectively, is to be displayed, and such a definitio
16726 n can be given for any `entry type' that might be present in a BibTeX file.
16727 LyX defines a default format in the source code that will be used if no
16728 specific definition has been given.
16729 LyX predefines several formats in the file
16730 \begin_inset Flex Code
16733 \begin_layout Plain Layout
16739 , which is included in most of LyX's document classes.
16742 \begin_layout Standard
16743 The definitions use a simple language that allows BibTeX keys to be replaced
16745 Keys should be enclosed in
16746 \begin_inset Flex Code
16749 \begin_layout Plain Layout
16756 \begin_inset Flex Code
16759 \begin_layout Plain Layout
16766 So a simple definition might look like this:
16769 \begin_layout LyX-Code
16771 \begin_inset Quotes eld
16775 \begin_inset Quotes erd
16781 \begin_layout Standard
16782 This would print the author, followed by a comma, followed by the title,
16783 in quotes, followed by a period.
16786 \begin_layout Standard
16787 Of course, sometimes you may want to print a key only if it exists.
16788 This can be done by using a conditional construction, such as:
16789 \begin_inset Flex Code
16792 \begin_layout Plain Layout
16794 \begin_inset space ~
16804 \begin_inset Flex Code
16807 \begin_layout Plain Layout
16813 key exists, then print
16814 \begin_inset Quotes eld
16818 \begin_inset space ~
16822 \begin_inset Quotes erd
16825 followed by the volume key.
16826 It is also possible to have an else clause in the conditional, such as:
16828 \begin_inset Flex Code
16831 \begin_layout Plain Layout
16832 {%author%[[%author%]][[%editor%, ed.]]}
16839 \begin_inset Flex Code
16842 \begin_layout Plain Layout
16848 key is printed if it exists; otherwise, the editor key is printed, followed
16850 \begin_inset Quotes eld
16854 \begin_inset space ~
16858 \begin_inset Quotes erd
16861 Note that the key is again enclosed in
16862 \begin_inset Flex Code
16865 \begin_layout Plain Layout
16871 signs; the entire conditional is enclosed in braces; and the if and else
16872 clauses are enclosed in double brackets,
16873 \begin_inset Quotes eld
16877 \begin_inset Flex Code
16880 \begin_layout Plain Layout
16887 \begin_inset Quotes eld
16891 \begin_inset Quotes eld
16895 \begin_inset Flex Code
16898 \begin_layout Plain Layout
16905 \begin_inset Quotes erd
16909 There must be no space between any of these.
16912 \begin_layout Standard
16913 There is one other piece of syntax available in definitions, which looks
16915 \begin_inset Flex Code
16918 \begin_layout Plain Layout
16925 This defines a piece of formatting information that is to be used when
16927 \begin_inset Quotes eld
16931 \begin_inset Quotes erd
16935 Obviously, we do not want to output HTML tags when writing plain text,
16936 so they should be wrapped in
16937 \begin_inset Quotes eld
16941 \begin_inset Quotes erd
16945 \begin_inset Quotes eld
16949 \begin_inset Quotes erd
16955 \begin_layout Standard
16956 Two special sorts of definitions are also possible in a
16957 \begin_inset Flex Code
16960 \begin_layout Plain Layout
16967 An example of the first would be:
16970 \begin_layout LyX-Code
16972 \begin_inset Quotes eld
16976 \begin_inset Quotes erd
16982 \begin_layout Standard
16983 This is an abbreviation, or macro, and it can be used by treating it as
16985 \begin_inset Flex Code
16988 \begin_layout Plain Layout
16996 \begin_inset Flex Code
16999 \begin_layout Plain Layout
17005 exactly as it would treat its definition.
17006 So, let us issue the obvious
17014 \begin_layout LyX-Code
17018 \begin_layout Standard
17019 or anything like it.
17020 LyX shouldn't go into an infinite loop, but it may go into a long one before
17024 \begin_layout Standard
17025 The second sort of special definition might look like this:
17028 \begin_layout LyX-Code
17032 \begin_layout Standard
17033 This defines a translatable piece of text, which allows relevant parts of
17034 the bibliography to be translated.
17035 It can be included in a definition by treating it as a key:
17036 \begin_inset Flex Code
17039 \begin_layout Plain Layout
17046 Several of these are predefined in
17047 \begin_inset Flex Code
17050 \begin_layout Plain Layout
17057 Note that these are not macros, in the sense just defined.
17058 They will not be expanded.
17061 \begin_layout Standard
17062 So here then is an example that use all these features:
17065 \begin_layout LyX-Code
17066 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
17069 \begin_layout Standard
17070 This defines a macro that prints the author, followed by a comma, if the
17072 \begin_inset Flex Code
17075 \begin_layout Plain Layout
17081 key is defined, or else prints the name of the editor, followed by the
17083 \begin_inset Flex Code
17086 \begin_layout Plain Layout
17092 or its translation (it is by default
17093 \begin_inset Quotes eld
17097 \begin_inset Quotes erd
17101 \begin_inset Flex Code
17104 \begin_layout Plain Layout
17111 Note that this is in fact defined in
17112 \begin_inset Flex Code
17115 \begin_layout Plain Layout
17121 , so you can use it in your own definitions, or re-definitions, if you load
17125 \begin_layout Section
17126 \begin_inset CommandInset label
17128 name "sec:Tags-for-XHTML"
17132 Tags for XHTML output
17135 \begin_layout Standard
17136 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
17137 by layout information.
17138 In general, LyX provides sensible defaults and, as mentioned earlier, it
17139 will even construct default CSS style rules from the other layout tags.
17140 For example, LyX will attempt to use the information provided in the
17141 \begin_inset Flex Code
17144 \begin_layout Plain Layout
17150 declaration for the Chapter style to write CSS that will appropriately
17151 format chapter headings.
17154 \begin_layout Standard
17155 In many cases, then, you may not have to do anything at all to get acceptable
17156 XHTML output for your own environments, custom insets, and so forth.
17157 But in some cases you will, and so LyX provides a number of layout tags
17158 that can be used to customize the XHTML and CSS that are generated.
17161 \begin_layout Standard
17162 Note that there are two tags,
17163 \begin_inset Flex Code
17166 \begin_layout Plain Layout
17173 \begin_inset Flex Code
17176 \begin_layout Plain Layout
17182 that may appear outside style and inset declarations.
17184 \begin_inset CommandInset ref
17186 reference "sub:General-text-class"
17190 for details on these.
17193 \begin_layout Subsection
17194 \begin_inset CommandInset label
17196 name "sub:Paragraph-Style-XHTML"
17203 \begin_layout Standard
17204 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
17205 dealing with a normal paragraph, a command, or an environment, where this
17206 is itself determined by the contents of the corresponding
17207 \begin_inset Flex Code
17210 \begin_layout Plain Layout
17220 \begin_layout Standard
17221 For a command or normal paragraph, the output XHTML has the following form:
17224 \begin_layout LyX-Code
17226 \begin_inset Quotes erd
17230 \begin_inset Quotes erd
17236 \begin_layout LyX-Code
17238 \begin_inset Quotes erd
17242 \begin_inset Quotes erd
17248 \begin_layout LyX-Code
17249 Contents of the paragraph.
17252 \begin_layout LyX-Code
17256 \begin_layout Standard
17257 The label tags are of course omitted if the paragraph does not have a label.
17260 \begin_layout Standard
17261 For an environment that is not some sort of list, the XHTML takes this form:
17264 \begin_layout LyX-Code
17266 \begin_inset Quotes erd
17270 \begin_inset Quotes erd
17276 \begin_layout LyX-Code
17278 \begin_inset Quotes erd
17282 \begin_inset Quotes erd
17286 \begin_inset Quotes erd
17290 \begin_inset Quotes erd
17293 >Environment Label</labeltag>First paragraph.</itemtag>
17296 \begin_layout LyX-Code
17297 <itemtag>Second paragraph.</itemtag>
17300 \begin_layout LyX-Code
17304 \begin_layout Standard
17305 Note that the label is output only for the first paragraph, as it should
17306 be for a theorem, for example.
17310 \begin_layout Standard
17311 For a list, we have one of these forms:
17314 \begin_layout LyX-Code
17316 \begin_inset Quotes erd
17320 \begin_inset Quotes erd
17326 \begin_layout LyX-Code
17328 \begin_inset Quotes erd
17332 \begin_inset Quotes erd
17336 \begin_inset Quotes erd
17340 \begin_inset Quotes erd
17343 >List Label</labeltag>First item.</itemtag>
17346 \begin_layout LyX-Code
17348 \begin_inset Quotes erd
17352 \begin_inset Quotes erd
17356 \begin_inset Quotes erd
17360 \begin_inset Quotes erd
17363 >List Label</labeltag>Second item.</itemtag>
17366 \begin_layout LyX-Code
17370 \begin_layout LyX-Code
17374 \begin_layout LyX-Code
17376 \begin_inset Quotes erd
17380 \begin_inset Quotes erd
17386 \begin_layout LyX-Code
17388 \begin_inset Quotes erd
17392 \begin_inset Quotes erd
17395 >List Label</labeltag><itemtag attr=
17396 \begin_inset Quotes erd
17400 \begin_inset Quotes erd
17403 >First item.</itemtag>
17406 \begin_layout LyX-Code
17408 \begin_inset Quotes erd
17412 \begin_inset Quotes erd
17415 >List Label</labeltag><itemtag attr=
17416 \begin_inset Quotes erd
17420 \begin_inset Quotes erd
17423 >Second item.</itemtag>
17426 \begin_layout LyX-Code
17430 \begin_layout Standard
17431 Note the different orders of
17432 \begin_inset Flex Code
17435 \begin_layout Plain Layout
17442 \begin_inset Flex Code
17445 \begin_layout Plain Layout
17452 Which order we get depends upon the setting of
17453 \begin_inset Flex Code
17456 \begin_layout Plain Layout
17463 \begin_inset Flex Code
17466 \begin_layout Plain Layout
17472 is false (the default), you get the first of these, with the label within
17473 the item; if true, you get the second, with the label outside the item.
17476 \begin_layout Standard
17477 The specific tags and attributes output for each paragraph type can be controlle
17478 d by means of the layout tags we are about to describe.
17479 As mentioned earlier, however, LyX uses sensible defaults for many of these,
17480 so you often may not need to do very much to get good XHTML output.
17481 Think of the available tags as there so you can tweak things to your liking.
17484 \begin_layout Description
17485 \begin_inset Flex Code
17488 \begin_layout Plain Layout
17495 \begin_inset Flex Code
17498 \begin_layout Plain Layout
17504 ] Specifies attribute information to be output with the main tag.
17506 \begin_inset Quotes eld
17510 \begin_inset Flex Code
17513 \begin_layout Plain Layout
17520 \begin_inset Quotes erd
17524 By default, LyX will output
17525 \begin_inset Quotes eld
17529 \begin_inset Flex Code
17532 \begin_layout Plain Layout
17539 \begin_inset Quotes erd
17543 \begin_inset Flex Code
17546 \begin_layout Plain Layout
17552 is the LyX name of the layout, made lowercase, for example: chapter.
17557 contain any style information.
17559 \begin_inset Flex Code
17562 \begin_layout Plain Layout
17571 \begin_layout Description
17572 \begin_inset Flex Code
17575 \begin_layout Plain Layout
17582 \begin_inset Flex Code
17585 \begin_layout Plain Layout
17595 ] Whether to output the default CSS information LyX generates for this layout,
17596 even if additional information is explicitly provided via
17597 \begin_inset Flex Code
17600 \begin_layout Plain Layout
17608 \begin_inset Flex Code
17611 \begin_layout Plain Layout
17617 allows you to alter or augment the generated CSS, rather than to override
17620 \begin_inset Flex Code
17623 \begin_layout Plain Layout
17632 \begin_layout Description
17633 \begin_inset Flex Code
17636 \begin_layout Plain Layout
17643 \begin_inset Flex Code
17646 \begin_layout Plain Layout
17652 ] The tag to be used for individual paragraphs of environments, replacing
17654 \begin_inset Flex Code
17657 \begin_layout Plain Layout
17663 in the examples above.
17665 \begin_inset Flex Code
17668 \begin_layout Plain Layout
17677 \begin_layout Description
17678 \begin_inset Flex Code
17681 \begin_layout Plain Layout
17688 \begin_inset Flex Code
17691 \begin_layout Plain Layout
17697 ] Attributes for the item tag.
17699 \begin_inset Quotes eld
17703 \begin_inset Flex Code
17706 \begin_layout Plain Layout
17707 class=`layoutname_item'
17713 \begin_inset Quotes erd
17721 contain any style information.
17723 \begin_inset Flex Code
17726 \begin_layout Plain Layout
17735 \begin_layout Description
17736 \begin_inset Flex Code
17739 \begin_layout Plain Layout
17746 \begin_inset Flex Code
17749 \begin_layout Plain Layout
17755 ] The tag to be used for paragraph and item labels, replacing
17756 \begin_inset Flex Code
17759 \begin_layout Plain Layout
17765 in the examples above.
17767 \begin_inset Flex Code
17770 \begin_layout Plain Layout
17777 \begin_inset Flex Code
17780 \begin_layout Plain Layout
17787 \begin_inset Flex Code
17790 \begin_layout Plain Layout
17797 \begin_inset Flex Code
17800 \begin_layout Plain Layout
17801 Centered_Top_Environment
17806 , in which case it defaults to
17807 \begin_inset Flex Code
17810 \begin_layout Plain Layout
17819 \begin_layout Description
17820 \begin_inset Flex Code
17823 \begin_layout Plain Layout
17830 \begin_inset Flex Code
17833 \begin_layout Plain Layout
17839 ] Attributes for the label tag.
17841 \begin_inset Quotes eld
17845 \begin_inset Flex Code
17848 \begin_layout Plain Layout
17849 class=`layoutname_label'
17855 \begin_inset Quotes erd
17863 contain any style information.
17865 \begin_inset Flex Code
17868 \begin_layout Plain Layout
17877 \begin_layout Description
17878 \begin_inset Flex Code
17881 \begin_layout Plain Layout
17888 \begin_inset Flex Code
17891 \begin_layout Plain Layout
17901 ] Meaningful only for list-like environments, this tag controls whether
17902 the label tag is output before or inside the item tag.
17903 This is used, for example, in the description environment, where we want
17905 \begin_inset Flex Code
17908 \begin_layout Plain Layout
17909 <dt>\SpecialChar \ldots{}
17910 </dt><dd>\SpecialChar \ldots{}
17918 \begin_inset Flex Code
17921 \begin_layout Plain Layout
17927 : The label tag is output inside the item tag.
17930 \begin_layout Description
17931 \begin_inset Flex Code
17934 \begin_layout Plain Layout
17940 Information to be output in the
17941 \begin_inset Flex Code
17944 \begin_layout Plain Layout
17950 section when this style is used.
17951 This might, for example, be used to include a
17952 \begin_inset Flex Code
17955 \begin_layout Plain Layout
17962 \begin_inset Flex Code
17965 \begin_layout Plain Layout
17974 \begin_layout Description
17975 \begin_inset Flex Code
17978 \begin_layout Plain Layout
17984 CSS style information to be included when this style is used.
17985 Note that this will automatically be wrapped in a layout-generated
17986 \begin_inset Flex Code
17989 \begin_layout Plain Layout
17995 block, so only the CSS itself need be included.
17998 \begin_layout Description
17999 \begin_inset Flex Code
18002 \begin_layout Plain Layout
18009 \begin_inset Flex Code
18012 \begin_layout Plain Layout
18018 ] The tag to be used for the main label, replacing
18019 \begin_inset Flex Code
18022 \begin_layout Plain Layout
18028 in the examples above.
18030 \begin_inset Flex Code
18033 \begin_layout Plain Layout
18042 \begin_layout Description
18043 \begin_inset Flex Code
18046 \begin_layout Plain Layout
18053 \begin_inset Flex Code
18056 \begin_layout Plain Layout
18066 ] Marks this style as the one to be used to generate the
18067 \begin_inset Flex Code
18070 \begin_layout Plain Layout
18076 tag for the XHTML file.
18077 By default, it is false.
18079 \begin_inset Flex Code
18082 \begin_layout Plain Layout
18088 file sets it to true for the
18089 \begin_inset Flex Code
18092 \begin_layout Plain Layout
18102 \begin_layout Subsection
18106 \begin_layout Standard
18107 The XHTML output of insets can also be controlled by information in layout
18112 \begin_layout Plain Layout
18113 At present, this is true only for
18114 \begin_inset Quotes eld
18118 \begin_inset Quotes erd
18121 insets (insets you can type into) and is not true for
18122 \begin_inset Quotes eld
18126 \begin_inset Quotes erd
18129 insets (insets that are associated with dialog boxes).
18134 Here, too, LyX tries to provide sensible defaults, and it constructs default
18136 But everything can be customized.
18139 \begin_layout Standard
18140 The XHTML LyX outputs for an inset has the following form:
18143 \begin_layout LyX-Code
18145 \begin_inset Quotes erd
18149 \begin_inset Quotes erd
18155 \begin_layout LyX-Code
18156 <labeltag>Label</labeltag>
18159 \begin_layout LyX-Code
18161 \begin_inset Quotes erd
18165 \begin_inset Quotes erd
18168 >Contents of the inset.</innertag>
18171 \begin_layout LyX-Code
18175 \begin_layout Standard
18176 If the inset permits multiple paragraphs---that is, if
18177 \begin_inset Flex Code
18180 \begin_layout Plain Layout
18186 is true---then the contents of the inset will itself be output as paragraphs
18187 formatted according to the styles used for those paragraphs (standard,
18188 quote, and the like).
18189 The label tag is of course omitted if the paragraph does not have a label
18190 and, at present, is always
18191 \begin_inset Flex Code
18194 \begin_layout Plain Layout
18201 The inner tag is optional and, by default, does not appear.
18204 \begin_layout Standard
18205 The specific tags and attributes output for each inset can be controlled
18206 by means of the following layout tags.
18209 \begin_layout Description
18210 \begin_inset Flex Code
18213 \begin_layout Plain Layout
18220 \begin_inset Flex Code
18223 \begin_layout Plain Layout
18229 ] Specifies attribute information to be output with the main tag.
18231 \begin_inset Quotes eld
18235 \begin_inset Flex Code
18238 \begin_layout Plain Layout
18239 class=`myinset' onclick=`\SpecialChar \ldots{}
18246 \begin_inset Quotes erd
18250 By default, LyX will output
18251 \begin_inset Quotes eld
18255 \begin_inset Flex Code
18258 \begin_layout Plain Layout
18265 \begin_inset Quotes erd
18269 \begin_inset Flex Code
18272 \begin_layout Plain Layout
18278 is the LyX name of the inset, made lowercase and with non-alphanumeric
18279 characters converted to underscores, for example: footnote.
18282 \begin_layout Description
18283 \begin_inset Flex Code
18286 \begin_layout Plain Layout
18293 \begin_inset Flex Code
18296 \begin_layout Plain Layout
18306 ] Whether to output the default CSS information LyX generates for this layout,
18307 even if additional information is explicitly provided via
18308 \begin_inset Flex Code
18311 \begin_layout Plain Layout
18319 \begin_inset Flex Code
18322 \begin_layout Plain Layout
18328 allows you to alter or augment the generated CSS, rather than to override
18333 \begin_layout Description
18334 \begin_inset Flex Code
18337 \begin_layout Plain Layout
18344 \begin_inset Flex Code
18347 \begin_layout Plain Layout
18353 ] Attributes for the inner tag.
18355 \begin_inset Quotes eld
18359 \begin_inset Flex Code
18362 \begin_layout Plain Layout
18363 class=`insetname_inner'
18369 \begin_inset Quotes erd
18375 \begin_layout Description
18376 \begin_inset Flex Code
18379 \begin_layout Plain Layout
18386 \begin_inset Flex Code
18389 \begin_layout Plain Layout
18395 ] The inner tag, replacing
18396 \begin_inset Flex Code
18399 \begin_layout Plain Layout
18405 in the examples above.
18406 By default, there is none.
18409 \begin_layout Description
18410 \begin_inset Flex Code
18413 \begin_layout Plain Layout
18420 \begin_inset Flex Code
18423 \begin_layout Plain Layout
18431 ] Whether this inset represents a standalone block of text (such as a footnote)
18432 or instead represents material that is included in the surrounding text
18433 (such as a branch).
18437 \begin_layout Description
18438 \begin_inset Flex Code
18441 \begin_layout Plain Layout
18448 \begin_inset Flex Code
18451 \begin_layout Plain Layout
18457 ] A label for this inset, possibly including a reference to a counter.
18458 For example, for footnote, it might be:
18459 \begin_inset Flex Code
18462 \begin_layout Plain Layout
18471 This is optional, and there is no default.
18474 \begin_layout Description
18475 \begin_inset Flex Code
18478 \begin_layout Plain Layout
18484 Information to be output in the
18485 \begin_inset Flex Code
18488 \begin_layout Plain Layout
18494 section when this style is used.
18495 This might, for example, be used to include a
18496 \begin_inset Flex Code
18499 \begin_layout Plain Layout
18506 \begin_inset Flex Code
18509 \begin_layout Plain Layout
18518 \begin_layout Description
18519 \begin_inset Flex Code
18522 \begin_layout Plain Layout
18528 CSS style information to be included when this style is used.
18529 Note that this will automatically be wrapped in a layout-generated
18530 \begin_inset Flex Code
18533 \begin_layout Plain Layout
18539 block, so only the CSS itself need be included.
18542 \begin_layout Description
18543 \begin_inset Flex Code
18546 \begin_layout Plain Layout
18553 \begin_inset Flex Code
18556 \begin_layout Plain Layout
18562 ] The tag to be used for the main label, replacing
18563 \begin_inset Flex Code
18566 \begin_layout Plain Layout
18572 in the examples above.
18573 The default depends upon the setting of
18574 \begin_inset Flex Code
18577 \begin_layout Plain Layout
18584 \begin_inset Flex Code
18587 \begin_layout Plain Layout
18593 is true, the default is
18594 \begin_inset Flex Code
18597 \begin_layout Plain Layout
18603 ; if it is false, the default is
18604 \begin_inset Flex Code
18607 \begin_layout Plain Layout
18616 \begin_layout Subsection
18620 \begin_layout Standard
18621 The XHTML output for floats too can be controlled by layout information.
18622 The output has the following form:
18625 \begin_layout LyX-Code
18627 \begin_inset Quotes erd
18631 \begin_inset Quotes erd
18637 \begin_layout LyX-Code
18638 Contents of the float.
18641 \begin_layout LyX-Code
18645 \begin_layout Standard
18646 The caption, if there is one, is a separate inset and will be output as
18648 Its appearance can be controlled via the InsetLayout for caption insets.
18652 \begin_layout Description
18653 \begin_inset Flex Code
18656 \begin_layout Plain Layout
18663 \begin_inset Flex Code
18666 \begin_layout Plain Layout
18672 ] Specifies attribute information to be output with the main tag.
18674 \begin_inset Quotes eld
18678 \begin_inset Flex Code
18681 \begin_layout Plain Layout
18682 class=`myfloat' onclick=`\SpecialChar \ldots{}
18689 \begin_inset Quotes erd
18693 By default, LyX will output
18694 \begin_inset Quotes eld
18698 \begin_inset Flex Code
18701 \begin_layout Plain Layout
18702 class=`float float-floattype'
18708 \begin_inset Quotes erd
18712 \begin_inset Flex Code
18715 \begin_layout Plain Layout
18721 is LyX's name for this type of float, as determined by the float declaration
18723 \begin_inset CommandInset ref
18725 reference "sub:Floats"
18729 ), though made lowercase and with non-alphanumeric characters converted
18730 to underscores, for example: float-table.
18733 \begin_layout Description
18734 \begin_inset Flex Code
18737 \begin_layout Plain Layout
18743 CSS style information to be included when this float is used.
18744 Note that this will automatically be wrapped in a layout-generated
18745 \begin_inset Flex Code
18748 \begin_layout Plain Layout
18754 block, so only the CSS itself need be included.
18757 \begin_layout Description
18758 \begin_inset Flex Code
18761 \begin_layout Plain Layout
18768 \begin_inset Flex Code
18771 \begin_layout Plain Layout
18777 ] The tag to be used for this float, replacing
18778 \begin_inset Quotes eld
18782 \begin_inset Flex Code
18785 \begin_layout Plain Layout
18792 \begin_inset Quotes erd
18795 in the example above.
18797 \begin_inset Flex Code
18800 \begin_layout Plain Layout
18806 and will rarely need changing.
18809 \begin_layout Subsection
18810 Bibliography formatting
18813 \begin_layout Standard
18814 The bibliography can be formatted using
18815 \begin_inset Flex Code
18818 \begin_layout Plain Layout
18826 \begin_inset CommandInset ref
18828 reference "sub:Citation-format-description"
18835 \begin_layout Subsection
18839 \begin_layout Standard
18840 We have several times mentioned that LyX will generate default CSS style
18841 rules for both insets and paragraph styles, based upon the other layout
18842 information that is provided.
18843 In this section, we shall say a word about which layout information LyX
18847 \begin_layout Standard
18848 At present, LyX auto-generates CSS only for font information, making use
18850 \begin_inset Flex Code
18853 \begin_layout Plain Layout
18860 \begin_inset Flex Code
18863 \begin_layout Plain Layout
18870 \begin_inset Flex Code
18873 \begin_layout Plain Layout
18880 \begin_inset Flex Code
18883 \begin_layout Plain Layout
18890 \begin_inset Flex Code
18893 \begin_layout Plain Layout
18901 \begin_inset CommandInset ref
18903 reference "sub:Font-description"
18907 .) The translation is mostly straightforward and obvious.
18909 \begin_inset Quotes eld
18913 \begin_inset Flex Code
18916 \begin_layout Plain Layout
18923 \begin_inset Quotes erd
18927 \begin_inset Quotes eld
18931 \begin_inset Flex Code
18934 \begin_layout Plain Layout
18935 font-family: sans-serif;
18941 \begin_inset Quotes erd
18945 The correspondence of LyX sizes and CSS sizes is a little less obvious
18946 but nonetheless intuitive.
18948 \begin_inset Flex Code
18951 \begin_layout Plain Layout
18958 \begin_inset Flex URL
18961 \begin_layout Plain Layout
18972 \begin_layout Chapter
18973 Including External Material
18976 \begin_layout Standard
18977 \begin_inset Box Shadowbox
18987 height_special "totalheight"
18990 \begin_layout Plain Layout
18991 WARNING: This portion of the documentation has not been updated for some
18993 We certainly hope that it is still accurate, but there are no guarantees.
19001 \begin_layout Standard
19002 The use of material from sources external to LyX is covered in detail in
19008 This part of the manual covers what needs to happen behind the scenes for
19009 new sorts of material to be included.
19012 \begin_layout Section
19016 \begin_layout Standard
19017 The external material feature is based on the concept of a
19022 A template is a specification of how LyX should interface with a certain
19024 As bundled, LyX comes with predefined templates for Xfig figures, various
19025 raster format images, chess diagrams, and LilyPond music notation.
19026 You can check the actual list by using the menu
19027 \begin_inset Flex MenuItem
19030 \begin_layout Plain Layout
19031 Insert\SpecialChar \menuseparator
19032 File\SpecialChar \menuseparator
19039 Furthermore, it is possible to roll your own template to support a specific
19041 Later we'll describe in more detail what is involved, and hopefully you
19042 will submit all the templates you create so we can include them in a later
19046 \begin_layout Standard
19047 Another basic idea of the external material feature is to distinguish between
19048 the original file that serves as a base for final material and the produced
19049 file that is included in your exported or printed document.
19050 For example, consider the case of a figure produced with
19051 \begin_inset Flex Code
19054 \begin_layout Plain Layout
19061 The Xfig application itself works on an original file with the
19062 \begin_inset Flex Code
19065 \begin_layout Plain Layout
19072 Within Xfig, you create and change your figure, and when you are done,
19074 \begin_inset Flex Code
19077 \begin_layout Plain Layout
19084 When you want to include the figure in your document, you invoke
19085 \begin_inset Flex Code
19088 \begin_layout Plain Layout
19094 in order to create a PostScript file that can readily be included in your
19097 \begin_inset Flex Code
19100 \begin_layout Plain Layout
19106 file is the original file, and the PostScript file is the produced file.
19109 \begin_layout Standard
19110 This distinction is important in order to allow updating of the material
19111 while you are in the process of writing the document.
19112 Furthermore, it provides us with the flexibility that is needed to support
19113 multiple export formats.
19114 For instance, in the case of a plain text file, it is not exactly an award-winn
19115 ing idea to include the figure as raw PostScript.
19116 Instead, you'd either prefer to just include a reference to the figure
19117 or try to invoke some graphics to ASCII converter to make the final result
19118 look similar to the real graphics.
19119 The external material management allows you to do this, because it is parametri
19120 zed on the different export formats that LyX supports.
19123 \begin_layout Standard
19124 Besides supporting the production of different products according to the
19125 exported format, it supports tight integration with editing and viewing
19127 In the case of an Xfig figure, you are able to invoke Xfig on the original
19128 file with a single click from within the external material dialog in LyX,
19129 and also preview the produced PostScript file with Ghostview with another
19131 No more fiddling around with the command line and/or file browsers to locate
19132 and manipulate the original or produced files.
19133 In this way, you are finally able to take full advantage of the many different
19134 applications that are relevant to use when you write your documents, and
19135 ultimately be more productive.
19138 \begin_layout Section
19139 The external template configuration file
19142 \begin_layout Standard
19143 It is relatively easy to add custom external template definitions to LyX.
19144 However, be aware that doing this in an careless manner most probably
19148 introduce an easily exploitable security hole.
19149 So before you do this, please read the discussion about security in section
19151 \begin_inset CommandInset ref
19153 reference "sec:Security-discussion"
19160 \begin_layout Standard
19161 Having said that, we encourage you to submit any interesting templates that
19166 \begin_layout Standard
19167 The external templates are defined in the
19168 \begin_inset Flex Code
19171 \begin_layout Plain Layout
19172 LyXDir/lib/external_templates
19178 You can place your own version in
19179 \begin_inset Flex Code
19182 \begin_layout Plain Layout
19183 UserDir/external_templates
19191 \begin_layout Standard
19192 A typical template looks like this:
19195 \begin_layout LyX-Code
19199 \begin_layout LyX-Code
19200 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
19203 \begin_layout LyX-Code
19207 \begin_layout LyX-Code
19211 \begin_layout LyX-Code
19215 \begin_layout LyX-Code
19219 \begin_layout LyX-Code
19223 \begin_layout LyX-Code
19224 AutomaticProduction true
19227 \begin_layout LyX-Code
19231 \begin_layout LyX-Code
19235 \begin_layout LyX-Code
19239 \begin_layout LyX-Code
19240 TransformCommand Rotate RotationLatexCommand
19243 \begin_layout LyX-Code
19244 TransformCommand Resize ResizeLatexCommand
19247 \begin_layout LyX-Code
19248 Product "$$RotateFront$$ResizeFront
19251 \begin_layout LyX-Code
19256 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
19259 \begin_layout LyX-Code
19260 $$ResizeBack$$RotateBack"
19263 \begin_layout LyX-Code
19267 \begin_layout LyX-Code
19268 UpdateResult "$$AbsPath$$Basename.pstex_t"
19271 \begin_layout LyX-Code
19272 Requirement "graphicx"
19275 \begin_layout LyX-Code
19276 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
19279 \begin_layout LyX-Code
19280 ReferencedFile latex "$$AbsPath$$Basename.eps"
19283 \begin_layout LyX-Code
19284 ReferencedFile dvi "$$AbsPath$$Basename.eps"
19287 \begin_layout LyX-Code
19291 \begin_layout LyX-Code
19295 \begin_layout LyX-Code
19296 TransformCommand Rotate RotationLatexCommand
19299 \begin_layout LyX-Code
19300 TransformCommand Resize ResizeLatexCommand
19303 \begin_layout LyX-Code
19304 Product "$$RotateFront$$ResizeFront
19307 \begin_layout LyX-Code
19312 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
19315 \begin_layout LyX-Code
19316 $$ResizeBack$$RotateBack"
19319 \begin_layout LyX-Code
19320 UpdateFormat pdftex
19323 \begin_layout LyX-Code
19324 UpdateResult "$$AbsPath$$Basename.pdftex_t"
19327 \begin_layout LyX-Code
19328 Requirement "graphicx"
19331 \begin_layout LyX-Code
19332 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
19335 \begin_layout LyX-Code
19336 ReferencedFile latex "$$AbsPath$$Basename.pdf"
19339 \begin_layout LyX-Code
19343 \begin_layout LyX-Code
19347 \begin_layout LyX-Code
19348 Product "$$Contents(
19350 "$$AbsPath$$Basename.asc
19355 \begin_layout LyX-Code
19356 UpdateFormat asciixfig
19359 \begin_layout LyX-Code
19360 UpdateResult "$$AbsPath$$Basename.asc"
19363 \begin_layout LyX-Code
19367 \begin_layout LyX-Code
19371 \begin_layout LyX-Code
19372 Product "<graphic fileref=
19374 "$$AbsOrRelPathMaster$$Basename.eps
19379 \begin_layout LyX-Code
19383 \begin_layout LyX-Code
19387 \begin_layout LyX-Code
19388 UpdateResult "$$AbsPath$$Basename.eps"
19391 \begin_layout LyX-Code
19392 ReferencedFile docbook "$$AbsPath$$Basename.eps"
19395 \begin_layout LyX-Code
19396 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
19399 \begin_layout LyX-Code
19403 \begin_layout LyX-Code
19404 Product "[XFig: $$FName]"
19407 \begin_layout LyX-Code
19411 \begin_layout LyX-Code
19415 \begin_layout Standard
19416 As you can see, the template is enclosed in
19417 \begin_inset Flex Code
19420 \begin_layout Plain Layout
19426 \SpecialChar \ldots{}
19428 \begin_inset Flex Code
19431 \begin_layout Plain Layout
19438 It contains a header specifying some general settings and, for each supported
19439 primary document file format, a section
19440 \begin_inset Flex Code
19443 \begin_layout Plain Layout
19449 \SpecialChar \ldots{}
19451 \begin_inset Flex Code
19454 \begin_layout Plain Layout
19463 \begin_layout Subsection
19464 The template header
19467 \begin_layout Description
19468 \begin_inset Flex Code
19471 \begin_layout Plain Layout
19472 AutomaticProduction
19473 \begin_inset space ~
19481 Whether the file represented by the template must be generated by LyX.
19482 This command must occur exactly once.
19485 \begin_layout Description
19486 \begin_inset Flex Code
19489 \begin_layout Plain Layout
19491 \begin_inset space ~
19499 A glob pattern that is used in the file dialog to filter out the desired
19501 If there is more than one possible file extension (e.
19502 \begin_inset space \thinspace{}
19506 \begin_inset space \space{}
19510 \begin_inset Flex Code
19513 \begin_layout Plain Layout
19520 \begin_inset Flex Code
19523 \begin_layout Plain Layout
19529 ), use something like
19530 \begin_inset Flex Code
19533 \begin_layout Plain Layout
19540 This command must occur exactly once.
19543 \begin_layout Description
19544 \begin_inset Flex Code
19547 \begin_layout Plain Layout
19549 \begin_inset space ~
19557 The text that is displayed on the button.
19558 This command must occur exactly once.
19561 \begin_layout Description
19562 \begin_inset Flex Code
19565 \begin_layout Plain Layout
19567 \begin_inset space ~
19571 \begin_inset space ~
19579 The help text that is used in the External dialog.
19580 Provide enough information to explain to the user just what the template
19581 can provide him with.
19582 This command must occur exactly once.
19585 \begin_layout Description
19586 \begin_inset Flex Code
19589 \begin_layout Plain Layout
19591 \begin_inset space ~
19599 The file format of the original file.
19600 This must be the name of a format that is known to LyX (see section
19601 \change_inserted 34634807 1296982650
19603 \begin_inset space ~
19607 \change_deleted 34634807 1296982649
19611 \begin_inset CommandInset ref
19613 reference "sec:Formats"
19619 \begin_inset Quotes eld
19623 \begin_inset Flex Code
19626 \begin_layout Plain Layout
19633 \begin_inset Quotes erd
19636 if the template can handle original files of more than one format.
19637 LyX will attempt to interrogate the file itself in order to deduce its
19638 format in this case.
19639 This command must occur exactly once.
19642 \begin_layout Description
19643 \begin_inset Flex Code
19646 \begin_layout Plain Layout
19648 \begin_inset space ~
19656 A unique name for the template.
19657 It must not contain substitution macros (see below).
19660 \begin_layout Description
19661 \begin_inset Flex Code
19664 \begin_layout Plain Layout
19666 \begin_inset space ~
19669 Rotate|Resize|Clip|Extra
19674 This command specifies which transformations are supported by this template.
19675 It may occur zero or more times.
19676 This command enables the corresponding tabs in the external dialog.
19678 \begin_inset Flex Code
19681 \begin_layout Plain Layout
19687 command must have either a corresponding
19688 \begin_inset Flex Code
19691 \begin_layout Plain Layout
19698 \begin_inset Flex Code
19701 \begin_layout Plain Layout
19708 \begin_inset Flex Code
19711 \begin_layout Plain Layout
19718 Otherwise the transformation will not be supported by that format.
19721 \begin_layout Subsection
19725 \begin_layout Description
19726 \begin_inset Flex Code
19729 \begin_layout Plain Layout
19731 \begin_inset space ~
19734 LaTeX|PDFLaTeX|PlainText|DocBook
19739 The primary document file format that this format definition is for.
19740 Not every template has a sensible representation in all document file formats.
19741 Please define nevertheless a
19742 \begin_inset Flex Code
19745 \begin_layout Plain Layout
19752 \change_deleted 34634807 1296982695
19754 \change_inserted 34634807 1296982711
19756 \begin_inset Note Note
19759 \begin_layout Plain Layout
19761 \change_inserted 34634807 1296982711
19762 format or template here ?
19770 Use a dummy text when no representation is available.
19771 Then you can at least see a reference to the external material in the exported
19775 \begin_layout Description
19776 \begin_inset Flex Code
19779 \begin_layout Plain Layout
19781 \begin_inset space ~
19785 \begin_inset space ~
19793 This command defines an additional macro
19794 \begin_inset Flex Code
19797 \begin_layout Plain Layout
19803 for substitution in
19804 \begin_inset Flex Code
19807 \begin_layout Plain Layout
19815 \begin_inset Flex Code
19818 \begin_layout Plain Layout
19824 itself may contain substitution macros.
19825 The advantage over using
19826 \begin_inset Flex Code
19829 \begin_layout Plain Layout
19836 \begin_inset Flex Code
19839 \begin_layout Plain Layout
19845 is that the substituted value of
19846 \begin_inset Flex Code
19849 \begin_layout Plain Layout
19855 is sanitized so that it is a valid optional argument in the document format.
19856 This command may occur zero or more times.
19859 \begin_layout Description
19860 \begin_inset Flex Code
19863 \begin_layout Plain Layout
19865 \begin_inset space ~
19873 The text that is inserted in the exported document.
19874 This is actually the most important command and can be quite complex.
19875 This command must occur exactly once.
19878 \begin_layout Description
19879 \begin_inset Flex Code
19882 \begin_layout Plain Layout
19884 \begin_inset space ~
19892 This command specifies a preamble snippet that will be included in the
19894 It has to be defined using
19895 \begin_inset Flex Code
19898 \begin_layout Plain Layout
19904 \SpecialChar \ldots{}
19906 \begin_inset Flex Code
19909 \begin_layout Plain Layout
19916 This command may occur zero or more times.
19919 \begin_layout Description
19920 \begin_inset Flex Code
19923 \begin_layout Plain Layout
19925 \begin_inset space ~
19929 \begin_inset space ~
19937 This command denotes files that are created by the conversion process and
19938 are needed for a particular export format.
19939 If the filename is relative, it is interpreted relative to the master document.
19940 This command may be given zero or more times.
19943 \begin_layout Description
19944 \begin_inset Flex Code
19947 \begin_layout Plain Layout
19949 \begin_inset space ~
19957 The name of a required LaTeX package.
19958 The package is included via
19959 \begin_inset Flex Code
19962 \begin_layout Plain Layout
19970 in the LaTeX preamble.
19971 This command may occur zero or more times.
19974 \begin_layout Description
19975 \begin_inset Flex Code
19978 \begin_layout Plain Layout
19980 \begin_inset space ~
19984 \begin_inset space ~
19987 RotationLatexCommand
19992 This command specifies that the built in LaTeX command should be used for
19994 This command may occur once or not at all.
19997 \begin_layout Description
19998 \begin_inset Flex Code
20001 \begin_layout Plain Layout
20003 \begin_inset space ~
20007 \begin_inset space ~
20015 This command specifies that the built in LaTeX command should be used for
20017 This command may occur once or not at all.
20020 \begin_layout Description
20021 \begin_inset Flex Code
20024 \begin_layout Plain Layout
20026 \begin_inset space ~
20030 \begin_inset space ~
20033 RotationLatexOption
20038 This command specifies that rotation is done via an optional argument.
20039 This command may occur once or not at all.
20042 \begin_layout Description
20043 \begin_inset Flex Code
20046 \begin_layout Plain Layout
20048 \begin_inset space ~
20052 \begin_inset space ~
20060 This command specifies that resizing is done via an optional argument.
20061 This command may occur once or not at all.
20064 \begin_layout Description
20065 \begin_inset Flex Code
20068 \begin_layout Plain Layout
20070 \begin_inset space ~
20074 \begin_inset space ~
20082 This command specifies that clipping is done via an optional argument.
20083 This command may occur once or not at all.
20086 \begin_layout Description
20087 \begin_inset Flex Code
20090 \begin_layout Plain Layout
20092 \begin_inset space ~
20096 \begin_inset space ~
20104 This command specifies that an extra optional argument is used.
20105 This command may occur once or not at all.
20108 \begin_layout Description
20109 \begin_inset Flex Code
20112 \begin_layout Plain Layout
20114 \begin_inset space ~
20122 The file format of the converted file.
20123 This must be the name of a format that is known to LyX (see the
20124 \begin_inset Flex MenuItem
20127 \begin_layout Plain Layout
20132 ools\SpecialChar \menuseparator
20138 \change_deleted 34634807 1296982746
20140 \change_inserted 34634807 1296982770
20142 \begin_inset space ~
20145 handling\SpecialChar \menuseparator
20147 \begin_inset space ~
20158 This command must occur exactly once.
20161 \begin_layout Description
20162 \begin_inset Flex Code
20165 \begin_layout Plain Layout
20167 \begin_inset space ~
20175 The file name of the converted file.
20176 The file name must be absolute.
20177 This command must occur exactly once.
20180 \begin_layout Subsection
20181 Preamble definitions
20184 \begin_layout Standard
20185 The external template configuration file may contain additional preamble
20186 definitions enclosed by
20187 \begin_inset Flex Code
20190 \begin_layout Plain Layout
20196 \SpecialChar \ldots{}
20198 \begin_inset Flex Code
20201 \begin_layout Plain Layout
20208 They can be used by the templates in the
20209 \begin_inset Flex Code
20212 \begin_layout Plain Layout
20221 \begin_layout Section
20222 The substitution mechanism
20225 \begin_layout Standard
20226 When the external material facility invokes an external program, it is done
20227 on the basis of a command defined in the template configuration file.
20228 These commands can contain various macros that are expanded before execution.
20229 Execution always take place in the directory of the containing document.
20232 \begin_layout Standard
20233 Also, whenever external material is to be displayed, the name will be produced
20234 by the substitution mechanism, and most other commands in the template
20235 definition support substitution as well.
20238 \begin_layout Standard
20239 The available macros are the following:
20242 \begin_layout Description
20243 \begin_inset Flex Code
20246 \begin_layout Plain Layout
20247 $$AbsOrRelPathMaster
20252 The file path, absolute or relative to the master LyX document.
20255 \begin_layout Description
20256 \begin_inset Flex Code
20259 \begin_layout Plain Layout
20260 $$AbsOrRelPathParent
20265 The file path, absolute or relative to the LyX document.
20268 \begin_layout Description
20269 \begin_inset Flex Code
20272 \begin_layout Plain Layout
20278 The absolute file path.
20281 \begin_layout Description
20282 \begin_inset Flex Code
20285 \begin_layout Plain Layout
20291 The filename without path and without the extension.
20294 \begin_layout Description
20295 \begin_inset Flex Code
20298 \begin_layout Plain Layout
20300 \begin_inset Quotes eld
20304 \begin_inset Quotes erd
20312 This macro will expand to the contents of the file with the name
20313 \begin_inset Flex Code
20316 \begin_layout Plain Layout
20325 \begin_layout Description
20326 \begin_inset Flex Code
20329 \begin_layout Plain Layout
20335 The file extension (including the dot).
20338 \begin_layout Description
20339 \begin_inset Flex Code
20342 \begin_layout Plain Layout
20348 The filename of the file specified in the external material dialog.
20349 This is either an absolute name, or it is relative to the LyX document.
20352 \begin_layout Description
20353 \begin_inset Flex Code
20356 \begin_layout Plain Layout
20363 \begin_inset Flex Code
20366 \begin_layout Plain Layout
20372 (absolute name or relative to the LyX document).
20375 \begin_layout Description
20376 \begin_inset Flex Code
20379 \begin_layout Plain Layout
20385 The file path, relative to the master LyX document.
20388 \begin_layout Description
20389 \begin_inset Flex Code
20392 \begin_layout Plain Layout
20398 The file path, relative to the LyX document.
20401 \begin_layout Description
20402 \begin_inset Flex Code
20405 \begin_layout Plain Layout
20411 This macro will expand to the absolute path of the system directory.
20412 This is typically used to point to the various helper scripts that are
20416 \begin_layout Description
20417 \begin_inset Flex Code
20420 \begin_layout Plain Layout
20426 A name and full path to a temporary file which will be automatically deleted
20427 whenever the containing document is closed, or the external material insertion
20431 \begin_layout Standard
20432 All path macros contain a trailing directory separator, so you can construct
20434 \begin_inset space \thinspace{}
20438 \begin_inset space \space{}
20441 the absolute filename with
20442 \begin_inset Flex Code
20445 \begin_layout Plain Layout
20446 $$AbsPath$$Basename$$Extension
20454 \begin_layout Standard
20455 The macros above are substituted in all commands unless otherwise noted.
20457 \begin_inset Flex Code
20460 \begin_layout Plain Layout
20466 supports additionally the following substitutions if they are enabled by
20468 \begin_inset Flex Code
20471 \begin_layout Plain Layout
20478 \begin_inset Flex Code
20481 \begin_layout Plain Layout
20490 \begin_layout Description
20491 \begin_inset Flex Code
20494 \begin_layout Plain Layout
20500 The front part of the resize command.
20503 \begin_layout Description
20504 \begin_inset Flex Code
20507 \begin_layout Plain Layout
20513 The back part of the resize command.
20516 \begin_layout Description
20517 \begin_inset Flex Code
20520 \begin_layout Plain Layout
20526 The front part of the rotation command.
20529 \begin_layout Description
20530 \begin_inset Flex Code
20533 \begin_layout Plain Layout
20539 The back part of the rotation command.
20542 \begin_layout Standard
20543 The value string of the
20544 \begin_inset Flex Code
20547 \begin_layout Plain Layout
20553 command supports additionally the following substitutions if they are enabled
20555 \begin_inset Flex Code
20558 \begin_layout Plain Layout
20565 \begin_inset Flex Code
20568 \begin_layout Plain Layout
20577 \begin_layout Description
20578 \begin_inset Flex Code
20581 \begin_layout Plain Layout
20590 \begin_layout Description
20591 \begin_inset Flex Code
20594 \begin_layout Plain Layout
20603 \begin_layout Description
20604 \begin_inset Flex Code
20607 \begin_layout Plain Layout
20616 \begin_layout Description
20617 \begin_inset Flex Code
20620 \begin_layout Plain Layout
20626 The rotation option.
20629 \begin_layout Standard
20630 You may ask why there are so many path macros.
20631 There are mainly two reasons:
20634 \begin_layout Enumerate
20635 Relative and absolute file names should remain relative or absolute, respectivel
20637 Users may have reasons to prefer either form.
20638 Relative names are useful for portable documents that should work on different
20639 machines, for example.
20640 Absolute names may be required by some programs.
20643 \begin_layout Enumerate
20644 LaTeX treats relative file names differently than LyX and other programs
20645 in nested included files.
20646 For LyX, a relative file name is always relative to the document that contains
20648 For LaTeX, it is always relative to the master document.
20649 These two definitions are identical if you have only one document, but
20650 differ if you have a master document that includes part documents.
20651 That means that relative filenames must be transformed when presented to
20653 Fortunately LyX does this automatically for you if you choose the right
20657 \begin_layout Standard
20658 So which path macro should be used in new template definitions? The rule
20662 \begin_layout Itemize
20664 \begin_inset Flex Code
20667 \begin_layout Plain Layout
20673 if an absolute path is required.
20676 \begin_layout Itemize
20678 \begin_inset Flex Code
20681 \begin_layout Plain Layout
20682 $$AbsOrRelPathMaster
20687 if the substituted string is some kind of LaTeX input.
20690 \begin_layout Itemize
20692 \begin_inset Flex Code
20695 \begin_layout Plain Layout
20696 $$AbsOrRelPathParent
20701 in order to preserve the user's choice.
20704 \begin_layout Standard
20705 There are special cases where this rule does not work and e.
20706 \begin_inset space \thinspace{}
20710 \begin_inset space \space{}
20713 relative names are needed, but normally it will work just fine.
20714 One example for such a case is the command
20715 \begin_inset Flex Code
20718 \begin_layout Plain Layout
20719 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
20724 in the XFig template above: We can't use the absolute name because the
20726 \begin_inset Flex Code
20729 \begin_layout Plain Layout
20735 files needs the relative name in order to rewrite the file content.
20738 \begin_layout Section
20739 Security discussion
20740 \begin_inset CommandInset label
20742 name "sec:Security-discussion"
20749 \begin_layout Standard
20750 The external material feature interfaces with a lot of external programs
20751 and does so automatically, so we have to consider the security implications
20753 In particular, since you have the option of including your own filenames
20754 and/or parameter strings and those are expanded into a command, it seems
20755 that it would be possible to create a malicious document which executes
20756 arbitrary commands when a user views or prints the document.
20757 This is something we definitely want to avoid.
20760 \begin_layout Standard
20761 However, since the external program commands are specified in the template
20762 configuration file only, there are no security issues if LyX is properly
20763 configured with safe templates only.
20764 This is so because the external programs are invoked with the
20765 \begin_inset Flex Code
20768 \begin_layout Plain Layout
20774 -system call rather than the
20775 \begin_inset Flex Code
20778 \begin_layout Plain Layout
20784 system-call, so it's not possible to execute arbitrary commands from the
20785 filename or parameter section via the shell.
20788 \begin_layout Standard
20789 This also implies that you are restricted in what command strings you can
20790 use in the external material templates.
20791 In particular, pipes and redirection are not readily available.
20792 This has to be so if LyX should remain safe.
20793 If you want to use some of the shell features, you should write a safe
20794 script to do this in a controlled manner, and then invoke the script from
20795 the command string.
20799 \begin_layout Standard
20800 It is possible to design a template that interacts directly with the shell,
20801 but since this would allow a malicious user to execute arbitrary commands
20802 by writing clever filenames and/or parameters, we generally recommend that
20803 you only use safe scripts that work with the
20804 \begin_inset Flex Code
20807 \begin_layout Plain Layout
20813 system call in a controlled manner.
20814 Of course, for use in a controlled environment, it can be tempting to just
20815 fall back to use ordinary shell scripts.
20816 If you do so, be aware that you
20820 provide an easily exploitable security hole in your system.
20821 Of course it stands to reason that such unsafe templates will never be
20822 included in the standard LyX distribution, although we do encourage people
20823 to submit new templates in the open source tradition.
20824 But LyX as shipped from the official distribution channels will never have
20828 \begin_layout Standard
20829 Including external material provides a lot of power, and you have to be
20830 careful not to introduce security hazards with this power.
20831 A subtle error in a single line in an innocent looking script can open
20832 the door to huge security problems.
20833 So if you do not fully understand the issues, we recommend that you consult
20834 a knowledgeable security professional or the LyX development team if you
20835 have any questions about whether a given template is safe or not.
20836 And do this before you use it in an uncontrolled environment.