1 #LyX 2.0.0svn created this file. For more info see http://www.lyx.org/
7 % DO NOT ALTER THIS PREAMBLE!!!
9 % This preamble is designed to ensure that this document prints
10 % out as advertised. If you mess with this preamble,
11 % parts of this document may not print out as expected. If you
12 % have problems LaTeXing this file, please contact
13 % the documentation team
14 % email: lyx-docs@lists.lyx.org
16 \usepackage{ifpdf} % part of the hyperref bundle
17 \ifpdf % if pdflatex is used
19 % set fonts for nicer pdf view
20 \IfFileExists{lmodern.sty}
21 {\usepackage{lmodern}}{}
23 \fi % end if pdflatex is used
25 % the pages of the TOC is numbered roman
26 % and a pdf-bookmark for the TOC is added
27 \let\myTOC\tableofcontents
28 \renewcommand\tableofcontents{%
30 \pdfbookmark[1]{\contentsname}{}
34 % redefine the \LyX macro for PDF bookmarks
35 \def\LyX{\texorpdfstring{%
36 L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
39 % used for multi-column text
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}}
63 # In case we need to do with sans...
64 #InsetLayout CharStyle:Code
69 #\renewcommand{\code}[1]{{\sffamily #1}}
78 \font_typewriter default
79 \font_default_family default
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
130 \paragraph_separation indent
131 \paragraph_indentation default
132 \quotes_language english
135 \paperpagestyle headings
136 \tracking_changes false
137 \output_changes false
145 Customizing LyX: Features for the Advanced User
153 \begin_layout Plain Layout
155 If you have comments or error corrections, please send them to the LyX Documenta
157 \begin_inset CommandInset href
159 target "lyx-docs@lists.lyx.org"
166 \begin_inset Quotes eld
170 \begin_inset Quotes erd
173 in the subject header, and please cc the current maintainer of this file,
174 Richard Heck <rgheck@comcast.net>.
180 \begin_inset Newline newline
184 \begin_inset Newline newline
190 \begin_layout Standard
191 \begin_inset CommandInset toc
192 LatexCommand tableofcontents
199 \begin_layout Standard
200 \begin_inset Note Note
203 \begin_layout Plain Layout
204 Please use change tracking when modifying this document.
205 This makes it easier for our translators to recognize things that have
206 been changed, and it helps the maintainer keep up-to-date with what's been
215 \begin_layout Chapter
219 \begin_layout Standard
220 This manual covers the customization features present in LyX.
221 In it, we discuss issues like keyboard shortcuts, screen previewing options,
222 printer options, sending commands to LyX via the LyX Server, internationalizati
223 on, installing new LaTeX classes and LyX layouts, etc.
224 We can't possibly hope to touch on everything you can change—our developers
225 add new features faster than we can document them—but we will explain the
226 most common customizations and hopefully point you in the right direction
227 for some of the more obscure ones.
230 \begin_layout Standard
231 \begin_inset Branch OutDated
234 \begin_layout Standard
235 Information from previous versions of this document that now seems to be
236 outdated is contained in the OutDated branch of this document.
237 By default, this information will not appear in the LaTeX output.
245 \begin_layout Chapter
246 LyX configuration files
249 \begin_layout Standard
250 This chapter aims to help you to find your way through the LyX configuration
252 Before continuing to read this chapter, you should find out where your
253 LyX library and user directories are by using
254 \begin_inset Flex CharStyle:MenuItem
257 \begin_layout Plain Layout
258 Help\SpecialChar \menuseparator
269 The library directory is the place where LyX places its system-wide configurati
270 on files; the user directory is where you can place your modified versions.
271 We will call the former
272 \begin_inset Flex CharStyle:Code
275 \begin_layout Plain Layout
282 \begin_inset Flex CharStyle:MenuItem
285 \begin_layout Plain Layout
291 in the remainder of this document.
295 \begin_layout Section
297 \begin_inset Flex CharStyle:Code
300 \begin_layout Plain Layout
309 \begin_layout Standard
310 \begin_inset Flex CharStyle:Code
313 \begin_layout Plain Layout
319 and its sub-directories contain a number of files and that can be used
320 to customize LyX's behavior.
321 You can change many of these files from within LyX itself through the
322 \begin_inset Flex CharStyle:MenuItem
325 \begin_layout Plain Layout
326 Tools\SpecialChar \menuseparator
333 Most customization that you will want to do in LyX is possible through
335 However, many other inner aspects of LyX can be customized by modifying
337 \begin_inset Flex CharStyle:Code
340 \begin_layout Plain Layout
347 These files fall in different categories, described in the following subsection
351 \begin_layout Subsection
352 Automatically generated files
355 \begin_layout Standard
356 The files, which are to be found in
357 \begin_inset Flex CharStyle:MenuItem
360 \begin_layout Plain Layout
366 , are generated when you configure LyX.
367 They contain various default values that are guessed by inspection.
368 In general, it is not a good idea to modify them, since they might be overwritt
372 \begin_layout Labeling
373 \labelwidthstring 00.00.0000
374 \begin_inset Flex CharStyle:Code
377 \begin_layout Plain Layout
383 contains defaults for various commands.
386 \begin_layout Labeling
387 \labelwidthstring 00.00.0000
388 \begin_inset Flex CharStyle:Code
391 \begin_layout Plain Layout
397 contains the list of packages that have been recognized by LyX.
398 It is currently unused by the LyX program itself, but the information extracted
399 , and more, is made available with
400 \begin_inset Flex CharStyle:MenuItem
403 \begin_layout Plain Layout
404 Help\SpecialChar \menuseparator
417 \begin_layout Labeling
418 \labelwidthstring 00.00.0000
419 \begin_inset Flex CharStyle:Code
422 \begin_layout Plain Layout
428 the list of text classes that have been found in your
429 \begin_inset Flex CharStyle:Code
432 \begin_layout Plain Layout
438 directories, along with the associated LaTeX document class and their descripti
442 \begin_layout Labeling
443 \labelwidthstring 00.00.0000
444 \begin_inset Flex CharStyle:Code
447 \begin_layout Plain Layout
453 the list of layout modules found in your
454 \begin_inset Flex CharStyle:Code
457 \begin_layout Plain Layout
466 \begin_layout Labeling
467 \labelwidthstring 00.00.0000
468 \begin_inset Flex CharStyle:Code
471 \begin_layout Plain Layout
477 lists of various sorts of LaTeX-related files found on your system
480 \begin_layout Labeling
481 \labelwidthstring 00.00.0000
482 \begin_inset Flex CharStyle:Code
485 \begin_layout Plain Layout
491 is automatically generated during configuration from the file
492 \begin_inset Flex CharStyle:Code
495 \begin_layout Plain Layout
502 It contains information on your LaTeX configuration.
505 \begin_layout Subsection
509 \begin_layout Standard
510 These directories are duplicated between
511 \begin_inset Flex CharStyle:Code
514 \begin_layout Plain Layout
521 \begin_inset Flex CharStyle:Code
524 \begin_layout Plain Layout
531 If a particular files exists in both places, the one in
532 \begin_inset Flex CharStyle:Code
535 \begin_layout Plain Layout
544 \begin_layout Labeling
545 \labelwidthstring 00.00.0000
546 \begin_inset Flex CharStyle:Code
549 \begin_layout Plain Layout
555 this directory contains files with the extension
556 \begin_inset Flex CharStyle:Code
559 \begin_layout Plain Layout
565 that define the keybindings used in LyX.
566 If there exists an internationalized version of the bind file named
567 \begin_inset Flex CharStyle:Code
570 \begin_layout Plain Layout
576 , that will be used first.
579 \begin_layout Labeling
580 \labelwidthstring 00.00.0000
581 \begin_inset Flex CharStyle:Code
584 \begin_layout Plain Layout
590 contains graphics files that can be included in documents.
594 \begin_layout Labeling
595 \labelwidthstring 00.00.0000
596 \begin_inset Flex CharStyle:Code
599 \begin_layout Plain Layout
605 contains LyX documentation files (including the one you are currently reading).
607 \begin_inset Flex CharStyle:Code
610 \begin_layout Plain Layout
616 deserves special attention, as noted above.
617 The internationalized help docs are in subdirectories
618 \begin_inset Flex CharStyle:Code
621 \begin_layout Plain Layout
628 \begin_inset Quotes eld
632 \begin_inset Quotes erd
635 is the ISO language code.
641 \begin_inset CommandInset ref
643 reference "cha:Internationalizing-LyX"
650 \begin_layout Labeling
651 \labelwidthstring 00.00.0000
652 \begin_inset Flex CharStyle:Code
655 \begin_layout Plain Layout
661 contains example files that explain how to use some features.
662 In the file browser, press the
663 \begin_inset Flex CharStyle:MenuItem
666 \begin_layout Plain Layout
675 \begin_layout Labeling
676 \labelwidthstring 00.00.0000
677 \begin_inset Flex CharStyle:Code
680 \begin_layout Plain Layout
686 contains image files that are used by the
687 \begin_inset Flex CharStyle:MenuItem
690 \begin_layout Plain Layout
697 In addition, it also contains the individual icons used in the toolbar
698 and the banners that can be shown when LyX is launched.
701 \begin_layout Labeling
702 \labelwidthstring 00.00.0000
703 \begin_inset Flex CharStyle:Code
706 \begin_layout Plain Layout
712 contains keyboard keymapping files.
718 \begin_inset CommandInset ref
720 reference "sec:International-Keymap-Stuff"
727 \begin_layout Labeling
728 \labelwidthstring 00.00.0000
729 \begin_inset Flex CharStyle:Code
732 \begin_layout Plain Layout
738 contains the text class and module files described in Chapter
743 \begin_inset CommandInset ref
745 reference "cha:Installing-New-Document"
752 \begin_layout Labeling
753 \labelwidthstring 00.00.0000
754 \begin_inset Flex CharStyle:Code
757 \begin_layout Plain Layout
764 \begin_inset Flex CharStyle:Code
767 \begin_layout Plain Layout
773 Python scripts used to convert between LyX versions.
774 These can be run from the command line if, say, you want to batch-convert
778 \begin_layout Labeling
779 \labelwidthstring 00.00.0000
780 \begin_inset Flex CharStyle:Code
783 \begin_layout Plain Layout
789 contains some files that demonstrate the capabilities of the
790 \begin_inset Flex CharStyle:MenuItem
793 \begin_layout Plain Layout
804 Also contains some scripts used by LyX itself.
807 \begin_layout Labeling
808 \labelwidthstring 00.00.0000
809 \begin_inset Flex CharStyle:Code
812 \begin_layout Plain Layout
818 contains the standard LyX template files described in Chapter
823 \begin_inset CommandInset ref
825 reference "sub:Creating-Templates"
832 \begin_layout Labeling
833 \labelwidthstring 00.00.0000
834 \begin_inset Flex CharStyle:Code
837 \begin_layout Plain Layout
843 contains files with the extension
844 \begin_inset Flex CharStyle:Code
847 \begin_layout Plain Layout
853 that define the user interface to LyX.
854 That is, the files define which items appear in which menus and the items
855 appearing on the toolbar.
858 \begin_layout Subsection
859 Files you don't want to modify
862 \begin_layout Standard
863 These files are used internally by LyX and you generally do not need to
864 modify them unless you are a developer.
867 \begin_layout Labeling
868 \labelwidthstring 00.00.0000
869 \begin_inset Flex CharStyle:Code
872 \begin_layout Plain Layout
878 this file contains the list of LyX developers.
879 The contents are displayed with the menu entry
880 \begin_inset Flex CharStyle:MenuItem
883 \begin_layout Plain Layout
884 Help\SpecialChar \menuseparator
897 \begin_layout Labeling
898 \labelwidthstring 00.00.0000
899 \begin_inset Flex CharStyle:Code
902 \begin_layout Plain Layout
908 this is a LaTeX script used during the configuration process.
912 \begin_layout Labeling
913 \labelwidthstring 00.00.0000
914 \begin_inset Flex CharStyle:Code
917 \begin_layout Plain Layout
923 this is the script that is used to re-configure LyX.
924 It creates configuration files in the directory it was run from.
927 \begin_layout Subsection
928 Other files needing a line or two...
931 \begin_layout Labeling
932 \labelwidthstring 00.00.0000
933 \begin_inset Flex CharStyle:Code
936 \begin_layout Plain Layout
942 this contains tables describing how different character encodings can be
946 \begin_layout Labeling
947 \labelwidthstring 00.00.0000
948 \begin_inset Flex CharStyle:Code
951 \begin_layout Plain Layout
957 this file contains the templates available to the new
958 \begin_inset Flex CharStyle:MenuItem
961 \begin_layout Plain Layout
974 \begin_layout Labeling
975 \labelwidthstring 00.00.0000
976 \begin_inset Flex CharStyle:Code
979 \begin_layout Plain Layout
985 this file contains a list of all the languages currently supported by LyX.
988 \begin_layout Section
989 Your local configuration directory
992 \begin_layout Standard
993 Even if you are using LyX as an unprivileged user, you might want to change
994 LyX configuration for your own use.
996 \begin_inset Flex CharStyle:Code
999 \begin_layout Plain Layout
1005 directory contains all your personal configuration files.
1006 This is the directory described as
1007 \begin_inset Quotes eld
1011 \begin_inset Quotes erd
1015 \begin_inset Flex CharStyle:MenuItem
1018 \begin_layout Plain Layout
1019 Help\SpecialChar \menuseparator
1021 \begin_inset space ~
1030 This directory is used as a mirror of
1031 \begin_inset Flex CharStyle:Code
1034 \begin_layout Plain Layout
1040 , which means that every file in
1041 \begin_inset Flex CharStyle:Code
1044 \begin_layout Plain Layout
1050 is a replacement for the corresponding file in
1051 \begin_inset Flex CharStyle:Code
1054 \begin_layout Plain Layout
1061 Any configuration file described in the above sections can be placed either
1062 in the system-wide directory, in which case it will affect all users, or
1063 in your local directory for your own use.
1066 \begin_layout Standard
1067 To make things clearer, let's provide a few examples:
1070 \begin_layout Itemize
1071 The preferences set in the
1072 \begin_inset Flex CharStyle:MenuItem
1075 \begin_layout Plain Layout
1076 Tools\SpecialChar \menuseparator
1082 dialog are saved to a file
1083 \begin_inset Flex CharStyle:Code
1086 \begin_layout Plain Layout
1093 \begin_inset Flex CharStyle:Code
1096 \begin_layout Plain Layout
1105 \begin_layout Itemize
1106 When you reconfigure using
1107 \begin_inset Flex CharStyle:MenuItem
1110 \begin_layout Plain Layout
1111 Tools\SpecialChar \menuseparator
1118 \begin_inset Flex CharStyle:Code
1121 \begin_layout Plain Layout
1127 script, and the resulting files are written in your local configuration
1129 This means that any additional text class file that you might have added
1131 \begin_inset Flex CharStyle:Code
1134 \begin_layout Plain Layout
1140 will be added to the list of classes in the
1141 \begin_inset Flex CharStyle:MenuItem
1144 \begin_layout Plain Layout
1145 Document\SpecialChar \menuseparator
1154 \begin_layout Itemize
1155 If you get some updated documentation from LyX ftp site and cannot install
1156 it because you do not have sysadmin rights on your system, you can just
1158 \begin_inset Flex CharStyle:Code
1161 \begin_layout Plain Layout
1167 and the items in the
1168 \begin_inset Flex CharStyle:MenuItem
1171 \begin_layout Plain Layout
1177 menu will open them!
1180 \begin_layout Section
1181 Running LyX with multiple configurations
1184 \begin_layout Standard
1185 The configuration freedom of the local configuration directory may not suffice
1186 if you want to have more than one configuration at your disposal.
1187 For example, you may want to be use different key bindings or printer settings
1189 You can achieve this by having several such directories.
1190 You then specify which directory to use at run-time.
1193 \begin_layout Standard
1194 Invoking LyX with the command line switch
1195 \begin_inset Flex CharStyle:Code
1198 \begin_layout Plain Layout
1208 instructs the program to read the configuration from that directory, and
1209 not from the default directory.
1210 (You can determine the default directory by running LyX without the
1211 \begin_inset Flex CharStyle:Code
1214 \begin_layout Plain Layout
1220 switch.) If the specified directory does not exist, LyX offers to create
1221 it for you, just like it does for the default directory on the first time
1222 you run the program.
1223 You can modify the configuration options in this additional user directory
1224 exactly as you would for the default directory.
1225 These directories are completely independent (but read on).
1226 Note that setting the environment variable
1227 \begin_inset Flex CharStyle:Code
1230 \begin_layout Plain Layout
1236 to some value has exactly the same effect.
1239 \begin_layout Standard
1240 Having several configurations also requires more maintenance: if you want
1241 to add a new layout to
1242 \begin_inset Flex CharStyle:Code
1245 \begin_layout Plain Layout
1251 which you want available from all your configurations, you must add it
1252 to each directory separately.
1253 You can avoid this with the following trick: after LyX creates the additional
1254 directory, most of the subdirectories (see above) are empty.
1255 If you want the new configuration to mirror an existing one, replace the
1256 empty subdirectory with a symbolic link to the matching subdirectory in
1257 the existing configuration.
1259 \begin_inset Flex CharStyle:Code
1262 \begin_layout Plain Layout
1268 subdirectory, however, since it contains a file written by the configuration
1269 script (also accessible through
1270 \begin_inset Flex CharStyle:MenuItem
1273 \begin_layout Plain Layout
1274 Tools\SpecialChar \menuseparator
1280 ) which is configuration-specific.
1283 \begin_layout Chapter
1284 The Preferences dialog
1287 \begin_layout Standard
1288 All options of the preferences dialog are described in the Appendix
1290 The Preferences Dialog
1297 For some options you might find here more details.
1300 \begin_layout Section
1302 \begin_inset CommandInset label
1311 \begin_layout Standard
1312 The first step is to define your file formats if they are not already defined.
1314 \begin_inset Flex CharStyle:MenuItem
1317 \begin_layout Plain Layout
1318 Tools\SpecialChar \menuseparator
1326 \begin_inset Flex CharStyle:MenuItem
1329 \begin_layout Plain Layout
1330 File Handling\SpecialChar \menuseparator
1337 \begin_inset Flex CharStyle:MenuItem
1340 \begin_layout Plain Layout
1341 New\SpecialChar \ldots{}
1347 button to define your new format.
1349 \begin_inset Flex CharStyle:MenuItem
1352 \begin_layout Plain Layout
1358 field contains the name used to identify the format in the GUI.
1360 \begin_inset Flex CharStyle:MenuItem
1363 \begin_layout Plain Layout
1369 is used to identify the format internally.
1370 You will also need to enter a file extension.
1371 These are all required.
1373 \begin_inset Flex CharStyle:MenuItem
1376 \begin_layout Plain Layout
1382 field is used to provide a keyboard shortcut on the menus.
1383 (For example, pressing
1384 \begin_inset Flex CharStyle:MenuItem
1387 \begin_layout Plain Layout
1394 \begin_inset Flex CharStyle:MenuItem
1397 \begin_layout Plain Layout
1398 View\SpecialChar \menuseparator
1407 \begin_layout Standard
1409 \begin_inset Flex CharStyle:MenuItem
1412 \begin_layout Plain Layout
1419 \begin_inset Flex CharStyle:MenuItem
1422 \begin_layout Plain Layout
1429 For example, you might want to use
1430 \begin_inset Flex CharStyle:MenuItem
1433 \begin_layout Plain Layout
1439 to view PostScript files.
1440 You can enter the command needed to start the program in the corresponding
1442 In defining this command, you can use the four variables listed in the
1444 The viewer is launched when you view an image in LyX or use the
1445 \begin_inset Flex CharStyle:MenuItem
1448 \begin_layout Plain Layout
1455 The editor is for example launched when you right-click on an image and
1457 \begin_inset Flex CharStyle:MenuItem
1460 \begin_layout Plain Layout
1466 in the appearing context menu.
1469 \begin_layout Standard
1471 \begin_inset Flex CharStyle:MenuItem
1474 \begin_layout Plain Layout
1480 option tells LyX that a format is suitable for document export.
1481 If this is set and if a suitable conversion route exists (see sec.
1482 \begin_inset space \thinspace{}
1486 \begin_inset CommandInset ref
1488 reference "sec:Converters"
1492 ), the format will appear in the
1493 \begin_inset Flex CharStyle:MenuItem
1496 \begin_layout Plain Layout
1497 File\SpecialChar \menuseparator
1504 The format will also appear in the
1505 \begin_inset Flex CharStyle:MenuItem
1508 \begin_layout Plain Layout
1514 menu if a viewer is specified for the format.
1515 Pure image formats, such as
1516 \begin_inset Flex CharStyle:Code
1519 \begin_layout Plain Layout
1525 , should not use this option.
1526 Formats that can both represent vector graphics and documents like
1527 \begin_inset Flex CharStyle:Code
1530 \begin_layout Plain Layout
1539 \begin_layout Standard
1541 \begin_inset Flex CharStyle:MenuItem
1544 \begin_layout Plain Layout
1545 Vector graphics format
1550 tells LyX that a format can contain vector graphics.
1551 This information is used to determine the target format of included graphics
1553 \begin_inset Flex CharStyle:MenuItem
1556 \begin_layout Plain Layout
1563 Included graphics may need to be converted to either
1564 \begin_inset Flex CharStyle:MenuItem
1567 \begin_layout Plain Layout
1574 \begin_inset Flex CharStyle:MenuItem
1577 \begin_layout Plain Layout
1584 \begin_inset Flex CharStyle:MenuItem
1587 \begin_layout Plain Layout
1594 \begin_inset Flex CharStyle:MenuItem
1597 \begin_layout Plain Layout
1603 cannot handle other image formats.
1604 If an included graphic is not already in
1605 \begin_inset Flex CharStyle:MenuItem
1608 \begin_layout Plain Layout
1615 \begin_inset Flex CharStyle:MenuItem
1618 \begin_layout Plain Layout
1625 \begin_inset Flex CharStyle:MenuItem
1628 \begin_layout Plain Layout
1634 format, it is converted to
1635 \begin_inset Flex CharStyle:MenuItem
1638 \begin_layout Plain Layout
1644 if the vector format option is set, and otherwise to
1645 \begin_inset Flex CharStyle:MenuItem
1648 \begin_layout Plain Layout
1657 \begin_layout Section
1661 \begin_layout Standard
1662 Since all conversions from one format to another take place in LyX's temporary
1663 directory, it is sometimes necessary to modify a file before copying it
1664 to the temporary directory in order that the conversion may be performed.
1668 \begin_layout Plain Layout
1669 For example, the file may refer to other files—images, for example—using
1670 relative file names, and these may become invalid when the file is copied
1671 to the temporary directory.
1676 This is done by a Copier: It copies a file to (or from) the temporary directory
1677 and may modify it in the process.
1680 \begin_layout Standard
1681 The definitions of the copiers may use four variables:
1684 \begin_layout Labeling
1685 \labelwidthstring 00.00.0000
1686 \begin_inset Flex CharStyle:Code
1689 \begin_layout Plain Layout
1695 The LyX system directory (e.
1696 \begin_inset space \thinspace{}
1700 \begin_inset space \space{}
1704 \begin_inset Flex CharStyle:MenuItem
1707 \begin_layout Plain Layout
1716 \begin_layout Labeling
1717 \labelwidthstring 00.00.0000
1718 \begin_inset Flex CharStyle:Code
1721 \begin_layout Plain Layout
1730 \begin_layout Labeling
1731 \labelwidthstring 00.00.0000
1732 \begin_inset Flex CharStyle:Code
1735 \begin_layout Plain Layout
1744 \begin_layout Labeling
1745 \labelwidthstring 00.00.0000
1746 \begin_inset Flex CharStyle:Code
1749 \begin_layout Plain Layout
1758 \begin_layout Standard
1759 The latter should be the filename as it would be used in a LaTeX's
1766 It is relevant only when exporting files suitable for such inclusion.
1769 \begin_layout Standard
1770 Copiers can be used to do almost anything with output files.
1771 For example, suppose you want generated pdf files to be copied to a special
1773 \begin_inset Flex CharStyle:Code
1776 \begin_layout Plain Layout
1783 Then you could write a shell script such as this one:
1786 \begin_layout Standard
1787 \begin_inset listings
1791 \begin_layout Plain Layout
1796 \begin_layout Plain Layout
1801 \begin_layout Plain Layout
1803 TOFILE=`basename $2`
1806 \begin_layout Plain Layout
1808 cp $FROMFILE /home/you/pdf/$TOFILE
1813 Save it in your local LyX directory—say,
1814 \begin_inset Flex CharStyle:Code
1817 \begin_layout Plain Layout
1818 /home/you/.lyx/scripts/pdfcopier.sh
1823 —and make it executable, if you need to do so on your platform.
1825 \begin_inset Flex CharStyle:MenuItem
1828 \begin_layout Plain Layout
1829 Tools\SpecialChar \menuseparator
1835 dialog, select under
1836 \begin_inset Flex CharStyle:MenuItem
1839 \begin_layout Plain Layout
1840 File Handling\SpecialChar \menuseparator
1847 \begin_inset Flex CharStyle:MenuItem
1850 \begin_layout Plain Layout
1856 format—or one of the other pdf formats—and enter
1857 \begin_inset Flex CharStyle:Code
1860 \begin_layout Plain Layout
1861 pdfcopier.sh $$i $$o
1867 \begin_inset Flex CharStyle:MenuItem
1870 \begin_layout Plain Layout
1880 \begin_layout Standard
1881 Copiers are used by LyX in various of its own conversions.
1882 For example, if appropriate programs are found, LyX will automatically
1883 install copiers for the
1884 \begin_inset Flex CharStyle:MenuItem
1887 \begin_layout Plain Layout
1894 \begin_inset Flex CharStyle:MenuItem
1897 \begin_layout Plain Layout
1899 \begin_inset space ~
1908 When these formats are exported, the copier sees that not just the main
1909 HTML file but various associated files (style files, images, etc.) are also
1911 All these files are written to a subdirectory of the directory in which
1912 the original LyX file was found.
1916 \begin_layout Plain Layout
1917 This copier can be customized.
1919 \begin_inset Quotes eld
1923 \begin_inset Quotes erd
1926 argument takes a comma-separated list of extensions to be copied; if it
1927 is omitted, all files will be copied.
1929 \begin_inset Quotes eld
1933 \begin_inset Quotes erd
1936 argument determines the extension added to the generated directory.
1938 \begin_inset Quotes eld
1942 \begin_inset Flex CharStyle:MenuItem
1945 \begin_layout Plain Layout
1952 \begin_inset Quotes erd
1955 , so HTML generated from
1956 \begin_inset Flex CharStyle:MenuItem
1959 \begin_layout Plain Layout
1960 /path/to/filename.lyx
1966 \begin_inset Flex CharStyle:MenuItem
1969 \begin_layout Plain Layout
1970 /path/to/filename.html.LyXconv
1984 \begin_layout Section
1986 \begin_inset CommandInset label
1988 name "sec:Converters"
1995 \begin_layout Standard
1996 You can define your own Converters to convert files between different formats.
1998 \begin_inset Flex CharStyle:MenuItem
2001 \begin_layout Plain Layout
2002 Tools\SpecialChar \menuseparator
2003 Preferences\SpecialChar \menuseparator
2004 File Handling\SpecialChar \menuseparator
2013 \begin_layout Standard
2014 To define a new converter, select the
2015 \begin_inset Flex CharStyle:MenuItem
2018 \begin_layout Plain Layout
2020 \begin_inset space ~
2029 \begin_inset Flex CharStyle:MenuItem
2032 \begin_layout Plain Layout
2034 \begin_inset space ~
2042 from the drop-down lists, enter the command needed for the conversion,
2044 \begin_inset Flex CharStyle:MenuItem
2047 \begin_layout Plain Layout
2054 Several variables can be used in the definition of converters:
2057 \begin_layout Labeling
2058 \labelwidthstring 00.00.0000
2059 \begin_inset Flex CharStyle:Code
2062 \begin_layout Plain Layout
2068 The LyX system directory
2071 \begin_layout Labeling
2072 \labelwidthstring 00.00.0000
2073 \begin_inset Flex CharStyle:Code
2076 \begin_layout Plain Layout
2085 \begin_layout Labeling
2086 \labelwidthstring 00.00.0000
2087 \begin_inset Flex CharStyle:Code
2090 \begin_layout Plain Layout
2099 \begin_layout Labeling
2100 \labelwidthstring 00.00.0000
2101 \begin_inset Flex CharStyle:Code
2104 \begin_layout Plain Layout
2110 The base filename of the input file (i.
2111 \begin_inset space \thinspace{}
2114 g., without the extension)
2117 \begin_layout Labeling
2118 \labelwidthstring 00.00.0000
2119 \begin_inset Flex CharStyle:Code
2122 \begin_layout Plain Layout
2128 The path to the input file
2131 \begin_layout Labeling
2132 \labelwidthstring 00.00.0000
2133 \begin_inset Flex CharStyle:Code
2136 \begin_layout Plain Layout
2142 The path to the original input file (this is different from $$p when a
2143 chain of converters is called).
2146 \begin_layout Standard
2148 \begin_inset Flex CharStyle:MenuItem
2151 \begin_layout Plain Layout
2153 \begin_inset space ~
2161 field you can enter the following flags, separated by commas:
2164 \begin_layout Labeling
2165 \labelwidthstring 00.00.0000
2166 \begin_inset Flex CharStyle:Code
2169 \begin_layout Plain Layout
2175 This converter runs some form of LaTeX.
2176 This will make LyX's LaTeX error logs available.
2179 \begin_layout Labeling
2180 \labelwidthstring 00.00.0000
2181 \begin_inset Flex CharStyle:Code
2184 \begin_layout Plain Layout
2191 \begin_inset Flex CharStyle:MenuItem
2194 \begin_layout Plain Layout
2200 file for the conversion.
2203 \begin_layout Labeling
2204 \labelwidthstring 00.00.0000
2205 \begin_inset Flex CharStyle:Code
2208 \begin_layout Plain Layout
2217 \begin_layout Standard
2218 The following three flags are not really flags at all because they take
2220 \begin_inset Flex CharStyle:MenuItem
2223 \begin_layout Plain Layout
2225 \begin_inset space ~
2229 \begin_inset space ~
2240 \begin_layout Labeling
2241 \labelwidthstring 00.00.0000
2242 \begin_inset Flex CharStyle:Code
2245 \begin_layout Plain Layout
2251 If set, the converter's standard error will be redirected to a file
2252 \begin_inset Flex CharStyle:Code
2255 \begin_layout Plain Layout
2261 , and the script given as argument will be run as:
2262 \begin_inset Flex CharStyle:Code
2265 \begin_layout Plain Layout
2266 script < infile.out > infile.log
2272 The argument may contain
2273 \begin_inset Flex CharStyle:Code
2276 \begin_layout Plain Layout
2285 \begin_layout Labeling
2286 \labelwidthstring 00.00.0000
2287 \begin_inset Flex CharStyle:Code
2290 \begin_layout Plain Layout
2296 The name of the directory in which the converter will dump the generated
2298 LyX will not create this directory, and it does not copy anything into
2299 it, though it will copy this directory to the destination.
2300 The argument may contain
2301 \begin_inset Flex CharStyle:Code
2304 \begin_layout Plain Layout
2310 , which will be replaced by the base name of the input and output files,
2311 respectively, when the directory is copied.
2312 \begin_inset Newline newline
2315 Note that resultdir and usetempdir make no sense together.
2316 The latter will be ignored if the former is given.
2319 \begin_layout Labeling
2320 \labelwidthstring 00.00.0000
2321 \begin_inset Flex CharStyle:Code
2324 \begin_layout Plain Layout
2330 Determines the output file name and may, contain
2331 \begin_inset Flex CharStyle:Code
2334 \begin_layout Plain Layout
2341 Sensible only with resultdir and optional even then; if not given, it defaults
2345 \begin_layout Standard
2346 None of these last three are presently used in any of the converters that
2347 are installed with LyX.
2351 \begin_layout Standard
2352 You do not have to define converters for all formats between which you want
2354 For example, you will note that there is no `LyX to PostScript' converter,
2355 but LyX will export PostScript.
2356 It does so by first creating a LaTeX file (no converter needs to be defined
2357 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2358 and finally converting the resulting DVI file to PostScript.
2359 LyX finds such `chains' of converters automatically, and it will always
2360 choose the shortest possible chain.
2361 You can, though, still define multiple conversion methods between file
2363 For example, the standard LyX configuration provides three ways to convert
2364 LaTeX to PDF: Directly, using
2365 \begin_inset Flex CharStyle:MenuItem
2368 \begin_layout Plain Layout
2374 ; via (DVI and) PostScript, using
2375 \begin_inset Flex CharStyle:MenuItem
2378 \begin_layout Plain Layout
2385 \begin_inset Flex CharStyle:MenuItem
2388 \begin_layout Plain Layout
2395 To define such alternate chains, you must define multiple target `file
2396 formats', as described in section
2397 \begin_inset CommandInset ref
2399 reference "sec:Formats"
2404 For example, in the standard configuration, the formats named
2405 \begin_inset Flex CharStyle:MenuItem
2408 \begin_layout Plain Layout
2415 \begin_inset Flex CharStyle:MenuItem
2418 \begin_layout Plain Layout
2425 \begin_inset Flex CharStyle:MenuItem
2428 \begin_layout Plain Layout
2434 are defined, all of which share the extension
2435 \begin_inset Flex CharStyle:MenuItem
2438 \begin_layout Plain Layout
2444 , and which correspond to the conversion methods just mentioned.
2447 \begin_layout Chapter
2448 Internationalizing LyX
2449 \begin_inset CommandInset label
2451 name "cha:Internationalizing-LyX"
2458 \begin_layout Standard
2459 LyX supports using a translated interface.
2460 Last time we checked, LyX provided text in thirty languages.
2461 The language of choice is called your
2466 (For further reading on locale settings, see also the documentation for
2467 locale that comes with your operating system.
2468 For Linux, the manual page for
2469 \begin_inset Flex CharStyle:Code
2472 \begin_layout Plain Layout
2478 could be a good place to start).
2481 \begin_layout Standard
2482 Notice that these translations will work, but do contain a few flaws.
2483 In particular, all dialogs have been designed with the English text in
2484 mind, which means that some of the translated text will be too large to
2485 fit within the space allocated.
2486 This is only a display problem and will not cause any harm.
2487 Also, you will find that some of the translations do not define shortcut
2488 keys for everything.
2489 Sometimes, there are simply not enough free letters to do it.
2490 Other times, the translator just hasn't got around to doing it yet.
2491 Our localization team, which you may wish to join,
2495 \begin_layout Plain Layout
2496 If you are a fluent speaker of a language other than English, joining these
2497 teams is a great way to give back to the LyX community!
2502 will of course try to fix these shortcomings in future versions of LyX.
2505 \begin_layout Section
2509 \begin_layout Subsection
2510 Translating the graphical user interface (text messages).
2513 \begin_layout Standard
2515 \begin_inset Flex CharStyle:Code
2518 \begin_layout Plain Layout
2524 library to handle the internationalization of the interface.
2525 To have LyX speak your favorite language in all menus and dialogs, you
2527 \begin_inset Flex CharStyle:Code
2530 \begin_layout Plain Layout
2536 -file for that language.
2537 When this is available, you'll have to generate a
2538 \begin_inset Flex CharStyle:Code
2541 \begin_layout Plain Layout
2547 -file from it and install the
2548 \begin_inset Flex CharStyle:Code
2551 \begin_layout Plain Layout
2558 The process of doing all of this is explained in the documentation for
2560 \begin_inset Flex CharStyle:Code
2563 \begin_layout Plain Layout
2570 It is possible to do this just for yourself, but if you're going to do
2571 it, you might as well share the results of your labors with the rest of
2573 Send a message to the LyX developers' list for more information about how
2577 \begin_layout Standard
2578 In short, this is what you should do (xx denotes the language code):
2581 \begin_layout Itemize
2582 Check out the LyX source code.
2584 \begin_inset CommandInset href
2586 name "information on the web"
2587 target "http://www.lyx.org/devel/cvs.php"
2594 \begin_layout Itemize
2596 \begin_inset Flex CharStyle:Code
2599 \begin_layout Plain Layout
2605 to the folder of the
2606 \begin_inset Flex CharStyle:Code
2609 \begin_layout Plain Layout
2617 \begin_inset Flex CharStyle:Code
2620 \begin_layout Plain Layout
2628 \begin_inset Flex CharStyle:Code
2631 \begin_layout Plain Layout
2637 doesn't exist anywhere, it can be remade with the console command
2638 \begin_inset Flex CharStyle:Code
2641 \begin_layout Plain Layout
2647 in that directory, or you can use an existing po-file for some other language
2651 \begin_layout Itemize
2653 \begin_inset Flex CharStyle:Code
2656 \begin_layout Plain Layout
2666 \begin_layout Plain Layout
2667 This is just a text file, so it can be edited in any text editor.
2668 But there are also specialized programs that support such editing, such
2673 (for all platforms) or
2682 contains a `mode' for editing
2683 \begin_inset Flex CharStyle:Code
2686 \begin_layout Plain Layout
2697 For some menu- and widget-labels, there are also shortcut keys that should
2699 Those keys are marked after a `|', and should be translated according to
2700 the words and phrases of the language.
2701 You should also fill also out the information at the beginning of the new
2703 \begin_inset Flex CharStyle:Code
2706 \begin_layout Plain Layout
2712 -file with your email-address, etc., so people know where to reach you with
2713 suggestions and entertaining flames.
2716 \begin_layout Standard
2717 If you are just doing this on your own, then:
2720 \begin_layout Itemize
2722 \begin_inset Flex CharStyle:Code
2725 \begin_layout Plain Layout
2732 This can be done with
2733 \begin_inset Flex CharStyle:Code
2736 \begin_layout Plain Layout
2737 msgfmt -o xx.mo < xx.po
2745 \begin_layout Itemize
2747 \begin_inset Flex CharStyle:Code
2750 \begin_layout Plain Layout
2756 -file to your locale-tree, at the correct directory for application messages
2761 xx, and under the name
2762 \begin_inset Flex CharStyle:Code
2765 \begin_layout Plain Layout
2772 \begin_inset space \thinspace{}
2776 \begin_inset space \space{}
2780 \begin_inset Flex CharStyle:Code
2783 \begin_layout Plain Layout
2784 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2794 \begin_layout Standard
2795 As said, however, it would be best if the new
2796 \begin_inset Flex CharStyle:Code
2799 \begin_layout Plain Layout
2805 -file could be added to the LyX distribution, so others can use it.
2806 Adding it involves making additional changes to LyX.
2807 So send an email to the developers' mailing list if you're interested in
2811 \begin_layout Subsubsection
2815 \begin_layout Standard
2816 Sometimes it turns out that one English message needs to be translated into
2817 different messages in the target language.
2818 One example is the message
2819 \begin_inset Flex CharStyle:Code
2822 \begin_layout Plain Layout
2828 which has the German translation
2836 , depending upon exactly what the English
2837 \begin_inset Quotes eld
2841 \begin_inset Quotes erd
2846 \begin_inset Flex CharStyle:Code
2849 \begin_layout Plain Layout
2855 does not handle such ambiguous translations.
2856 Therefore you have to add some context information to the message: Instead
2858 \begin_inset Flex CharStyle:Code
2861 \begin_layout Plain Layout
2868 \begin_inset Flex CharStyle:Code
2871 \begin_layout Plain Layout
2872 To[[as in 'From format x to format y']]
2878 \begin_inset Flex CharStyle:Code
2881 \begin_layout Plain Layout
2882 To[[as in 'From page x to page y']].
2887 Now the two occurrences of
2888 \begin_inset Flex CharStyle:Code
2891 \begin_layout Plain Layout
2898 \begin_inset Flex CharStyle:Code
2901 \begin_layout Plain Layout
2907 and can be translated correctly to
2918 \begin_layout Standard
2919 Of course the context information needs to be stripped off the original
2920 message when no translation is used.
2921 Therefore you have to put it in double square brackets at the end of the
2922 message (see the example above).
2923 The translation mechanism of LyX ensures that everything in double square
2924 brackets at the end of messages is removed before displaying the message.
2927 \begin_layout Subsection
2928 Translating the documentation.
2931 \begin_layout Standard
2932 The online documentation (in the
2933 \begin_inset Flex CharStyle:MenuItem
2936 \begin_layout Plain Layout
2942 -menu) can (and should!) be translated.
2943 If there are translated versions of the documentation available
2947 \begin_layout Plain Layout
2948 As of March 2008, at least some of the documents have been translated into
2949 fourteen languages, with the Tutorial available in a few more.
2954 and the locale is set accordingly, these will be used automagically by
2956 LyX looks for translated versions as
2957 \begin_inset Flex CharStyle:Code
2960 \begin_layout Plain Layout
2961 LyXDir/doc/xx/DocName.lyx
2967 \begin_inset Flex CharStyle:Code
2970 \begin_layout Plain Layout
2976 is the code for the language currently in use.
2977 If there are no translated documents, the default English versions will
2979 Note that the translated versions must have the same filenames (
2980 \begin_inset Flex CharStyle:Code
2983 \begin_layout Plain Layout
2989 above) as the original.
2990 If you feel up to translating the documentation (an excellent way to proof-read
2991 the original documentation by the way!), there are a few things you should
2995 \begin_layout Itemize
2996 Check out the documentation translation web page at
2997 \begin_inset CommandInset href
2999 name "http://www.lyx.org/Translation"
3000 target "http://www.lyx.org/Translation"
3005 That way, you can find out which (if any) documents have already been translate
3006 d into your language.
3007 You can also find out who (if anyone) is organizing the effort to translate
3008 the documentation into your language.
3009 If no one is organizing the effort, please let us know that you're interested.
3012 \begin_layout Standard
3013 Once you get to actually translating, here's a few hints for you that may
3017 \begin_layout Itemize
3018 Join the documentation team! There is information on how to do that in
3019 \begin_inset Flex CharStyle:Code
3022 \begin_layout Plain Layout
3029 \begin_inset Flex CharStyle:MenuItem
3032 \begin_layout Plain Layout
3033 Help\SpecialChar \menuseparator
3039 ), which by the way is the first document you should translate.
3042 \begin_layout Itemize
3043 Learn the typographic conventions for the language you are translating to.
3044 Typography is an ancient art and over the centuries, a great variety of
3045 conventions have developed throughout different parts of the world.
3046 Also study the professional terminology amongst typographers in your country.
3047 Inventing your own terminology will only confuse the users.
3050 (Warning! Typography is addictive!)
3053 \begin_layout Itemize
3054 Make a copy of the document.
3055 This will be your working copy.
3056 You can use this as your personal translated help-file by placing it in
3058 \begin_inset Flex CharStyle:Code
3061 \begin_layout Plain Layout
3070 \begin_layout Itemize
3071 Sometimes the original document (from the LyX-team) will be updated.
3072 Use the source viewer at
3073 \begin_inset CommandInset href
3075 name "http://www.lyx.org/trac/timeline"
3076 target "http://www.lyx.org/trac/timeline"
3080 to see what has been changed.
3081 That way you can easily see which parts of the translated document need
3085 \begin_layout Standard
3086 If you ever find an error in the original document, fix it and notify the
3087 rest of the documentation team of the changes! (You didn't forget to join
3088 the documentation team, did you?)
3091 \begin_layout Standard
3092 \begin_inset Branch OutDated
3095 \begin_layout Section
3096 International Keyboard Support
3099 \begin_layout Standard
3102 [Editor's Note: The following section is by
3110 It needs to be fixed to conform to the new Documentation Style sheet and
3111 to make use of the new v1.0 features.
3112 The whole thing also needs to be merged with the section following it.-jw
3113 It may also be badly out of date.-rh (2008)]
3116 \begin_layout Subsection
3117 Defining Own Keymaps: Keymap File Format
3120 \begin_layout Standard
3121 Let's look at a keyboard definition file a little closer.
3122 It is a plain text file defining
3125 \begin_layout Itemize
3126 key-to-key or key-to-string translations
3129 \begin_layout Itemize
3133 \begin_layout Itemize
3134 dead keys exceptions
3137 \begin_layout Standard
3138 To define key-to-key or key-to-string translation, use this command:
3141 \begin_layout Quotation
3142 \begin_inset Flex CharStyle:Code
3145 \begin_layout Plain Layout
3154 \begin_inset Flex CharStyle:Code
3157 \begin_layout Plain Layout
3166 \begin_layout Standard
3168 \begin_inset Flex CharStyle:Code
3171 \begin_layout Plain Layout
3177 is the key to be translated and
3178 \begin_inset Flex CharStyle:Code
3181 \begin_layout Plain Layout
3187 is the string to be inserted into the document.
3188 To define dead keys, use:
3191 \begin_layout Quotation
3192 \begin_inset Flex CharStyle:Code
3195 \begin_layout Plain Layout
3204 \begin_inset Flex CharStyle:Code
3207 \begin_layout Plain Layout
3216 \begin_layout Standard
3218 \begin_inset Flex CharStyle:Code
3221 \begin_layout Plain Layout
3227 is a keyboard key and
3228 \begin_inset Flex CharStyle:Code
3231 \begin_layout Plain Layout
3238 The following dead keys are supported (shortcut name is in parentheses):
3241 \begin_layout Quotation
3245 \begin_inset space \hfill{}
3251 \begin_layout Quotation
3253 \begin_inset space \hfill{}
3259 \begin_layout Quotation
3261 \begin_inset space \hfill{}
3267 \begin_layout Quotation
3269 \begin_inset space \hfill{}
3275 \begin_layout Quotation
3277 \begin_inset space \hfill{}
3283 \begin_layout Quotation
3285 \begin_inset space \hfill{}
3292 \begin_layout Plain Layout
3304 \begin_layout Quotation
3306 \begin_inset space \hfill{}
3312 \begin_layout Quotation
3314 \begin_inset space \hfill{}
3321 \begin_layout Plain Layout
3333 \begin_layout Quotation
3335 \begin_inset space \hfill{}
3341 \begin_layout Quotation
3343 \begin_inset space \hfill{}
3349 \begin_layout Quotation
3351 \begin_inset space \hfill{}
3358 \begin_layout Plain Layout
3370 \begin_layout Quotation
3372 \begin_inset space \hfill{}
3379 \begin_layout Plain Layout
3391 \begin_layout Quotation
3393 \begin_inset space \hfill{}
3399 \begin_layout Quotation
3400 hungarian umlaut (hug)
3401 \begin_inset space \hfill{}
3407 \begin_layout Quotation
3409 \begin_inset space \hfill{}
3415 \begin_layout Quotation
3417 \begin_inset space \hfill{}
3424 \begin_layout Plain Layout
3436 \begin_layout Standard
3437 Since in many international keyboards there are exceptions to what some
3438 dead keys should do, you can define them using
3441 \begin_layout Quotation
3442 \begin_inset Flex CharStyle:Code
3445 \begin_layout Plain Layout
3453 deadkey key outstring
3456 \begin_layout Standard
3457 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3461 \begin_layout Quotation
3462 \begin_inset Flex CharStyle:Code
3465 \begin_layout Plain Layout
3478 \begin_layout Standard
3479 to make it work correctly.
3480 Also, you have to define as exceptions dead keys over i and j, to remove
3481 the dot from them before inserting an accent mark.
3482 I will change this when the time comes, but so far I haven't had time.
3485 \begin_layout Standard
3486 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3489 \begin_inset Flex CharStyle:Code
3492 \begin_layout Plain Layout
3498 have different meaning.
3500 \begin_inset Flex CharStyle:Code
3503 \begin_layout Plain Layout
3509 marks comments, quotes start and end LaTeX-style commands.
3510 To enter quote, you'll need to use
3511 \begin_inset Flex CharStyle:Code
3514 \begin_layout Plain Layout
3523 \begin_inset Flex CharStyle:Code
3526 \begin_layout Plain Layout
3533 \begin_inset Flex CharStyle:Code
3536 \begin_layout Plain Layout
3547 \begin_layout Standard
3548 If you make a keyboard description file that works for your language, please
3549 mail it to me, so I can include it in the next keymap distribution.
3552 \begin_layout Standard
3553 More keywords will be supported in keymap configuration file in future,
3557 \begin_layout Itemize
3558 \begin_inset Flex CharStyle:Code
3561 \begin_layout Plain Layout
3572 \begin_inset space \hfill{}
3576 \begin_inset Flex CharStyle:Code
3579 \begin_layout Plain Layout
3588 \begin_layout Itemize
3589 \begin_inset Flex CharStyle:Code
3592 \begin_layout Plain Layout
3603 \begin_inset space \hfill{}
3607 \begin_inset Flex CharStyle:Code
3610 \begin_layout Plain Layout
3616 an external keymap translation program
3619 \begin_layout Standard
3620 Also, it should look into
3621 \begin_inset Flex CharStyle:Code
3624 \begin_layout Plain Layout
3630 file for defaults, too (for example, a
3631 \begin_inset Flex CharStyle:Code
3634 \begin_layout Plain Layout
3642 option to include default keyboard).
3650 \begin_layout Section
3651 International Keymap Stuff
3652 \begin_inset CommandInset label
3654 name "sec:International-Keymap-Stuff"
3661 \begin_layout Standard
3662 \begin_inset Note Note
3665 \begin_layout Plain Layout
3666 In doing the revisions on this document in March 2008, I did not look over
3667 this stuff, as I do not understand it.
3668 It would be good if someone else could do so.
3677 \begin_layout Standard
3678 The next two sections describe the
3679 \begin_inset Flex CharStyle:Code
3682 \begin_layout Plain Layout
3691 \begin_inset Flex CharStyle:Code
3694 \begin_layout Plain Layout
3702 file syntax in detail.
3703 These sections should help you design your own key map if the ones provided
3704 do not meet your needs.
3707 \begin_layout Subsection
3711 \begin_layout Standard
3715 \begin_inset Flex CharStyle:Code
3718 \begin_layout Plain Layout
3724 file maps keystrokes to characters or strings.
3725 As the name suggests, it sets a keyboard mapping.
3727 \begin_inset Flex CharStyle:Code
3730 \begin_layout Plain Layout
3741 \begin_inset Flex CharStyle:Code
3744 \begin_layout Plain Layout
3759 \begin_inset Flex CharStyle:Code
3762 \begin_layout Plain Layout
3775 \begin_inset Flex CharStyle:Code
3778 \begin_layout Plain Layout
3787 \begin_inset Flex CharStyle:Code
3790 \begin_layout Plain Layout
3798 are described in this section.
3801 \begin_layout Labeling
3802 \labelwidthstring 00.00.0000
3803 \begin_inset Flex CharStyle:Code
3806 \begin_layout Plain Layout
3814 Map a character to a string
3817 \begin_layout LyX-Code
3832 \begin_layout Standard
3865 the double-quote (")
3882 must be escaped with a preceding backslash (
3893 \begin_layout Standard
3895 \begin_inset Flex CharStyle:MenuItem
3898 \begin_layout Plain Layout
3906 statement to cause the symbol
3907 \begin_inset Flex CharStyle:MenuItem
3910 \begin_layout Plain Layout
3918 to be output for the keystroke
3919 \begin_inset Flex CharStyle:MenuItem
3922 \begin_layout Plain Layout
3933 \begin_layout LyX-Code
3939 \begin_layout Labeling
3940 \labelwidthstring 00.00.0000
3941 \begin_inset Flex CharStyle:Code
3944 \begin_layout Plain Layout
3952 Specify an accent character
3955 \begin_layout LyX-Code
3964 \begin_layout Standard
3965 This will make the cha
4003 This is the dead key
4007 \begin_layout Plain Layout
4014 refers to a key that does not produce a character by itself, but when followed
4015 with another key, produces the desired accent character.
4016 For example, a German characte
4018 r with an umlaut like
4028 can be produced in this manner.
4037 \begin_layout Standard
4050 and then another key not in
4067 followed by the other, not allowed key, as output.
4071 \begin_inset Flex CharStyle:MenuItem
4074 \begin_layout Plain Layout
4082 cancels a dead key, so if
4093 \begin_inset Flex CharStyle:MenuItem
4096 \begin_layout Plain Layout
4105 , the cursor will not go one position backwards but will instead cancel
4121 might have had on the next keystroke.
4125 \begin_layout Standard
4126 The following example specifies that the character ' is to be an acute accent,
4127 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4130 \begin_layout LyX-Code
4133 kmod ' acute aeiouAEIOU
4136 \begin_layout Labeling
4137 \labelwidthstring 00.00.0000
4138 \begin_inset Flex CharStyle:Code
4141 \begin_layout Plain Layout
4147 Specify an exception to the accent character
4150 \begin_layout LyX-Code
4159 \begin_layout Standard
4160 This defines an exce
4201 have been assigned a keystroke with a previous
4204 \begin_inset Flex CharStyle:Code
4207 \begin_layout Plain Layout
4231 must not belong in the
4278 If such a declaration does not exist in
4286 \begin_inset Flex CharStyle:Code
4289 \begin_layout Plain Layout
4323 \begin_inset Flex CharStyle:Code
4326 \begin_layout Plain Layout
4340 \begin_layout Standard
4341 The following command produces causes äi to be produced when you enter acute-i
4345 \begin_layout LyX-Code
4359 \begin_layout Labeling
4360 \labelwidthstring 00.00.0000
4361 \begin_inset Flex CharStyle:Code
4364 \begin_layout Plain Layout
4370 Combine two accent characters
4373 \begin_layout LyX-Code
4379 accent1 accent2 allowed
4382 \begin_layout Standard
4383 This one is getting pretty esoteric.
4384 It allows you to combine the effect
4440 \begin_inset Flex CharStyle:Code
4443 \begin_layout Plain Layout
4471 \begin_layout Standard
4472 Consider this example from the
4473 \begin_inset Flex CharStyle:Code
4476 \begin_layout Plain Layout
4487 \begin_layout LyX-Code
4490 kmod ; acute aeioyvhAEIOYVH
4494 kcomb acute umlaut iyIY
4497 \begin_layout Standard
4498 This allows you to press
4499 \begin_inset Flex CharStyle:MenuItem
4502 \begin_layout Plain Layout
4510 and get the effect of
4511 \begin_inset Flex CharStyle:Code
4514 \begin_layout Plain Layout
4533 in this case cancels the last dead key, so if you press
4534 \begin_inset Flex CharStyle:MenuItem
4537 \begin_layout Plain Layout
4546 \begin_inset Flex CharStyle:Code
4549 \begin_layout Plain Layout
4562 \begin_layout Subsection
4566 \begin_layout Standard
4568 \begin_inset Flex CharStyle:Code
4571 \begin_layout Plain Layout
4579 mapping is performed, a
4580 \begin_inset Flex CharStyle:Code
4583 \begin_layout Plain Layout
4593 file maps the strings that the symbols generate to characters in the current
4595 The LyX distribution currently includes at least the
4596 \begin_inset Flex CharStyle:Code
4599 \begin_layout Plain Layout
4608 \begin_inset Flex CharStyle:Code
4611 \begin_layout Plain Layout
4622 \begin_layout Standard
4624 \begin_inset Flex CharStyle:Code
4627 \begin_layout Plain Layout
4635 file is a sequence of declarations of the form
4638 \begin_layout LyX-Code
4651 \begin_layout Standard
4652 For example, in order to map
4653 \begin_inset Flex CharStyle:MenuItem
4656 \begin_layout Plain Layout
4666 to the corresponding character in the iso-8859-1 set (233), the following
4670 \begin_layout LyX-Code
4678 \begin_layout Standard
4680 \begin_inset Flex CharStyle:Code
4683 \begin_layout Plain Layout
4692 \begin_inset Flex CharStyle:Code
4695 \begin_layout Plain Layout
4713 the same character can apply to more than one string.
4715 \begin_inset Flex CharStyle:Code
4718 \begin_layout Plain Layout
4729 \begin_layout LyX-Code
4741 \begin_inset Newline newline
4757 \begin_layout Standard
4758 If LyX cannot find a mapping for the string produced by the keystroke or
4759 a deadkey sequence, it will check if it looks like an accented char and
4760 try to draw an accent over the character on screen.
4763 \begin_layout Subsection
4767 \begin_layout Standard
4768 There is a second way to add support for international characters through
4769 so-called dead-keys.
4770 A dead-key works in combination with a letter to produce an accented character.
4771 Here, we'll explain how to create a really simple dead-key to illustrate
4775 \begin_layout Standard
4776 Suppose you happen to need the circumflex character,
4777 \begin_inset Quotes eld
4781 \begin_inset Quotes erd
4786 \begin_inset Flex CharStyle:MenuItem
4789 \begin_layout Plain Layout
4796 \begin_inset space ~
4800 \begin_inset Flex CharStyle:MenuItem
4803 \begin_layout Plain Layout
4809 ] to the LyX command
4810 \begin_inset Flex CharStyle:Code
4813 \begin_layout Plain Layout
4820 \begin_inset Flex CharStyle:Code
4823 \begin_layout Plain Layout
4830 Now, whenever you type the
4831 \begin_inset Flex CharStyle:MenuItem
4834 \begin_layout Plain Layout
4840 -key followed by a letter, that letter will have a circumflex accent on
4842 For example, the sequence
4843 \begin_inset Quotes eld
4847 \begin_inset Flex CharStyle:MenuItem
4850 \begin_layout Plain Layout
4857 \begin_inset Quotes erd
4860 produces the letter:
4861 \begin_inset Quotes eld
4865 \begin_inset Quotes erd
4869 If you tried to type
4870 \begin_inset Quotes eld
4874 \begin_inset Flex CharStyle:MenuItem
4877 \begin_layout Plain Layout
4884 \begin_inset Quotes erd
4887 , however, LyX will complain with a beep, since a
4888 \begin_inset Quotes eld
4892 \begin_inset Flex CharStyle:MenuItem
4895 \begin_layout Plain Layout
4902 \begin_inset Quotes erd
4905 never takes a circumflex accent.
4907 \begin_inset Flex CharStyle:MenuItem
4910 \begin_layout Plain Layout
4916 after a dead-key produces the bare-accent.
4917 Please note this last point! If you bind a key to a dead-key, you'll need
4918 to rebind the character on that key to yet another key.
4920 \begin_inset Flex CharStyle:MenuItem
4923 \begin_layout Plain Layout
4929 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
4932 \begin_layout Standard
4933 One common way to bind dead-keys is to use
4934 \begin_inset Flex CharStyle:MenuItem
4937 \begin_layout Plain Layout
4944 \begin_inset Flex CharStyle:MenuItem
4947 \begin_layout Plain Layout
4954 \begin_inset Flex CharStyle:MenuItem
4957 \begin_layout Plain Layout
4963 in combination with an accent, like
4964 \begin_inset Quotes eld
4968 \begin_inset Flex CharStyle:MenuItem
4971 \begin_layout Plain Layout
4978 \begin_inset Quotes erd
4982 \begin_inset Quotes eld
4986 \begin_inset Flex CharStyle:MenuItem
4989 \begin_layout Plain Layout
4996 \begin_inset Quotes erd
5000 \begin_inset Quotes eld
5004 \begin_inset Flex CharStyle:MenuItem
5007 \begin_layout Plain Layout
5014 \begin_inset Quotes erd
5018 Another way involves using
5019 \begin_inset Flex CharStyle:Code
5022 \begin_layout Plain Layout
5029 \begin_inset Flex CharStyle:Code
5032 \begin_layout Plain Layout
5038 to set up the special
5039 \begin_inset Flex CharStyle:Code
5042 \begin_layout Plain Layout
5050 \begin_inset Flex CharStyle:Code
5053 \begin_layout Plain Layout
5059 acts in some ways just like
5060 \begin_inset Flex CharStyle:MenuItem
5063 \begin_layout Plain Layout
5069 and permits you to bind keys to accented characters.
5070 You can also turn keys into dead-keys by binding them to something like
5072 \begin_inset Flex CharStyle:Code
5075 \begin_layout Plain Layout
5081 and then binding this symbolic key to the corresponding LyX command.
5085 \begin_layout Plain Layout
5090 : This is exactly what I do in my
5091 \begin_inset Flex CharStyle:Code
5094 \begin_layout Plain Layout
5101 \begin_inset Flex CharStyle:Code
5104 \begin_layout Plain Layout
5112 \begin_inset Flex CharStyle:MenuItem
5115 \begin_layout Plain Layout
5117 \begin_inset space ~
5126 \begin_inset Flex CharStyle:Code
5129 \begin_layout Plain Layout
5135 and a bunch of these
5136 \begin_inset Quotes eld
5140 \begin_inset Flex CharStyle:Code
5143 \begin_layout Plain Layout
5150 \begin_inset Quotes erd
5153 symbolic keys bound such things as
5154 \begin_inset Flex CharStyle:MenuItem
5157 \begin_layout Plain Layout
5159 \begin_inset space ~
5168 \begin_inset Flex CharStyle:MenuItem
5171 \begin_layout Plain Layout
5173 \begin_inset space ~
5182 This is how I produce my accented characters.
5187 You can make just about anything into the
5188 \begin_inset Flex CharStyle:Code
5191 \begin_layout Plain Layout
5198 \begin_inset Flex CharStyle:MenuItem
5201 \begin_layout Plain Layout
5207 keys, a spare function key, etc.
5208 As for the LyX commands that produce accents, check the entry for
5209 \begin_inset Flex CharStyle:Code
5212 \begin_layout Plain Layout
5223 You'll find the complete list there.
5226 \begin_layout Subsection
5227 Saving your Language Configuration
5230 \begin_layout Standard
5231 You can edit your preferences so that your desired language environment
5232 is automatically configured when LyX starts up, via the
5233 \begin_inset Flex CharStyle:MenuItem
5236 \begin_layout Plain Layout
5237 Edit\SpecialChar \menuseparator
5246 \begin_layout Chapter
5247 Installing New Document Classes, Layouts, and Templates
5248 \begin_inset CommandInset label
5250 name "cha:Installing-New-Document"
5255 \begin_inset Argument
5258 \begin_layout Plain Layout
5259 Installing New Document Classes
5267 \begin_layout Standard
5268 In this chapter, we describe the procedures for creating and installing
5269 new LyX layout and template files, as well as offer a refresher on correctly
5270 installing new LaTeX document classes.
5274 \begin_layout Standard
5275 First, let us a say a few words about how one ought to think about the relation
5276 between LyX and LaTeX.
5277 The thing to understand is that, in a certain sense, LyX doesn't know anything
5279 Indeed, from LyX's point of view, LaTeX is just one of several
5280 \begin_inset Quotes eld
5284 \begin_inset Quotes erd
5287 in which it is capable of producing output.
5288 Other such formats are DocBook, plaintext, and XHTML.
5289 LaTeX is, of course, a particularly important format, but very little of
5290 the information LyX has about LaTeX is actually contained in the program
5295 \begin_layout Plain Layout
5296 Some commands are sufficiently complex that they are
5297 \begin_inset Quotes eld
5301 \begin_inset Quotes erd
5305 But the developers generally regard this as a Bad Thing.
5310 Rather, that information, even for the standard classes like
5311 \begin_inset Flex CharStyle:Code
5314 \begin_layout Plain Layout
5320 , is contained in `layout files'.
5321 Similarly, LyX itself does not know much about DocBook or XHTML.
5322 What it knows is contained in layout files.
5325 \begin_layout Standard
5326 You can think of the layout file for a given document class as a translation
5327 manual between LyX constructs---paragraphs with their corresponding styles,
5328 certain sorts of insets, etc---and the corresponding LaTeX, DocBook, or
5330 Almost everything LyX knows about
5331 \begin_inset Flex CharStyle:Code
5334 \begin_layout Plain Layout
5340 , for example, is contained in the file
5341 \begin_inset Flex CharStyle:Code
5344 \begin_layout Plain Layout
5350 and in various other files it includes.
5351 For this reason, anyone intending to write layout files should plan to
5352 study the existing files.
5353 A good place to start is with
5354 \begin_inset Flex CharStyle:Code
5357 \begin_layout Plain Layout
5363 , which is included in
5364 \begin_inset Flex CharStyle:Code
5367 \begin_layout Plain Layout
5374 \begin_inset Flex CharStyle:Code
5377 \begin_layout Plain Layout
5383 , and many of the other layout files for document classes.
5384 This file is where sections and the like are defined:
5385 \begin_inset Flex CharStyle:Code
5388 \begin_layout Plain Layout
5394 tells LyX how paragraphs that are marked with the Section, Subsection,
5395 etc, styles can be translated into corresponding LaTeX, DocBook, and XHTML
5398 \begin_inset Flex CharStyle:Code
5401 \begin_layout Plain Layout
5407 file basically just includes several of these
5408 \begin_inset Flex CharStyle:Code
5411 \begin_layout Plain Layout
5420 \begin_layout Standard
5421 Defining the LyX--LaTeX correspondence is not the only thing layout files
5423 Their other job is to define how the LyX constructs themselves will appear
5425 The fact that layout files have these two jobs is often a source of confusion,
5426 because they are completely separate.
5427 Telling LyX how to translate a certain paragraph style into LaTeX does
5428 not tell LyX how to display it; conversely, telling LyX how to display
5429 a certain paragraph style does not tell LyX how to translate it into LaTeX
5430 (let alone tell LaTeX how to display it).
5431 So, in general, when you define a new LyX construct, you must always do
5432 two quite separate things: (i)
5433 \begin_inset space ~
5436 tell LyX how to translate it into LaTeX and (ii)
5437 \begin_inset space ~
5440 tell LyX how to display it.
5443 \begin_layout Standard
5444 Much the same is true, of course, as regards LyX's other backend formats,
5445 though XHTML is in some ways different, because in that case LyX
5449 able, to some extent, to use information about how it should display a
5450 paragraph on the screen to output information (in the form of CSS) about
5451 how the paragraph should be displayed in a browser.
5452 Even in this case, however, the distinction between what LyX does internally
5453 and how things are rendered externally remains in force, and the two can
5454 be controlled separately.
5456 \begin_inset CommandInset ref
5458 reference "sec:Tags-for-XHTML"
5465 \begin_layout Section
5466 Installing new LaTeX files
5469 \begin_layout Standard
5470 Some installations may not include a LaTeX package or class file that you
5471 would like to use within LyX.
5472 For example, you might need FoilTeX, a package for preparing slides for
5473 overhead projectors.
5474 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5475 a user interface for installing such packages.
5476 For example, with MiKTeX, you start the program
5477 \begin_inset Quotes eld
5481 \begin_inset space ~
5485 \begin_inset Quotes erd
5488 to get a list of available packages.
5489 To install one of them, right click on it or use the corresponding toolbar
5493 \begin_layout Standard
5494 If your LaTeX distribution does not provide such a `package manager', or
5495 if the package is not available from your distribution, then follow these
5496 steps to install it manually:
5499 \begin_layout Enumerate
5500 Get the package from
5501 \begin_inset CommandInset href
5504 target "http://www.ctan.org/"
5511 \begin_layout Enumerate
5512 If the package contains a file with the ending
5513 \begin_inset Quotes eld
5517 \begin_inset Flex CharStyle:Code
5520 \begin_layout Plain Layout
5527 \begin_inset Quotes erd
5530 (is the case for FoilTeX) then open a console, change to the folder of
5531 this file and execute the command
5532 \begin_inset Flex CharStyle:Code
5535 \begin_layout Plain Layout
5542 You have now unpacked the package and have all files to install it.
5543 Most LaTeX-packages are not packed and you can skip this step.
5546 \begin_layout Enumerate
5547 Now you need to decide if the package should be available for all users
5552 \begin_layout Enumerate
5553 On *nix systems (Linux, OSX, etc.), if you want the new package to be available
5554 for all users on your system, then install it in your `local' TeX tree,
5555 otherwise install it in your own `user' TeX tree.
5556 Where these trees should be created, if they do not already exist, depends
5558 To find this out, look in the file
5559 \begin_inset Flex CharStyle:Code
5562 \begin_layout Plain Layout
5572 \begin_layout Plain Layout
5573 This is usually in the directory
5574 \begin_inset Flex CharStyle:Code
5577 \begin_layout Plain Layout
5583 , though you can execute the command
5584 \begin_inset Flex CharStyle:Code
5587 \begin_layout Plain Layout
5598 The location of the `local' TeX tree is defined by the
5599 \begin_inset Flex CharStyle:Code
5602 \begin_layout Plain Layout
5608 variable; this is usually somewhere like
5609 \begin_inset Flex CharStyle:Code
5612 \begin_layout Plain Layout
5613 /usr/local/share/texmf
5619 The location of the `user' TeX tree is defined by
5620 \begin_inset Flex CharStyle:Code
5623 \begin_layout Plain Layout
5630 \begin_inset Flex CharStyle:Code
5633 \begin_layout Plain Layout
5640 (If these variables are not predefined, you have to define them.) You'll
5641 probably need root permissions to create or modify the `local' tree, but
5642 not for your `user' tree.
5643 \begin_inset Newline newline
5646 In general, it is recommended to install in the user tree because your user
5647 will not be modified or even overwritten when you upgrade your system.
5648 It will typically also be backed up together with everything else when
5649 you backup your home directory (which, of course, you do on a regular basis).
5652 \begin_layout Enumerate
5653 On Windows, if you want the new package to be available for all users on
5654 your system, change to the folder where LaTeX is installed and then change
5656 \begin_inset Flex CharStyle:Code
5659 \begin_layout Plain Layout
5670 (For MiKTeX, this would be by default the folder
5671 \begin_inset Flex CharStyle:Code
5674 \begin_layout Plain Layout
5692 \begin_layout Plain Layout
5693 Note that this will be the correct path only on English installations.
5694 On a German one, it would be
5695 \begin_inset Flex CharStyle:Code
5698 \begin_layout Plain Layout
5712 , and similarly for other languages.
5717 Create there a new folder
5718 \begin_inset Flex CharStyle:Code
5721 \begin_layout Plain Layout
5727 and copy all files of the package into it.
5729 \begin_inset Newline newline
5732 If the package should only available for you or you don't have admin permissions
5733 , do the same, but in the local LaTeX folder.
5735 \begin_inset space \thinspace{}
5739 \begin_inset space ~
5742 2.8 under Windows XP, this would be the folder:
5743 \begin_inset Newline newline
5749 \begin_inset Flex CharStyle:Code
5752 \begin_layout Plain Layout
5755 Documents and Settings
5767 \begin_inset Newline newline
5773 \begin_inset Phantom HPhantom
5776 \begin_layout Plain Layout
5787 \begin_inset Flex CharStyle:Code
5790 \begin_layout Plain Layout
5803 \begin_inset Newline newline
5806 On Vista, it would be:
5807 \begin_inset Newline newline
5811 \begin_inset Flex CharStyle:Code
5814 \begin_layout Plain Layout
5840 \begin_layout Enumerate
5841 Now one only need to tell LaTeX that there are new files.
5842 This depends on the used LaTeX-Distribution:
5846 \begin_layout Enumerate
5847 For TeXLive execute the command
5848 \begin_inset Flex CharStyle:Code
5851 \begin_layout Plain Layout
5858 If you installed the package for all users, then you will probably need
5859 to have root permissions for that.
5862 \begin_layout Enumerate
5863 For MiKTeX, if you have installed the package for all users, start the program
5865 \begin_inset Quotes eld
5869 \begin_inset space ~
5873 \begin_inset Quotes erd
5876 and press the button marked
5877 \begin_inset Quotes eld
5881 \begin_inset Quotes erd
5885 Otherwise start the program
5886 \begin_inset Quotes eld
5890 \begin_inset Quotes erd
5897 \begin_layout Enumerate
5898 Finally, you need to tell LyX that there are new packages available.
5899 So, in LyX, use the menu
5900 \begin_inset Flex CharStyle:MenuItem
5903 \begin_layout Plain Layout
5906 \SpecialChar \menuseparator
5912 and then restart LyX.
5915 \begin_layout Standard
5916 Now the package is installed.
5917 In our example, the document class
5918 \begin_inset Flex CharStyle:Code
5921 \begin_layout Plain Layout
5923 \begin_inset space ~
5930 \begin_layout Plain Layout
5942 will now be available under
5943 \begin_inset Flex CharStyle:MenuItem
5946 \begin_layout Plain Layout
5947 Document\SpecialChar \menuseparator
5948 Settings\SpecialChar \menuseparator
5958 \begin_layout Standard
5959 If you would like to use a LaTeX document class that is not even listed
5961 \begin_inset Flex CharStyle:MenuItem
5964 \begin_layout Plain Layout
5965 Document\SpecialChar \menuseparator
5966 Settings\SpecialChar \menuseparator
5972 , then you need to create a `layout' file for it.
5973 That is the topic of the next section.
5976 \begin_layout Section
5977 Types of layout files
5980 \begin_layout Standard
5981 This section describes the various sorts of LyX files that contain layout
5983 These files describe various paragraph and character styles, determining
5984 how LyX should display them and how they should be translated into LaTeX,
5985 DocBook, XHTML, or whatever output format is being used.
5989 \begin_layout Standard
5990 We shall try to provide a thorough description of the process of writing
5992 However, there are so many different types of documents supported even
5993 by just LaTeX that we can't hope to cover every different possibility or
5994 problem you might encounter.
5995 The LyX users' list is frequented by people with lots of experience with
5996 layout design who are willing to share what they've learned, so please
5997 feel free to ask questions there.
6000 \begin_layout Standard
6001 As you prepare to write a new layout, it is extremely helpful to look at
6002 the layouts distributed with LyX.
6003 If you write a LyX layout for a LaTeX document class that might also be
6004 used by others, or write a module that might be useful to others, then
6005 you should consider posting your layout to the
6006 \begin_inset CommandInset href
6008 name "layout section on the LyX wiki"
6009 target "http://wiki.lyx.org/Layouts/Layouts"
6013 or even to the LyX developers' list, so that it might be included in LyX
6018 \begin_layout Plain Layout
6019 Note that LyX is licensed under the General Public License, so any material
6020 that is contributed to LyX must be similarly licensed.
6028 \begin_layout Subsection
6030 \begin_inset CommandInset label
6032 name "sub:Layout-modules"
6039 \begin_layout Standard
6040 We have spoken to this point about `layout files'.
6041 But there are different sorts of files that contain layout information.
6042 Layout files, strictly so called, have the
6043 \begin_inset Flex CharStyle:Code
6046 \begin_layout Plain Layout
6052 extension and provide LyX with information about document classes.
6053 As of LyX 1.6, however, layout information can also be contained in layout
6059 \begin_inset Flex CharStyle:Code
6062 \begin_layout Plain Layout
6069 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
6070 some modules—such as the
6071 \begin_inset Flex CharStyle:Code
6074 \begin_layout Plain Layout
6080 module—specifcally provide support for one package.
6081 In a sense, layout modules are similar to included
6085 \begin_layout Plain Layout
6086 These can have any extension, but by convention have the
6087 \begin_inset Flex CharStyle:Code
6090 \begin_layout Plain Layout
6102 \begin_inset Flex CharStyle:Code
6105 \begin_layout Plain Layout
6111 —in that modules are not specific to a given document class but may be used
6112 with many different classes.
6113 The difference is that using an included file with
6114 \begin_inset Flex CharStyle:Code
6117 \begin_layout Plain Layout
6123 requires editing that file.
6124 Modules, by contrast, are selected in the
6125 \begin_inset Flex CharStyle:MenuItem
6128 \begin_layout Plain Layout
6129 Document\SpecialChar \menuseparator
6138 \begin_layout Standard
6139 Building modules is the easiest way to get started with layout editing,
6140 since it can be as simple as adding a single new paragraph style or flex
6142 But modules may, in principle, contain anything a layout file can contain.
6145 \begin_layout Standard
6146 After creating a new module and copying it to the
6147 \begin_inset Flex CharStyle:Code
6150 \begin_layout Plain Layout
6156 folder, you will need to reconfigure and then restart LyX for the module
6157 to appear in the menu.
6158 However, changes you make to the module will be seen immediately, if you
6160 \begin_inset Flex CharStyle:MenuItem
6163 \begin_layout Plain Layout
6164 Document\SpecialChar \menuseparator
6170 , highlight something, and then hit
6171 \begin_inset Quotes eld
6175 \begin_inset Quotes erd
6181 It is strongly recommended that you save your work before doing this
6186 it is strongly recommended that you not attempt to edit modules while simultaneo
6187 usly working on actual documents
6190 Though of course the developers strive to keep LyX stable in such situations,
6191 syntax errors and the like in your module file could cause strange behavior.
6194 \begin_layout Subsection
6196 \begin_inset Flex CharStyle:MenuItem
6199 \begin_layout Plain Layout
6208 \begin_layout Standard
6209 There are two situations you are likely to encounter when wanting to support
6210 a new LaTeX document class, involving LaTeX2e class (
6211 \begin_inset Flex CharStyle:Code
6214 \begin_layout Plain Layout
6221 \begin_inset Flex CharStyle:Code
6224 \begin_layout Plain Layout
6231 Supporting a style file is usually fairly easy.
6232 Supporting a new class file is a bit harder.
6233 We'll discuss the former in this section and the latter in the next.
6234 Similar remarks apply, of course, if you want to support a new DocBook
6238 \begin_layout Standard
6239 The easier case is the one in which your new document class is provided
6240 as a style file that is to be used in conjunction with an already supported
6242 For the sake of the example, we'll assume that the style file is called
6244 \begin_inset Flex CharStyle:MenuItem
6247 \begin_layout Plain Layout
6253 and that it is meant to be used with
6254 \begin_inset Flex CharStyle:MenuItem
6257 \begin_layout Plain Layout
6263 , which is a standard class.
6267 \begin_layout Standard
6268 Start by copying the existing class's layout file into your local directory:
6272 \begin_layout Plain Layout
6273 Of course, which directory is your local directory will vary by platform,
6274 and LyX allows you to specify your local directory on startup, too, using
6276 \begin_inset Flex CharStyle:Code
6279 \begin_layout Plain Layout
6293 \begin_layout LyX-Code
6294 cp report.layout ~/.lyx/layouts/myclass.layout
6297 \begin_layout Standard
6299 \begin_inset Flex CharStyle:Code
6302 \begin_layout Plain Layout
6308 and change the line:
6311 \begin_layout LyX-Code
6314 DeclareLaTeXClass{report}
6317 \begin_layout Standard
6321 \begin_layout LyX-Code
6324 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6327 \begin_layout Standard
6331 \begin_layout LyX-Code
6333 \begin_inset Newline newline
6339 \begin_inset Newline newline
6345 \begin_layout Standard
6346 near the top of the file.
6349 \begin_layout Standard
6350 Start LyX and select
6351 \begin_inset Flex CharStyle:MenuItem
6354 \begin_layout Plain Layout
6355 Tools\SpecialChar \menuseparator
6362 Then restart LyX and try creating a new document.
6364 \begin_inset Flex CharStyle:MenuItem
6367 \begin_layout Plain Layout
6373 " as a document class option in the
6374 \begin_inset Flex CharStyle:MenuItem
6377 \begin_layout Plain Layout
6378 Document\SpecialChar \menuseparator
6385 It is likely that some of the sectioning commands and such in your new
6386 class will work differently from how they worked in the base class—
6387 \begin_inset Flex CharStyle:Code
6390 \begin_layout Plain Layout
6396 in this example—so you can fiddle around with the settings for the different
6397 sections if you wish.
6398 The layout information for sections is contained in
6399 \begin_inset Flex CharStyle:Code
6402 \begin_layout Plain Layout
6408 , but you do not need to copy and change this file.
6409 Instead, you can simply add your changes to your layout file, after the
6411 \begin_inset Flex CharStyle:Code
6414 \begin_layout Plain Layout
6420 , which itself includes
6421 \begin_inset Flex CharStyle:Code
6424 \begin_layout Plain Layout
6431 For example, you might add these lines:
6434 \begin_layout LyX-Code
6438 \begin_layout LyX-Code
6442 \begin_layout LyX-Code
6446 \begin_layout LyX-Code
6450 \begin_layout LyX-Code
6454 \begin_layout Standard
6455 to change the font for chapter headings to sans-serif.
6456 This will override (or, in this case, add to) the existing declaration
6457 for the Chapter style.
6461 \begin_layout Standard
6462 Your new package may also provide commands or environments not present in
6464 In this case, you will want to add these to the layout file.
6466 \begin_inset CommandInset ref
6468 reference "sec:TextClass"
6472 for information on how to do so.
6475 \begin_layout Standard
6477 \begin_inset Flex CharStyle:MenuItem
6480 \begin_layout Plain Layout
6486 can be used with several different document classes, and even if it cannot,
6487 you might find it easiest just to write a module that you can load with
6489 The simplest possible such module would be:
6492 \begin_layout LyX-Code
6495 DeclareLyXModule{My Package}
6498 \begin_layout LyX-Code
6502 \begin_layout LyX-Code
6503 #Support for mypkg.sty.
6506 \begin_layout LyX-Code
6508 \begin_inset Newline newline
6514 \begin_layout LyX-Code
6516 \begin_inset Newline newline
6522 \begin_layout LyX-Code
6524 \begin_inset Newline newline
6530 \begin_inset Newline newline
6536 \begin_layout Standard
6537 A more complex module might modify the behavior of some existing constructs
6538 or define some new ones.
6540 \begin_inset CommandInset ref
6542 reference "sec:TextClass"
6549 \begin_layout Subsection
6551 \begin_inset Flex CharStyle:MenuItem
6554 \begin_layout Plain Layout
6563 \begin_layout Standard
6564 There are two possibilities here.
6565 One is that the class file is itself based upon an existing document class.
6566 For example, many thesis classes are based upon
6567 \begin_inset Flex CharStyle:MenuItem
6570 \begin_layout Plain Layout
6577 To see whether yours is, look for a line like
6580 \begin_layout LyX-Code
6586 \begin_layout Standard
6588 If so, then you may proceed largely as in the previous section, though
6590 \begin_inset Flex CharStyle:Code
6593 \begin_layout Plain Layout
6599 line will be different.
6600 If your new class is
6601 \begin_inset Flex CharStyle:Code
6604 \begin_layout Plain Layout
6610 and it is based upon
6611 \begin_inset Flex CharStyle:Code
6614 \begin_layout Plain Layout
6620 , then the line should read:
6624 \begin_layout Plain Layout
6625 And it will be easiest if you save the file to
6626 \begin_inset Flex CharStyle:Code
6629 \begin_layout Plain Layout
6635 : LyX assumes that the document class has the same name as the layout file.
6644 \begin_layout LyX-Code
6647 DeclareLaTeXClass[thesis,book]{thesis}
6650 \begin_layout Standard
6651 If, on the other hand, the new class is not based upon an existing class,
6652 you will probably have to
6653 \begin_inset Quotes eld
6657 \begin_inset Quotes erd
6661 We strongly suggest copying an existing layout file which uses a similar
6662 LaTeX class and then modifying it, if you can do so.
6663 At least use an existing file as a starting point so you can find out what
6664 items you need to worry about.
6665 Again, the specifics are covered below.
6668 \begin_layout Subsection
6670 \begin_inset CommandInset label
6672 name "sub:Creating-Templates"
6679 \begin_layout Standard
6680 Once you have written a layout file for a new document class, you might
6681 want to consider writing a
6686 A template acts as a kind of tutorial for your layout, showing how it might
6687 be used, though containing dummy content.
6688 You can of course look at the various templates included with LyX for ideas.
6691 \begin_layout Standard
6692 Templates are created just like usual documents: using LyX.
6693 The only difference is that usual documents contain all possible settings,
6694 including the font scheme and the paper size.
6695 Usually a user doesn't want a template to overwrite his preferred settings
6696 for such parameters.
6697 For that reason, the designer of a template should remove the corresponding
6699 \begin_inset Flex CharStyle:Code
6702 \begin_layout Plain Layout
6711 \begin_inset Flex CharStyle:Code
6714 \begin_layout Plain Layout
6722 from the template LyX file.
6723 This can be done with any simple text-editor, for example
6724 \begin_inset Flex CharStyle:Code
6727 \begin_layout Plain Layout
6734 \begin_inset Flex CharStyle:Code
6737 \begin_layout Plain Layout
6747 \begin_layout Standard
6748 Put the edited template files you create in
6749 \begin_inset Flex CharStyle:Code
6752 \begin_layout Plain Layout
6758 , copy the ones you use from the global template directory in
6759 \begin_inset Flex CharStyle:Code
6762 \begin_layout Plain Layout
6768 to the same place, and redefine the template path in the
6769 \begin_inset Flex CharStyle:MenuItem
6772 \begin_layout Plain Layout
6773 Tools\SpecialChar \menuseparator
6774 Preferences\SpecialChar \menuseparator
6783 \begin_layout Standard
6784 Note, by the way, that there is a template which has a particular meaning:
6786 \begin_inset Flex CharStyle:Code
6789 \begin_layout Plain Layout
6796 This template is loaded every time you create a new document with
6797 \begin_inset Flex CharStyle:MenuItem
6800 \begin_layout Plain Layout
6801 File\SpecialChar \menuseparator
6807 in order to provide useful defaults.
6808 To create this template from inside LyX, all you have to do is to open
6809 a document with the correct settings, and use the
6810 \begin_inset Flex CharStyle:MenuItem
6813 \begin_layout Plain Layout
6814 Save as Document Defaults
6822 \begin_layout Subsection
6823 Upgrading old layout files
6826 \begin_layout Standard
6827 The format of layout files changes with each LyX release, so old layout
6828 files need to be converted to the new format.
6829 This process has been automated since LyX 1.4: If LyX reads a layout file
6830 in an older format, it automatically calls the script
6831 \begin_inset Flex CharStyle:Code
6834 \begin_layout Plain Layout
6840 to convert it to a temporary file in current format.
6841 The original file is left untouched.
6842 If you use the layout file often, then, you may want to convert it permanently,
6843 so that LyX does not have to do so itself every time.
6844 To do this, you can call the converter manually:
6847 \begin_layout LyX-Code
6848 mv myclass.layout myclass.old
6851 \begin_layout LyX-Code
6852 python LyXDir/scripts/layout2layout.py myclass.old myclass.layout
6855 \begin_layout Standard
6857 \begin_inset Flex CharStyle:Code
6860 \begin_layout Plain Layout
6866 with the name of your LyX system directory, of course.
6869 \begin_layout Standard
6870 Note that manual conversion does not affect included files, so these will
6871 have to be converted separately.
6874 \begin_layout Section
6875 \begin_inset CommandInset label
6877 name "sec:TextClass"
6881 The layout file format
6884 \begin_layout Standard
6885 When it's finally time to get your hands dirty and create or edit your own
6886 layout file, the following sections describe what you're up against.
6887 Our advice is to go slowly, save and test often, listen to soothing music,
6888 and enjoy one or two of your favorite adult beverages; more if you are
6889 getting particularly stuck.
6890 It's really not that hard, except that the multitude of options can become
6891 overwhelming if you try to do too much in one sitting.
6892 Go have another adult beverage, just for good measure.
6895 \begin_layout Standard
6896 Note that all the tags used in layout files are case-insensitive.
6898 \begin_inset Flex CharStyle:Code
6901 \begin_layout Plain Layout
6908 \begin_inset Flex CharStyle:Code
6911 \begin_layout Plain Layout
6918 \begin_inset Flex CharStyle:Code
6921 \begin_layout Plain Layout
6927 are really the same tag.
6928 The possible values are printed in brackets after the feature's name.
6929 The default value if a feature isn't specified inside a text class-description
6931 \begin_inset Flex CharStyle:Code
6934 \begin_layout Plain Layout
6943 If the argument has a data type like
6944 \begin_inset Quotes eld
6948 \begin_inset Quotes erd
6952 \begin_inset Quotes eld
6956 \begin_inset Quotes erd
6959 , the default is shown like this:
6960 \begin_inset Flex CharStyle:Code
6963 \begin_layout Plain Layout
6974 \begin_layout Subsection
6975 The document class declaration
6978 \begin_layout Standard
6979 Lines in a layout file which begin with
6980 \begin_inset Flex CharStyle:Code
6983 \begin_layout Plain Layout
6990 There is one exception to this rule.
6992 \begin_inset Flex CharStyle:Code
6995 \begin_layout Plain Layout
7001 files should begin with a line like:
7004 \begin_layout LyX-Code
7007 #% Do not delete the line below; configure depends on this
7010 \begin_layout LyX-Code
7015 DeclareLaTeXClass{article}
7018 \begin_layout Standard
7019 The second line is used when you (re)configure LyX.
7020 The layout file is read by the LaTeX script
7021 \begin_inset Flex CharStyle:Code
7024 \begin_layout Plain Layout
7030 , in a special mode where
7031 \begin_inset Flex CharStyle:Code
7034 \begin_layout Plain Layout
7041 The first line is just a LaTeX comment, and the second one contains the
7042 declaration of the text class.
7043 If these lines appear in a file named
7044 \begin_inset Flex CharStyle:Code
7047 \begin_layout Plain Layout
7053 , then they define a text class of name
7054 \begin_inset Flex CharStyle:Code
7057 \begin_layout Plain Layout
7063 (the name of the layout file) which uses the LaTeX document class
7064 \begin_inset Flex CharStyle:Code
7067 \begin_layout Plain Layout
7073 (the default is to use the same name as the layout).
7075 \begin_inset Quotes eld
7079 \begin_inset Quotes erd
7082 that appears above is used as a description of the text class in the
7083 \begin_inset Flex CharStyle:MenuItem
7086 \begin_layout Plain Layout
7087 Document\SpecialChar \menuseparator
7096 \begin_layout Standard
7097 Let's assume that you wrote your own text class that uses the
7098 \begin_inset Flex CharStyle:Code
7101 \begin_layout Plain Layout
7107 document class, but where you changed the appearance of the section headings.
7108 If you put it in a file
7109 \begin_inset Flex CharStyle:Code
7112 \begin_layout Plain Layout
7118 , the header of this file should be:
7121 \begin_layout LyX-Code
7124 #% Do not delete the line below; configure depends on this
7127 \begin_layout LyX-Code
7132 DeclareLaTeXClass[article]{article (with my own headings)}
7135 \begin_layout Standard
7136 This declares a text class
7137 \begin_inset Flex CharStyle:Code
7140 \begin_layout Plain Layout
7146 , associated with the LaTeX document class
7147 \begin_inset Flex CharStyle:Code
7150 \begin_layout Plain Layout
7157 \begin_inset Quotes eld
7160 article (with my own headings)
7161 \begin_inset Quotes erd
7165 If your text class depends on several packages, you can declare it as:
7168 \begin_layout LyX-Code
7171 #% Do not delete the line below; configure depends on this
7174 \begin_layout LyX-Code
7179 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
7182 \begin_layout Standard
7183 This indicates that your text class uses the
7184 \begin_inset Flex CharStyle:Code
7187 \begin_layout Plain Layout
7194 Finally, it is also possible to declare classes for DocBook code.
7195 Typical declarations will look like:
7198 \begin_layout LyX-Code
7201 #% Do not delete the line below; configure depends on this
7204 \begin_layout LyX-Code
7209 DeclareDocBookClass[article]{SGML (DocBook article)}
7212 \begin_layout Standard
7213 Note that these declarations can also be given an optional parameter declaring
7214 the name of the document class (but not a list).
7217 \begin_layout Standard
7218 So, to be as explicit as possible, the form of the layout declaration is:
7221 \begin_layout LyX-Code
7226 DeclareLaTeXClass[class,package.sty]{layout description}
7229 \begin_layout Standard
7230 The class need only be specified if the name of the LaTeX class file and
7231 the name of the layout file are different or if there are packages to load.
7232 If the name of the class file is not specified, then LyX will simply assume
7233 that it is the same as the name of the layout file.
7236 \begin_layout Standard
7237 When the text class has been modified to your taste, all you have to do
7238 is to copy it either to
7239 \begin_inset Flex CharStyle:Code
7242 \begin_layout Plain Layout
7249 \begin_inset Flex CharStyle:Code
7252 \begin_layout Plain Layout
7259 \begin_inset Flex CharStyle:MenuItem
7262 \begin_layout Plain Layout
7263 Tools\SpecialChar \menuseparator
7269 , exit LyX and restart.
7270 Then your new text class should be available along with the others.
7273 \begin_layout Standard
7274 Once the layout file is installed, you can edit it and see your changes
7275 without having to reconfigure or to restart LyX.
7280 \begin_layout Plain Layout
7281 In versions of LyX prior to 1.6, this was not true.
7282 As a result, editing layout files was very time consuming, since you had
7283 constantly to restart LyX to see changes.
7288 You can force a reload of the current layout by using the LyX function
7290 \begin_inset Flex CharStyle:MenuItem
7293 \begin_layout Plain Layout
7300 There is no default binding for this function—though, of course, you can
7301 bind it to a key yourself.
7302 But you will normally use this function simply by entering it in the mini-buffe
7307 \begin_layout Standard
7313 \begin_inset Flex CharStyle:MenuItem
7316 \begin_layout Plain Layout
7322 is very much an `advanced feature'.
7327 recommended that you save your work before using this function.
7332 recommended that you not attempt to edit layout information while simultaneousl
7333 y working on a document that you care about.
7334 Use a test document.
7335 Syntax errors and the like in your layout file could cause peculiar behavior.
7336 In particular, such errors could cause LyX to regard the current layout
7337 as invalid and to attempt to switch to some other layout.
7341 \begin_layout Plain Layout
7342 Really bad syntax errors may even caused LyX to exit.
7343 This is because certain sorts of errors may make LyX unable to read
7353 The LyX team strives to keep LyX stable in such situations, but safe is
7358 \begin_layout Plain Layout
7359 While we're giving advice: make regular backups.
7360 And be nice to your mother.
7368 \begin_layout Subsection
7369 The Module declaration
7372 \begin_layout Standard
7373 A module must begin with a line like the following:
7376 \begin_layout LyX-Code
7379 DeclareLyXModule[endnotes.sty]{Endnotes}
7382 \begin_layout Standard
7383 The mandatory argument, in curly brackets, is the name of the module, as
7385 \begin_inset Flex CharStyle:MenuItem
7388 \begin_layout Plain Layout
7389 Document\SpecialChar \menuseparator
7396 The argument in square brackets is optional: It declares any LaTeX packages
7397 on which the module depends.
7398 Please note that only packages about which LyX knows should be listed in
7399 the square brackets.
7403 \begin_layout Plain Layout
7404 The list of such packages is documented only in the source code.
7409 LyX will not check for arbitrary packages.
7410 It is also possible to use the form
7411 \begin_inset Flex CharStyle:MenuItem
7414 \begin_layout Plain Layout
7420 as an optional argument, which declares that the module can only be used
7421 when there exists a conversion chain between the formats `
7422 \begin_inset Flex CharStyle:Code
7425 \begin_layout Plain Layout
7432 \begin_inset Flex CharStyle:Code
7435 \begin_layout Plain Layout
7444 \begin_layout Standard
7445 The module declaration should then be followed by lines like the following:
7448 \begin_layout LyX-Code
7452 \begin_layout LyX-Code
7453 #Adds an endnote command, in addition to footnotes.
7457 \begin_layout LyX-Code
7458 #You will need to add
7460 theendnotes in TeX code where you
7463 \begin_layout LyX-Code
7464 #want the endnotes to appear.
7468 \begin_layout LyX-Code
7472 \begin_layout LyX-Code
7473 #Requires: somemodule | othermodule
7476 \begin_layout LyX-Code
7477 #Excludes: badmodule
7480 \begin_layout Standard
7481 The description is used in
7482 \begin_inset Flex CharStyle:MenuItem
7485 \begin_layout Plain Layout
7486 Document\SpecialChar \menuseparator
7492 to provide the user with information about what the module does.
7494 \begin_inset Flex CharStyle:Code
7497 \begin_layout Plain Layout
7503 line is used to identify other modules with which this one must be used;
7505 \begin_inset Flex CharStyle:Code
7508 \begin_layout Plain Layout
7514 line is used to identify modules with which this one may not be used.
7515 Both are optional, and, as shown, multiple modules should be separated
7516 with the pipe symbol: |.
7517 Note that the required modules are treated disjunctively:
7521 of the required modules must be used.
7526 excluded module may be used.
7527 Note that modules are identified here by their
7532 \begin_inset Flex CharStyle:Code
7535 \begin_layout Plain Layout
7543 \begin_inset Flex CharStyle:Code
7546 \begin_layout Plain Layout
7553 \begin_inset Flex CharStyle:Code
7556 \begin_layout Plain Layout
7565 \begin_layout Subsection
7569 \begin_layout Standard
7570 The first non-comment line of any layout file, included file, or module
7575 contain the file format number:
7578 \begin_layout Description
7579 \begin_inset Flex CharStyle:Code
7582 \begin_layout Plain Layout
7589 \begin_inset Flex CharStyle:Code
7592 \begin_layout Plain Layout
7598 ] The format of the layout file.
7601 \begin_layout Standard
7602 This tag was introduced with LyX 1.4.0.
7603 Layout files from LyX 1.3.x and earlier don't have an explicit file format
7604 and are considered to be of format 1.
7605 The format for the present version of LyX is format 21.
7606 But each version of LyX is capable of reading earlier versions' layout
7607 files, just as they are capable of reading files produced by earlier versions
7609 There is, however, no provision for converting to earlier formats.
7610 So LyX 1.6.x will not read layout files in format 21 but only files in format
7614 \begin_layout Subsection
7615 \begin_inset CommandInset label
7617 name "sub:General-text-class"
7621 General text class parameters
7624 \begin_layout Standard
7625 These are general parameters that govern the behavior of an entire document
7631 mean that they must appear in
7632 \begin_inset Flex CharStyle:Code
7635 \begin_layout Plain Layout
7641 files rather than in modules.
7642 A module can contain any layout tag.)
7645 \begin_layout Description
7646 \begin_inset Flex CharStyle:Code
7649 \begin_layout Plain Layout
7655 Adds information that will be output in the
7656 \begin_inset Flex CharStyle:Code
7659 \begin_layout Plain Layout
7665 block when this document class is output to XHTML.
7666 Typically, this would be used to output CSS style information, but it can
7667 be used for anything that can appear in
7668 \begin_inset Flex CharStyle:Code
7671 \begin_layout Plain Layout
7679 \begin_inset Quotes eld
7683 \begin_inset Flex CharStyle:Code
7686 \begin_layout Plain Layout
7693 \begin_inset Quotes erd
7699 \begin_layout Description
7700 \begin_inset Flex CharStyle:Code
7703 \begin_layout Plain Layout
7709 Adds information to the document preamble.
7711 \begin_inset Quotes eld
7715 \begin_inset Flex CharStyle:Code
7718 \begin_layout Plain Layout
7725 \begin_inset Quotes erd
7731 \begin_layout Description
7732 \begin_inset Flex CharStyle:Code
7735 \begin_layout Plain Layout
7741 Defines formats for use in the display of bibliographic information.
7743 \begin_inset CommandInset ref
7745 reference "sub:Citation-format-description"
7751 \begin_inset Quotes eld
7755 \begin_inset Flex CharStyle:Code
7758 \begin_layout Plain Layout
7765 \begin_inset Quotes erd
7771 \begin_layout Description
7772 \begin_inset Flex CharStyle:Code
7775 \begin_layout Plain Layout
7781 Describes various global options supported by the document class.
7783 \begin_inset space ~
7787 \begin_inset CommandInset ref
7789 reference "sub:ClassOptions"
7795 \begin_inset Quotes eld
7799 \begin_inset Flex CharStyle:Code
7802 \begin_layout Plain Layout
7809 \begin_inset Quotes erd
7815 \begin_layout Description
7816 \begin_inset Flex CharStyle:Code
7819 \begin_layout Plain Layout
7826 \begin_inset Flex CharStyle:Code
7829 \begin_layout Plain Layout
7838 \begin_inset Flex CharStyle:Code
7841 \begin_layout Plain Layout
7847 ] Whether the class should
7851 to having one or two columns.
7852 Can be changed in the
7853 \begin_inset Flex CharStyle:MenuItem
7856 \begin_layout Plain Layout
7857 Document\SpecialChar \menuseparator
7866 \begin_layout Description
7867 \begin_inset Flex CharStyle:Code
7870 \begin_layout Plain Layout
7877 \begin_inset Flex CharStyle:Code
7880 \begin_layout Plain Layout
7886 ] This sequence defines the properties for a counter.
7887 If the counter does not yet exist, it is created; if it does exist, it
7890 \begin_inset Quotes eld
7894 \begin_inset Flex CharStyle:Code
7897 \begin_layout Plain Layout
7904 \begin_inset Quotes erd
7908 \begin_inset Newline newline
7912 \begin_inset space ~
7916 \begin_inset CommandInset ref
7918 reference "sub:Counters"
7922 for details on counters.
7925 \begin_layout Description
7926 \begin_inset Flex CharStyle:Code
7929 \begin_layout Plain Layout
7935 Sets the default font used to display the document.
7937 \begin_inset space ~
7941 \begin_inset CommandInset ref
7943 reference "sub:Font-description"
7947 for how to declare fonts.
7949 \begin_inset Quotes eld
7953 \begin_inset Flex CharStyle:Code
7956 \begin_layout Plain Layout
7963 \begin_inset Quotes erd
7969 \begin_layout Description
7970 \begin_inset Flex CharStyle:Code
7973 \begin_layout Plain Layout
7980 \begin_inset Flex CharStyle:Code
7983 \begin_layout Plain Layout
7989 Specifies a module to be included by default with this document class.
7990 The module should be specified by filename without the
7991 \begin_inset Flex CharStyle:Code
7994 \begin_layout Plain Layout
8001 The user can still remove the module, but it will be active at the outset.
8002 (This applies only when new files are created, or when this class is chosen
8003 for an existing document.)
8006 \begin_layout Description
8007 \begin_inset Flex CharStyle:Code
8010 \begin_layout Plain Layout
8017 \begin_inset Flex CharStyle:Code
8020 \begin_layout Plain Layout
8026 ] This is the style that will be assigned to new paragraphs, usually
8027 \begin_inset Flex CharStyle:MenuItem
8030 \begin_layout Plain Layout
8037 This will default to the first defined style if not given, but you are
8038 encouraged to use this directive.
8041 \begin_layout Description
8042 \begin_inset Flex CharStyle:Code
8045 \begin_layout Plain Layout
8052 \begin_inset Flex CharStyle:Code
8055 \begin_layout Plain Layout
8061 ] This tag indicates that the module in question—which should be specified
8062 by filename without the
8063 \begin_inset Flex CharStyle:Code
8066 \begin_layout Plain Layout
8072 extension—cannot be used with this document class.
8073 This might be used in a journal-specific layout file to prevent, say, the
8075 \begin_inset Flex CharStyle:Code
8078 \begin_layout Plain Layout
8084 module that numbers theorems by section.
8089 be used in a module.
8090 Modules have their own way of excluding other modules (see
8091 \begin_inset CommandInset ref
8093 reference "sub:Layout-modules"
8100 \begin_layout Description
8101 \begin_inset Flex CharStyle:Code
8104 \begin_layout Plain Layout
8110 Defines a new float.
8112 \begin_inset space ~
8116 \begin_inset CommandInset ref
8118 reference "sub:Floats"
8124 \begin_inset Quotes eld
8128 \begin_inset Flex CharStyle:Code
8131 \begin_layout Plain Layout
8138 \begin_inset Quotes erd
8144 \begin_layout Description
8145 \begin_inset Flex CharStyle:Code
8148 \begin_layout Plain Layout
8154 Sets the information that will be output in the
8155 \begin_inset Flex CharStyle:Code
8158 \begin_layout Plain Layout
8164 block when this document class is output to XHTML.
8165 Note that this will completely override any prior
8166 \begin_inset Flex CharStyle:Code
8169 \begin_layout Plain Layout
8176 \begin_inset Flex CharStyle:Code
8179 \begin_layout Plain Layout
8187 \begin_inset Flex CharStyle:Code
8190 \begin_layout Plain Layout
8196 if you just want to add material to the preamble.) Must end with
8197 \begin_inset Quotes eld
8201 \begin_inset Flex CharStyle:Code
8204 \begin_layout Plain Layout
8211 \begin_inset Quotes erd
8217 \begin_layout Description
8218 \begin_inset Flex CharStyle:Code
8221 \begin_layout Plain Layout
8228 \begin_inset Flex CharStyle:Code
8231 \begin_layout Plain Layout
8237 ] The layout to use for the table of contents, bibliography, and so forth,
8238 when the document is output to HTML.
8239 For articles, this should normally be Section; for books, Chapter.
8240 If it is not given, then LyX will attempt to figure out which layout to
8244 \begin_layout Description
8245 \begin_inset Flex CharStyle:Code
8248 \begin_layout Plain Layout
8255 \begin_inset Flex CharStyle:Code
8258 \begin_layout Plain Layout
8264 ] Modifies the properties of the given counter.
8265 If the counter does not exist, the section is ignored.
8267 \begin_inset Quotes eld
8271 \begin_inset Flex CharStyle:Code
8274 \begin_layout Plain Layout
8281 \begin_inset Quotes erd
8285 \begin_inset Newline newline
8289 \begin_inset space ~
8293 \begin_inset CommandInset ref
8295 reference "sub:Counters"
8299 for details on counters.
8302 \begin_layout Description
8303 \begin_inset Flex CharStyle:Code
8306 \begin_layout Plain Layout
8313 \begin_inset Flex CharStyle:Code
8316 \begin_layout Plain Layout
8322 ] Modifies the properties of the given paragraph style.
8323 If the style does not exist, the section is ignored.
8325 \begin_inset Quotes eld
8329 \begin_inset Flex CharStyle:Code
8332 \begin_layout Plain Layout
8339 \begin_inset Quotes erd
8345 \begin_layout Description
8346 \begin_inset Flex CharStyle:Code
8349 \begin_layout Plain Layout
8355 As its name implies, this command allows you to include another layout
8356 definition file within yours to avoid duplicating commands.
8357 Common examples are the standard layout files, for example,
8358 \begin_inset Flex CharStyle:Code
8361 \begin_layout Plain Layout
8367 , which contains most of the basic layouts.
8370 \begin_layout Description
8371 \begin_inset Flex CharStyle:Code
8374 \begin_layout Plain Layout
8380 This section (re-)defines the layout of an inset.
8381 It can be applied to an existing inset or to a new, user-defined inset,
8382 e.g., a new character style.
8384 \begin_inset Quotes eld
8388 \begin_inset Flex CharStyle:Code
8391 \begin_layout Plain Layout
8398 \begin_inset Quotes erd
8402 \begin_inset Newline newline
8406 \begin_inset space ~
8410 \begin_inset CommandInset ref
8412 reference "sub:Flex-insets-and"
8416 for more information.
8420 \begin_layout Description
8421 \begin_inset Flex CharStyle:Code
8424 \begin_layout Plain Layout
8431 \begin_inset Flex CharStyle:Code
8434 \begin_layout Plain Layout
8440 ] A string that indicates the width of the left margin on the screen, for
8442 \begin_inset Quotes eld
8446 \begin_inset Quotes erd
8450 (Note that this is not a `length', like
8451 \begin_inset Quotes eld
8455 \begin_inset Quotes erd
8461 \begin_layout Description
8462 \begin_inset Flex CharStyle:Code
8465 \begin_layout Plain Layout
8471 This command deletes an existing float.
8472 This is particularly useful when you want to suppress a float that has
8473 been defined in an input file.
8476 \begin_layout Description
8477 \begin_inset Flex CharStyle:Code
8480 \begin_layout Plain Layout
8486 This command deletes an existing style.
8487 This is particularly useful when you want to suppress a style that has
8488 be defined in an input file.
8491 \begin_layout Description
8492 \begin_inset Flex CharStyle:Code
8495 \begin_layout Plain Layout
8501 A string indicating the file format (as defined in the Preferences dialog)
8502 produced by this class.
8503 It is mainly useful when
8504 \begin_inset Flex CharStyle:Code
8507 \begin_layout Plain Layout
8513 is `literate' and one wants to define a new type of literate document.
8514 This string is reset to `docbook', `latex', or `literate' when the correspondin
8516 \begin_inset Flex CharStyle:Code
8519 \begin_layout Plain Layout
8525 parameter is encountered.
8528 \begin_layout Description
8529 \begin_inset Flex CharStyle:Code
8532 \begin_layout Plain Layout
8538 A string indicating what sort of output documents using this class will
8540 At present, the options are: `docbook', `latex', and `literate'.
8543 \begin_layout Description
8544 \begin_inset Flex CharStyle:Code
8547 \begin_layout Plain Layout
8554 \begin_inset Flex CharStyle:Code
8557 \begin_layout Plain Layout
8566 \begin_inset Flex CharStyle:Code
8569 \begin_layout Plain Layout
8576 \begin_inset Flex CharStyle:Code
8579 \begin_layout Plain Layout
8585 ] The default pagestyle.
8586 Can be changed in the
8587 \begin_inset Flex CharStyle:MenuItem
8590 \begin_layout Plain Layout
8591 Document\SpecialChar \menuseparator
8600 \begin_layout Description
8601 \begin_inset Flex CharStyle:Code
8604 \begin_layout Plain Layout
8610 Sets the preamble for the LaTeX document.
8611 Note that this will completely override any prior
8612 \begin_inset Flex CharStyle:Code
8615 \begin_layout Plain Layout
8622 \begin_inset Flex CharStyle:Code
8625 \begin_layout Plain Layout
8633 \begin_inset Flex CharStyle:Code
8636 \begin_layout Plain Layout
8642 if you just want to add material to the preamble.) Must end with
8643 \begin_inset Quotes eld
8647 \begin_inset Flex CharStyle:Code
8650 \begin_layout Plain Layout
8657 \begin_inset Quotes erd
8663 \begin_layout Description
8664 \begin_inset Flex CharStyle:Code
8667 \begin_layout Plain Layout
8674 \begin_inset Flex CharStyle:Code
8677 \begin_layout Plain Layout
8684 \begin_inset Flex CharStyle:Code
8687 \begin_layout Plain Layout
8696 \begin_inset Flex CharStyle:Code
8699 \begin_layout Plain Layout
8705 ] Whether the class already provides the feature
8706 \begin_inset Flex CharStyle:Code
8709 \begin_layout Plain Layout
8716 A feature is in general the name of a package (
8717 \begin_inset Flex CharStyle:Code
8720 \begin_layout Plain Layout
8727 \begin_inset Flex CharStyle:Code
8730 \begin_layout Plain Layout
8736 , \SpecialChar \ldots{}
8738 \begin_inset Flex CharStyle:Code
8741 \begin_layout Plain Layout
8748 \begin_inset Flex CharStyle:Code
8751 \begin_layout Plain Layout
8757 ,\SpecialChar \ldots{}
8758 ); the complete list of supported features is unfortunately not documented
8759 outside the LyX source code—but see
8760 \begin_inset Flex CharStyle:Code
8763 \begin_layout Plain Layout
8769 if you're interested.
8771 \begin_inset Flex CharStyle:MenuItem
8774 \begin_layout Plain Layout
8775 Help\SpecialChar \menuseparator
8781 also gives an overview of the supported packages.
8784 \begin_layout Description
8785 \begin_inset Flex CharStyle:Code
8788 \begin_layout Plain Layout
8795 \begin_inset Flex CharStyle:Code
8798 \begin_layout Plain Layout
8804 ] Indicates that this layout provides the functionality of the module mentioned,
8805 which should be specified by the filename without the
8806 \begin_inset Flex CharStyle:Code
8809 \begin_layout Plain Layout
8816 This will typically be used if the layout includes the module directly,
8817 rather than using the
8818 \begin_inset Flex CharStyle:Code
8821 \begin_layout Plain Layout
8827 tag to indicate that it ought to be used.
8828 It could also be used in a module that provided an alternate implementation
8829 of the same functionality.
8832 \begin_layout Description
8833 \begin_inset Flex CharStyle:Code
8836 \begin_layout Plain Layout
8843 \begin_inset Flex CharStyle:Code
8846 \begin_layout Plain Layout
8852 ] Whether the class requires the feature
8853 \begin_inset Flex CharStyle:Code
8856 \begin_layout Plain Layout
8863 Multiple features must be separated by commas.
8864 Note that you can only request supported features.
8866 \begin_inset Flex CharStyle:Code
8869 \begin_layout Plain Layout
8875 for a list of these.)
8878 \begin_layout Description
8879 \begin_inset Flex CharStyle:Code
8882 \begin_layout Plain Layout
8888 A string that indicates the width of the right margin on the screen, for
8890 \begin_inset Quotes eld
8894 \begin_inset Quotes erd
8900 \begin_layout Description
8901 \begin_inset Flex CharStyle:Code
8904 \begin_layout Plain Layout
8910 Sets which divisions get numbered.
8912 \begin_inset Flex CharStyle:Code
8915 \begin_layout Plain Layout
8924 \begin_layout Description
8925 \begin_inset Flex CharStyle:Code
8928 \begin_layout Plain Layout
8935 \begin_inset Flex CharStyle:Code
8938 \begin_layout Plain Layout
8947 \begin_inset Flex CharStyle:Code
8950 \begin_layout Plain Layout
8956 ] Whether the class-default should be printing on one or both sides of the
8958 Can be changed in the
8959 \begin_inset Flex CharStyle:MenuItem
8962 \begin_layout Plain Layout
8963 Document\SpecialChar \menuseparator
8972 \begin_layout Description
8973 \begin_inset Flex CharStyle:Code
8976 \begin_layout Plain Layout
8982 This sequence defines a paragraph style.
8983 If the style does not yet exist, it is created; if it does exist, its parameter
8986 \begin_inset Quotes eld
8990 \begin_inset Flex CharStyle:Code
8993 \begin_layout Plain Layout
9000 \begin_inset Quotes erd
9004 \begin_inset Newline newline
9008 \begin_inset space ~
9012 \begin_inset CommandInset ref
9014 reference "sub:Paragraph-Styles"
9018 for details on paragraph styles.
9021 \begin_layout Description
9022 \begin_inset Flex CharStyle:Code
9025 \begin_layout Plain Layout
9032 \begin_inset Flex CharStyle:Code
9035 \begin_layout Plain Layout
9041 ] The name of the command or environment to be used with
9042 \begin_inset Flex CharStyle:Code
9045 \begin_layout Plain Layout
9054 \begin_layout Description
9055 \begin_inset Flex CharStyle:Code
9058 \begin_layout Plain Layout
9065 \begin_inset Flex CharStyle:Code
9068 \begin_layout Plain Layout
9077 \begin_inset Flex CharStyle:Code
9080 \begin_layout Plain Layout
9086 ] Indicates what kind of markup is used to define the title of a document.
9088 \begin_inset Flex CharStyle:Code
9091 \begin_layout Plain Layout
9097 means that the macro with name
9098 \begin_inset Flex CharStyle:Code
9101 \begin_layout Plain Layout
9107 will be inserted after the last layout which has
9108 \begin_inset Quotes eld
9112 \begin_inset Flex CharStyle:Code
9115 \begin_layout Plain Layout
9122 \begin_inset Quotes erd
9127 \begin_inset Flex CharStyle:Code
9130 \begin_layout Plain Layout
9136 corresponds to the case where the block of paragraphs which have
9137 \begin_inset Quotes eld
9141 \begin_inset Flex CharStyle:Code
9144 \begin_layout Plain Layout
9151 \begin_inset Quotes erd
9154 should be enclosed into the
9155 \begin_inset Flex CharStyle:Code
9158 \begin_layout Plain Layout
9167 \begin_layout Description
9168 \begin_inset Flex CharStyle:Code
9171 \begin_layout Plain Layout
9177 Sets which divisions are included in the table of contents.
9179 \begin_inset Flex CharStyle:Code
9182 \begin_layout Plain Layout
9191 \begin_layout Subsection
9192 \begin_inset Flex CharStyle:Code
9195 \begin_layout Plain Layout
9202 \begin_inset CommandInset label
9204 name "sub:ClassOptions"
9211 \begin_layout Standard
9213 \begin_inset Flex CharStyle:Code
9216 \begin_layout Plain Layout
9222 section can contain the following entries:
9225 \begin_layout Description
9226 \begin_inset Flex CharStyle:Code
9229 \begin_layout Plain Layout
9236 \begin_inset Flex CharStyle:Code
9239 \begin_layout Plain Layout
9245 ] The list of available font sizes for the document's main font, separated
9247 \begin_inset Quotes eld
9251 \begin_inset Flex CharStyle:Code
9254 \begin_layout Plain Layout
9261 \begin_inset Quotes erd
9267 \begin_layout Description
9268 \begin_inset Flex CharStyle:Code
9271 \begin_layout Plain Layout
9277 Used to set the DTD line with XML-based output classes.
9279 \begin_inset space \thinspace{}
9283 \begin_inset Quotes eld
9286 -//OASIS//DTD DocBook V4.2//EN
9287 \begin_inset Quotes erd
9293 \begin_layout Description
9294 \begin_inset Flex CharStyle:Code
9297 \begin_layout Plain Layout
9304 \begin_inset Flex CharStyle:Code
9307 \begin_layout Plain Layout
9308 string="empty|plain|headings|fancy"
9313 ] The list of available page styles, separated by
9314 \begin_inset Quotes eld
9318 \begin_inset Flex CharStyle:Code
9321 \begin_layout Plain Layout
9328 \begin_inset Quotes erd
9334 \begin_layout Description
9335 \begin_inset Flex CharStyle:Code
9338 \begin_layout Plain Layout
9345 \begin_inset Flex CharStyle:Code
9348 \begin_layout Plain Layout
9354 ] Some document class options, separated by a comma, that will be added
9355 to the optional part of the
9356 \begin_inset Flex CharStyle:Code
9359 \begin_layout Plain Layout
9370 \begin_layout Standard
9372 \begin_inset Flex CharStyle:Code
9375 \begin_layout Plain Layout
9381 section must end with
9382 \begin_inset Quotes eld
9386 \begin_inset Flex CharStyle:Code
9389 \begin_layout Plain Layout
9396 \begin_inset Quotes erd
9402 \begin_layout Subsection
9404 \begin_inset CommandInset label
9406 name "sub:Paragraph-Styles"
9413 \begin_layout Standard
9414 A paragraph style description looks like this:
9418 \begin_layout Plain Layout
9419 Note that this will either define a new layout or modify an existing one.
9427 \begin_layout LyX-Code
9434 \begin_layout LyX-Code
9438 \begin_layout LyX-Code
9442 \begin_layout Standard
9443 where the following commands are allowed:
9446 \begin_layout Description
9447 \begin_inset Flex CharStyle:Code
9450 \begin_layout Plain Layout
9457 \begin_inset Flex CharStyle:Code
9460 \begin_layout Plain Layout
9465 , left, right, center
9470 ] Paragraph alignment.
9473 \begin_layout Description
9474 \begin_inset Flex CharStyle:Code
9477 \begin_layout Plain Layout
9484 \begin_inset Flex CharStyle:Code
9487 \begin_layout Plain Layout
9492 , left, right, center
9497 ] A comma separated list of permitted alignments.
9498 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
9500 For example a right-aligned or centered enumeration isn't possible.)
9503 \begin_layout Description
9504 \begin_inset Flex CharStyle:Code
9507 \begin_layout Plain Layout
9513 Note that this will completely override any prior
9514 \begin_inset Flex CharStyle:Code
9517 \begin_layout Plain Layout
9523 declaration for this style.
9525 \begin_inset Quotes eld
9529 \begin_inset Flex CharStyle:Code
9532 \begin_layout Plain Layout
9539 \begin_inset Quotes erd
9544 \begin_inset CommandInset ref
9546 reference "sub:I18n"
9550 for details on its use.
9553 \begin_layout Description
9554 \begin_inset Flex CharStyle:Code
9557 \begin_layout Plain Layout
9564 \begin_inset Flex CharStyle:Code
9567 \begin_layout Plain Layout
9577 \begin_layout Plain Layout
9578 Note that a `float' here is a real number, such as: 1.5.
9583 The vertical space with which the last of a chain of paragraphs with this
9584 layout is separated from the following paragraph.
9585 If the next paragraph has another layout, the separations are not simply
9586 added, but the maximum is taken.
9589 \begin_layout Description
9590 \begin_inset Flex CharStyle:Code
9593 \begin_layout Plain Layout
9600 \begin_inset Flex CharStyle:Code
9603 \begin_layout Plain Layout
9609 The category for this style.
9610 This is used to group related styles in the Layout combobox on the toolbar.
9611 Any string can be used, but you may want to use existing categories with
9616 \begin_layout Description
9617 \begin_inset Flex CharStyle:Code
9620 \begin_layout Plain Layout
9626 Depth of XML command.
9627 Used only with XML-type formats.
9630 \begin_layout Description
9631 \begin_inset Flex CharStyle:Code
9634 \begin_layout Plain Layout
9641 \begin_inset CommandInset label
9643 name "des:CopyStyle"
9648 \begin_inset Flex CharStyle:Code
9651 \begin_layout Plain Layout
9657 Copies all the features of an existing style into the current one.
9661 \begin_layout Description
9662 \begin_inset Flex CharStyle:Code
9665 \begin_layout Plain Layout
9671 The name of a style whose preamble should be output
9676 This allows to ensure some ordering of the preamble snippets when macros
9677 definitions depend on one another.
9681 \begin_layout Plain Layout
9682 Note that, besides that functionality, there is no way to ensure any ordering
9684 The ordering that you see in a given version of LyX may change without
9685 warning in later versions.
9693 \begin_layout Description
9694 \begin_inset Flex CharStyle:Code
9697 \begin_layout Plain Layout
9704 \begin_inset Flex CharStyle:Code
9707 \begin_layout Plain Layout
9712 , Box, Filled_Box, Static
9717 ] The type of label that stands at the end of the paragraph (or sequence
9719 \begin_inset Flex CharStyle:Code
9722 \begin_layout Plain Layout
9729 \begin_inset Flex CharStyle:Code
9732 \begin_layout Plain Layout
9739 \begin_inset Flex CharStyle:Code
9742 \begin_layout Plain Layout
9749 \begin_inset Flex CharStyle:Code
9752 \begin_layout Plain Layout
9760 \begin_inset Flex CharStyle:Code
9763 \begin_layout Plain Layout
9770 \begin_inset Quotes eld
9774 \begin_inset Quotes erd
9778 \begin_inset Flex CharStyle:Code
9781 \begin_layout Plain Layout
9788 \begin_inset Flex CharStyle:Code
9791 \begin_layout Plain Layout
9792 \begin_inset space ~
9801 \begin_inset space ~
9804 black) square suitable for end of proof markers,
9805 \begin_inset Flex CharStyle:Code
9808 \begin_layout Plain Layout
9814 is an explicit text string.
9817 \begin_layout Description
9818 \begin_inset Flex CharStyle:Code
9821 \begin_layout Plain Layout
9828 \begin_inset Flex CharStyle:Code
9831 \begin_layout Plain Layout
9837 ] The string used for a label with a
9838 \begin_inset Flex CharStyle:Code
9841 \begin_layout Plain Layout
9848 \begin_inset Flex CharStyle:Code
9851 \begin_layout Plain Layout
9861 \begin_layout Description
9862 \begin_inset Flex CharStyle:Code
9865 \begin_layout Plain Layout
9872 \begin_inset Flex CharStyle:Code
9875 \begin_layout Plain Layout
9886 \begin_inset Flex CharStyle:Code
9889 \begin_layout Plain Layout
9898 \begin_layout Description
9899 \begin_inset Flex CharStyle:Code
9902 \begin_layout Plain Layout
9909 \begin_inset Flex CharStyle:Code
9912 \begin_layout Plain Layout
9922 ] With this parameter the
9923 \begin_inset Flex CharStyle:MenuItem
9926 \begin_layout Plain Layout
9933 \begin_inset Quotes eld
9936 Vertical space above
9937 \begin_inset Quotes erd
9941 \begin_inset Flex CharStyle:MenuItem
9944 \begin_layout Plain Layout
9945 Edit\SpecialChar \menuseparator
9947 \begin_inset space ~
9955 dialog can be set when initializing a paragraph with this style.
9959 \begin_layout Plain Layout
9962 Note from Jean-Marc:
9964 I'm not sure that this setting has much use, and it should probably be
9965 removed in later versions.
9973 \begin_layout Description
9974 \begin_inset Flex CharStyle:Code
9977 \begin_layout Plain Layout
9983 The font used for both the text body
9989 \begin_inset space ~
9993 \begin_inset CommandInset ref
9995 reference "sub:Font-description"
10000 Note that defining this font automatically defines the
10001 \begin_inset Flex CharStyle:Code
10004 \begin_layout Plain Layout
10011 So you should define this one first if you also want to define
10012 \begin_inset Flex CharStyle:Code
10015 \begin_layout Plain Layout
10024 \begin_layout Description
10025 \begin_inset Flex CharStyle:Code
10028 \begin_layout Plain Layout
10035 \begin_inset CommandInset label
10037 name "des:FreeSpacing"
10042 \begin_inset Flex CharStyle:Code
10045 \begin_layout Plain Layout
10054 \begin_inset Flex CharStyle:Code
10057 \begin_layout Plain Layout
10063 ] Usually LyX doesn't allow you to insert more than one space between words,
10064 since a space is considered as the separation between two words, not a
10065 character or symbol of its own.
10066 This is a very fine thing but sometimes annoying, for example, when typing
10067 program code or plain LaTeX code.
10069 \begin_inset Flex CharStyle:Code
10072 \begin_layout Plain Layout
10079 Note that LyX will create protected blanks for the additional blanks when
10080 in another mode than LaTeX-mode.
10083 \begin_layout Description
10084 \begin_inset Flex CharStyle:Code
10087 \begin_layout Plain Layout
10093 These tags are used with XHTML output.
10095 \begin_inset CommandInset ref
10097 reference "sub:Paragraph-Style-XHTML"
10104 \begin_layout Description
10105 \begin_inset Flex CharStyle:Code
10108 \begin_layout Plain Layout
10114 [[FIXME]] (Used only with XML-type formats.)
10117 \begin_layout Description
10118 \begin_inset Flex CharStyle:Code
10121 \begin_layout Plain Layout
10128 \begin_inset Flex CharStyle:Code
10131 \begin_layout Plain Layout
10137 If 1, marks the layout as to be included in the document preamble rather
10138 than in the document body.
10139 This is useful for document classes that want such information as the title
10140 and author to appear in the preamble.
10141 Note that this works only for layouts for which the
10142 \begin_inset Flex CharStyle:Code
10145 \begin_layout Plain Layout
10152 \begin_inset Flex CharStyle:Code
10155 \begin_layout Plain Layout
10164 \begin_layout Description
10165 \begin_inset Flex CharStyle:Code
10168 \begin_layout Plain Layout
10175 \begin_inset Flex CharStyle:Code
10178 \begin_layout Plain Layout
10184 If 1, marks the layout as being part of a title block (see also the
10185 \begin_inset Flex CharStyle:Code
10188 \begin_layout Plain Layout
10195 \begin_inset Flex CharStyle:Code
10198 \begin_layout Plain Layout
10207 \begin_layout Description
10208 \begin_inset Flex CharStyle:Code
10211 \begin_layout Plain Layout
10218 \begin_inset Flex CharStyle:Code
10221 \begin_layout Plain Layout
10227 ] This provides extra space between paragraphs that have the same layout.
10228 If you put other layouts into an environment, each is separated with the
10230 \begin_inset Flex CharStyle:Code
10233 \begin_layout Plain Layout
10240 But the whole items of the environment are additionally separated with
10242 \begin_inset Flex CharStyle:Code
10245 \begin_layout Plain Layout
10252 Note that this is a
10257 \begin_layout Description
10258 \begin_inset Flex CharStyle:Code
10261 \begin_layout Plain Layout
10267 [[FIXME]] (Used only with XML-type formats.)
10270 \begin_layout Description
10271 \begin_inset Flex CharStyle:Code
10274 \begin_layout Plain Layout
10281 \begin_inset CommandInset label
10283 name "des:KeepEmpty"
10288 \begin_inset Flex CharStyle:Code
10291 \begin_layout Plain Layout
10300 \begin_inset Flex CharStyle:Code
10303 \begin_layout Plain Layout
10309 ] Usually LyX does not allow you to leave a paragraph empty, since it would
10310 lead to empty LaTeX output.
10311 There are some cases where this could be desirable however: in a letter
10312 template, the required fields can be provided as empty fields, so that
10313 people do not forget them; in some special classes, a layout can be used
10314 as some kind of break, which does not contain actual text.
10317 \begin_layout Description
10318 \begin_inset Flex CharStyle:Code
10321 \begin_layout Plain Layout
10327 [float=0] The vertical space between the label and the text body.
10328 Only used for labels that are above the text body (
10329 \begin_inset Flex CharStyle:Code
10332 \begin_layout Plain Layout
10339 \begin_inset Flex CharStyle:Code
10342 \begin_layout Plain Layout
10343 Centered_Top_Environment
10351 \begin_layout Description
10352 \begin_inset Flex CharStyle:Code
10355 \begin_layout Plain Layout
10362 \begin_inset Flex CharStyle:Code
10365 \begin_layout Plain Layout
10372 \begin_inset Newline newline
10375 The name of the counter for automatic numbering.
10377 \begin_inset Newline newline
10385 \begin_inset Flex CharStyle:Code
10388 \begin_layout Plain Layout
10395 \begin_inset Flex CharStyle:Code
10398 \begin_layout Plain Layout
10405 In that case, the counter will be stepped each time the layout appears.
10407 \begin_inset Newline newline
10415 \begin_inset Flex CharStyle:Code
10418 \begin_layout Plain Layout
10425 \begin_inset Flex CharStyle:Code
10428 \begin_layout Plain Layout
10434 , though this case is a bit complicated.
10435 Suppose you declare
10436 \begin_inset Quotes eld
10440 \begin_inset Flex CharStyle:Code
10443 \begin_layout Plain Layout
10444 LabelCounter myenum
10450 \begin_inset Quotes erd
10454 Then the actual counters used are
10455 \begin_inset Flex CharStyle:Code
10458 \begin_layout Plain Layout
10465 \begin_inset Flex CharStyle:Code
10468 \begin_layout Plain Layout
10475 \begin_inset Flex CharStyle:Code
10478 \begin_layout Plain Layout
10485 \begin_inset Flex CharStyle:Code
10488 \begin_layout Plain Layout
10494 , much as in LaTeX.
10495 These counters must all be declared separately.
10496 \begin_inset Newline newline
10500 \begin_inset CommandInset ref
10502 reference "sub:Counters"
10506 for details on counters.
10509 \begin_layout Description
10510 \begin_inset Flex CharStyle:Code
10513 \begin_layout Plain Layout
10519 The font used for the label.
10521 \begin_inset space ~
10525 \begin_inset CommandInset ref
10527 reference "sub:Font-description"
10534 \begin_layout Description
10535 \begin_inset Flex CharStyle:Code
10538 \begin_layout Plain Layout
10544 Text that indicates how far a label should be indented.
10547 \begin_layout Description
10548 \begin_inset Flex CharStyle:Code
10551 \begin_layout Plain Layout
10558 \begin_inset Flex CharStyle:Code
10561 \begin_layout Plain Layout
10567 ] The horizontal space between the label and the text body.
10568 Only used for labels that are not above the text body.
10571 \begin_layout Description
10572 \begin_inset Flex CharStyle:Code
10575 \begin_layout Plain Layout
10582 \begin_inset Flex CharStyle:Code
10585 \begin_layout Plain Layout
10591 ] The string used for a label with a
10592 \begin_inset Flex CharStyle:Code
10595 \begin_layout Plain Layout
10603 \begin_inset Flex CharStyle:Code
10606 \begin_layout Plain Layout
10612 is set, this string can be contain the special formatting commands described
10614 \begin_inset CommandInset ref
10616 reference "sub:Counters"
10624 \begin_layout Plain Layout
10625 For the sake of backwards compatibility, the string
10626 \begin_inset Flex CharStyle:Code
10629 \begin_layout Plain Layout
10639 will be replaced by the expanded
10640 \begin_inset Flex CharStyle:Code
10643 \begin_layout Plain Layout
10650 \begin_inset Flex CharStyle:Code
10653 \begin_layout Plain Layout
10662 This feature is now obsolete and should be replaced by the mechanisms of
10664 \begin_inset CommandInset ref
10666 reference "sub:Counters"
10678 \begin_layout Description
10679 \begin_inset Flex CharStyle:Code
10682 \begin_layout Plain Layout
10683 LabelStringAppendix
10689 \begin_inset Flex CharStyle:Code
10692 \begin_layout Plain Layout
10698 ] This is used inside the appendix instead of
10699 \begin_inset Flex CharStyle:Code
10702 \begin_layout Plain Layout
10710 \begin_inset Flex CharStyle:Code
10713 \begin_layout Plain Layout
10720 \begin_inset Flex CharStyle:Code
10723 \begin_layout Plain Layout
10724 LabelStringAppendix
10732 \begin_layout Description
10733 \begin_inset Flex CharStyle:Code
10736 \begin_layout Plain Layout
10742 [FIXME] (Used only with XML-type formats.)
10745 \begin_layout Description
10746 \begin_inset Flex CharStyle:Code
10749 \begin_layout Plain Layout
10756 \begin_inset Flex CharStyle:Code
10759 \begin_layout Plain Layout
10764 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
10765 Enumerate, Itemize, Bibliography
10774 \begin_layout Itemize
10775 \begin_inset Flex CharStyle:Code
10778 \begin_layout Plain Layout
10784 means the label is the very first word (up to the first real blank).
10785 Use protected spaces (like
10786 \begin_inset space ~
10789 that one) if you want more than one word as the label.
10793 \begin_layout Itemize
10794 \begin_inset Flex CharStyle:Code
10797 \begin_layout Plain Layout
10803 means the label is simply whatever
10804 \begin_inset Flex CharStyle:Code
10807 \begin_layout Plain Layout
10814 Note that this really is `static'.
10817 \begin_layout Itemize
10818 \begin_inset Flex CharStyle:Code
10821 \begin_layout Plain Layout
10828 \begin_inset Flex CharStyle:Code
10831 \begin_layout Plain Layout
10832 Centered_Top_Environment
10837 are special cases of
10838 \begin_inset Flex CharStyle:Code
10841 \begin_layout Plain Layout
10848 The label will be printed above the paragraph, but only at the top of an
10849 environment or the top of a chain of paragraphs with this layout.
10850 This might be used with the
10851 \begin_inset Flex CharStyle:MenuItem
10854 \begin_layout Plain Layout
10860 layout, for example.
10863 \begin_layout Itemize
10864 \begin_inset Flex CharStyle:Code
10867 \begin_layout Plain Layout
10873 is a special case for the caption-labels
10874 \begin_inset Quotes eld
10878 \begin_inset Quotes erd
10882 \begin_inset Quotes eld
10886 \begin_inset Quotes erd
10891 \begin_inset Flex CharStyle:Code
10894 \begin_layout Plain Layout
10900 means the (hardcoded) label string depends on the kind of float: It is
10901 hardcoded to be `FloatType N', where N is the value of the counter associated
10905 \begin_layout Itemize
10907 \begin_inset Flex CharStyle:Code
10910 \begin_layout Plain Layout
10916 label type defines automatically numbered labels.
10918 \begin_inset Flex CharStyle:Code
10921 \begin_layout Plain Layout
10927 will be expanded to resolve any counter references it contains: For example,
10929 \begin_inset Quotes eld
10933 \begin_inset Flex CharStyle:Code
10936 \begin_layout Plain Layout
10947 \begin_inset Quotes erd
10952 \begin_inset CommandInset ref
10954 reference "sub:Counters"
10958 for more information on counters.
10961 \begin_layout Itemize
10962 \begin_inset Flex CharStyle:Code
10965 \begin_layout Plain Layout
10971 produces the usual sort of enumeration labels.
10972 At present, it is hardcoded to use Arabic numerals, lowercase letters,
10973 small Roman numerals, and uppercase letters for the four possible depths.
10976 \begin_layout Itemize
10977 \begin_inset Flex CharStyle:Code
10980 \begin_layout Plain Layout
10986 produces various bullets at the different levels.
10987 It is also hardcoded.
10990 \begin_layout Itemize
10991 \begin_inset Flex CharStyle:Code
10994 \begin_layout Plain Layout
11000 is used internally by LyX and should be used only with
11001 \begin_inset Flex CharStyle:Code
11004 \begin_layout Plain Layout
11005 LatexType BibEnvironment
11014 \begin_layout Description
11015 \begin_inset Flex CharStyle:Code
11018 \begin_layout Plain Layout
11024 Note that this will completely override any prior
11025 \begin_inset Flex CharStyle:Code
11028 \begin_layout Plain Layout
11034 declaration for this style.
11036 \begin_inset Quotes eld
11040 \begin_inset Flex CharStyle:Code
11043 \begin_layout Plain Layout
11050 \begin_inset Quotes erd
11055 \begin_inset CommandInset ref
11057 reference "sub:I18n"
11061 for details on its use.
11064 \begin_layout Description
11065 \begin_inset Flex CharStyle:Code
11068 \begin_layout Plain Layout
11074 The name of the corresponding LaTeX stuff.
11075 Either the environment or command name.
11078 \begin_layout Description
11079 \begin_inset Flex CharStyle:Code
11082 \begin_layout Plain Layout
11088 An optional parameter for the corresponding
11089 \begin_inset Flex CharStyle:Code
11092 \begin_layout Plain Layout
11099 This parameter cannot be changed from within LyX.
11102 \begin_layout Description
11103 \begin_inset Flex CharStyle:Code
11106 \begin_layout Plain Layout
11113 \begin_inset CommandInset label
11115 name "des:LatexType"
11120 \begin_inset Flex CharStyle:Code
11123 \begin_layout Plain Layout
11128 , Command, Environment, Item_Environment,
11134 \begin_inset Flex CharStyle:Code
11137 \begin_layout Plain Layout
11138 List_Environment, Bib_Environment
11143 ] How the layout should be translated into LaTeX.
11147 \begin_layout Plain Layout
11148 \begin_inset Flex CharStyle:Code
11151 \begin_layout Plain Layout
11157 is perhaps a bit misleading, since these rules apply to SGML classes, too.
11158 Visit the SGML class files for specific examples.
11167 \begin_layout Itemize
11168 \begin_inset Flex CharStyle:Code
11171 \begin_layout Plain Layout
11177 means nothing special.
11181 \begin_layout Itemize
11182 \begin_inset Flex CharStyle:Code
11185 \begin_layout Plain Layout
11192 \begin_inset Flex CharStyle:Code
11195 \begin_layout Plain Layout
11202 {\SpecialChar \ldots{}
11211 \begin_layout Itemize
11212 \begin_inset Flex CharStyle:Code
11215 \begin_layout Plain Layout
11222 \begin_inset Flex CharStyle:Code
11225 \begin_layout Plain Layout
11232 }\SpecialChar \ldots{}
11248 \begin_layout Itemize
11249 \begin_inset Flex CharStyle:Code
11252 \begin_layout Plain Layout
11259 \begin_inset Flex CharStyle:Code
11262 \begin_layout Plain Layout
11269 \begin_inset Flex CharStyle:Code
11272 \begin_layout Plain Layout
11280 is generated for each paragraph of this environment.
11284 \begin_layout Itemize
11285 \begin_inset Flex CharStyle:Code
11288 \begin_layout Plain Layout
11295 \begin_inset Flex CharStyle:Code
11298 \begin_layout Plain Layout
11305 \begin_inset Flex CharStyle:Code
11308 \begin_layout Plain Layout
11314 is passed as an argument to the environment.
11316 \begin_inset Flex CharStyle:Code
11319 \begin_layout Plain Layout
11325 can be defined in the
11326 \begin_inset Flex CharStyle:MenuItem
11329 \begin_layout Plain Layout
11334 ayout\SpecialChar \menuseparator
11348 \begin_layout Standard
11349 Putting the last few things together, the LaTeX output will be either:
11352 \begin_layout LyX-Code
11355 latexname[latexparam]{\SpecialChar \ldots{}
11359 \begin_layout Standard
11363 \begin_layout LyX-Code
11366 begin{latexname}[latexparam] \SpecialChar \ldots{}
11372 \begin_layout Standard
11373 depending upon the LaTeX type.
11377 \begin_layout Description
11378 \begin_inset Flex CharStyle:Code
11381 \begin_layout Plain Layout
11388 \begin_inset Flex CharStyle:Code
11391 \begin_layout Plain Layout
11397 ] If you put layouts into environments, the leftmargins are not simply added,
11398 but added with a factor
11399 \begin_inset Formula $\frac{4}{depth+4}$
11403 Note that this parameter is also used when the margin is defined as
11404 \begin_inset Flex CharStyle:Code
11407 \begin_layout Plain Layout
11414 \begin_inset Flex CharStyle:Code
11417 \begin_layout Plain Layout
11424 Then it is added to the manual or dynamic margin.
11426 \begin_inset Newline newline
11429 The argument is passed as a string.
11431 \begin_inset Quotes eld
11435 \begin_inset Flex CharStyle:Code
11438 \begin_layout Plain Layout
11445 \begin_inset Quotes erd
11448 means that the paragraph is indented with the width of
11449 \begin_inset Quotes eld
11453 \begin_inset Flex CharStyle:Code
11456 \begin_layout Plain Layout
11463 \begin_inset Quotes erd
11466 in the normal font.
11467 You can get a negative width by prefixing the string with
11468 \begin_inset Quotes eld
11472 \begin_inset Flex CharStyle:Code
11475 \begin_layout Plain Layout
11482 \begin_inset Quotes erd
11486 This way was chosen so that the look is the same with each used screen
11491 \begin_layout Description
11492 \begin_inset Flex CharStyle:Code
11495 \begin_layout Plain Layout
11502 \begin_inset Flex CharStyle:Code
11505 \begin_layout Plain Layout
11510 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11516 \begin_inset Newline newline
11519 The kind of margin that the layout has on the left side.
11521 \begin_inset Flex CharStyle:Code
11524 \begin_layout Plain Layout
11530 just means a fixed margin.
11532 \begin_inset Flex CharStyle:Code
11535 \begin_layout Plain Layout
11541 means that the left margin depends on the string entered in the
11542 \begin_inset Flex CharStyle:MenuItem
11545 \begin_layout Plain Layout
11546 Edit\SpecialChar \menuseparator
11548 \begin_inset space ~
11557 This is used to typeset nice lists without tabulators.
11559 \begin_inset Flex CharStyle:Code
11562 \begin_layout Plain Layout
11568 means that the margin depends on the size of the label.
11569 This is used for automatic enumerated headlines.
11570 It is obvious that the headline
11571 \begin_inset Quotes eld
11574 5.4.3.2.1 Very long headline
11575 \begin_inset Quotes erd
11578 must have a wider left margin (as wide as
11579 \begin_inset Quotes eld
11583 \begin_inset Quotes erd
11586 plus the space) than
11587 \begin_inset Quotes eld
11590 3.2 Very long headline
11591 \begin_inset Quotes erd
11595 \begin_inset Quotes eld
11599 \begin_inset Quotes erd
11602 are not able to do this.
11604 \begin_inset Flex CharStyle:Code
11607 \begin_layout Plain Layout
11613 is similar, but only the very first row of the paragraph is dynamic, while
11614 the others are static; this is used, for example, for descriptions.
11616 \begin_inset Flex CharStyle:Code
11619 \begin_layout Plain Layout
11625 means the margin is chosen in a way that the longest row of this paragraph
11626 fits to the right margin.
11627 This is used to typeset an address on the right edge of the page.
11630 \begin_layout Description
11631 \begin_inset Flex CharStyle:Code
11634 \begin_layout Plain Layout
11641 \begin_inset Flex CharStyle:Code
11644 \begin_layout Plain Layout
11653 \begin_inset Flex CharStyle:Code
11656 \begin_layout Plain Layout
11662 ] Whether fragile commands in this layout should be
11663 \begin_inset Flex CharStyle:Code
11666 \begin_layout Plain Layout
11679 whether this command should itself be protected.)
11682 \begin_layout Description
11683 \begin_inset Flex CharStyle:Code
11686 \begin_layout Plain Layout
11693 \begin_inset Flex CharStyle:Code
11696 \begin_layout Plain Layout
11703 \begin_inset Flex CharStyle:Code
11706 \begin_layout Plain Layout
11714 ] Whether newlines are translated into LaTeX newlines (
11715 \begin_inset Flex CharStyle:Code
11718 \begin_layout Plain Layout
11729 The translation can be switched off to allow more comfortable LaTeX editing
11733 \begin_layout Description
11734 \begin_inset Flex CharStyle:Code
11737 \begin_layout Plain Layout
11744 \begin_inset Flex CharStyle:Code
11747 \begin_layout Plain Layout
11754 \begin_inset Flex CharStyle:Code
11757 \begin_layout Plain Layout
11765 ] Whether the following Paragraph is allowed to indent its very first row.
11767 \begin_inset Flex CharStyle:Code
11770 \begin_layout Plain Layout
11776 means that it is not allowed to do so;
11777 \begin_inset Flex CharStyle:Code
11780 \begin_layout Plain Layout
11786 means it could do so if it wants to.
11789 \begin_layout Description
11790 \begin_inset Flex CharStyle:Code
11793 \begin_layout Plain Layout
11799 Name of a layout that has replaced this layout.
11800 This is used to rename a layout, while keeping backward compatibility.
11803 \begin_layout Description
11804 \begin_inset Flex CharStyle:Code
11807 \begin_layout Plain Layout
11814 \begin_inset Flex CharStyle:Code
11817 \begin_layout Plain Layout
11823 ] The number of optional arguments that can be used with this layout.
11824 This is useful for things like section headings, and only makes sense with
11826 Note that, on output, the optional arguments will all precede any required
11827 arguments (see below).
11828 So one can have constructs like:
11832 \begin_layout LyX-Code
11835 mycmd[opt1]{req1}{contents of paragraph}
11838 \begin_layout Standard
11839 but one cannot have things like:
11842 \begin_layout LyX-Code
11845 mycmd[opt1]{req1}[opt2]{contents of paragraph}
11848 \begin_layout Standard
11849 at least, not without ERT (with which you can have anything).
11854 \begin_layout Description
11855 \begin_inset Flex CharStyle:Code
11858 \begin_layout Plain Layout
11865 \begin_inset CommandInset label
11867 name "des:ParbreakIsNewline"
11872 \begin_inset Flex CharStyle:Code
11875 \begin_layout Plain Layout
11884 \begin_inset Flex CharStyle:Code
11887 \begin_layout Plain Layout
11893 ] Indicates that paragraphs will not be separated by an empty line in LaTeX
11894 output, but only by a line break; together with
11895 \begin_inset Flex CharStyle:Code
11898 \begin_layout Plain Layout
11904 , this allows to emulate a plain text editor (like the ERT inset).
11907 \begin_layout Description
11908 \begin_inset Flex CharStyle:Code
11911 \begin_layout Plain Layout
11918 \begin_inset Flex CharStyle:Code
11921 \begin_layout Plain Layout
11927 ] The indent of the very first line of a paragraph.
11929 \begin_inset Flex CharStyle:Code
11932 \begin_layout Plain Layout
11938 will be fixed for a certain layout.
11939 The exception is Standard layout, since the indentation of a Standard layout
11940 paragraph can be prohibited with
11941 \begin_inset Flex CharStyle:Code
11944 \begin_layout Plain Layout
11951 Also, Standard layout paragraphs inside environments use the
11952 \begin_inset Flex CharStyle:Code
11955 \begin_layout Plain Layout
11961 of the environment, not their native one.
11962 For example, Standard paragraphs inside an enumeration are not indented.
11965 \begin_layout Description
11966 \begin_inset Flex CharStyle:Code
11969 \begin_layout Plain Layout
11976 \begin_inset Flex CharStyle:Code
11979 \begin_layout Plain Layout
11985 ] The vertical space between two paragraphs of this layout.
11988 \begin_layout Description
11989 \begin_inset Flex CharStyle:Code
11992 \begin_layout Plain Layout
11999 \begin_inset Flex CharStyle:Code
12002 \begin_layout Plain Layout
12008 ] LyX allows the user to choose either
12009 \begin_inset Quotes eld
12013 \begin_inset Quotes erd
12017 \begin_inset Quotes eld
12021 \begin_inset Quotes erd
12024 to typeset a document.
12026 \begin_inset Quotes eld
12030 \begin_inset Quotes erd
12033 is chosen, this value is completely ignored.
12035 \begin_inset Quotes eld
12039 \begin_inset Quotes erd
12042 is chosen, the parindent of a LaTeXtype
12043 \begin_inset Quotes eld
12047 \begin_inset Quotes erd
12050 layout is ignored and all paragraphs are separated by this parskip argument.
12051 The vertical space is calculated with
12052 \begin_inset Flex CharStyle:Code
12055 \begin_layout Plain Layout
12057 \begin_inset space ~
12066 \begin_inset Flex CharStyle:Code
12069 \begin_layout Plain Layout
12075 is the height of a row with the normal font.
12076 This way, the look stays the same with different screen fonts.
12079 \begin_layout Description
12080 \begin_inset Flex CharStyle:Code
12083 \begin_layout Plain Layout
12090 \begin_inset CommandInset label
12092 name "des:PassThru"
12097 \begin_inset Flex CharStyle:Code
12100 \begin_layout Plain Layout
12109 \begin_inset Flex CharStyle:Code
12112 \begin_layout Plain Layout
12118 ] Whether the contents of this paragraph should be output in raw form, meaning
12119 without special translations that LaTeX would require.
12122 \begin_layout Description
12123 \begin_inset Flex CharStyle:Code
12126 \begin_layout Plain Layout
12133 \begin_inset CommandInset label
12135 name "des:Preamble"
12139 Information to be included in the LaTeX preamble when this style is used.
12140 Used to define macros, load packages, etc., required by this particular
12143 \begin_inset Quotes eld
12147 \begin_inset Flex CharStyle:Code
12150 \begin_layout Plain Layout
12157 \begin_inset Quotes erd
12163 \begin_layout Description
12164 \begin_inset Flex CharStyle:Code
12167 \begin_layout Plain Layout
12174 \begin_inset Flex CharStyle:Code
12177 \begin_layout Plain Layout
12183 ] The prefix to use when creating labels referring to paragraphs of this
12185 This allows the use of formatted references.
12188 \begin_layout Description
12189 \begin_inset Flex CharStyle:Code
12192 \begin_layout Plain Layout
12199 \begin_inset Flex CharStyle:Code
12202 \begin_layout Plain Layout
12208 ] The number of required arguments that the LaTeX command or environment
12209 corresponding to this layout expects.
12210 In the case of a command, these are required arguments
12214 that associated with the content of the paragraph itself.
12215 These do not actually have to be provided: LyX will output empty arguments
12217 Note that optional arguments will be output before required arguments.
12218 See the discussion of the
12219 \begin_inset Flex CharStyle:Code
12222 \begin_layout Plain Layout
12228 tag above for more information.
12231 \begin_layout Description
12232 \begin_inset Flex CharStyle:Code
12235 \begin_layout Plain Layout
12242 \begin_inset Flex CharStyle:Code
12245 \begin_layout Plain Layout
12252 \begin_inset CommandInset label
12254 name "des:Requires"
12258 Whether the layout requires the feature
12259 \begin_inset Flex CharStyle:Code
12262 \begin_layout Plain Layout
12269 See the description of
12270 \begin_inset Flex CharStyle:Code
12273 \begin_layout Plain Layout
12280 \begin_inset CommandInset ref
12281 LatexCommand pageref
12282 reference "des:FreeSpacing"
12286 ) for information on `features'.
12290 \begin_layout Description
12291 \begin_inset Flex CharStyle:Code
12294 \begin_layout Plain Layout
12301 \begin_inset Flex CharStyle:Code
12304 \begin_layout Plain Layout
12311 \begin_inset Flex CharStyle:Code
12314 \begin_layout Plain Layout
12323 \begin_layout Description
12324 \begin_inset Flex CharStyle:Code
12327 \begin_layout Plain Layout
12334 \begin_inset Flex CharStyle:Code
12337 \begin_layout Plain Layout
12342 , onehalf, double, other
12351 ] This defines what the default spacing should be in the layout.
12353 \begin_inset Flex CharStyle:Code
12356 \begin_layout Plain Layout
12363 \begin_inset Flex CharStyle:Code
12366 \begin_layout Plain Layout
12373 \begin_inset Flex CharStyle:Code
12376 \begin_layout Plain Layout
12382 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
12383 If you specify the argument
12384 \begin_inset Flex CharStyle:Code
12387 \begin_layout Plain Layout
12393 , then you should also provide a numerical argument which will be the actual
12395 Note that, contrary to other parameters,
12396 \begin_inset Flex CharStyle:Code
12399 \begin_layout Plain Layout
12405 implies the generation of specific LaTeX code, using the package
12408 \begin_inset Flex CharStyle:Code
12411 \begin_layout Plain Layout
12420 \begin_layout Description
12421 \begin_inset Flex CharStyle:Code
12424 \begin_layout Plain Layout
12431 \begin_inset Flex CharStyle:Code
12434 \begin_layout Plain Layout
12441 \begin_inset Flex CharStyle:Code
12444 \begin_layout Plain Layout
12452 ] Spellcheck paragraphs of this style.
12456 \begin_layout Description
12457 \begin_inset Flex CharStyle:Code
12460 \begin_layout Plain Layout
12466 The font used for the text body .
12468 \begin_inset CommandInset ref
12470 reference "sub:Font-description"
12477 \begin_layout Description
12478 \begin_inset Flex CharStyle:Code
12481 \begin_layout Plain Layout
12490 \begin_inset Flex CharStyle:Code
12493 \begin_layout Plain Layout
12503 The level of the style in the table of contents.
12504 This is used for automatic numbering of section headings.
12507 \begin_layout Description
12508 \begin_inset Flex CharStyle:Code
12511 \begin_layout Plain Layout
12518 \begin_inset Flex CharStyle:Code
12521 \begin_layout Plain Layout
12527 ] The vertical space with which the very first of a chain of paragraphs
12528 with this layout is separated from the previous paragraph.
12529 If the previous paragraph has another layout, the separations are not simply
12530 added, but the maximum is taken.
12533 \begin_layout Subsection
12534 \begin_inset CommandInset label
12540 Internationalization of Paragraph Styles
12543 \begin_layout Standard
12544 LyX has long supported internationalization of layout information, but,
12545 until version 2.0, this applied only to the user interface and not to, say,
12547 Thus, French authors were forced to resort to ugly hacks if they wanted
12552 1' instead of `Theorem 1'.
12553 Thanks to Georg Baum, that is no longer the case.
12556 \begin_layout Standard
12558 \begin_inset Flex CharStyle:Code
12561 \begin_layout Plain Layout
12567 defines text that is to appear in the typeset document, it may use
12568 \begin_inset Flex CharStyle:Code
12571 \begin_layout Plain Layout
12578 \begin_inset Flex CharStyle:Code
12581 \begin_layout Plain Layout
12587 to support non-English and even multi-language documents correctly.
12588 The following excerpt (from the
12589 \begin_inset Flex CharStyle:Code
12592 \begin_layout Plain Layout
12598 file) shows how this works:
12601 \begin_layout LyX-Code
12606 \begin_layout LyX-Code
12609 theoremstyle{remark}
12612 \begin_layout LyX-Code
12615 newtheorem{claim}[thm]{
12622 \begin_layout LyX-Code
12626 \begin_layout LyX-Code
12630 \begin_layout LyX-Code
12635 claimname}{_(Claim)}
12638 \begin_layout LyX-Code
12642 \begin_layout LyX-Code
12646 \begin_layout LyX-Code
12655 claimname}{_(Claim)}}
12658 \begin_layout LyX-Code
12663 \begin_layout Standard
12664 In principle, any legal LaTeX may appear in the
12665 \begin_inset Flex CharStyle:Code
12668 \begin_layout Plain Layout
12675 \begin_inset Flex CharStyle:Code
12678 \begin_layout Plain Layout
12684 tags, but in practice they will typically look as they do here.
12685 The key to correct translation of the typeset text is the definition of
12687 \begin_inset Flex CharStyle:Code
12690 \begin_layout Plain Layout
12699 \begin_inset Flex CharStyle:Code
12702 \begin_layout Plain Layout
12714 \begin_layout Standard
12716 \begin_inset Flex CharStyle:Code
12719 \begin_layout Plain Layout
12725 tag provides for internationalization based upon the overall language of
12727 The contents of the tag will be included in the preamble, just as with
12729 \begin_inset Flex CharStyle:Code
12732 \begin_layout Plain Layout
12739 What makes it special is the use of the
12740 \begin_inset Quotes eld
12744 \begin_inset Quotes erd
12748 \begin_inset Flex CharStyle:Code
12751 \begin_layout Plain Layout
12757 , which will be replaced, when LyX produces LaTeX output, with the translation
12758 of its argument into the document language.
12761 \begin_layout Standard
12763 \begin_inset Flex CharStyle:Code
12766 \begin_layout Plain Layout
12772 tag is more complex, since it is meant to provide support for multi-language
12773 documents and so offers an interface to the
12774 \begin_inset Flex CharStyle:Code
12777 \begin_layout Plain Layout
12784 Its contents will be added to the preamble once for each language that
12785 appears in the document.
12786 In this case, the argument to
12787 \begin_inset Flex CharStyle:Code
12790 \begin_layout Plain Layout
12796 will be replaced with its translation into the language in question; the
12798 \begin_inset Flex CharStyle:Code
12801 \begin_layout Plain Layout
12807 is replaced by the language name (as used by the babel package).
12810 \begin_layout Standard
12811 A German document that also included a French section would thus have the
12812 following in the preamble:
12815 \begin_layout LyX-Code
12824 claimname}{Affirmation}}
12832 claimname}{Behauptung}}
12836 claimname}{Behauptung}
12839 \begin_layout Standard
12841 \begin_inset Flex CharStyle:Code
12844 \begin_layout Plain Layout
12850 will then conspire to produce the correct text in the output.
12853 \begin_layout Standard
12854 One important point to note here is that the translations are provided by
12855 LyX itself, through the same mechanism it uses for internationalization
12856 of the user interface.
12857 This means, in effect, that
12858 \begin_inset Flex CharStyle:Code
12861 \begin_layout Plain Layout
12868 \begin_inset Flex CharStyle:Code
12871 \begin_layout Plain Layout
12877 are really only of use in layout files that are provided with LyX, since
12878 text entered in user-created layout files will not be seen by LyX's internation
12879 alization routines.
12880 That said, however, any layout created with the intention that it will
12881 be included with LyX should use these tags where appropriate.
12884 \begin_layout Subsection
12886 \begin_inset CommandInset label
12895 \begin_layout Standard
12896 Since version 1.3.0 of LyX, it is has been both possible and necessary to
12897 define the floats (
12898 \begin_inset Flex CharStyle:MenuItem
12901 \begin_layout Plain Layout
12908 \begin_inset Flex CharStyle:MenuItem
12911 \begin_layout Plain Layout
12917 , \SpecialChar \ldots{}
12918 ) in the text class itself.
12919 Standard floats are included in the file
12920 \begin_inset Flex CharStyle:Code
12923 \begin_layout Plain Layout
12929 , so you may have to do no more than add
12932 \begin_layout LyX-Code
12933 Input stdfloats.inc
12936 \begin_layout Standard
12937 to your layout file.
12938 If you want to implement a text class that proposes some other float types
12939 (like the AGU class bundled with LyX), the information below will hopefully
12943 \begin_layout Description
12944 \begin_inset Flex CharStyle:Code
12947 \begin_layout Plain Layout
12954 \begin_inset Flex CharStyle:Code
12957 \begin_layout Plain Layout
12964 \begin_inset Quotes erd
12968 \begin_inset Quotes erd
12971 ] The file name extension of an auxiliary file for the list of figures (or
12973 LaTeX writes the captions to this file.
12976 \begin_layout Description
12977 \begin_inset Flex CharStyle:Code
12980 \begin_layout Plain Layout
12987 \begin_inset Flex CharStyle:Code
12990 \begin_layout Plain Layout
12997 \begin_inset Quotes erd
13001 \begin_inset Quotes erd
13004 ] The string that will be used in the menus and also for the caption.
13005 This is translated to the current language if babel is used.
13008 \begin_layout Description
13009 \begin_inset Flex CharStyle:Code
13012 \begin_layout Plain Layout
13018 These are used for XHTML output.
13020 \begin_inset CommandInset ref
13022 reference "sec:Tags-for-XHTML"
13029 \begin_layout Description
13030 \begin_inset Flex CharStyle:Code
13033 \begin_layout Plain Layout
13040 \begin_inset Flex CharStyle:Code
13043 \begin_layout Plain Layout
13050 \begin_inset Quotes erd
13054 \begin_inset Quotes erd
13057 ] The command used to generate a list of floats of this type; the leading
13060 ' should be omitted.
13066 \begin_inset Flex CharStyle:Code
13069 \begin_layout Plain Layout
13075 is false, since there is no standard way to generate this command.
13077 \begin_inset Flex CharStyle:Code
13080 \begin_layout Plain Layout
13086 is true, since in that case there is a standard way.
13089 \begin_layout Description
13090 \begin_inset Flex CharStyle:Code
13093 \begin_layout Plain Layout
13100 \begin_inset Flex CharStyle:Code
13103 \begin_layout Plain Layout
13110 \begin_inset Quotes erd
13114 \begin_inset Quotes erd
13117 ] A title for a list of floats of this kind (list of figures, tables, or
13119 It is used for the screen label within LyX; it is passed to LaTeX for use
13120 as the title there; and it is used as the title in XHTML output.
13121 It will be translated to the document language.
13124 \begin_layout Description
13125 \begin_inset Flex CharStyle:Code
13128 \begin_layout Plain Layout
13135 \begin_inset Flex CharStyle:Code
13138 \begin_layout Plain Layout
13145 \begin_inset Flex CharStyle:Code
13148 \begin_layout Plain Layout
13156 ] Indicates whether the float is already defined in the document class or
13157 if we instead need to load
13158 \begin_inset Flex CharStyle:Code
13161 \begin_layout Plain Layout
13167 and use what it provides.
13169 \begin_inset Flex CharStyle:Code
13172 \begin_layout Plain Layout
13179 \begin_inset Flex CharStyle:Code
13182 \begin_layout Plain Layout
13189 It should be set to
13190 \begin_inset Flex CharStyle:Code
13193 \begin_layout Plain Layout
13199 if the float is already defined by the LaTeX document class.
13202 \begin_layout Description
13203 \begin_inset Flex CharStyle:Code
13206 \begin_layout Plain Layout
13213 \begin_inset Flex CharStyle:Code
13216 \begin_layout Plain Layout
13223 \begin_inset Quotes erd
13227 \begin_inset Quotes erd
13230 ] This (optional) argument determines whether floats of this class will
13231 be numbered within some sectional unit of the document.
13232 For example, if within is equal to
13233 \begin_inset Flex CharStyle:Code
13236 \begin_layout Plain Layout
13242 , the floats will be numbered within chapters.
13246 \begin_layout Description
13247 \begin_inset Flex CharStyle:Code
13250 \begin_layout Plain Layout
13257 \begin_inset Flex CharStyle:Code
13260 \begin_layout Plain Layout
13267 \begin_inset Quotes erd
13271 \begin_inset Quotes erd
13274 ] The default placement for the given class of floats.
13275 The string should be as in standard LaTeX:
13276 \begin_inset Flex CharStyle:Code
13279 \begin_layout Plain Layout
13286 \begin_inset Flex CharStyle:Code
13289 \begin_layout Plain Layout
13296 \begin_inset Flex CharStyle:Code
13299 \begin_layout Plain Layout
13306 \begin_inset Flex CharStyle:Code
13309 \begin_layout Plain Layout
13315 for top, bottom, page, and here, respectively.
13319 \begin_layout Plain Layout
13320 Note that the order of these letters in the string is irrelevant, like in
13326 On top of that there is a new type,
13327 \begin_inset Flex CharStyle:Code
13330 \begin_layout Plain Layout
13336 , which does not really correspond to a float, since it means: put it
13337 \begin_inset Quotes eld
13341 \begin_inset Quotes erd
13345 Note however that the
13346 \begin_inset Flex CharStyle:Code
13349 \begin_layout Plain Layout
13355 specifier is special and, because of implementation details, cannot be
13356 used in non-built in float types.
13357 If you do not understand what this means, just use
13358 \begin_inset Quotes eld
13362 \begin_inset Flex CharStyle:Code
13365 \begin_layout Plain Layout
13372 \begin_inset Quotes erd
13378 \begin_layout Description
13379 \begin_inset Flex CharStyle:Code
13382 \begin_layout Plain Layout
13389 \begin_inset Flex CharStyle:Code
13392 \begin_layout Plain Layout
13398 ] The prefix to use when creating labels referring to floats of this type.
13399 This allows the use of formatted references.
13400 Note that you can remove any
13401 \begin_inset Flex CharStyle:Code
13404 \begin_layout Plain Layout
13410 set by a copied style by using the special value
13411 \begin_inset Quotes eld
13415 \begin_inset Quotes erd
13418 , which must be all caps.
13421 \begin_layout Description
13422 \begin_inset Flex CharStyle:Code
13425 \begin_layout Plain Layout
13432 \begin_inset Flex CharStyle:Code
13435 \begin_layout Plain Layout
13442 \begin_inset Quotes erd
13446 \begin_inset Quotes erd
13449 ] The style used when defining the float using
13450 \begin_inset Flex CharStyle:Code
13453 \begin_layout Plain Layout
13464 \begin_layout Description
13465 \begin_inset Flex CharStyle:Code
13468 \begin_layout Plain Layout
13475 \begin_inset Flex CharStyle:Code
13478 \begin_layout Plain Layout
13485 \begin_inset Quotes erd
13489 \begin_inset Quotes erd
13493 \begin_inset Quotes eld
13497 \begin_inset Quotes erd
13500 of the new class of floats, like program or algorithm.
13501 After the appropriate
13502 \begin_inset Flex CharStyle:Code
13505 \begin_layout Plain Layout
13514 \begin_inset Flex CharStyle:Code
13517 \begin_layout Plain Layout
13526 \begin_inset Flex CharStyle:Code
13529 \begin_layout Plain Layout
13540 \begin_layout Standard
13541 Note that defining a float with type
13542 \begin_inset Flex CharStyle:Code
13545 \begin_layout Plain Layout
13553 automatically defines the corresponding counter with name
13554 \begin_inset Flex CharStyle:Code
13557 \begin_layout Plain Layout
13568 \begin_layout Subsection
13569 Flex insets and InsetLayout
13570 \begin_inset CommandInset label
13572 name "sub:Flex-insets-and"
13579 \begin_layout Standard
13580 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
13581 these are called Flex insets.
13585 \begin_layout Standard
13586 Flex insets come in three different kinds:
13589 \begin_layout Itemize
13591 \begin_inset Flex CharStyle:Code
13594 \begin_layout Plain Layout
13600 ): These define semantic markup corresponding to such LaTeX commands as
13602 \begin_inset Flex CharStyle:Code
13605 \begin_layout Plain Layout
13614 \begin_inset Flex CharStyle:Code
13617 \begin_layout Plain Layout
13628 \begin_layout Itemize
13630 \begin_inset Flex CharStyle:Code
13633 \begin_layout Plain Layout
13639 ): These can be used to define custom collapsible insets, similar to TeX
13640 code, footnote, and the like.
13641 An obvious example is an endnote inset, which is defined in the
13642 \begin_inset Flex CharStyle:Code
13645 \begin_layout Plain Layout
13654 \begin_layout Itemize
13656 \begin_inset Flex CharStyle:Code
13659 \begin_layout Plain Layout
13665 ): For use with DocBook classes.
13668 \begin_layout Standard
13669 Flex insets are defined using the
13670 \begin_inset Flex CharStyle:Code
13673 \begin_layout Plain Layout
13679 tag, which shall be explained in a moment.
13682 \begin_layout Standard
13684 \begin_inset Flex CharStyle:Code
13687 \begin_layout Plain Layout
13693 tag also serves another function: It can be used to customize the general
13694 layout of many different types of insets.
13696 \begin_inset Flex CharStyle:Code
13699 \begin_layout Plain Layout
13705 can be used to customize the layout parameters for footnotes, marginal
13706 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
13707 boxes, tables, algorithms, URLs, and optional arguments, as well as to
13708 define Flex insets.
13711 \begin_layout Standard
13713 \begin_inset Flex CharStyle:Code
13716 \begin_layout Plain Layout
13722 definition must begin with a line of the form:
13725 \begin_layout LyX-Code
13729 \begin_layout Standard
13731 \begin_inset Flex CharStyle:Code
13734 \begin_layout Plain Layout
13740 indicates the inset whose layout is being defined, and here there are two
13744 \begin_layout Enumerate
13745 The layout for a pre-existing inset is being modified.
13746 In this case, can be
13747 \begin_inset Flex CharStyle:Code
13750 \begin_layout Plain Layout
13756 any one of the following:
13757 \begin_inset Flex CharStyle:Code
13760 \begin_layout Plain Layout
13767 \begin_inset Flex CharStyle:Code
13770 \begin_layout Plain Layout
13777 \begin_inset Flex CharStyle:Code
13780 \begin_layout Plain Layout
13787 \begin_inset Flex CharStyle:Code
13790 \begin_layout Plain Layout
13797 \begin_inset Flex CharStyle:Code
13800 \begin_layout Plain Layout
13807 \begin_inset Flex CharStyle:Code
13810 \begin_layout Plain Layout
13817 \begin_inset Flex CharStyle:Code
13820 \begin_layout Plain Layout
13827 \begin_inset Flex CharStyle:Code
13830 \begin_layout Plain Layout
13837 \begin_inset Flex CharStyle:Code
13840 \begin_layout Plain Layout
13847 \begin_inset Flex CharStyle:Code
13850 \begin_layout Plain Layout
13857 \begin_inset Flex CharStyle:Code
13860 \begin_layout Plain Layout
13867 \begin_inset Flex CharStyle:Code
13870 \begin_layout Plain Layout
13877 \begin_inset Flex CharStyle:Code
13880 \begin_layout Plain Layout
13887 \begin_inset Flex CharStyle:Code
13890 \begin_layout Plain Layout
13897 \begin_inset Flex CharStyle:Code
13900 \begin_layout Plain Layout
13907 \begin_inset Flex CharStyle:Code
13910 \begin_layout Plain Layout
13917 \begin_inset Flex CharStyle:Code
13920 \begin_layout Plain Layout
13927 \begin_inset Flex CharStyle:Code
13930 \begin_layout Plain Layout
13937 \begin_inset Flex CharStyle:Code
13940 \begin_layout Plain Layout
13947 \begin_inset Flex CharStyle:Code
13950 \begin_layout Plain Layout
13959 \begin_layout Enumerate
13960 The layout for a Flex inset is being defined.
13962 \begin_inset Flex CharStyle:Code
13965 \begin_layout Plain Layout
13971 can be any valid identifier not used by a pre-existing inset.
13972 Note that the definition of a flex inset
13977 \begin_inset Flex CharStyle:Code
13980 \begin_layout Plain Layout
13986 entry, declaring which type of inset this is.
13989 \begin_layout Standard
13991 \begin_inset Flex CharStyle:Code
13994 \begin_layout Plain Layout
14000 definition can contain the following entries:
14003 \begin_layout Description
14004 \begin_inset Flex CharStyle:Code
14007 \begin_layout Plain Layout
14013 The color for the inset's background.
14014 The valid colors are defined in
14015 \begin_inset Flex CharStyle:Code
14018 \begin_layout Plain Layout
14027 \begin_layout Description
14028 \begin_inset Flex CharStyle:Code
14031 \begin_layout Plain Layout
14038 \begin_inset Flex CharStyle:Code
14041 \begin_layout Plain Layout
14050 \begin_inset Flex CharStyle:Code
14053 \begin_layout Plain Layout
14059 ] Whether to use the content of the inset as the label, when the inset is
14064 \begin_layout Description
14065 \begin_inset Flex CharStyle:Code
14068 \begin_layout Plain Layout
14074 As with paragraph styles (see page
14075 \begin_inset CommandInset ref
14077 reference "des:CopyStyle"
14084 \begin_layout Description
14085 \begin_inset Flex CharStyle:Code
14088 \begin_layout Plain Layout
14095 \begin_inset Flex CharStyle:Code
14098 \begin_layout Plain Layout
14107 \begin_inset Flex CharStyle:Code
14110 \begin_layout Plain Layout
14116 ] Indicates whether the user may employ the Paragraph Settings dialog to
14117 customize the paragraph.
14120 \begin_layout Description
14121 \begin_inset Flex CharStyle:Code
14124 \begin_layout Plain Layout
14131 \begin_inset Flex CharStyle:Code
14134 \begin_layout Plain Layout
14141 \begin_inset Flex CharStyle:Code
14144 \begin_layout Plain Layout
14151 \begin_inset Flex CharStyle:Code
14154 \begin_layout Plain Layout
14160 , describing the rendering style used for the inset's frame and buttons.
14161 Footnotes generally use
14162 \begin_inset Flex CharStyle:Code
14165 \begin_layout Plain Layout
14171 , ERT insets generally
14172 \begin_inset Flex CharStyle:Code
14175 \begin_layout Plain Layout
14181 , and character styles
14182 \begin_inset Flex CharStyle:Code
14185 \begin_layout Plain Layout
14194 \begin_layout Description
14195 \begin_inset Flex CharStyle:Code
14198 \begin_layout Plain Layout
14204 Required at the end of the InsetLayout declarations.
14207 \begin_layout Description
14208 \begin_inset Flex CharStyle:Code
14211 \begin_layout Plain Layout
14217 The font used for both the text body
14223 \begin_inset space ~
14227 \begin_inset CommandInset ref
14229 reference "sub:Font-description"
14234 Note that defining this font automatically defines the
14235 \begin_inset Flex CharStyle:Code
14238 \begin_layout Plain Layout
14244 to the same value, so define this first and define
14245 \begin_inset Flex CharStyle:Code
14248 \begin_layout Plain Layout
14254 later if you want them to be different.
14257 \begin_layout Description
14258 \begin_inset Flex CharStyle:Code
14261 \begin_layout Plain Layout
14268 \begin_inset Quotes eld
14272 \begin_inset Quotes erd
14275 language, leading to Left-to-Right (latin) output, e.
14276 \begin_inset space \thinspace{}
14280 \begin_inset space \space{}
14283 in TeX code or URL.
14287 \begin_layout Description
14288 \begin_inset Flex CharStyle:Code
14291 \begin_layout Plain Layout
14298 \begin_inset Flex CharStyle:Code
14301 \begin_layout Plain Layout
14310 \begin_inset Flex CharStyle:Code
14313 \begin_layout Plain Layout
14319 ] Indicates whether the PlainLayout should be used or, instead, the user
14320 can change the paragraph style used in the inset.
14324 \begin_layout Description
14325 \begin_inset Flex CharStyle:Code
14328 \begin_layout Plain Layout
14334 As with paragraph styles (see page
14335 \begin_inset CommandInset ref
14336 LatexCommand pageref
14337 reference "des:FreeSpacing"
14345 \begin_layout Description
14346 \begin_inset Flex CharStyle:Code
14349 \begin_layout Plain Layout
14355 These tags control XHTML output.
14359 \begin_layout Description
14360 \begin_inset Flex CharStyle:Code
14363 \begin_layout Plain Layout
14370 \begin_inset Flex CharStyle:Code
14373 \begin_layout Plain Layout
14382 \begin_inset Flex CharStyle:Code
14385 \begin_layout Plain Layout
14391 ] Whether to include the contents of this inset in the strings generated
14392 for the `Outline' pane.
14393 One would not, for example, want the content of a footnote in a section
14394 header to be included in the TOC displayed in the outline, but one would
14395 normally want the content of a character style displayed.
14396 Default is false: not to include.
14399 \begin_layout Description
14400 \begin_inset Flex CharStyle:Code
14403 \begin_layout Plain Layout
14409 As with paragraph styles (see page
14410 \begin_inset CommandInset ref
14411 LatexCommand pageref
14412 reference "des:KeepEmpty"
14420 \begin_layout Description
14421 \begin_inset Flex CharStyle:Code
14424 \begin_layout Plain Layout
14430 The font used for the label.
14432 \begin_inset space ~
14436 \begin_inset CommandInset ref
14438 reference "sub:Font-description"
14443 Note that this definition can never appear before
14444 \begin_inset Flex CharStyle:Code
14447 \begin_layout Plain Layout
14453 , lest it be ineffective.
14456 \begin_layout Description
14457 \begin_inset Flex CharStyle:Code
14460 \begin_layout Plain Layout
14466 What will be displayed on the button or elsewhere as the inset label.
14467 Some inset types (TeX code and Branch) modify this label on the fly.
14470 \begin_layout Description
14471 \begin_inset Flex CharStyle:Code
14474 \begin_layout Plain Layout
14480 The name of the corresponding LaTeX stuff.
14481 Either the environment or command name.
14484 \begin_layout Description
14485 \begin_inset Flex CharStyle:Code
14488 \begin_layout Plain Layout
14494 The optional parameter for the corresponding
14495 \begin_inset Flex CharStyle:Code
14498 \begin_layout Plain Layout
14504 stuff, including possible bracket pairs like
14505 \begin_inset Flex CharStyle:Code
14508 \begin_layout Plain Layout
14515 This parameter cannot be changed from within LyX.
14518 \begin_layout Description
14519 \begin_inset Flex CharStyle:Code
14522 \begin_layout Plain Layout
14528 As with paragraph styles (see page
14529 \begin_inset CommandInset ref
14530 LatexCommand pageref
14531 reference "des:LatexType"
14538 \begin_layout Description
14539 \begin_inset Flex CharStyle:Code
14542 \begin_layout Plain Layout
14549 \begin_inset Flex CharStyle:Code
14552 \begin_layout Plain Layout
14559 \begin_inset Flex CharStyle:Code
14562 \begin_layout Plain Layout
14569 \begin_inset Flex CharStyle:Code
14572 \begin_layout Plain Layout
14579 \begin_inset Flex CharStyle:Code
14582 \begin_layout Plain Layout
14588 (indicating a dummy definition ending definitions of charstyles, etc).
14589 This entry is required in and is only meaningful for Flex insets.
14590 Among other things, it determines on which menu this inset will appear.
14592 \begin_inset Flex CharStyle:Code
14595 \begin_layout Plain Layout
14602 \begin_inset Flex CharStyle:Code
14605 \begin_layout Plain Layout
14612 \begin_inset Flex CharStyle:Code
14615 \begin_layout Plain Layout
14623 \begin_inset Flex CharStyle:Code
14626 \begin_layout Plain Layout
14632 can be set to true for charstyle insets, if you wish, by setting it
14637 \begin_inset Flex CharStyle:Code
14640 \begin_layout Plain Layout
14649 \begin_layout Description
14650 \begin_inset Flex CharStyle:Code
14653 \begin_layout Plain Layout
14660 \begin_inset Flex CharStyle:Code
14663 \begin_layout Plain Layout
14672 \begin_inset Flex CharStyle:Code
14675 \begin_layout Plain Layout
14681 ] Whether multiple paragraphs are permitted in this inset.
14683 \begin_inset Flex CharStyle:Code
14686 \begin_layout Plain Layout
14692 to the same value and
14693 \begin_inset Flex CharStyle:Code
14696 \begin_layout Plain Layout
14702 to the opposite value.
14703 These can be reset to other values, if they are used
14708 \begin_inset Flex CharStyle:Code
14711 \begin_layout Plain Layout
14721 \begin_layout Description
14722 \begin_inset Flex CharStyle:Code
14725 \begin_layout Plain Layout
14732 \begin_inset Flex CharStyle:Code
14735 \begin_layout Plain Layout
14744 \begin_inset Flex CharStyle:Code
14747 \begin_layout Plain Layout
14753 ] Whether fragile commands in this layout should be
14754 \begin_inset Flex CharStyle:Code
14757 \begin_layout Plain Layout
14770 whether the command should itself be protected.) Default is false.
14773 \begin_layout Description
14774 \begin_inset Flex CharStyle:Code
14777 \begin_layout Plain Layout
14784 \begin_inset Flex CharStyle:Code
14787 \begin_layout Plain Layout
14796 \begin_inset Flex CharStyle:Code
14799 \begin_layout Plain Layout
14805 ] As with paragraph styles (see page
14806 \begin_inset CommandInset ref
14807 LatexCommand pageref
14808 reference "des:ParbreakIsNewline"
14816 \begin_layout Description
14817 \begin_inset Flex CharStyle:Code
14820 \begin_layout Plain Layout
14827 \begin_inset Flex CharStyle:Code
14830 \begin_layout Plain Layout
14839 \begin_inset Flex CharStyle:Code
14842 \begin_layout Plain Layout
14848 ] As with paragraph styles (see page
14849 \begin_inset CommandInset ref
14850 LatexCommand pageref
14851 reference "des:PassThru"
14859 \begin_layout Description
14860 \begin_inset Flex CharStyle:Code
14863 \begin_layout Plain Layout
14869 As with paragraph styles (see page
14870 \begin_inset CommandInset ref
14871 LatexCommand pageref
14872 reference "des:Preamble"
14879 \begin_layout Description
14880 \begin_inset Flex CharStyle:Code
14883 \begin_layout Plain Layout
14890 \begin_inset Flex CharStyle:Code
14893 \begin_layout Plain Layout
14899 ] The prefix to use when creating labels referring to insets of this type.
14900 This allows the use of formatted references.
14903 \begin_layout Description
14904 \begin_inset Flex CharStyle:Code
14907 \begin_layout Plain Layout
14914 \begin_inset Flex CharStyle:Code
14917 \begin_layout Plain Layout
14923 ] As with paragraph styles (see page
14924 \begin_inset CommandInset ref
14925 LatexCommand pageref
14926 reference "des:Requires"
14933 \begin_layout Description
14934 \begin_inset Flex CharStyle:Code
14937 \begin_layout Plain Layout
14944 \begin_inset Flex CharStyle:Code
14947 \begin_layout Plain Layout
14954 \begin_inset Flex CharStyle:Code
14957 \begin_layout Plain Layout
14965 ] Spellcheck the contents of this inset.
14969 \begin_layout Subsection
14971 \begin_inset CommandInset label
14973 name "sub:Counters"
14980 \begin_layout Standard
14981 Since version 1.3.0 of LyX, it is both possible and necessary to define the
14983 \begin_inset Flex CharStyle:MenuItem
14986 \begin_layout Plain Layout
14993 \begin_inset Flex CharStyle:MenuItem
14996 \begin_layout Plain Layout
15002 , \SpecialChar \ldots{}
15003 ) in the text class itself.
15004 The standard counters are defined in the file
15005 \begin_inset Flex CharStyle:Code
15008 \begin_layout Plain Layout
15014 , so you may have to do no more than add
15017 \begin_layout LyX-Code
15018 Input stdcounters.inc
15021 \begin_layout Standard
15022 to your layout file to get them to work.
15023 But if you want to define custom counters, then you can do so.
15024 The counter declaration must begin with:
15027 \begin_layout LyX-Code
15028 Counter CounterName
15031 \begin_layout Standard
15033 \begin_inset Flex CharStyle:Code
15036 \begin_layout Plain Layout
15042 ' is replaced by the name of the counter.
15043 And it must end with
15044 \begin_inset Quotes eld
15048 \begin_inset Flex CharStyle:Code
15051 \begin_layout Plain Layout
15058 \begin_inset Quotes erd
15062 The following parameters can also be used:
15065 \begin_layout Description
15066 \begin_inset Flex CharStyle:Code
15069 \begin_layout Plain Layout
15076 \begin_inset Flex CharStyle:Code
15079 \begin_layout Plain Layout
15086 \begin_inset Quotes erd
15090 \begin_inset Quotes erd
15093 ] When defined, this string defines how the counter is displayed.
15094 Setting this value sets
15095 \begin_inset Flex CharStyle:Code
15098 \begin_layout Plain Layout
15099 LabelStringAppendix
15105 The following special constructs can be used in the string:
15109 \begin_layout Itemize
15110 \begin_inset Flex CharStyle:Code
15113 \begin_layout Plain Layout
15121 will be replaced by the expansion of the
15122 \begin_inset Flex CharStyle:Code
15125 \begin_layout Plain Layout
15132 \begin_inset Flex CharStyle:Code
15135 \begin_layout Plain Layout
15136 LabelStringAppendix
15142 \begin_inset Flex CharStyle:Code
15145 \begin_layout Plain Layout
15155 \begin_layout Itemize
15156 counter values can be expressed using LaTeX-like macros
15157 \begin_inset Flex CharStyle:Code
15160 \begin_layout Plain Layout
15177 \begin_inset Flex CharStyle:Code
15180 \begin_layout Plain Layout
15192 \begin_layout Plain Layout
15202 Actually, the situation is a bit more complicated: any
15221 other than those described below will produce arabic numerals.
15222 It would not be surprising to see this change in the future.
15228 \begin_inset Flex CharStyle:Code
15231 \begin_layout Plain Layout
15237 : 1, 2, 3,\SpecialChar \ldots{}
15239 \begin_inset Flex CharStyle:Code
15242 \begin_layout Plain Layout
15248 for lower-case letters: a, b, c, \SpecialChar \ldots{}
15250 \begin_inset Flex CharStyle:Code
15253 \begin_layout Plain Layout
15259 for upper-case letters: A, B, C, \SpecialChar \ldots{}
15261 \begin_inset Flex CharStyle:Code
15264 \begin_layout Plain Layout
15270 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
15272 \begin_inset Flex CharStyle:Code
15275 \begin_layout Plain Layout
15281 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
15283 \begin_inset Flex CharStyle:Code
15286 \begin_layout Plain Layout
15292 for hebrew numerals.
15296 \begin_layout Standard
15297 If LabelString is not defined, a default value is constructed as follows:
15298 if the counter has a master counter
15299 \begin_inset Flex CharStyle:Code
15302 \begin_layout Plain Layout
15309 \begin_inset Flex CharStyle:Code
15312 \begin_layout Plain Layout
15319 \begin_inset Flex CharStyle:Code
15322 \begin_layout Plain Layout
15332 is used; otherwise the string
15333 \begin_inset Flex CharStyle:Code
15336 \begin_layout Plain Layout
15347 \begin_layout Description
15348 \begin_inset Flex CharStyle:Code
15351 \begin_layout Plain Layout
15352 LabelStringAppendix
15358 \begin_inset Flex CharStyle:Code
15361 \begin_layout Plain Layout
15368 \begin_inset Quotes erd
15372 \begin_inset Quotes erd
15376 \begin_inset Flex CharStyle:Code
15379 \begin_layout Plain Layout
15385 , but for use in the Appendix.
15388 \begin_layout Description
15389 \begin_inset Flex CharStyle:Code
15392 \begin_layout Plain Layout
15399 \begin_inset Flex CharStyle:Code
15402 \begin_layout Plain Layout
15409 \begin_inset Quotes erd
15413 \begin_inset Quotes erd
15416 ] A format for use with formatted references to this counter.
15417 For example, one might want to have references to section numbers appear
15419 \begin_inset Quotes eld
15423 \begin_inset Quotes erd
15427 The string should contain
15428 \begin_inset Quotes eld
15432 \begin_inset Quotes erd
15436 This will be replaced by the counter number itself.
15437 So, for sections, it would be: Section ##.
15440 \begin_layout Description
15441 \begin_inset Flex CharStyle:Code
15444 \begin_layout Plain Layout
15451 \begin_inset Flex CharStyle:Code
15454 \begin_layout Plain Layout
15461 \begin_inset Quotes erd
15465 \begin_inset Quotes erd
15468 ] If this is set to the name of another counter, the present counter will
15469 be reset every time the other one is increased.
15471 \begin_inset Flex CharStyle:Code
15474 \begin_layout Plain Layout
15481 \begin_inset Flex CharStyle:Code
15484 \begin_layout Plain Layout
15493 \begin_layout Subsection
15495 \begin_inset CommandInset label
15497 name "sub:Font-description"
15504 \begin_layout Standard
15505 A font description looks like this:
15508 \begin_layout LyX-Code
15518 \begin_layout LyX-Code
15522 \begin_layout LyX-Code
15526 \begin_layout Standard
15527 The following commands are available:
15530 \begin_layout Description
15531 \begin_inset Flex CharStyle:Code
15534 \begin_layout Plain Layout
15541 \begin_inset Flex CharStyle:Code
15544 \begin_layout Plain Layout
15553 \begin_inset Flex CharStyle:Code
15556 \begin_layout Plain Layout
15563 \begin_inset Flex CharStyle:Code
15566 \begin_layout Plain Layout
15573 \begin_inset Flex CharStyle:Code
15576 \begin_layout Plain Layout
15583 \begin_inset Flex CharStyle:Code
15586 \begin_layout Plain Layout
15593 \begin_inset Flex CharStyle:Code
15596 \begin_layout Plain Layout
15603 \begin_inset Flex CharStyle:Code
15606 \begin_layout Plain Layout
15613 \begin_inset Flex CharStyle:Code
15616 \begin_layout Plain Layout
15623 \begin_inset Flex CharStyle:Code
15626 \begin_layout Plain Layout
15635 \begin_layout Description
15636 \begin_inset Flex CharStyle:Code
15639 \begin_layout Plain Layout
15646 \begin_inset Flex CharStyle:Code
15649 \begin_layout Plain Layout
15658 \begin_inset Flex CharStyle:Code
15661 \begin_layout Plain Layout
15668 \begin_inset Flex CharStyle:Code
15671 \begin_layout Plain Layout
15680 \begin_layout Description
15681 \begin_inset Flex CharStyle:Code
15684 \begin_layout Plain Layout
15691 \begin_inset Flex CharStyle:Code
15694 \begin_layout Plain Layout
15700 ] Valid arguments are:
15701 \begin_inset Flex CharStyle:Code
15704 \begin_layout Plain Layout
15711 \begin_inset Flex CharStyle:Code
15714 \begin_layout Plain Layout
15721 \begin_inset Flex CharStyle:Code
15724 \begin_layout Plain Layout
15731 \begin_inset Flex CharStyle:Code
15734 \begin_layout Plain Layout
15741 \begin_inset Flex CharStyle:Code
15744 \begin_layout Plain Layout
15751 \begin_inset Flex CharStyle:Code
15754 \begin_layout Plain Layout
15761 Each of these turns on or off the corresponding attribute.
15763 \begin_inset Flex CharStyle:Code
15766 \begin_layout Plain Layout
15772 turns on emphasis, and
15773 \begin_inset Flex CharStyle:Code
15776 \begin_layout Plain Layout
15784 \begin_inset Newline newline
15787 If the latter seems puzzling, remember that the font settings for the present
15788 context are generally inherited from the surrounding context.
15790 \begin_inset Flex CharStyle:Code
15793 \begin_layout Plain Layout
15799 would turn off the emphasis that was anyway in effect, say, in a theorem
15803 \begin_layout Description
15804 \begin_inset Flex CharStyle:Code
15807 \begin_layout Plain Layout
15814 \begin_inset Flex CharStyle:Code
15817 \begin_layout Plain Layout
15826 \begin_inset Flex CharStyle:Code
15829 \begin_layout Plain Layout
15838 \begin_layout Description
15839 \begin_inset Flex CharStyle:Code
15842 \begin_layout Plain Layout
15849 \begin_inset Flex CharStyle:Code
15852 \begin_layout Plain Layout
15861 \begin_inset Flex CharStyle:Code
15864 \begin_layout Plain Layout
15871 \begin_inset Flex CharStyle:Code
15874 \begin_layout Plain Layout
15881 \begin_inset Flex CharStyle:Code
15884 \begin_layout Plain Layout
15893 \begin_layout Description
15894 \begin_inset Flex CharStyle:Code
15897 \begin_layout Plain Layout
15904 \begin_inset Flex CharStyle:Code
15907 \begin_layout Plain Layout
15914 \begin_inset Flex CharStyle:Code
15917 \begin_layout Plain Layout
15924 \begin_inset Flex CharStyle:Code
15927 \begin_layout Plain Layout
15936 \begin_inset Flex CharStyle:Code
15939 \begin_layout Plain Layout
15946 \begin_inset Flex CharStyle:Code
15949 \begin_layout Plain Layout
15956 \begin_inset Flex CharStyle:Code
15959 \begin_layout Plain Layout
15966 \begin_inset Flex CharStyle:Code
15969 \begin_layout Plain Layout
15976 \begin_inset Flex CharStyle:Code
15979 \begin_layout Plain Layout
15988 \begin_layout Subsection
15989 \begin_inset CommandInset label
15991 name "sub:Citation-format-description"
15995 Citation format description
15998 \begin_layout Standard
16000 \begin_inset Flex CharStyle:Code
16003 \begin_layout Plain Layout
16009 blocks are used to describe how bibliographic information should be displayed,
16010 both within LyX itself (in the citation dialog and in tooltips, for example)
16011 and in XHTML output.
16012 Such a block might look like this:
16015 \begin_layout LyX-Code
16019 \begin_layout LyX-Code
16023 \begin_layout LyX-Code
16027 \begin_layout LyX-Code
16031 \begin_layout Standard
16032 The individual lines define how the bibliographic information associated
16033 with an article or book, respectively, is to be displayed, and such a definitio
16034 n can be given for any `entry type' that might be present in a BibTeX file.
16035 LyX defines a default format in the source code that will be used if no
16036 specific definition has been given.
16037 LyX predefines several formats in the file
16038 \begin_inset Flex CharStyle:Code
16041 \begin_layout Plain Layout
16047 , which is included in most of LyX's document classes.
16050 \begin_layout Standard
16051 The definitions use a simple language that allows BibTeX keys to be replaced
16053 Keys should be enclosed in
16054 \begin_inset Flex CharStyle:Code
16057 \begin_layout Plain Layout
16064 \begin_inset Flex CharStyle:Code
16067 \begin_layout Plain Layout
16074 So a simple definition might look like this:
16077 \begin_layout LyX-Code
16079 \begin_inset Quotes eld
16083 \begin_inset Quotes erd
16089 \begin_layout Standard
16090 This would print the author, followed by a comma, followed by the title,
16091 in quotes, followed by a period.
16094 \begin_layout Standard
16095 Of course, sometimes you may want to print a key only if it exists.
16096 This can be done by using a conditional construction, such as:
16097 \begin_inset Flex CharStyle:Code
16100 \begin_layout Plain Layout
16102 \begin_inset space ~
16112 \begin_inset Flex CharStyle:Code
16115 \begin_layout Plain Layout
16121 key exists, then print
16122 \begin_inset Quotes eld
16126 \begin_inset space ~
16130 \begin_inset Quotes erd
16133 followed by the volume key.
16134 It is also possible to have an else clause in the conditional, such as:
16136 \begin_inset Flex CharStyle:Code
16139 \begin_layout Plain Layout
16140 {%author%[[%author%]][[%editor%, ed.]]}
16147 \begin_inset Flex CharStyle:Code
16150 \begin_layout Plain Layout
16156 key is printed if it exists; otherwise, the editor key is printed, followed
16158 \begin_inset Quotes eld
16162 \begin_inset space ~
16166 \begin_inset Quotes erd
16169 Note that the key is again enclosed in
16170 \begin_inset Flex CharStyle:Code
16173 \begin_layout Plain Layout
16179 signs; the entire conditional is enclosed in braces; and the if and else
16180 clauses are enclosed in double brackets,
16181 \begin_inset Quotes eld
16185 \begin_inset Flex CharStyle:Code
16188 \begin_layout Plain Layout
16195 \begin_inset Quotes eld
16199 \begin_inset Quotes eld
16203 \begin_inset Flex CharStyle:Code
16206 \begin_layout Plain Layout
16213 \begin_inset Quotes erd
16217 There must be no space between any of these.
16220 \begin_layout Standard
16221 There is one other piece of syntax available in definitions, which looks
16223 \begin_inset Flex CharStyle:Code
16226 \begin_layout Plain Layout
16233 This defines a piece of formatting information that is to be used when
16235 \begin_inset Quotes eld
16239 \begin_inset Quotes erd
16243 Obviously, we do not want to output HTML tags when writing plain text,
16244 so they should be wrapped in
16245 \begin_inset Quotes eld
16249 \begin_inset Quotes erd
16253 \begin_inset Quotes eld
16257 \begin_inset Quotes erd
16263 \begin_layout Standard
16264 Two special sorts of definitions are also possible in a
16265 \begin_inset Flex CharStyle:Code
16268 \begin_layout Plain Layout
16275 An example of the first would be:
16278 \begin_layout LyX-Code
16280 \begin_inset Quotes eld
16284 \begin_inset Quotes erd
16290 \begin_layout Standard
16291 This is an abbreviation, or macro, and it can be used by treating it as
16293 \begin_inset Flex CharStyle:Code
16296 \begin_layout Plain Layout
16304 \begin_inset Flex CharStyle:Code
16307 \begin_layout Plain Layout
16313 exactly as it would treat its definition.
16314 So, let us issue the obvious
16322 \begin_layout LyX-Code
16326 \begin_layout Standard
16327 or anything like it.
16328 LyX shouldn't go into an infinite loop, but it may go into a long one before
16332 \begin_layout Standard
16333 The second sort of special definition might look like this:
16336 \begin_layout LyX-Code
16340 \begin_layout Standard
16341 This defines a translatable piece of text, which allows relevant parts of
16342 the bibliography to be translated.
16343 It can be included in a definition by treating it as a key:
16344 \begin_inset Flex CharStyle:Code
16347 \begin_layout Plain Layout
16354 Several of these are predefined in
16355 \begin_inset Flex CharStyle:Code
16358 \begin_layout Plain Layout
16365 Note that these are not macros, in the sense just defined.
16366 They will not be expanded.
16369 \begin_layout Standard
16370 So here then is an example that use all these features:
16373 \begin_layout LyX-Code
16374 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
16377 \begin_layout Standard
16378 The defines a macro that prints the author, followed by a comma, if the
16380 \begin_inset Flex CharStyle:Code
16383 \begin_layout Plain Layout
16389 key is defined, or else prints the name of the editor, followed by the
16391 \begin_inset Flex CharStyle:Code
16394 \begin_layout Plain Layout
16400 or its translation (it is by default
16401 \begin_inset Quotes eld
16405 \begin_inset Quotes erd
16409 \begin_inset Flex CharStyle:Code
16412 \begin_layout Plain Layout
16419 Note that this is in fact defined in
16420 \begin_inset Flex CharStyle:Code
16423 \begin_layout Plain Layout
16429 , so you can use it in your own definitions, or re-definitions, if you load
16433 \begin_layout Section
16434 \begin_inset CommandInset label
16436 name "sec:Tags-for-XHTML"
16440 Tags for XHTML output
16443 \begin_layout Standard
16444 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
16445 by layout information.
16446 In general, LyX provides sensible defaults and, as mentioned earlier, it
16447 will even construct default CSS style rules from the other layout tags.
16448 For example, LyX will attempt to use the information provided in the
16449 \begin_inset Flex CharStyle:Code
16452 \begin_layout Plain Layout
16458 declaration for the Chapter style to write CSS that will appropriately
16459 format chapter headings.
16462 \begin_layout Standard
16463 In many cases, then, you may not have to do anything at all to get acceptable
16464 XHTML output for your own environments, custom insets, and so forth.
16465 But in some cases you will, and so LyX provides a number of layout tags
16466 that can be used to customize the XHTML and CSS that are generated.
16469 \begin_layout Standard
16470 Note that there are two tags,
16471 \begin_inset Flex CharStyle:Code
16474 \begin_layout Plain Layout
16481 \begin_inset Flex CharStyle:Code
16484 \begin_layout Plain Layout
16490 that may appear outside style and inset declarations.
16492 \begin_inset CommandInset ref
16494 reference "sub:General-text-class"
16498 for details on these.
16501 \begin_layout Subsection
16502 \begin_inset CommandInset label
16504 name "sub:Paragraph-Style-XHTML"
16511 \begin_layout Standard
16512 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
16513 dealing with a normal paragraph, a command, or an environment, where this
16514 is itself determined by the contents of the corresponding
16515 \begin_inset Flex CharStyle:Code
16518 \begin_layout Plain Layout
16528 \begin_layout Standard
16529 For a command or normal paragraph, the output XHTML has the following form:
16532 \begin_layout LyX-Code
16534 \begin_inset Quotes erd
16538 \begin_inset Quotes erd
16544 \begin_layout LyX-Code
16546 \begin_inset Quotes erd
16550 \begin_inset Quotes erd
16556 \begin_layout LyX-Code
16557 Contents of the paragraph.
16560 \begin_layout LyX-Code
16564 \begin_layout Standard
16565 The label tags are of course omitted if the paragraph does not have a label.
16568 \begin_layout Standard
16569 For an environment that is not some sort of list, the XHTML takes this form:
16572 \begin_layout LyX-Code
16574 \begin_inset Quotes erd
16578 \begin_inset Quotes erd
16584 \begin_layout LyX-Code
16586 \begin_inset Quotes erd
16590 \begin_inset Quotes erd
16594 \begin_inset Quotes erd
16598 \begin_inset Quotes erd
16601 >Environment Label</labeltag>First paragraph.</itemtag>
16604 \begin_layout LyX-Code
16605 <itemtag>Second paragraph.</itemtag>
16608 \begin_layout LyX-Code
16612 \begin_layout Standard
16613 Note that the label is output only for the first paragraph, as it should
16614 be for a theorem, for example.
16618 \begin_layout Standard
16619 For a list, we have one of these forms:
16622 \begin_layout LyX-Code
16624 \begin_inset Quotes erd
16628 \begin_inset Quotes erd
16634 \begin_layout LyX-Code
16636 \begin_inset Quotes erd
16640 \begin_inset Quotes erd
16644 \begin_inset Quotes erd
16648 \begin_inset Quotes erd
16651 >List Label</labeltag>First item.</itemtag>
16654 \begin_layout LyX-Code
16656 \begin_inset Quotes erd
16660 \begin_inset Quotes erd
16664 \begin_inset Quotes erd
16668 \begin_inset Quotes erd
16671 >List Label</labeltag>Second item.</itemtag>
16674 \begin_layout LyX-Code
16678 \begin_layout LyX-Code
16682 \begin_layout LyX-Code
16684 \begin_inset Quotes erd
16688 \begin_inset Quotes erd
16694 \begin_layout LyX-Code
16696 \begin_inset Quotes erd
16700 \begin_inset Quotes erd
16703 >List Label</labeltag><itemtag attr=
16704 \begin_inset Quotes erd
16708 \begin_inset Quotes erd
16711 >First item.</itemtag>
16714 \begin_layout LyX-Code
16716 \begin_inset Quotes erd
16720 \begin_inset Quotes erd
16723 >List Label</labeltag><itemtag attr=
16724 \begin_inset Quotes erd
16728 \begin_inset Quotes erd
16731 >Second item.</itemtag>
16734 \begin_layout LyX-Code
16738 \begin_layout Standard
16739 Note the different orders of
16740 \begin_inset Flex CharStyle:Code
16743 \begin_layout Plain Layout
16750 \begin_inset Flex CharStyle:Code
16753 \begin_layout Plain Layout
16760 Which order we get depends upon the setting of
16761 \begin_inset Flex CharStyle:Code
16764 \begin_layout Plain Layout
16771 \begin_inset Flex CharStyle:Code
16774 \begin_layout Plain Layout
16780 is false (the default), you get the first of these, with the label within
16781 the item; if true, you get the second, with the label outside the item.
16784 \begin_layout Standard
16785 The specific tags and attributes output for each paragraph type can be controlle
16786 d by means of the layout tags we are about to describe.
16787 As mentioned earlier, however, LyX uses sensible defaults for many of these,
16788 so you often may not need to do very much to get good XHTML output.
16789 Think of the available tags as there so you can tweak things to your liking.
16792 \begin_layout Description
16793 \begin_inset Flex CharStyle:Code
16796 \begin_layout Plain Layout
16803 \begin_inset Flex CharStyle:Code
16806 \begin_layout Plain Layout
16812 ] Specifies attribute information to be output with the main tag.
16814 \begin_inset Quotes eld
16818 \begin_inset Flex CharStyle:Code
16821 \begin_layout Plain Layout
16828 \begin_inset Quotes erd
16832 By default, LyX will output
16833 \begin_inset Quotes eld
16837 \begin_inset Flex CharStyle:Code
16840 \begin_layout Plain Layout
16847 \begin_inset Quotes erd
16851 \begin_inset Flex CharStyle:Code
16854 \begin_layout Plain Layout
16860 is the LyX name of the layout, made lowercase, for example: chapter.
16865 contain any style information.
16867 \begin_inset Flex CharStyle:Code
16870 \begin_layout Plain Layout
16879 \begin_layout Description
16880 \begin_inset Flex CharStyle:Code
16883 \begin_layout Plain Layout
16890 \begin_inset Flex CharStyle:Code
16893 \begin_layout Plain Layout
16903 ] Whether to output the default CSS information LyX generates for this layout,
16904 even if additional information is explicitly provided via
16905 \begin_inset Flex CharStyle:Code
16908 \begin_layout Plain Layout
16916 \begin_inset Flex CharStyle:Code
16919 \begin_layout Plain Layout
16925 allows you to alter or augment the generated CSS, rather than to override
16928 \begin_inset Flex CharStyle:Code
16931 \begin_layout Plain Layout
16940 \begin_layout Description
16941 \begin_inset Flex CharStyle:Code
16944 \begin_layout Plain Layout
16951 \begin_inset Flex CharStyle:Code
16954 \begin_layout Plain Layout
16960 ] The tag to be used for individual paragraphs of environments, replacing
16962 \begin_inset Flex CharStyle:Code
16965 \begin_layout Plain Layout
16971 in the examples above.
16973 \begin_inset Flex CharStyle:Code
16976 \begin_layout Plain Layout
16985 \begin_layout Description
16986 \begin_inset Flex CharStyle:Code
16989 \begin_layout Plain Layout
16996 \begin_inset Flex CharStyle:Code
16999 \begin_layout Plain Layout
17005 ] Attributes for the item tag.
17007 \begin_inset Quotes eld
17011 \begin_inset Flex CharStyle:Code
17014 \begin_layout Plain Layout
17015 class=`layoutname_item'
17021 \begin_inset Quotes erd
17029 contain any style information.
17031 \begin_inset Flex CharStyle:Code
17034 \begin_layout Plain Layout
17043 \begin_layout Description
17044 \begin_inset Flex CharStyle:Code
17047 \begin_layout Plain Layout
17054 \begin_inset Flex CharStyle:Code
17057 \begin_layout Plain Layout
17063 ] The tag to be used for paragraph and item labels, replacing
17064 \begin_inset Flex CharStyle:Code
17067 \begin_layout Plain Layout
17073 in the examples above.
17075 \begin_inset Flex CharStyle:Code
17078 \begin_layout Plain Layout
17085 \begin_inset Flex CharStyle:Code
17088 \begin_layout Plain Layout
17095 \begin_inset Flex CharStyle:Code
17098 \begin_layout Plain Layout
17105 \begin_inset Flex CharStyle:Code
17108 \begin_layout Plain Layout
17109 Centered_Top_Environment
17114 , in which case it defaults to
17115 \begin_inset Flex CharStyle:Code
17118 \begin_layout Plain Layout
17127 \begin_layout Description
17128 \begin_inset Flex CharStyle:Code
17131 \begin_layout Plain Layout
17138 \begin_inset Flex CharStyle:Code
17141 \begin_layout Plain Layout
17147 ] Attributes for the label tag.
17149 \begin_inset Quotes eld
17153 \begin_inset Flex CharStyle:Code
17156 \begin_layout Plain Layout
17157 class=`layoutname_label'
17163 \begin_inset Quotes erd
17171 contain any style information.
17173 \begin_inset Flex CharStyle:Code
17176 \begin_layout Plain Layout
17185 \begin_layout Description
17186 \begin_inset Flex CharStyle:Code
17189 \begin_layout Plain Layout
17196 \begin_inset Flex CharStyle:Code
17199 \begin_layout Plain Layout
17209 ] Meaningful only for list-like environments, this tag controls whether
17210 the label tag is output before or inside the item tag.
17211 This is used, for example, in the description environment, where we want
17213 \begin_inset Flex CharStyle:Code
17216 \begin_layout Plain Layout
17217 <dt>\SpecialChar \ldots{}
17218 </dt><dd>\SpecialChar \ldots{}
17226 \begin_inset Flex CharStyle:Code
17229 \begin_layout Plain Layout
17235 : The label tag is output inside the item tag.
17238 \begin_layout Description
17239 \begin_inset Flex CharStyle:Code
17242 \begin_layout Plain Layout
17248 Information to be output in the
17249 \begin_inset Flex CharStyle:Code
17252 \begin_layout Plain Layout
17258 section when this style is used.
17259 This might, for example, be used to include a
17260 \begin_inset Flex CharStyle:Code
17263 \begin_layout Plain Layout
17270 \begin_inset Flex CharStyle:Code
17273 \begin_layout Plain Layout
17282 \begin_layout Description
17283 \begin_inset Flex CharStyle:Code
17286 \begin_layout Plain Layout
17292 CSS style information to be included when this style is used.
17293 Note that this will automatically be wrapped in a layout-generated
17294 \begin_inset Flex CharStyle:Code
17297 \begin_layout Plain Layout
17303 block, so only the CSS itself need be included.
17306 \begin_layout Description
17307 \begin_inset Flex CharStyle:Code
17310 \begin_layout Plain Layout
17317 \begin_inset Flex CharStyle:Code
17320 \begin_layout Plain Layout
17326 ] The tag to be used for the main label, replacing
17327 \begin_inset Flex CharStyle:Code
17330 \begin_layout Plain Layout
17336 in the examples above.
17338 \begin_inset Flex CharStyle:Code
17341 \begin_layout Plain Layout
17350 \begin_layout Description
17351 \begin_inset Flex CharStyle:Code
17354 \begin_layout Plain Layout
17361 \begin_inset Flex CharStyle:Code
17364 \begin_layout Plain Layout
17374 ] Marks this style as the one to be used to generate the
17375 \begin_inset Flex CharStyle:Code
17378 \begin_layout Plain Layout
17384 tag for the XHTML file.
17385 By default, it is false.
17387 \begin_inset Flex CharStyle:Code
17390 \begin_layout Plain Layout
17396 file sets it to true for the
17397 \begin_inset Flex CharStyle:Code
17400 \begin_layout Plain Layout
17410 \begin_layout Subsection
17414 \begin_layout Standard
17415 The XHTML output of insets can also be controlled by information in layout
17420 \begin_layout Plain Layout
17421 At present, this is true only for
17422 \begin_inset Quotes eld
17426 \begin_inset Quotes erd
17429 insets (insets you can type into) and is not true for
17430 \begin_inset Quotes eld
17434 \begin_inset Quotes erd
17437 insets (insets that are associated with dialog boxes).
17442 Here, too, LyX tries to provide sensible defaults, and it constructs default
17444 But everything can be customized.
17447 \begin_layout Standard
17448 The XHTML LyX outputs for an inset has the following form:
17451 \begin_layout LyX-Code
17453 \begin_inset Quotes erd
17457 \begin_inset Quotes erd
17463 \begin_layout LyX-Code
17464 <labeltag>Label</labeltag>
17467 \begin_layout LyX-Code
17469 \begin_inset Quotes erd
17473 \begin_inset Quotes erd
17476 >Contents of the inset.</innertag>
17479 \begin_layout LyX-Code
17483 \begin_layout Standard
17484 If the inset permits multiple paragraphs---that is, if
17485 \begin_inset Flex CharStyle:Code
17488 \begin_layout Plain Layout
17494 is true---then the contents of the inset will itself be output as paragraphs
17495 formatted according to the styles used for those paragraphs (standard,
17496 quote, and the like).
17497 The label tag is of course omitted if the paragraph does not have a label
17498 and, at present, is always
17499 \begin_inset Flex CharStyle:Code
17502 \begin_layout Plain Layout
17509 The inner tag is optional and, by default, does not appear.
17512 \begin_layout Standard
17513 The specific tags and attributes output for each inset can be controlled
17514 by means of the following layout tags.
17517 \begin_layout Description
17518 \begin_inset Flex CharStyle:Code
17521 \begin_layout Plain Layout
17528 \begin_inset Flex CharStyle:Code
17531 \begin_layout Plain Layout
17537 ] Specifies attribute information to be output with the main tag.
17539 \begin_inset Quotes eld
17543 \begin_inset Flex CharStyle:Code
17546 \begin_layout Plain Layout
17547 class=`myinset' onclick=`\SpecialChar \ldots{}
17554 \begin_inset Quotes erd
17558 By default, LyX will output
17559 \begin_inset Quotes eld
17563 \begin_inset Flex CharStyle:Code
17566 \begin_layout Plain Layout
17573 \begin_inset Quotes erd
17577 \begin_inset Flex CharStyle:Code
17580 \begin_layout Plain Layout
17586 is the LyX name of the inset, made lowercase and with non-alphanumeric
17587 characters converted to underscores, for example: footnote.
17590 \begin_layout Description
17591 \begin_inset Flex CharStyle:Code
17594 \begin_layout Plain Layout
17601 \begin_inset Flex CharStyle:Code
17604 \begin_layout Plain Layout
17614 ] Whether to output the default CSS information LyX generates for this layout,
17615 even if additional information is explicitly provided via
17616 \begin_inset Flex CharStyle:Code
17619 \begin_layout Plain Layout
17627 \begin_inset Flex CharStyle:Code
17630 \begin_layout Plain Layout
17636 allows you to alter or augment the generated CSS, rather than to override
17641 \begin_layout Description
17642 \begin_inset Flex CharStyle:Code
17645 \begin_layout Plain Layout
17652 \begin_inset Flex CharStyle:Code
17655 \begin_layout Plain Layout
17661 ] Attributes for the inner tag.
17663 \begin_inset Quotes eld
17667 \begin_inset Flex CharStyle:Code
17670 \begin_layout Plain Layout
17671 class=`insetname_inner'
17677 \begin_inset Quotes erd
17683 \begin_layout Description
17684 \begin_inset Flex CharStyle:Code
17687 \begin_layout Plain Layout
17694 \begin_inset Flex CharStyle:Code
17697 \begin_layout Plain Layout
17703 ] The inner tag, replacing
17704 \begin_inset Flex CharStyle:Code
17707 \begin_layout Plain Layout
17713 in the examples above.
17714 By default, there is none.
17717 \begin_layout Description
17718 \begin_inset Flex CharStyle:Code
17721 \begin_layout Plain Layout
17728 \begin_inset Flex CharStyle:Code
17731 \begin_layout Plain Layout
17739 ] Whether this inset represents a standalone block of text (such as a footnote)
17740 or instead represents material that is included in the surrounding text
17741 (such as a branch).
17745 \begin_layout Description
17746 \begin_inset Flex CharStyle:Code
17749 \begin_layout Plain Layout
17756 \begin_inset Flex CharStyle:Code
17759 \begin_layout Plain Layout
17765 ] A label for this inset, possibly including a reference to a counter.
17766 For example, for footnote, it might be:
17767 \begin_inset Flex CharStyle:Code
17770 \begin_layout Plain Layout
17779 This is optional, and there is no default.
17782 \begin_layout Description
17783 \begin_inset Flex CharStyle:Code
17786 \begin_layout Plain Layout
17792 Information to be output in the
17793 \begin_inset Flex CharStyle:Code
17796 \begin_layout Plain Layout
17802 section when this style is used.
17803 This might, for example, be used to include a
17804 \begin_inset Flex CharStyle:Code
17807 \begin_layout Plain Layout
17814 \begin_inset Flex CharStyle:Code
17817 \begin_layout Plain Layout
17826 \begin_layout Description
17827 \begin_inset Flex CharStyle:Code
17830 \begin_layout Plain Layout
17836 CSS style information to be included when this style is used.
17837 Note that this will automatically be wrapped in a layout-generated
17838 \begin_inset Flex CharStyle:Code
17841 \begin_layout Plain Layout
17847 block, so only the CSS itself need be included.
17850 \begin_layout Description
17851 \begin_inset Flex CharStyle:Code
17854 \begin_layout Plain Layout
17861 \begin_inset Flex CharStyle:Code
17864 \begin_layout Plain Layout
17870 ] The tag to be used for the main label, replacing
17871 \begin_inset Flex CharStyle:Code
17874 \begin_layout Plain Layout
17880 in the examples above.
17881 The default depends upon the setting of
17882 \begin_inset Flex CharStyle:Code
17885 \begin_layout Plain Layout
17892 \begin_inset Flex CharStyle:Code
17895 \begin_layout Plain Layout
17901 is true, the default is
17902 \begin_inset Flex CharStyle:Code
17905 \begin_layout Plain Layout
17911 ; if it is false, the default is
17912 \begin_inset Flex CharStyle:Code
17915 \begin_layout Plain Layout
17924 \begin_layout Subsection
17928 \begin_layout Standard
17929 The XHTML output for floats too can be controlled by layout information.
17930 The output has the following form:
17933 \begin_layout LyX-Code
17935 \begin_inset Quotes erd
17939 \begin_inset Quotes erd
17945 \begin_layout LyX-Code
17946 Contents of the float.
17949 \begin_layout LyX-Code
17953 \begin_layout Standard
17954 The caption, if there is one, is a separate inset and will be output as
17956 Its appearance can be controlled via the InsetLayout for caption insets.
17960 \begin_layout Description
17961 \begin_inset Flex CharStyle:Code
17964 \begin_layout Plain Layout
17971 \begin_inset Flex CharStyle:Code
17974 \begin_layout Plain Layout
17980 ] Specifies attribute information to be output with the main tag.
17982 \begin_inset Quotes eld
17986 \begin_inset Flex CharStyle:Code
17989 \begin_layout Plain Layout
17990 class=`myfloat' onclick=`\SpecialChar \ldots{}
17997 \begin_inset Quotes erd
18001 By default, LyX will output
18002 \begin_inset Quotes eld
18006 \begin_inset Flex CharStyle:Code
18009 \begin_layout Plain Layout
18010 class=`float float-floattype'
18016 \begin_inset Quotes erd
18020 \begin_inset Flex CharStyle:Code
18023 \begin_layout Plain Layout
18029 is LyX's name for this type of float, as determined by the float delcaration
18031 \begin_inset CommandInset ref
18033 reference "sub:Floats"
18037 ), though made lowercase and with non-alphanumeric characters converted
18038 to underscores, for example: float-table.
18041 \begin_layout Description
18042 \begin_inset Flex CharStyle:Code
18045 \begin_layout Plain Layout
18051 CSS style information to be included when this float is used.
18052 Note that this will automatically be wrapped in a layout-generated
18053 \begin_inset Flex CharStyle:Code
18056 \begin_layout Plain Layout
18062 block, so only the CSS itself need be included.
18065 \begin_layout Description
18066 \begin_inset Flex CharStyle:Code
18069 \begin_layout Plain Layout
18076 \begin_inset Flex CharStyle:Code
18079 \begin_layout Plain Layout
18085 ] The tag to be used for this float, replacing
18086 \begin_inset Quotes eld
18090 \begin_inset Flex CharStyle:Code
18093 \begin_layout Plain Layout
18100 \begin_inset Quotes erd
18103 in the example above.
18105 \begin_inset Flex CharStyle:Code
18108 \begin_layout Plain Layout
18114 and will rarely need changing.
18117 \begin_layout Subsection
18118 Bibliography formatting
18121 \begin_layout Standard
18122 The bibliography can be formatted using
18123 \begin_inset Flex CharStyle:Code
18126 \begin_layout Plain Layout
18134 \begin_inset CommandInset ref
18136 reference "sub:Citation-format-description"
18143 \begin_layout Subsection
18147 \begin_layout Standard
18148 We have several times mentioned that LyX will generate default CSS style
18149 rules for both insets and paragraph styles, based upon the other layout
18150 information that is provided.
18151 In this section, we shall say a word about which layout information LyX
18155 \begin_layout Standard
18156 At present, LyX auto-generates CSS only for font information, making use
18158 \begin_inset Flex CharStyle:Code
18161 \begin_layout Plain Layout
18168 \begin_inset Flex CharStyle:Code
18171 \begin_layout Plain Layout
18178 \begin_inset Flex CharStyle:Code
18181 \begin_layout Plain Layout
18188 \begin_inset Flex CharStyle:Code
18191 \begin_layout Plain Layout
18198 \begin_inset Flex CharStyle:Code
18201 \begin_layout Plain Layout
18209 \begin_inset CommandInset ref
18211 reference "sub:Font-description"
18215 .) The translation is mostly straightforward and obvious.
18217 \begin_inset Quotes eld
18221 \begin_inset Flex CharStyle:Code
18224 \begin_layout Plain Layout
18231 \begin_inset Quotes erd
18235 \begin_inset Quotes eld
18239 \begin_inset Flex CharStyle:Code
18242 \begin_layout Plain Layout
18243 font-family: sans-serif;
18249 \begin_inset Quotes erd
18253 The correspondence of LyX sizes and CSS sizes is a little less obvious
18254 but nonetheless intuitive.
18256 \begin_inset Flex CharStyle:Code
18259 \begin_layout Plain Layout
18266 \begin_inset Flex URL
18269 \begin_layout Plain Layout
18280 \begin_layout Chapter
18281 Including External Material
18284 \begin_layout Standard
18285 \begin_inset Box Shadowbox
18295 height_special "totalheight"
18298 \begin_layout Plain Layout
18299 WARNING: This portion of the documentation has not been updated for some
18301 We certainly hope that it is still accurate, but there are no guarantees.
18309 \begin_layout Standard
18310 The use of material from sources external to LyX is covered in detail in
18316 This part of the manual covers what needs to happen behind the scenes for
18317 new sorts of material to be included.
18320 \begin_layout Section
18324 \begin_layout Standard
18325 The external material feature is based on the concept of a
18330 A template is a specification of how LyX should interface with a certain
18332 As bundled, LyX comes with predefined templates for Xfig figures, various
18333 raster format images, chess diagrams, and LilyPond music notation.
18334 You can check the actual list by using the menu
18335 \begin_inset Flex CharStyle:MenuItem
18338 \begin_layout Plain Layout
18339 Insert\SpecialChar \menuseparator
18340 File\SpecialChar \menuseparator
18347 Furthermore, it is possible to roll your own template to support a specific
18349 Later we'll describe in more detail what is involved, and hopefully you
18350 will submit all the templates you create so we can include them in a later
18354 \begin_layout Standard
18355 Another basic idea of the external material feature is to distinguish between
18356 the original file that serves as a base for final material and the produced
18357 file that is included in your exported or printed document.
18358 For example, consider the case of a figure produced with
18359 \begin_inset Flex CharStyle:Code
18362 \begin_layout Plain Layout
18369 The Xfig application itself works on an original file with the
18370 \begin_inset Flex CharStyle:Code
18373 \begin_layout Plain Layout
18380 Within Xfig, you create and change your figure, and when you are done,
18382 \begin_inset Flex CharStyle:Code
18385 \begin_layout Plain Layout
18392 When you want to include the figure in your document, you invoke
18393 \begin_inset Flex CharStyle:Code
18396 \begin_layout Plain Layout
18402 in order to create a PostScript file that can readily be included in your
18405 \begin_inset Flex CharStyle:Code
18408 \begin_layout Plain Layout
18414 file is the original file, and the PostScript file is the produced file.
18417 \begin_layout Standard
18418 This distinction is important in order to allow updating of the material
18419 while you are in the process of writing the document.
18420 Furthermore, it provides us with the flexibility that is needed to support
18421 multiple export formats.
18422 For instance, in the case of a plain text file, it is not exactly an award-winn
18423 ing idea to include the figure as raw PostScript.
18424 Instead, you'd either prefer to just include a reference to the figure
18425 or try to invoke some graphics to ASCII converter to make the final result
18426 look similar to the real graphics.
18427 The external material management allows you to do this, because it is parametri
18428 zed on the different export formats that LyX supports.
18431 \begin_layout Standard
18432 Besides supporting the production of different products according to the
18433 exported format, it supports tight integration with editing and viewing
18435 In the case of an Xfig figure, you are able to invoke Xfig on the original
18436 file with a single click from within the external material dialog in LyX,
18437 and also preview the produced PostScript file with Ghostview with another
18439 No more fiddling around with the command line and/or file browsers to locate
18440 and manipulate the original or produced files.
18441 In this way, you are finally able to take full advantage of the many different
18442 applications that are relevant to use when you write your documents, and
18443 ultimately be more productive.
18446 \begin_layout Section
18447 The external template configuration file
18450 \begin_layout Standard
18451 It is relatively easy to add custom external template definitions to LyX.
18452 However, be aware that doing this in an careless manner most probably
18456 introduce an easily exploitable security hole.
18457 So before you do this, please read the discussion about security in section
18459 \begin_inset CommandInset ref
18461 reference "sec:Security-discussion"
18468 \begin_layout Standard
18469 Having said that, we encourage you to submit any interesting templates that
18474 \begin_layout Standard
18475 The external templates are defined in the
18476 \begin_inset Flex CharStyle:Code
18479 \begin_layout Plain Layout
18480 LyXDir/lib/external_templates
18486 You can place your own version in
18487 \begin_inset Flex CharStyle:Code
18490 \begin_layout Plain Layout
18491 UserDir/external_templates
18499 \begin_layout Standard
18500 A typical template looks like this:
18503 \begin_layout LyX-Code
18507 \begin_layout LyX-Code
18508 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
18511 \begin_layout LyX-Code
18515 \begin_layout LyX-Code
18519 \begin_layout LyX-Code
18523 \begin_layout LyX-Code
18527 \begin_layout LyX-Code
18531 \begin_layout LyX-Code
18532 AutomaticProduction true
18535 \begin_layout LyX-Code
18539 \begin_layout LyX-Code
18543 \begin_layout LyX-Code
18547 \begin_layout LyX-Code
18548 TransformCommand Rotate RotationLatexCommand
18551 \begin_layout LyX-Code
18552 TransformCommand Resize ResizeLatexCommand
18555 \begin_layout LyX-Code
18556 Product "$$RotateFront$$ResizeFront
18559 \begin_layout LyX-Code
18564 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
18567 \begin_layout LyX-Code
18568 $$ResizeBack$$RotateBack"
18571 \begin_layout LyX-Code
18575 \begin_layout LyX-Code
18576 UpdateResult "$$AbsPath$$Basename.pstex_t"
18579 \begin_layout LyX-Code
18580 Requirement "graphicx"
18583 \begin_layout LyX-Code
18584 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
18587 \begin_layout LyX-Code
18588 ReferencedFile latex "$$AbsPath$$Basename.eps"
18591 \begin_layout LyX-Code
18592 ReferencedFile dvi "$$AbsPath$$Basename.eps"
18595 \begin_layout LyX-Code
18599 \begin_layout LyX-Code
18603 \begin_layout LyX-Code
18604 TransformCommand Rotate RotationLatexCommand
18607 \begin_layout LyX-Code
18608 TransformCommand Resize ResizeLatexCommand
18611 \begin_layout LyX-Code
18612 Product "$$RotateFront$$ResizeFront
18615 \begin_layout LyX-Code
18620 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
18623 \begin_layout LyX-Code
18624 $$ResizeBack$$RotateBack"
18627 \begin_layout LyX-Code
18628 UpdateFormat pdftex
18631 \begin_layout LyX-Code
18632 UpdateResult "$$AbsPath$$Basename.pdftex_t"
18635 \begin_layout LyX-Code
18636 Requirement "graphicx"
18639 \begin_layout LyX-Code
18640 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
18643 \begin_layout LyX-Code
18644 ReferencedFile latex "$$AbsPath$$Basename.pdf"
18647 \begin_layout LyX-Code
18651 \begin_layout LyX-Code
18655 \begin_layout LyX-Code
18656 Product "$$Contents(
18658 "$$AbsPath$$Basename.asc
18663 \begin_layout LyX-Code
18664 UpdateFormat asciixfig
18667 \begin_layout LyX-Code
18668 UpdateResult "$$AbsPath$$Basename.asc"
18671 \begin_layout LyX-Code
18675 \begin_layout LyX-Code
18679 \begin_layout LyX-Code
18680 Product "<graphic fileref=
18682 "$$AbsOrRelPathMaster$$Basename.eps
18687 \begin_layout LyX-Code
18691 \begin_layout LyX-Code
18695 \begin_layout LyX-Code
18696 UpdateResult "$$AbsPath$$Basename.eps"
18699 \begin_layout LyX-Code
18700 ReferencedFile docbook "$$AbsPath$$Basename.eps"
18703 \begin_layout LyX-Code
18704 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
18707 \begin_layout LyX-Code
18711 \begin_layout LyX-Code
18712 Product "[XFig: $$FName]"
18715 \begin_layout LyX-Code
18719 \begin_layout LyX-Code
18723 \begin_layout Standard
18724 As you can see, the template is enclosed in
18725 \begin_inset Flex CharStyle:Code
18728 \begin_layout Plain Layout
18734 \SpecialChar \ldots{}
18736 \begin_inset Flex CharStyle:Code
18739 \begin_layout Plain Layout
18746 It contains a header specifying some general settings and, for each supported
18747 primary document file format, a section
18748 \begin_inset Flex CharStyle:Code
18751 \begin_layout Plain Layout
18757 \SpecialChar \ldots{}
18759 \begin_inset Flex CharStyle:Code
18762 \begin_layout Plain Layout
18771 \begin_layout Subsection
18772 The template header
18775 \begin_layout Description
18776 \begin_inset Flex CharStyle:Code
18779 \begin_layout Plain Layout
18780 AutomaticProduction
18781 \begin_inset space ~
18789 Whether the file represented by the template must be generated by LyX.
18790 This command must occur exactly once.
18793 \begin_layout Description
18794 \begin_inset Flex CharStyle:Code
18797 \begin_layout Plain Layout
18799 \begin_inset space ~
18807 A glob pattern that is used in the file dialog to filter out the desired
18809 If there is more than one possible file extension (e.
18810 \begin_inset space \thinspace{}
18814 \begin_inset space \space{}
18818 \begin_inset Flex CharStyle:Code
18821 \begin_layout Plain Layout
18828 \begin_inset Flex CharStyle:Code
18831 \begin_layout Plain Layout
18837 ), use something like
18838 \begin_inset Flex CharStyle:Code
18841 \begin_layout Plain Layout
18848 This command must occur exactly once.
18851 \begin_layout Description
18852 \begin_inset Flex CharStyle:Code
18855 \begin_layout Plain Layout
18857 \begin_inset space ~
18865 The text that is displayed on the button.
18866 This command must occur exactly once.
18869 \begin_layout Description
18870 \begin_inset Flex CharStyle:Code
18873 \begin_layout Plain Layout
18875 \begin_inset space ~
18879 \begin_inset space ~
18887 The help text that is used in the External dialog.
18888 Provide enough information to explain to the user just what the template
18889 can provide him with.
18890 This command must occur exactly once.
18893 \begin_layout Description
18894 \begin_inset Flex CharStyle:Code
18897 \begin_layout Plain Layout
18899 \begin_inset space ~
18907 The file format of the original file.
18908 This must be the name of a format that is known to LyX (see section
18909 \begin_inset CommandInset ref
18911 reference "sec:Formats"
18917 \begin_inset Quotes eld
18921 \begin_inset Flex CharStyle:Code
18924 \begin_layout Plain Layout
18931 \begin_inset Quotes erd
18934 if the template can handle original files of more than one format.
18935 LyX will attempt to interrogate the file itself in order to deduce its
18936 format in this case.
18937 This command must occur exactly once.
18940 \begin_layout Description
18941 \begin_inset Flex CharStyle:Code
18944 \begin_layout Plain Layout
18946 \begin_inset space ~
18954 A unique name for the template.
18955 It must not contain substitution macros (see below).
18958 \begin_layout Description
18959 \begin_inset Flex CharStyle:Code
18962 \begin_layout Plain Layout
18964 \begin_inset space ~
18967 Rotate|Resize|Clip|Extra
18972 This command specifies which transformations are supported by this template.
18973 It may occur zero or more times.
18974 This command enables the corresponding tabs in the external dialog.
18976 \begin_inset Flex CharStyle:Code
18979 \begin_layout Plain Layout
18985 command must have either a corresponding
18986 \begin_inset Flex CharStyle:Code
18989 \begin_layout Plain Layout
18996 \begin_inset Flex CharStyle:Code
18999 \begin_layout Plain Layout
19006 \begin_inset Flex CharStyle:Code
19009 \begin_layout Plain Layout
19016 Otherwise the transformation will not be supported by that format.
19019 \begin_layout Subsection
19023 \begin_layout Description
19024 \begin_inset Flex CharStyle:Code
19027 \begin_layout Plain Layout
19029 \begin_inset space ~
19032 LaTeX|PDFLaTeX|PlainText|DocBook
19037 The primary document file format that this format definition is for.
19038 Not every template has a sensible representation in all document file formats.
19039 Please define nevertheless a
19040 \begin_inset Flex CharStyle:Code
19043 \begin_layout Plain Layout
19049 section for all formats.
19050 Use a dummy text when no representation is available.
19051 Then you can at least see a reference to the external material in the exported
19055 \begin_layout Description
19056 \begin_inset Flex CharStyle:Code
19059 \begin_layout Plain Layout
19061 \begin_inset space ~
19065 \begin_inset space ~
19073 This command defines an additional macro
19074 \begin_inset Flex CharStyle:Code
19077 \begin_layout Plain Layout
19083 for substitution in
19084 \begin_inset Flex CharStyle:Code
19087 \begin_layout Plain Layout
19095 \begin_inset Flex CharStyle:Code
19098 \begin_layout Plain Layout
19104 itself may contain substitution macros.
19105 The advantage over using
19106 \begin_inset Flex CharStyle:Code
19109 \begin_layout Plain Layout
19116 \begin_inset Flex CharStyle:Code
19119 \begin_layout Plain Layout
19125 is that the substituted value of
19126 \begin_inset Flex CharStyle:Code
19129 \begin_layout Plain Layout
19135 is sanitized so that it is a valid optional argument in the document format.
19136 This command may occur zero or more times.
19139 \begin_layout Description
19140 \begin_inset Flex CharStyle:Code
19143 \begin_layout Plain Layout
19145 \begin_inset space ~
19153 The text that is inserted in the exported document.
19154 This is actually the most important command and can be quite complex.
19155 This command must occur exactly once.
19158 \begin_layout Description
19159 \begin_inset Flex CharStyle:Code
19162 \begin_layout Plain Layout
19164 \begin_inset space ~
19172 This command specifies a preamble snippet that will be included in the
19174 It has to be defined using
19175 \begin_inset Flex CharStyle:Code
19178 \begin_layout Plain Layout
19184 \SpecialChar \ldots{}
19186 \begin_inset Flex CharStyle:Code
19189 \begin_layout Plain Layout
19196 This command may occur zero or more times.
19199 \begin_layout Description
19200 \begin_inset Flex CharStyle:Code
19203 \begin_layout Plain Layout
19205 \begin_inset space ~
19209 \begin_inset space ~
19217 This command denotes files that are created by the conversion process and
19218 are needed for a particular export format.
19219 If the filename is relative, it is interpreted relative to the master document.
19220 This command may be given zero or more times.
19223 \begin_layout Description
19224 \begin_inset Flex CharStyle:Code
19227 \begin_layout Plain Layout
19229 \begin_inset space ~
19237 The name of a required LaTeX package.
19238 The package is included via
19239 \begin_inset Flex CharStyle:Code
19242 \begin_layout Plain Layout
19250 in the LaTeX preamble.
19251 This command may occur zero or more times.
19254 \begin_layout Description
19255 \begin_inset Flex CharStyle:Code
19258 \begin_layout Plain Layout
19260 \begin_inset space ~
19264 \begin_inset space ~
19267 RotationLatexCommand
19272 This command specifies that the built in LaTeX command should be used for
19274 This command may occur once or not at all.
19277 \begin_layout Description
19278 \begin_inset Flex CharStyle:Code
19281 \begin_layout Plain Layout
19283 \begin_inset space ~
19287 \begin_inset space ~
19295 This command specifies that the built in LaTeX command should be used for
19297 This command may occur once or not at all.
19300 \begin_layout Description
19301 \begin_inset Flex CharStyle:Code
19304 \begin_layout Plain Layout
19306 \begin_inset space ~
19310 \begin_inset space ~
19313 RotationLatexOption
19318 This command specifies that rotation is done via an optional argument.
19319 This command may occur once or not at all.
19322 \begin_layout Description
19323 \begin_inset Flex CharStyle:Code
19326 \begin_layout Plain Layout
19328 \begin_inset space ~
19332 \begin_inset space ~
19340 This command specifies that resizing is done via an optional argument.
19341 This command may occur once or not at all.
19344 \begin_layout Description
19345 \begin_inset Flex CharStyle:Code
19348 \begin_layout Plain Layout
19350 \begin_inset space ~
19354 \begin_inset space ~
19362 This command specifies that clipping is done via an optional argument.
19363 This command may occur once or not at all.
19366 \begin_layout Description
19367 \begin_inset Flex CharStyle:Code
19370 \begin_layout Plain Layout
19372 \begin_inset space ~
19376 \begin_inset space ~
19384 This command specifies that an extra optional argument is used.
19385 This command may occur once or not at all.
19388 \begin_layout Description
19389 \begin_inset Flex CharStyle:Code
19392 \begin_layout Plain Layout
19394 \begin_inset space ~
19402 The file format of the converted file.
19403 This must be the name of a format that is known to LyX (see the
19404 \begin_inset Flex CharStyle:MenuItem
19407 \begin_layout Plain Layout
19412 ools\SpecialChar \menuseparator
19417 references:Conversion
19423 This command must occur exactly once.
19426 \begin_layout Description
19427 \begin_inset Flex CharStyle:Code
19430 \begin_layout Plain Layout
19432 \begin_inset space ~
19440 The file name of the converted file.
19441 The file name must be absolute.
19442 This command must occur exactly once.
19445 \begin_layout Subsection
19446 Preamble definitions
19449 \begin_layout Standard
19450 The external template configuration file may contain additional preamble
19451 definitions enclosed by
19452 \begin_inset Flex CharStyle:Code
19455 \begin_layout Plain Layout
19461 \SpecialChar \ldots{}
19463 \begin_inset Flex CharStyle:Code
19466 \begin_layout Plain Layout
19473 They can be used by the templates in the
19474 \begin_inset Flex CharStyle:Code
19477 \begin_layout Plain Layout
19486 \begin_layout Section
19487 The substitution mechanism
19490 \begin_layout Standard
19491 When the external material facility invokes an external program, it is done
19492 on the basis of a command defined in the template configuration file.
19493 These commands can contain various macros that are expanded before execution.
19494 Execution always take place in the directory of the containing document.
19497 \begin_layout Standard
19498 Also, whenever external material is to be displayed, the name will be produced
19499 by the substitution mechanism, and most other commands in the template
19500 definition support substitution as well.
19503 \begin_layout Standard
19504 The available macros are the following:
19507 \begin_layout Description
19508 \begin_inset Flex CharStyle:Code
19511 \begin_layout Plain Layout
19512 $$AbsOrRelPathMaster
19517 The file path, absolute or relative to the master LyX document.
19520 \begin_layout Description
19521 \begin_inset Flex CharStyle:Code
19524 \begin_layout Plain Layout
19525 $$AbsOrRelPathParent
19530 The file path, absolute or relative to the LyX document.
19533 \begin_layout Description
19534 \begin_inset Flex CharStyle:Code
19537 \begin_layout Plain Layout
19543 The absolute file path.
19546 \begin_layout Description
19547 \begin_inset Flex CharStyle:Code
19550 \begin_layout Plain Layout
19556 The filename without path and without the extension.
19559 \begin_layout Description
19560 \begin_inset Flex CharStyle:Code
19563 \begin_layout Plain Layout
19565 \begin_inset Quotes eld
19569 \begin_inset Quotes erd
19577 This macro will expand to the contents of the file with the name
19578 \begin_inset Flex CharStyle:Code
19581 \begin_layout Plain Layout
19590 \begin_layout Description
19591 \begin_inset Flex CharStyle:Code
19594 \begin_layout Plain Layout
19600 The file extension (including the dot).
19603 \begin_layout Description
19604 \begin_inset Flex CharStyle:Code
19607 \begin_layout Plain Layout
19613 The filename of the file specified in the external material dialog.
19614 This is either an absolute name, or it is relative to the LyX document.
19617 \begin_layout Description
19618 \begin_inset Flex CharStyle:Code
19621 \begin_layout Plain Layout
19628 \begin_inset Flex CharStyle:Code
19631 \begin_layout Plain Layout
19637 (absolute name or relative to the LyX document).
19640 \begin_layout Description
19641 \begin_inset Flex CharStyle:Code
19644 \begin_layout Plain Layout
19650 The file path, relative to the master LyX document.
19653 \begin_layout Description
19654 \begin_inset Flex CharStyle:Code
19657 \begin_layout Plain Layout
19663 The file path, relative to the LyX document.
19666 \begin_layout Description
19667 \begin_inset Flex CharStyle:Code
19670 \begin_layout Plain Layout
19676 This macro will expand to the absolute path of the system directory.
19677 This is typically used to point to the various helper scripts that are
19681 \begin_layout Description
19682 \begin_inset Flex CharStyle:Code
19685 \begin_layout Plain Layout
19691 A name and full path to a temporary file which will be automatically deleted
19692 whenever the containing document is closed, or the external material insertion
19696 \begin_layout Standard
19697 All path macros contain a trailing directory separator, so you can construct
19699 \begin_inset space \thinspace{}
19703 \begin_inset space \space{}
19706 the absolute filename with
19707 \begin_inset Flex CharStyle:Code
19710 \begin_layout Plain Layout
19711 $$AbsPath$$Basename$$Extension
19719 \begin_layout Standard
19720 The macros above are substituted in all commands unless otherwise noted.
19722 \begin_inset Flex CharStyle:Code
19725 \begin_layout Plain Layout
19731 supports additionally the following substitutions if they are enabled by
19733 \begin_inset Flex CharStyle:Code
19736 \begin_layout Plain Layout
19743 \begin_inset Flex CharStyle:Code
19746 \begin_layout Plain Layout
19755 \begin_layout Description
19756 \begin_inset Flex CharStyle:Code
19759 \begin_layout Plain Layout
19765 The front part of the resize command.
19768 \begin_layout Description
19769 \begin_inset Flex CharStyle:Code
19772 \begin_layout Plain Layout
19778 The back part of the resize command.
19781 \begin_layout Description
19782 \begin_inset Flex CharStyle:Code
19785 \begin_layout Plain Layout
19791 The front part of the rotation command.
19794 \begin_layout Description
19795 \begin_inset Flex CharStyle:Code
19798 \begin_layout Plain Layout
19804 The back part of the rotation command.
19807 \begin_layout Standard
19808 The value string of the
19809 \begin_inset Flex CharStyle:Code
19812 \begin_layout Plain Layout
19818 command supports additionally the following substitutions if they are enabled
19820 \begin_inset Flex CharStyle:Code
19823 \begin_layout Plain Layout
19830 \begin_inset Flex CharStyle:Code
19833 \begin_layout Plain Layout
19842 \begin_layout Description
19843 \begin_inset Flex CharStyle:Code
19846 \begin_layout Plain Layout
19855 \begin_layout Description
19856 \begin_inset Flex CharStyle:Code
19859 \begin_layout Plain Layout
19868 \begin_layout Description
19869 \begin_inset Flex CharStyle:Code
19872 \begin_layout Plain Layout
19881 \begin_layout Description
19882 \begin_inset Flex CharStyle:Code
19885 \begin_layout Plain Layout
19891 The rotation option.
19894 \begin_layout Standard
19895 You may ask why there are so many path macros.
19896 There are mainly two reasons:
19899 \begin_layout Enumerate
19900 Relative and absolute file names should remain relative or absolute, respectivel
19902 Users may have reasons to prefer either form.
19903 Relative names are useful for portable documents that should work on different
19904 machines, for example.
19905 Absolute names may be required by some programs.
19908 \begin_layout Enumerate
19909 LaTeX treats relative file names differently than LyX and other programs
19910 in nested included files.
19911 For LyX, a relative file name is always relative to the document that contains
19913 For LaTeX, it is always relative to the master document.
19914 These two definitions are identical if you have only one document, but
19915 differ if you have a master document that includes part documents.
19916 That means that relative filenames must be transformed when presented to
19918 Fortunately LyX does this automatically for you if you choose the right
19922 \begin_layout Standard
19923 So which path macro should be used in new template definitions? The rule
19927 \begin_layout Itemize
19929 \begin_inset Flex CharStyle:Code
19932 \begin_layout Plain Layout
19938 if an absolute path is required.
19941 \begin_layout Itemize
19943 \begin_inset Flex CharStyle:Code
19946 \begin_layout Plain Layout
19947 $$AbsOrRelPathMaster
19952 if the substituted string is some kind of LaTeX input.
19955 \begin_layout Itemize
19957 \begin_inset Flex CharStyle:Code
19960 \begin_layout Plain Layout
19961 $$AbsOrRelPathParent
19966 in order to preserve the user's choice.
19969 \begin_layout Standard
19970 There are special cases where this rule does not work and e.
19971 \begin_inset space \thinspace{}
19975 \begin_inset space \space{}
19978 relative names are needed, but normally it will work just fine.
19979 One example for such a case is the command
19980 \begin_inset Flex CharStyle:Code
19983 \begin_layout Plain Layout
19984 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
19989 in the XFig template above: We can't use the absolute name because the
19991 \begin_inset Flex CharStyle:Code
19994 \begin_layout Plain Layout
20000 files needs the relative name in order to rewrite the file content.
20003 \begin_layout Section
20004 Security discussion
20005 \begin_inset CommandInset label
20007 name "sec:Security-discussion"
20014 \begin_layout Standard
20015 The external material feature interfaces with a lot of external programs
20016 and does so automatically, so we have to consider the security implications
20018 In particular, since you have the option of including your own filenames
20019 and/or parameter strings and those are expanded into a command, it seems
20020 that it would be possible to create a malicious document which executes
20021 arbitrary commands when a user views or prints the document.
20022 This is something we definitely want to avoid.
20025 \begin_layout Standard
20026 However, since the external program commands are specified in the template
20027 configuration file only, there are no security issues if LyX is properly
20028 configured with safe templates only.
20029 This is so because the external programs are invoked with the
20030 \begin_inset Flex CharStyle:Code
20033 \begin_layout Plain Layout
20039 -system call rather than the
20040 \begin_inset Flex CharStyle:Code
20043 \begin_layout Plain Layout
20049 system-call, so it's not possible to execute arbitrary commands from the
20050 filename or parameter section via the shell.
20053 \begin_layout Standard
20054 This also implies that you are restricted in what command strings you can
20055 use in the external material templates.
20056 In particular, pipes and redirection are not readily available.
20057 This has to be so if LyX should remain safe.
20058 If you want to use some of the shell features, you should write a safe
20059 script to do this in a controlled manner, and then invoke the script from
20060 the command string.
20064 \begin_layout Standard
20065 It is possible to design a template that interacts directly with the shell,
20066 but since this would allow a malicious user to execute arbitrary commands
20067 by writing clever filenames and/or parameters, we generally recommend that
20068 you only use safe scripts that work with the
20069 \begin_inset Flex CharStyle:Code
20072 \begin_layout Plain Layout
20078 system call in a controlled manner.
20079 Of course, for use in a controlled environment, it can be tempting to just
20080 fall back to use ordinary shell scripts.
20081 If you do so, be aware that you
20085 provide an easily exploitable security hole in your system.
20086 Of course it stands to reason that such unsafe templates will never be
20087 included in the standard LyX distribution, although we do encourage people
20088 to submit new templates in the open source tradition.
20089 But LyX as shipped from the official distribution channels will never have
20093 \begin_layout Standard
20094 Including external material provides a lot of power, and you have to be
20095 careful not to introduce security hazards with this power.
20096 A subtle error in a single line in an innocent looking script can open
20097 the door to huge security problems.
20098 So if you do not fully understand the issues, we recommend that you consult
20099 a knowledgeable security professional or the LyX development team if you
20100 have any questions about whether a given template is safe or not.
20101 And do this before you use it in an uncontrolled environment.