1 #LyX 2.0.0svn created this file. For more info see http://www.lyx.org/
7 % DO NOT ALTER THIS PREAMBLE!!!
9 % This preamble is designed to ensure that this document prints
10 % out as advertised. If you mess with this preamble,
11 % parts of this document may not print out as expected. If you
12 % have problems LaTeXing this file, please contact
13 % the documentation team
14 % email: lyx-docs@lists.lyx.org
16 \usepackage{ifpdf} % part of the hyperref bundle
17 \ifpdf % if pdflatex is used
19 % set fonts for nicer pdf view
20 \IfFileExists{lmodern.sty}
21 {\usepackage{lmodern}}{}
23 \fi % end if pdflatex is used
25 % the pages of the TOC is numbered roman
26 % and a pdf-bookmark for the TOC is added
27 \let\myTOC\tableofcontents
28 \renewcommand\tableofcontents{%
30 \pdfbookmark[1]{\contentsname}{}
34 % redefine the \LyX macro for PDF bookmarks
35 \def\LyX{\texorpdfstring{%
36 L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
39 % used for multi-column text
43 \options fleqn,liststotoc,bibtotoc,idxtotoc,BCOR7.5mm,titlepage,tablecaptionabove
44 \use_default_options false
48 \maintain_unincluded_children false
51 InsetLayout CharStyle:MenuItem
60 \newcommand*{\menuitem}[1]{{\sffamily #1}}
69 \font_typewriter default
70 \font_default_family default
78 \default_output_format default
79 \bibtex_command default
80 \index_command default
84 \pdf_title "LyX Configuration Manual"
85 \pdf_author "LyX Team"
86 \pdf_subject "LyX-documentation Customization"
87 \pdf_keywords "LyX, documentation, customization"
89 \pdf_bookmarksnumbered true
90 \pdf_bookmarksopen true
91 \pdf_bookmarksopenlevel 1
96 \pdf_pdfusetitle false
97 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true,pdfstartview=XYZ, plainpages=false, pdfpagelabels"
106 \paperorientation portrait
119 \paragraph_separation indent
120 \paragraph_indentation default
121 \quotes_language english
124 \paperpagestyle headings
125 \tracking_changes false
126 \output_changes false
129 \html_math_img_scale 1
130 \html_latex_start "<span class='latex'>"
131 \html_latex_end "</span>"
137 Customizing LyX: Features for the Advanced User
145 \begin_layout Plain Layout
147 If you have comments or error corrections, please send them to the LyX Documenta
149 \begin_inset CommandInset href
151 target "lyx-docs@lists.lyx.org"
158 \begin_inset Quotes eld
162 \begin_inset Quotes erd
165 in the subject header, and please cc the current maintainer of this file,
166 Richard Heck <rgheck@comcast.net>.
172 \begin_inset Newline newline
176 \begin_inset Newline newline
182 \begin_layout Standard
183 \begin_inset CommandInset toc
184 LatexCommand tableofcontents
191 \begin_layout Standard
192 \begin_inset Note Note
195 \begin_layout Plain Layout
196 Please use change tracking when modifying this document.
197 This makes it easier for our translators to recognize things that have
198 been changed, and it helps the maintainer keep up-to-date with what's been
207 \begin_layout Chapter
211 \begin_layout Standard
212 This manual covers the customization features present in LyX.
213 In it, we discuss issues like keyboard shortcuts, screen previewing options,
214 printer options, sending commands to LyX via the LyX Server, internationalizati
215 on, installing new LaTeX classes and LyX layouts, etc.
216 We can't possibly hope to touch on everything you can change—our developers
217 add new features faster than we can document them—but we will explain the
218 most common customizations and hopefully point you in the right direction
219 for some of the more obscure ones.
222 \begin_layout Standard
223 \begin_inset Branch OutDated
226 \begin_layout Standard
227 Information from previous versions of this document that now seems to be
228 outdated is contained in the OutDated branch of this document.
229 By default, this information will not appear in the LaTeX output.
237 \begin_layout Chapter
238 LyX configuration files
241 \begin_layout Standard
242 This chapter aims to help you to find your way through the LyX configuration
244 Before continuing to read this chapter, you should find out where your
245 LyX library and user directories are by using
246 \begin_inset Flex CharStyle:MenuItem
249 \begin_layout Plain Layout
250 Help\SpecialChar \menuseparator
261 The library directory is the place where LyX places its system-wide configurati
262 on files; the user directory is where you can place your modified versions.
263 We will call the former
264 \begin_inset Flex CharStyle:Code
267 \begin_layout Plain Layout
274 \begin_inset Flex CharStyle:MenuItem
277 \begin_layout Plain Layout
283 in the remainder of this document.
287 \begin_layout Section
289 \begin_inset Flex CharStyle:Code
292 \begin_layout Plain Layout
301 \begin_layout Standard
302 \begin_inset Flex CharStyle:Code
305 \begin_layout Plain Layout
311 and its sub-directories contain a number of files and that can be used
312 to customize LyX's behavior.
313 You can change many of these files from within LyX itself through the
314 \begin_inset Flex CharStyle:MenuItem
317 \begin_layout Plain Layout
318 Tools\SpecialChar \menuseparator
325 Most customization that you will want to do in LyX is possible through
327 However, many other inner aspects of LyX can be customized by modifying
329 \begin_inset Flex CharStyle:Code
332 \begin_layout Plain Layout
339 These files fall in different categories, described in the following subsection
343 \begin_layout Subsection
344 Automatically generated files
347 \begin_layout Standard
348 The files, which are to be found in
349 \begin_inset Flex CharStyle:MenuItem
352 \begin_layout Plain Layout
358 , are generated when you configure LyX.
359 They contain various default values that are guessed by inspection.
360 In general, it is not a good idea to modify them, since they might be overwritt
364 \begin_layout Labeling
365 \labelwidthstring 00.00.0000
366 \begin_inset Flex CharStyle:Code
369 \begin_layout Plain Layout
375 contains defaults for various commands.
378 \begin_layout Labeling
379 \labelwidthstring 00.00.0000
380 \begin_inset Flex CharStyle:Code
383 \begin_layout Plain Layout
389 contains the list of packages that have been recognized by LyX.
390 It is currently unused by the LyX program itself, but the information extracted
391 , and more, is made available with
392 \begin_inset Flex CharStyle:MenuItem
395 \begin_layout Plain Layout
396 Help\SpecialChar \menuseparator
409 \begin_layout Labeling
410 \labelwidthstring 00.00.0000
411 \begin_inset Flex CharStyle:Code
414 \begin_layout Plain Layout
420 the list of text classes that have been found in your
421 \begin_inset Flex CharStyle:Code
424 \begin_layout Plain Layout
430 directories, along with the associated LaTeX document class and their descripti
434 \begin_layout Labeling
435 \labelwidthstring 00.00.0000
436 \begin_inset Flex CharStyle:Code
439 \begin_layout Plain Layout
445 the list of layout modules found in your
446 \begin_inset Flex CharStyle:Code
449 \begin_layout Plain Layout
458 \begin_layout Labeling
459 \labelwidthstring 00.00.0000
460 \begin_inset Flex CharStyle:Code
463 \begin_layout Plain Layout
469 lists of various sorts of LaTeX-related files found on your system
472 \begin_layout Labeling
473 \labelwidthstring 00.00.0000
474 \begin_inset Flex CharStyle:Code
477 \begin_layout Plain Layout
483 is automatically generated during configuration from the file
484 \begin_inset Flex CharStyle:Code
487 \begin_layout Plain Layout
494 It contains information on your LaTeX configuration.
497 \begin_layout Subsection
501 \begin_layout Standard
502 These directories are duplicated between
503 \begin_inset Flex CharStyle:Code
506 \begin_layout Plain Layout
513 \begin_inset Flex CharStyle:Code
516 \begin_layout Plain Layout
523 If a particular files exists in both places, the one in
524 \begin_inset Flex CharStyle:Code
527 \begin_layout Plain Layout
536 \begin_layout Labeling
537 \labelwidthstring 00.00.0000
538 \begin_inset Flex CharStyle:Code
541 \begin_layout Plain Layout
547 this directory contains files with the extension
548 \begin_inset Flex CharStyle:Code
551 \begin_layout Plain Layout
557 that define the keybindings used in LyX.
558 If there exists an internationalized version of the bind file named
559 \begin_inset Flex CharStyle:Code
562 \begin_layout Plain Layout
568 , that will be used first.
571 \begin_layout Labeling
572 \labelwidthstring 00.00.0000
573 \begin_inset Flex CharStyle:Code
576 \begin_layout Plain Layout
582 contains graphics files that can be included in documents.
586 \begin_layout Labeling
587 \labelwidthstring 00.00.0000
588 \begin_inset Flex CharStyle:Code
591 \begin_layout Plain Layout
597 contains LyX documentation files (including the one you are currently reading).
599 \begin_inset Flex CharStyle:Code
602 \begin_layout Plain Layout
608 deserves special attention, as noted above.
609 The internationalized help docs are in subdirectories
610 \begin_inset Flex CharStyle:Code
613 \begin_layout Plain Layout
620 \begin_inset Quotes eld
624 \begin_inset Quotes erd
627 is the ISO language code.
633 \begin_inset CommandInset ref
635 reference "cha:Internationalizing-LyX"
642 \begin_layout Labeling
643 \labelwidthstring 00.00.0000
644 \begin_inset Flex CharStyle:Code
647 \begin_layout Plain Layout
653 contains example files that explain how to use some features.
654 In the file browser, press the
655 \begin_inset Flex CharStyle:MenuItem
658 \begin_layout Plain Layout
667 \begin_layout Labeling
668 \labelwidthstring 00.00.0000
669 \begin_inset Flex CharStyle:Code
672 \begin_layout Plain Layout
678 contains image files that are used by the
679 \begin_inset Flex CharStyle:MenuItem
682 \begin_layout Plain Layout
689 In addition, it also contains the individual icons used in the toolbar
690 and the banners that can be shown when LyX is launched.
693 \begin_layout Labeling
694 \labelwidthstring 00.00.0000
695 \begin_inset Flex CharStyle:Code
698 \begin_layout Plain Layout
704 contains keyboard keymapping files.
710 \begin_inset CommandInset ref
712 reference "sec:International-Keymap-Stuff"
719 \begin_layout Labeling
720 \labelwidthstring 00.00.0000
721 \begin_inset Flex CharStyle:Code
724 \begin_layout Plain Layout
730 contains the text class and module files described in Chapter
735 \begin_inset CommandInset ref
737 reference "cha:Installing-New-Document"
744 \begin_layout Labeling
745 \labelwidthstring 00.00.0000
746 \begin_inset Flex CharStyle:Code
749 \begin_layout Plain Layout
756 \begin_inset Flex CharStyle:Code
759 \begin_layout Plain Layout
765 Python scripts used to convert between LyX versions.
766 These can be run from the command line if, say, you want to batch-convert
770 \begin_layout Labeling
771 \labelwidthstring 00.00.0000
772 \begin_inset Flex CharStyle:Code
775 \begin_layout Plain Layout
781 contains some files that demonstrate the capabilities of the
782 \begin_inset Flex CharStyle:MenuItem
785 \begin_layout Plain Layout
796 Also contains some scripts used by LyX itself.
799 \begin_layout Labeling
800 \labelwidthstring 00.00.0000
801 \begin_inset Flex CharStyle:Code
804 \begin_layout Plain Layout
810 contains the standard LyX template files described in Chapter
815 \begin_inset CommandInset ref
817 reference "sub:Creating-Templates"
824 \begin_layout Labeling
825 \labelwidthstring 00.00.0000
826 \begin_inset Flex CharStyle:Code
829 \begin_layout Plain Layout
835 contains files with the extension
836 \begin_inset Flex CharStyle:Code
839 \begin_layout Plain Layout
845 that define the user interface to LyX.
846 That is, the files define which items appear in which menus and the items
847 appearing on the toolbar.
850 \begin_layout Subsection
851 Files you don't want to modify
854 \begin_layout Standard
855 These files are used internally by LyX and you generally do not need to
856 modify them unless you are a developer.
859 \begin_layout Labeling
860 \labelwidthstring 00.00.0000
861 \begin_inset Flex CharStyle:Code
864 \begin_layout Plain Layout
870 this file contains the list of LyX developers.
871 The contents are displayed with the menu entry
872 \begin_inset Flex CharStyle:MenuItem
875 \begin_layout Plain Layout
876 Help\SpecialChar \menuseparator
889 \begin_layout Labeling
890 \labelwidthstring 00.00.0000
891 \begin_inset Flex CharStyle:Code
894 \begin_layout Plain Layout
900 this is a LaTeX script used during the configuration process.
904 \begin_layout Labeling
905 \labelwidthstring 00.00.0000
906 \begin_inset Flex CharStyle:Code
909 \begin_layout Plain Layout
915 this is the script that is used to re-configure LyX.
916 It creates configuration files in the directory it was run from.
919 \begin_layout Subsection
920 Other files needing a line or two...
923 \begin_layout Labeling
924 \labelwidthstring 00.00.0000
925 \begin_inset Flex CharStyle:Code
928 \begin_layout Plain Layout
934 this contains tables describing how different character encodings can be
938 \begin_layout Labeling
939 \labelwidthstring 00.00.0000
940 \begin_inset Flex CharStyle:Code
943 \begin_layout Plain Layout
949 this file contains the templates available to the new
950 \begin_inset Flex CharStyle:MenuItem
953 \begin_layout Plain Layout
966 \begin_layout Labeling
967 \labelwidthstring 00.00.0000
968 \begin_inset Flex CharStyle:Code
971 \begin_layout Plain Layout
977 this file contains a list of all the languages currently supported by LyX.
980 \begin_layout Section
981 Your local configuration directory
984 \begin_layout Standard
985 Even if you are using LyX as an unprivileged user, you might want to change
986 LyX configuration for your own use.
988 \begin_inset Flex CharStyle:Code
991 \begin_layout Plain Layout
997 directory contains all your personal configuration files.
998 This is the directory described as
999 \begin_inset Quotes eld
1003 \begin_inset Quotes erd
1007 \begin_inset Flex CharStyle:MenuItem
1010 \begin_layout Plain Layout
1011 Help\SpecialChar \menuseparator
1013 \begin_inset space ~
1022 This directory is used as a mirror of
1023 \begin_inset Flex CharStyle:Code
1026 \begin_layout Plain Layout
1032 , which means that every file in
1033 \begin_inset Flex CharStyle:Code
1036 \begin_layout Plain Layout
1042 is a replacement for the corresponding file in
1043 \begin_inset Flex CharStyle:Code
1046 \begin_layout Plain Layout
1053 Any configuration file described in the above sections can be placed either
1054 in the system-wide directory, in which case it will affect all users, or
1055 in your local directory for your own use.
1058 \begin_layout Standard
1059 To make things clearer, let's provide a few examples:
1062 \begin_layout Itemize
1063 The preferences set in the
1064 \begin_inset Flex CharStyle:MenuItem
1067 \begin_layout Plain Layout
1068 Tools\SpecialChar \menuseparator
1074 dialog are saved to a file
1075 \begin_inset Flex CharStyle:Code
1078 \begin_layout Plain Layout
1085 \begin_inset Flex CharStyle:Code
1088 \begin_layout Plain Layout
1097 \begin_layout Itemize
1098 When you reconfigure using
1099 \begin_inset Flex CharStyle:MenuItem
1102 \begin_layout Plain Layout
1103 Tools\SpecialChar \menuseparator
1110 \begin_inset Flex CharStyle:Code
1113 \begin_layout Plain Layout
1119 script, and the resulting files are written in your local configuration
1121 This means that any additional text class file that you might have added
1123 \begin_inset Flex CharStyle:Code
1126 \begin_layout Plain Layout
1132 will be added to the list of classes in the
1133 \begin_inset Flex CharStyle:MenuItem
1136 \begin_layout Plain Layout
1137 Document\SpecialChar \menuseparator
1146 \begin_layout Itemize
1147 If you get some updated documentation from LyX ftp site and cannot install
1148 it because you do not have sysadmin rights on your system, you can just
1150 \begin_inset Flex CharStyle:Code
1153 \begin_layout Plain Layout
1159 and the items in the
1160 \begin_inset Flex CharStyle:MenuItem
1163 \begin_layout Plain Layout
1169 menu will open them!
1172 \begin_layout Section
1173 Running LyX with multiple configurations
1176 \begin_layout Standard
1177 The configuration freedom of the local configuration directory may not suffice
1178 if you want to have more than one configuration at your disposal.
1179 For example, you may want to be use different key bindings or printer settings
1181 You can achieve this by having several such directories.
1182 You then specify which directory to use at run-time.
1185 \begin_layout Standard
1186 Invoking LyX with the command line switch
1187 \begin_inset Flex CharStyle:Code
1190 \begin_layout Plain Layout
1200 instructs the program to read the configuration from that directory, and
1201 not from the default directory.
1202 (You can determine the default directory by running LyX without the
1203 \begin_inset Flex CharStyle:Code
1206 \begin_layout Plain Layout
1212 switch.) If the specified directory does not exist, LyX offers to create
1213 it for you, just like it does for the default directory on the first time
1214 you run the program.
1215 You can modify the configuration options in this additional user directory
1216 exactly as you would for the default directory.
1217 These directories are completely independent (but read on).
1218 Note that setting the environment variable
1219 \begin_inset Flex CharStyle:Code
1222 \begin_layout Plain Layout
1228 to some value has exactly the same effect.
1231 \begin_layout Standard
1232 Having several configurations also requires more maintenance: if you want
1233 to add a new layout to
1234 \begin_inset Flex CharStyle:Code
1237 \begin_layout Plain Layout
1243 which you want available from all your configurations, you must add it
1244 to each directory separately.
1245 You can avoid this with the following trick: after LyX creates the additional
1246 directory, most of the subdirectories (see above) are empty.
1247 If you want the new configuration to mirror an existing one, replace the
1248 empty subdirectory with a symbolic link to the matching subdirectory in
1249 the existing configuration.
1251 \begin_inset Flex CharStyle:Code
1254 \begin_layout Plain Layout
1260 subdirectory, however, since it contains a file written by the configuration
1261 script (also accessible through
1262 \begin_inset Flex CharStyle:MenuItem
1265 \begin_layout Plain Layout
1266 Tools\SpecialChar \menuseparator
1272 ) which is configuration-specific.
1275 \begin_layout Chapter
1276 The Preferences dialog
1279 \begin_layout Standard
1280 All options of the preferences dialog are described in the Appendix
1282 The Preferences Dialog
1289 For some options you might find here more details.
1292 \begin_layout Section
1294 \begin_inset CommandInset label
1303 \begin_layout Standard
1304 The first step is to define your file formats if they are not already defined.
1306 \begin_inset Flex CharStyle:MenuItem
1309 \begin_layout Plain Layout
1310 Tools\SpecialChar \menuseparator
1318 \begin_inset Flex CharStyle:MenuItem
1321 \begin_layout Plain Layout
1322 File Handling\SpecialChar \menuseparator
1329 \begin_inset Flex CharStyle:MenuItem
1332 \begin_layout Plain Layout
1333 New\SpecialChar \ldots{}
1339 button to define your new format.
1341 \begin_inset Flex CharStyle:MenuItem
1344 \begin_layout Plain Layout
1350 field contains the name used to identify the format in the GUI.
1352 \begin_inset Flex CharStyle:MenuItem
1355 \begin_layout Plain Layout
1361 is used to identify the format internally.
1362 You will also need to enter a file extension.
1363 These are all required.
1365 \begin_inset Flex CharStyle:MenuItem
1368 \begin_layout Plain Layout
1374 field is used to provide a keyboard shortcut on the menus.
1375 (For example, pressing
1376 \begin_inset Flex CharStyle:MenuItem
1379 \begin_layout Plain Layout
1386 \begin_inset Flex CharStyle:MenuItem
1389 \begin_layout Plain Layout
1390 View\SpecialChar \menuseparator
1399 \begin_layout Standard
1401 \begin_inset Flex CharStyle:MenuItem
1404 \begin_layout Plain Layout
1411 \begin_inset Flex CharStyle:MenuItem
1414 \begin_layout Plain Layout
1421 For example, you might want to use
1422 \begin_inset Flex CharStyle:MenuItem
1425 \begin_layout Plain Layout
1431 to view PostScript files.
1432 You can enter the command needed to start the program in the corresponding
1434 In defining this command, you can use the four variables listed in the
1436 The viewer is launched when you view an image in LyX or use the
1437 \begin_inset Flex CharStyle:MenuItem
1440 \begin_layout Plain Layout
1447 The editor is for example launched when you right-click on an image and
1449 \begin_inset Flex CharStyle:MenuItem
1452 \begin_layout Plain Layout
1458 in the appearing context menu.
1461 \begin_layout Standard
1463 \begin_inset Flex CharStyle:MenuItem
1466 \begin_layout Plain Layout
1472 option tells LyX that a format is suitable for document export.
1473 If this is set and if a suitable conversion route exists (see sec.
1474 \begin_inset space \thinspace{}
1478 \begin_inset CommandInset ref
1480 reference "sec:Converters"
1484 ), the format will appear in the
1485 \begin_inset Flex CharStyle:MenuItem
1488 \begin_layout Plain Layout
1489 File\SpecialChar \menuseparator
1496 The format will also appear in the
1497 \begin_inset Flex CharStyle:MenuItem
1500 \begin_layout Plain Layout
1506 menu if a viewer is specified for the format.
1507 Pure image formats, such as
1508 \begin_inset Flex CharStyle:Code
1511 \begin_layout Plain Layout
1517 , should not use this option.
1518 Formats that can both represent vector graphics and documents like
1519 \begin_inset Flex CharStyle:Code
1522 \begin_layout Plain Layout
1531 \begin_layout Standard
1533 \begin_inset Flex CharStyle:MenuItem
1536 \begin_layout Plain Layout
1537 Vector graphics format
1542 tells LyX that a format can contain vector graphics.
1543 This information is used to determine the target format of included graphics
1545 \begin_inset Flex CharStyle:MenuItem
1548 \begin_layout Plain Layout
1555 Included graphics may need to be converted to either
1556 \begin_inset Flex CharStyle:MenuItem
1559 \begin_layout Plain Layout
1566 \begin_inset Flex CharStyle:MenuItem
1569 \begin_layout Plain Layout
1576 \begin_inset Flex CharStyle:MenuItem
1579 \begin_layout Plain Layout
1586 \begin_inset Flex CharStyle:MenuItem
1589 \begin_layout Plain Layout
1595 cannot handle other image formats.
1596 If an included graphic is not already in
1597 \begin_inset Flex CharStyle:MenuItem
1600 \begin_layout Plain Layout
1607 \begin_inset Flex CharStyle:MenuItem
1610 \begin_layout Plain Layout
1617 \begin_inset Flex CharStyle:MenuItem
1620 \begin_layout Plain Layout
1626 format, it is converted to
1627 \begin_inset Flex CharStyle:MenuItem
1630 \begin_layout Plain Layout
1636 if the vector format option is set, and otherwise to
1637 \begin_inset Flex CharStyle:MenuItem
1640 \begin_layout Plain Layout
1649 \begin_layout Section
1653 \begin_layout Standard
1654 Since all conversions from one format to another take place in LyX's temporary
1655 directory, it is sometimes necessary to modify a file before copying it
1656 to the temporary directory in order that the conversion may be performed.
1660 \begin_layout Plain Layout
1661 For example, the file may refer to other files—images, for example—using
1662 relative file names, and these may become invalid when the file is copied
1663 to the temporary directory.
1668 This is done by a Copier: It copies a file to (or from) the temporary directory
1669 and may modify it in the process.
1672 \begin_layout Standard
1673 The definitions of the copiers may use four variables:
1676 \begin_layout Labeling
1677 \labelwidthstring 00.00.0000
1678 \begin_inset Flex CharStyle:Code
1681 \begin_layout Plain Layout
1687 The LyX system directory (e.
1688 \begin_inset space \thinspace{}
1692 \begin_inset space \space{}
1696 \begin_inset Flex CharStyle:MenuItem
1699 \begin_layout Plain Layout
1708 \begin_layout Labeling
1709 \labelwidthstring 00.00.0000
1710 \begin_inset Flex CharStyle:Code
1713 \begin_layout Plain Layout
1722 \begin_layout Labeling
1723 \labelwidthstring 00.00.0000
1724 \begin_inset Flex CharStyle:Code
1727 \begin_layout Plain Layout
1736 \begin_layout Labeling
1737 \labelwidthstring 00.00.0000
1738 \begin_inset Flex CharStyle:Code
1741 \begin_layout Plain Layout
1750 \begin_layout Standard
1751 The latter should be the filename as it would be used in a LaTeX's
1758 It is relevant only when exporting files suitable for such inclusion.
1761 \begin_layout Standard
1762 Copiers can be used to do almost anything with output files.
1763 For example, suppose you want generated pdf files to be copied to a special
1765 \begin_inset Flex CharStyle:Code
1768 \begin_layout Plain Layout
1775 Then you could write a shell script such as this one:
1778 \begin_layout Standard
1779 \begin_inset listings
1783 \begin_layout Plain Layout
1788 \begin_layout Plain Layout
1793 \begin_layout Plain Layout
1795 TOFILE=`basename $2`
1798 \begin_layout Plain Layout
1800 cp $FROMFILE /home/you/pdf/$TOFILE
1805 Save it in your local LyX directory—say,
1806 \begin_inset Flex CharStyle:Code
1809 \begin_layout Plain Layout
1810 /home/you/.lyx/scripts/pdfcopier.sh
1815 —and make it executable, if you need to do so on your platform.
1817 \begin_inset Flex CharStyle:MenuItem
1820 \begin_layout Plain Layout
1821 Tools\SpecialChar \menuseparator
1827 dialog, select under
1828 \begin_inset Flex CharStyle:MenuItem
1831 \begin_layout Plain Layout
1832 File Handling\SpecialChar \menuseparator
1839 \begin_inset Flex CharStyle:MenuItem
1842 \begin_layout Plain Layout
1848 format—or one of the other pdf formats—and enter
1849 \begin_inset Flex CharStyle:Code
1852 \begin_layout Plain Layout
1853 pdfcopier.sh $$i $$o
1859 \begin_inset Flex CharStyle:MenuItem
1862 \begin_layout Plain Layout
1872 \begin_layout Standard
1873 Copiers are used by LyX in various of its own conversions.
1874 For example, if appropriate programs are found, LyX will automatically
1875 install copiers for the
1876 \begin_inset Flex CharStyle:MenuItem
1879 \begin_layout Plain Layout
1886 \begin_inset Flex CharStyle:MenuItem
1889 \begin_layout Plain Layout
1891 \begin_inset space ~
1900 When these formats are exported, the copier sees that not just the main
1901 HTML file but various associated files (style files, images, etc.) are also
1903 All these files are written to a subdirectory of the directory in which
1904 the original LyX file was found.
1908 \begin_layout Plain Layout
1909 This copier can be customized.
1911 \begin_inset Quotes eld
1915 \begin_inset Quotes erd
1918 argument takes a comma-separated list of extensions to be copied; if it
1919 is omitted, all files will be copied.
1921 \begin_inset Quotes eld
1925 \begin_inset Quotes erd
1928 argument determines the extension added to the generated directory.
1930 \begin_inset Quotes eld
1934 \begin_inset Flex CharStyle:MenuItem
1937 \begin_layout Plain Layout
1944 \begin_inset Quotes erd
1947 , so HTML generated from
1948 \begin_inset Flex CharStyle:MenuItem
1951 \begin_layout Plain Layout
1952 /path/to/filename.lyx
1958 \begin_inset Flex CharStyle:MenuItem
1961 \begin_layout Plain Layout
1962 /path/to/filename.html.LyXconv
1976 \begin_layout Section
1978 \begin_inset CommandInset label
1980 name "sec:Converters"
1987 \begin_layout Standard
1988 You can define your own Converters to convert files between different formats.
1990 \begin_inset Flex CharStyle:MenuItem
1993 \begin_layout Plain Layout
1994 Tools\SpecialChar \menuseparator
1995 Preferences\SpecialChar \menuseparator
1996 File Handling\SpecialChar \menuseparator
2005 \begin_layout Standard
2006 To define a new converter, select the
2007 \begin_inset Flex CharStyle:MenuItem
2010 \begin_layout Plain Layout
2012 \begin_inset space ~
2021 \begin_inset Flex CharStyle:MenuItem
2024 \begin_layout Plain Layout
2026 \begin_inset space ~
2034 from the drop-down lists, enter the command needed for the conversion,
2036 \begin_inset Flex CharStyle:MenuItem
2039 \begin_layout Plain Layout
2046 Several variables can be used in the definition of converters:
2049 \begin_layout Labeling
2050 \labelwidthstring 00.00.0000
2051 \begin_inset Flex CharStyle:Code
2054 \begin_layout Plain Layout
2060 The LyX system directory
2063 \begin_layout Labeling
2064 \labelwidthstring 00.00.0000
2065 \begin_inset Flex CharStyle:Code
2068 \begin_layout Plain Layout
2077 \begin_layout Labeling
2078 \labelwidthstring 00.00.0000
2079 \begin_inset Flex CharStyle:Code
2082 \begin_layout Plain Layout
2091 \begin_layout Labeling
2092 \labelwidthstring 00.00.0000
2093 \begin_inset Flex CharStyle:Code
2096 \begin_layout Plain Layout
2102 The base filename of the input file (i.
2103 \begin_inset space \thinspace{}
2106 g., without the extension)
2109 \begin_layout Labeling
2110 \labelwidthstring 00.00.0000
2111 \begin_inset Flex CharStyle:Code
2114 \begin_layout Plain Layout
2120 The path to the input file
2123 \begin_layout Labeling
2124 \labelwidthstring 00.00.0000
2125 \begin_inset Flex CharStyle:Code
2128 \begin_layout Plain Layout
2134 The path to the original input file (this is different from $$p when a
2135 chain of converters is called).
2138 \begin_layout Standard
2140 \begin_inset Flex CharStyle:MenuItem
2143 \begin_layout Plain Layout
2145 \begin_inset space ~
2153 field you can enter the following flags, separated by commas:
2156 \begin_layout Labeling
2157 \labelwidthstring 00.00.0000
2158 \begin_inset Flex CharStyle:Code
2161 \begin_layout Plain Layout
2167 This converter runs some form of LaTeX.
2168 This will make LyX's LaTeX error logs available.
2171 \begin_layout Labeling
2172 \labelwidthstring 00.00.0000
2173 \begin_inset Flex CharStyle:Code
2176 \begin_layout Plain Layout
2183 \begin_inset Flex CharStyle:MenuItem
2186 \begin_layout Plain Layout
2192 file for the conversion.
2195 \begin_layout Labeling
2196 \labelwidthstring 00.00.0000
2197 \begin_inset Flex CharStyle:Code
2200 \begin_layout Plain Layout
2209 \begin_layout Standard
2210 The following three flags are not really flags at all because they take
2212 \begin_inset Flex CharStyle:MenuItem
2215 \begin_layout Plain Layout
2217 \begin_inset space ~
2221 \begin_inset space ~
2232 \begin_layout Labeling
2233 \labelwidthstring 00.00.0000
2234 \begin_inset Flex CharStyle:Code
2237 \begin_layout Plain Layout
2243 If set, the converter's standard error will be redirected to a file
2244 \begin_inset Flex CharStyle:Code
2247 \begin_layout Plain Layout
2253 , and the script given as argument will be run as:
2254 \begin_inset Flex CharStyle:Code
2257 \begin_layout Plain Layout
2258 script < infile.out > infile.log
2264 The argument may contain
2265 \begin_inset Flex CharStyle:Code
2268 \begin_layout Plain Layout
2277 \begin_layout Labeling
2278 \labelwidthstring 00.00.0000
2279 \begin_inset Flex CharStyle:Code
2282 \begin_layout Plain Layout
2288 The name of the directory in which the converter will dump the generated
2290 LyX will not create this directory, and it does not copy anything into
2291 it, though it will copy this directory to the destination.
2292 The argument may contain
2293 \begin_inset Flex CharStyle:Code
2296 \begin_layout Plain Layout
2302 , which will be replaced by the base name of the input and output files,
2303 respectively, when the directory is copied.
2304 \begin_inset Newline newline
2307 Note that resultdir and usetempdir make no sense together.
2308 The latter will be ignored if the former is given.
2311 \begin_layout Labeling
2312 \labelwidthstring 00.00.0000
2313 \begin_inset Flex CharStyle:Code
2316 \begin_layout Plain Layout
2322 Determines the output file name and may, contain
2323 \begin_inset Flex CharStyle:Code
2326 \begin_layout Plain Layout
2333 Sensible only with resultdir and optional even then; if not given, it defaults
2337 \begin_layout Standard
2338 None of these last three are presently used in any of the converters that
2339 are installed with LyX.
2343 \begin_layout Standard
2344 You do not have to define converters for all formats between which you want
2346 For example, you will note that there is no `LyX to PostScript' converter,
2347 but LyX will export PostScript.
2348 It does so by first creating a LaTeX file (no converter needs to be defined
2349 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2350 and finally converting the resulting DVI file to PostScript.
2351 LyX finds such `chains' of converters automatically, and it will always
2352 choose the shortest possible chain.
2353 You can, though, still define multiple conversion methods between file
2355 For example, the standard LyX configuration provides three ways to convert
2356 LaTeX to PDF: Directly, using
2357 \begin_inset Flex CharStyle:MenuItem
2360 \begin_layout Plain Layout
2366 ; via (DVI and) PostScript, using
2367 \begin_inset Flex CharStyle:MenuItem
2370 \begin_layout Plain Layout
2377 \begin_inset Flex CharStyle:MenuItem
2380 \begin_layout Plain Layout
2387 To define such alternate chains, you must define multiple target `file
2388 formats', as described in section
2389 \begin_inset CommandInset ref
2391 reference "sec:Formats"
2396 For example, in the standard configuration, the formats named
2397 \begin_inset Flex CharStyle:MenuItem
2400 \begin_layout Plain Layout
2407 \begin_inset Flex CharStyle:MenuItem
2410 \begin_layout Plain Layout
2417 \begin_inset Flex CharStyle:MenuItem
2420 \begin_layout Plain Layout
2426 are defined, all of which share the extension
2427 \begin_inset Flex CharStyle:MenuItem
2430 \begin_layout Plain Layout
2436 , and which correspond to the conversion methods just mentioned.
2439 \begin_layout Chapter
2440 Internationalizing LyX
2441 \begin_inset CommandInset label
2443 name "cha:Internationalizing-LyX"
2450 \begin_layout Standard
2451 LyX supports using a translated interface.
2452 Last time we checked, LyX provided text in thirty languages.
2453 The language of choice is called your
2458 (For further reading on locale settings, see also the documentation for
2459 locale that comes with your operating system.
2460 For Linux, the manual page for
2461 \begin_inset Flex CharStyle:Code
2464 \begin_layout Plain Layout
2470 could be a good place to start).
2473 \begin_layout Standard
2474 Notice that these translations will work, but do contain a few flaws.
2475 In particular, all dialogs have been designed with the English text in
2476 mind, which means that some of the translated text will be too large to
2477 fit within the space allocated.
2478 This is only a display problem and will not cause any harm.
2479 Also, you will find that some of the translations do not define shortcut
2480 keys for everything.
2481 Sometimes, there are simply not enough free letters to do it.
2482 Other times, the translator just hasn't got around to doing it yet.
2483 Our localization team, which you may wish to join,
2487 \begin_layout Plain Layout
2488 If you are a fluent speaker of a language other than English, joining these
2489 teams is a great way to give back to the LyX community!
2494 will of course try to fix these shortcomings in future versions of LyX.
2497 \begin_layout Section
2501 \begin_layout Subsection
2502 Translating the graphical user interface (text messages).
2505 \begin_layout Standard
2507 \begin_inset Flex CharStyle:Code
2510 \begin_layout Plain Layout
2516 library to handle the internationalization of the interface.
2517 To have LyX speak your favorite language in all menus and dialogs, you
2519 \begin_inset Flex CharStyle:Code
2522 \begin_layout Plain Layout
2528 -file for that language.
2529 When this is available, you'll have to generate a
2530 \begin_inset Flex CharStyle:Code
2533 \begin_layout Plain Layout
2539 -file from it and install the
2540 \begin_inset Flex CharStyle:Code
2543 \begin_layout Plain Layout
2550 The process of doing all of this is explained in the documentation for
2552 \begin_inset Flex CharStyle:Code
2555 \begin_layout Plain Layout
2562 It is possible to do this just for yourself, but if you're going to do
2563 it, you might as well share the results of your labors with the rest of
2565 Send a message to the LyX developers' list for more information about how
2569 \begin_layout Standard
2570 In short, this is what you should do (xx denotes the language code):
2573 \begin_layout Itemize
2574 Check out the LyX source code.
2576 \begin_inset CommandInset href
2578 name "information on the web"
2579 target "http://www.lyx.org/devel/cvs.php"
2586 \begin_layout Itemize
2588 \begin_inset Flex CharStyle:Code
2591 \begin_layout Plain Layout
2597 to the folder of the
2598 \begin_inset Flex CharStyle:Code
2601 \begin_layout Plain Layout
2609 \begin_inset Flex CharStyle:Code
2612 \begin_layout Plain Layout
2620 \begin_inset Flex CharStyle:Code
2623 \begin_layout Plain Layout
2629 doesn't exist anywhere, it can be remade with the console command
2630 \begin_inset Flex CharStyle:Code
2633 \begin_layout Plain Layout
2639 in that directory, or you can use an existing po-file for some other language
2643 \begin_layout Itemize
2645 \begin_inset Flex CharStyle:Code
2648 \begin_layout Plain Layout
2658 \begin_layout Plain Layout
2659 This is just a text file, so it can be edited in any text editor.
2660 But there are also specialized programs that support such editing, such
2665 (for all platforms) or
2674 contains a `mode' for editing
2675 \begin_inset Flex CharStyle:Code
2678 \begin_layout Plain Layout
2689 For some menu- and widget-labels, there are also shortcut keys that should
2691 Those keys are marked after a `|', and should be translated according to
2692 the words and phrases of the language.
2693 You should also fill also out the information at the beginning of the new
2695 \begin_inset Flex CharStyle:Code
2698 \begin_layout Plain Layout
2704 -file with your email-address, etc., so people know where to reach you with
2705 suggestions and entertaining flames.
2708 \begin_layout Standard
2709 If you are just doing this on your own, then:
2712 \begin_layout Itemize
2714 \begin_inset Flex CharStyle:Code
2717 \begin_layout Plain Layout
2724 This can be done with
2725 \begin_inset Flex CharStyle:Code
2728 \begin_layout Plain Layout
2729 msgfmt -o xx.mo < xx.po
2737 \begin_layout Itemize
2739 \begin_inset Flex CharStyle:Code
2742 \begin_layout Plain Layout
2748 -file to your locale-tree, at the correct directory for application messages
2753 xx, and under the name
2754 \begin_inset Flex CharStyle:Code
2757 \begin_layout Plain Layout
2764 \begin_inset space \thinspace{}
2768 \begin_inset space \space{}
2772 \begin_inset Flex CharStyle:Code
2775 \begin_layout Plain Layout
2776 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2786 \begin_layout Standard
2787 As said, however, it would be best if the new
2788 \begin_inset Flex CharStyle:Code
2791 \begin_layout Plain Layout
2797 -file could be added to the LyX distribution, so others can use it.
2798 Adding it involves making additional changes to LyX.
2799 So send an email to the developers' mailing list if you're interested in
2803 \begin_layout Subsubsection
2807 \begin_layout Standard
2808 Sometimes it turns out that one English message needs to be translated into
2809 different messages in the target language.
2810 One example is the message
2811 \begin_inset Flex CharStyle:Code
2814 \begin_layout Plain Layout
2820 which has the German translation
2828 , depending upon exactly what the English
2829 \begin_inset Quotes eld
2833 \begin_inset Quotes erd
2838 \begin_inset Flex CharStyle:Code
2841 \begin_layout Plain Layout
2847 does not handle such ambiguous translations.
2848 Therefore you have to add some context information to the message: Instead
2850 \begin_inset Flex CharStyle:Code
2853 \begin_layout Plain Layout
2860 \begin_inset Flex CharStyle:Code
2863 \begin_layout Plain Layout
2864 To[[as in 'From format x to format y']]
2870 \begin_inset Flex CharStyle:Code
2873 \begin_layout Plain Layout
2874 To[[as in 'From page x to page y']].
2879 Now the two occurrences of
2880 \begin_inset Flex CharStyle:Code
2883 \begin_layout Plain Layout
2890 \begin_inset Flex CharStyle:Code
2893 \begin_layout Plain Layout
2899 and can be translated correctly to
2910 \begin_layout Standard
2911 Of course the context information needs to be stripped off the original
2912 message when no translation is used.
2913 Therefore you have to put it in double square brackets at the end of the
2914 message (see the example above).
2915 The translation mechanism of LyX ensures that everything in double square
2916 brackets at the end of messages is removed before displaying the message.
2919 \begin_layout Subsection
2920 Translating the documentation.
2923 \begin_layout Standard
2924 The online documentation (in the
2925 \begin_inset Flex CharStyle:MenuItem
2928 \begin_layout Plain Layout
2934 -menu) can (and should!) be translated.
2935 If there are translated versions of the documentation available
2939 \begin_layout Plain Layout
2940 As of March 2008, at least some of the documents have been translated into
2941 fourteen languages, with the Tutorial available in a few more.
2946 and the locale is set accordingly, these will be used automagically by
2948 LyX looks for translated versions as
2949 \begin_inset Flex CharStyle:Code
2952 \begin_layout Plain Layout
2953 LyXDir/doc/xx/DocName.lyx
2959 \begin_inset Flex CharStyle:Code
2962 \begin_layout Plain Layout
2968 is the code for the language currently in use.
2969 If there are no translated documents, the default English versions will
2971 Note that the translated versions must have the same filenames (
2972 \begin_inset Flex CharStyle:Code
2975 \begin_layout Plain Layout
2981 above) as the original.
2982 If you feel up to translating the documentation (an excellent way to proof-read
2983 the original documentation by the way!), there are a few things you should
2987 \begin_layout Itemize
2988 Check out the documentation translation web page at
2989 \begin_inset CommandInset href
2991 name "http://www.lyx.org/Translation"
2992 target "http://www.lyx.org/Translation"
2997 That way, you can find out which (if any) documents have already been translate
2998 d into your language.
2999 You can also find out who (if anyone) is organizing the effort to translate
3000 the documentation into your language.
3001 If no one is organizing the effort, please let us know that you're interested.
3004 \begin_layout Standard
3005 Once you get to actually translating, here's a few hints for you that may
3009 \begin_layout Itemize
3010 Join the documentation team! There is information on how to do that in
3011 \begin_inset Flex CharStyle:Code
3014 \begin_layout Plain Layout
3021 \begin_inset Flex CharStyle:MenuItem
3024 \begin_layout Plain Layout
3025 Help\SpecialChar \menuseparator
3031 ), which by the way is the first document you should translate.
3034 \begin_layout Itemize
3035 Learn the typographic conventions for the language you are translating to.
3036 Typography is an ancient art and over the centuries, a great variety of
3037 conventions have developed throughout different parts of the world.
3038 Also study the professional terminology amongst typographers in your country.
3039 Inventing your own terminology will only confuse the users.
3042 (Warning! Typography is addictive!)
3045 \begin_layout Itemize
3046 Make a copy of the document.
3047 This will be your working copy.
3048 You can use this as your personal translated help-file by placing it in
3050 \begin_inset Flex CharStyle:Code
3053 \begin_layout Plain Layout
3062 \begin_layout Itemize
3063 Sometimes the original document (from the LyX-team) will be updated.
3064 Use the source viewer at
3065 \begin_inset CommandInset href
3067 name "http://www.lyx.org/trac/timeline"
3068 target "http://www.lyx.org/trac/timeline"
3072 to see what has been changed.
3073 That way you can easily see which parts of the translated document need
3077 \begin_layout Standard
3078 If you ever find an error in the original document, fix it and notify the
3079 rest of the documentation team of the changes! (You didn't forget to join
3080 the documentation team, did you?)
3083 \begin_layout Standard
3084 \begin_inset Branch OutDated
3087 \begin_layout Section
3088 International Keyboard Support
3091 \begin_layout Standard
3094 [Editor's Note: The following section is by
3102 It needs to be fixed to conform to the new Documentation Style sheet and
3103 to make use of the new v1.0 features.
3104 The whole thing also needs to be merged with the section following it.-jw
3105 It may also be badly out of date.-rh (2008)]
3108 \begin_layout Subsection
3109 Defining Own Keymaps: Keymap File Format
3112 \begin_layout Standard
3113 Let's look at a keyboard definition file a little closer.
3114 It is a plain text file defining
3117 \begin_layout Itemize
3118 key-to-key or key-to-string translations
3121 \begin_layout Itemize
3125 \begin_layout Itemize
3126 dead keys exceptions
3129 \begin_layout Standard
3130 To define key-to-key or key-to-string translation, use this command:
3133 \begin_layout Quotation
3134 \begin_inset Flex CharStyle:Code
3137 \begin_layout Plain Layout
3146 \begin_inset Flex CharStyle:Code
3149 \begin_layout Plain Layout
3158 \begin_layout Standard
3160 \begin_inset Flex CharStyle:Code
3163 \begin_layout Plain Layout
3169 is the key to be translated and
3170 \begin_inset Flex CharStyle:Code
3173 \begin_layout Plain Layout
3179 is the string to be inserted into the document.
3180 To define dead keys, use:
3183 \begin_layout Quotation
3184 \begin_inset Flex CharStyle:Code
3187 \begin_layout Plain Layout
3196 \begin_inset Flex CharStyle:Code
3199 \begin_layout Plain Layout
3208 \begin_layout Standard
3210 \begin_inset Flex CharStyle:Code
3213 \begin_layout Plain Layout
3219 is a keyboard key and
3220 \begin_inset Flex CharStyle:Code
3223 \begin_layout Plain Layout
3230 The following dead keys are supported (shortcut name is in parentheses):
3233 \begin_layout Quotation
3237 \begin_inset space \hfill{}
3243 \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{}
3284 \begin_layout Plain Layout
3296 \begin_layout Quotation
3298 \begin_inset space \hfill{}
3304 \begin_layout Quotation
3306 \begin_inset space \hfill{}
3313 \begin_layout Plain Layout
3325 \begin_layout Quotation
3327 \begin_inset space \hfill{}
3333 \begin_layout Quotation
3335 \begin_inset space \hfill{}
3341 \begin_layout Quotation
3343 \begin_inset space \hfill{}
3350 \begin_layout Plain Layout
3362 \begin_layout Quotation
3364 \begin_inset space \hfill{}
3371 \begin_layout Plain Layout
3383 \begin_layout Quotation
3385 \begin_inset space \hfill{}
3391 \begin_layout Quotation
3392 hungarian umlaut (hug)
3393 \begin_inset space \hfill{}
3399 \begin_layout Quotation
3401 \begin_inset space \hfill{}
3407 \begin_layout Quotation
3409 \begin_inset space \hfill{}
3416 \begin_layout Plain Layout
3428 \begin_layout Standard
3429 Since in many international keyboards there are exceptions to what some
3430 dead keys should do, you can define them using
3433 \begin_layout Quotation
3434 \begin_inset Flex CharStyle:Code
3437 \begin_layout Plain Layout
3445 deadkey key outstring
3448 \begin_layout Standard
3449 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3453 \begin_layout Quotation
3454 \begin_inset Flex CharStyle:Code
3457 \begin_layout Plain Layout
3470 \begin_layout Standard
3471 to make it work correctly.
3472 Also, you have to define as exceptions dead keys over i and j, to remove
3473 the dot from them before inserting an accent mark.
3474 I will change this when the time comes, but so far I haven't had time.
3477 \begin_layout Standard
3478 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3481 \begin_inset Flex CharStyle:Code
3484 \begin_layout Plain Layout
3490 have different meaning.
3492 \begin_inset Flex CharStyle:Code
3495 \begin_layout Plain Layout
3501 marks comments, quotes start and end LaTeX-style commands.
3502 To enter quote, you'll need to use
3503 \begin_inset Flex CharStyle:Code
3506 \begin_layout Plain Layout
3515 \begin_inset Flex CharStyle:Code
3518 \begin_layout Plain Layout
3525 \begin_inset Flex CharStyle:Code
3528 \begin_layout Plain Layout
3539 \begin_layout Standard
3540 If you make a keyboard description file that works for your language, please
3541 mail it to me, so I can include it in the next keymap distribution.
3544 \begin_layout Standard
3545 More keywords will be supported in keymap configuration file in future,
3549 \begin_layout Itemize
3550 \begin_inset Flex CharStyle:Code
3553 \begin_layout Plain Layout
3564 \begin_inset space \hfill{}
3568 \begin_inset Flex CharStyle:Code
3571 \begin_layout Plain Layout
3580 \begin_layout Itemize
3581 \begin_inset Flex CharStyle:Code
3584 \begin_layout Plain Layout
3595 \begin_inset space \hfill{}
3599 \begin_inset Flex CharStyle:Code
3602 \begin_layout Plain Layout
3608 an external keymap translation program
3611 \begin_layout Standard
3612 Also, it should look into
3613 \begin_inset Flex CharStyle:Code
3616 \begin_layout Plain Layout
3622 file for defaults, too (for example, a
3623 \begin_inset Flex CharStyle:Code
3626 \begin_layout Plain Layout
3634 option to include default keyboard).
3642 \begin_layout Section
3643 International Keymap Stuff
3644 \begin_inset CommandInset label
3646 name "sec:International-Keymap-Stuff"
3653 \begin_layout Standard
3654 \begin_inset Note Note
3657 \begin_layout Plain Layout
3658 In doing the revisions on this document in March 2008, I did not look over
3659 this stuff, as I do not understand it.
3660 It would be good if someone else could do so.
3669 \begin_layout Standard
3670 The next two sections describe the
3671 \begin_inset Flex CharStyle:Code
3674 \begin_layout Plain Layout
3683 \begin_inset Flex CharStyle:Code
3686 \begin_layout Plain Layout
3694 file syntax in detail.
3695 These sections should help you design your own key map if the ones provided
3696 do not meet your needs.
3699 \begin_layout Subsection
3703 \begin_layout Standard
3707 \begin_inset Flex CharStyle:Code
3710 \begin_layout Plain Layout
3716 file maps keystrokes to characters or strings.
3717 As the name suggests, it sets a keyboard mapping.
3719 \begin_inset Flex CharStyle:Code
3722 \begin_layout Plain Layout
3733 \begin_inset Flex CharStyle:Code
3736 \begin_layout Plain Layout
3751 \begin_inset Flex CharStyle:Code
3754 \begin_layout Plain Layout
3767 \begin_inset Flex CharStyle:Code
3770 \begin_layout Plain Layout
3779 \begin_inset Flex CharStyle:Code
3782 \begin_layout Plain Layout
3790 are described in this section.
3793 \begin_layout Labeling
3794 \labelwidthstring 00.00.0000
3795 \begin_inset Flex CharStyle:Code
3798 \begin_layout Plain Layout
3806 Map a character to a string
3809 \begin_layout LyX-Code
3824 \begin_layout Standard
3857 the double-quote (")
3874 must be escaped with a preceding backslash (
3885 \begin_layout Standard
3887 \begin_inset Flex CharStyle:MenuItem
3890 \begin_layout Plain Layout
3898 statement to cause the symbol
3899 \begin_inset Flex CharStyle:MenuItem
3902 \begin_layout Plain Layout
3910 to be output for the keystroke
3911 \begin_inset Flex CharStyle:MenuItem
3914 \begin_layout Plain Layout
3925 \begin_layout LyX-Code
3931 \begin_layout Labeling
3932 \labelwidthstring 00.00.0000
3933 \begin_inset Flex CharStyle:Code
3936 \begin_layout Plain Layout
3944 Specify an accent character
3947 \begin_layout LyX-Code
3956 \begin_layout Standard
3957 This will make the cha
3995 This is the dead key
3999 \begin_layout Plain Layout
4006 refers to a key that does not produce a character by itself, but when followed
4007 with another key, produces the desired accent character.
4008 For example, a German characte
4010 r with an umlaut like
4020 can be produced in this manner.
4029 \begin_layout Standard
4042 and then another key not in
4059 followed by the other, not allowed key, as output.
4063 \begin_inset Flex CharStyle:MenuItem
4066 \begin_layout Plain Layout
4074 cancels a dead key, so if
4085 \begin_inset Flex CharStyle:MenuItem
4088 \begin_layout Plain Layout
4097 , the cursor will not go one position backwards but will instead cancel
4113 might have had on the next keystroke.
4117 \begin_layout Standard
4118 The following example specifies that the character ' is to be an acute accent,
4119 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4122 \begin_layout LyX-Code
4125 kmod ' acute aeiouAEIOU
4128 \begin_layout Labeling
4129 \labelwidthstring 00.00.0000
4130 \begin_inset Flex CharStyle:Code
4133 \begin_layout Plain Layout
4139 Specify an exception to the accent character
4142 \begin_layout LyX-Code
4151 \begin_layout Standard
4152 This defines an exce
4193 have been assigned a keystroke with a previous
4196 \begin_inset Flex CharStyle:Code
4199 \begin_layout Plain Layout
4223 must not belong in the
4270 If such a declaration does not exist in
4278 \begin_inset Flex CharStyle:Code
4281 \begin_layout Plain Layout
4315 \begin_inset Flex CharStyle:Code
4318 \begin_layout Plain Layout
4332 \begin_layout Standard
4333 The following command produces causes äi to be produced when you enter acute-i
4337 \begin_layout LyX-Code
4351 \begin_layout Labeling
4352 \labelwidthstring 00.00.0000
4353 \begin_inset Flex CharStyle:Code
4356 \begin_layout Plain Layout
4362 Combine two accent characters
4365 \begin_layout LyX-Code
4371 accent1 accent2 allowed
4374 \begin_layout Standard
4375 This one is getting pretty esoteric.
4376 It allows you to combine the effect
4432 \begin_inset Flex CharStyle:Code
4435 \begin_layout Plain Layout
4463 \begin_layout Standard
4464 Consider this example from the
4465 \begin_inset Flex CharStyle:Code
4468 \begin_layout Plain Layout
4479 \begin_layout LyX-Code
4482 kmod ; acute aeioyvhAEIOYVH
4486 kcomb acute umlaut iyIY
4489 \begin_layout Standard
4490 This allows you to press
4491 \begin_inset Flex CharStyle:MenuItem
4494 \begin_layout Plain Layout
4502 and get the effect of
4503 \begin_inset Flex CharStyle:Code
4506 \begin_layout Plain Layout
4525 in this case cancels the last dead key, so if you press
4526 \begin_inset Flex CharStyle:MenuItem
4529 \begin_layout Plain Layout
4538 \begin_inset Flex CharStyle:Code
4541 \begin_layout Plain Layout
4554 \begin_layout Subsection
4558 \begin_layout Standard
4560 \begin_inset Flex CharStyle:Code
4563 \begin_layout Plain Layout
4571 mapping is performed, a
4572 \begin_inset Flex CharStyle:Code
4575 \begin_layout Plain Layout
4585 file maps the strings that the symbols generate to characters in the current
4587 The LyX distribution currently includes at least the
4588 \begin_inset Flex CharStyle:Code
4591 \begin_layout Plain Layout
4600 \begin_inset Flex CharStyle:Code
4603 \begin_layout Plain Layout
4614 \begin_layout Standard
4616 \begin_inset Flex CharStyle:Code
4619 \begin_layout Plain Layout
4627 file is a sequence of declarations of the form
4630 \begin_layout LyX-Code
4643 \begin_layout Standard
4644 For example, in order to map
4645 \begin_inset Flex CharStyle:MenuItem
4648 \begin_layout Plain Layout
4658 to the corresponding character in the iso-8859-1 set (233), the following
4662 \begin_layout LyX-Code
4670 \begin_layout Standard
4672 \begin_inset Flex CharStyle:Code
4675 \begin_layout Plain Layout
4684 \begin_inset Flex CharStyle:Code
4687 \begin_layout Plain Layout
4705 the same character can apply to more than one string.
4707 \begin_inset Flex CharStyle:Code
4710 \begin_layout Plain Layout
4721 \begin_layout LyX-Code
4733 \begin_inset Newline newline
4749 \begin_layout Standard
4750 If LyX cannot find a mapping for the string produced by the keystroke or
4751 a deadkey sequence, it will check if it looks like an accented char and
4752 try to draw an accent over the character on screen.
4755 \begin_layout Subsection
4759 \begin_layout Standard
4760 There is a second way to add support for international characters through
4761 so-called dead-keys.
4762 A dead-key works in combination with a letter to produce an accented character.
4763 Here, we'll explain how to create a really simple dead-key to illustrate
4767 \begin_layout Standard
4768 Suppose you happen to need the circumflex character,
4769 \begin_inset Quotes eld
4773 \begin_inset Quotes erd
4778 \begin_inset Flex CharStyle:MenuItem
4781 \begin_layout Plain Layout
4788 \begin_inset space ~
4792 \begin_inset Flex CharStyle:MenuItem
4795 \begin_layout Plain Layout
4801 ] to the LyX command
4802 \begin_inset Flex CharStyle:Code
4805 \begin_layout Plain Layout
4812 \begin_inset Flex CharStyle:Code
4815 \begin_layout Plain Layout
4822 Now, whenever you type the
4823 \begin_inset Flex CharStyle:MenuItem
4826 \begin_layout Plain Layout
4832 -key followed by a letter, that letter will have a circumflex accent on
4834 For example, the sequence
4835 \begin_inset Quotes eld
4839 \begin_inset Flex CharStyle:MenuItem
4842 \begin_layout Plain Layout
4849 \begin_inset Quotes erd
4852 produces the letter:
4853 \begin_inset Quotes eld
4857 \begin_inset Quotes erd
4861 If you tried to type
4862 \begin_inset Quotes eld
4866 \begin_inset Flex CharStyle:MenuItem
4869 \begin_layout Plain Layout
4876 \begin_inset Quotes erd
4879 , however, LyX will complain with a beep, since a
4880 \begin_inset Quotes eld
4884 \begin_inset Flex CharStyle:MenuItem
4887 \begin_layout Plain Layout
4894 \begin_inset Quotes erd
4897 never takes a circumflex accent.
4899 \begin_inset Flex CharStyle:MenuItem
4902 \begin_layout Plain Layout
4908 after a dead-key produces the bare-accent.
4909 Please note this last point! If you bind a key to a dead-key, you'll need
4910 to rebind the character on that key to yet another key.
4912 \begin_inset Flex CharStyle:MenuItem
4915 \begin_layout Plain Layout
4921 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
4924 \begin_layout Standard
4925 One common way to bind dead-keys is to use
4926 \begin_inset Flex CharStyle:MenuItem
4929 \begin_layout Plain Layout
4936 \begin_inset Flex CharStyle:MenuItem
4939 \begin_layout Plain Layout
4946 \begin_inset Flex CharStyle:MenuItem
4949 \begin_layout Plain Layout
4955 in combination with an accent, like
4956 \begin_inset Quotes eld
4960 \begin_inset Flex CharStyle:MenuItem
4963 \begin_layout Plain Layout
4970 \begin_inset Quotes erd
4974 \begin_inset Quotes eld
4978 \begin_inset Flex CharStyle:MenuItem
4981 \begin_layout Plain Layout
4988 \begin_inset Quotes erd
4992 \begin_inset Quotes eld
4996 \begin_inset Flex CharStyle:MenuItem
4999 \begin_layout Plain Layout
5006 \begin_inset Quotes erd
5010 Another way involves using
5011 \begin_inset Flex CharStyle:Code
5014 \begin_layout Plain Layout
5021 \begin_inset Flex CharStyle:Code
5024 \begin_layout Plain Layout
5030 to set up the special
5031 \begin_inset Flex CharStyle:Code
5034 \begin_layout Plain Layout
5042 \begin_inset Flex CharStyle:Code
5045 \begin_layout Plain Layout
5051 acts in some ways just like
5052 \begin_inset Flex CharStyle:MenuItem
5055 \begin_layout Plain Layout
5061 and permits you to bind keys to accented characters.
5062 You can also turn keys into dead-keys by binding them to something like
5064 \begin_inset Flex CharStyle:Code
5067 \begin_layout Plain Layout
5073 and then binding this symbolic key to the corresponding LyX command.
5077 \begin_layout Plain Layout
5082 : This is exactly what I do in my
5083 \begin_inset Flex CharStyle:Code
5086 \begin_layout Plain Layout
5093 \begin_inset Flex CharStyle:Code
5096 \begin_layout Plain Layout
5104 \begin_inset Flex CharStyle:MenuItem
5107 \begin_layout Plain Layout
5109 \begin_inset space ~
5118 \begin_inset Flex CharStyle:Code
5121 \begin_layout Plain Layout
5127 and a bunch of these
5128 \begin_inset Quotes eld
5132 \begin_inset Flex CharStyle:Code
5135 \begin_layout Plain Layout
5142 \begin_inset Quotes erd
5145 symbolic keys bound such things as
5146 \begin_inset Flex CharStyle:MenuItem
5149 \begin_layout Plain Layout
5151 \begin_inset space ~
5160 \begin_inset Flex CharStyle:MenuItem
5163 \begin_layout Plain Layout
5165 \begin_inset space ~
5174 This is how I produce my accented characters.
5179 You can make just about anything into the
5180 \begin_inset Flex CharStyle:Code
5183 \begin_layout Plain Layout
5190 \begin_inset Flex CharStyle:MenuItem
5193 \begin_layout Plain Layout
5199 keys, a spare function key, etc.
5200 As for the LyX commands that produce accents, check the entry for
5201 \begin_inset Flex CharStyle:Code
5204 \begin_layout Plain Layout
5215 You'll find the complete list there.
5218 \begin_layout Subsection
5219 Saving your Language Configuration
5222 \begin_layout Standard
5223 You can edit your preferences so that your desired language environment
5224 is automatically configured when LyX starts up, via the
5225 \begin_inset Flex CharStyle:MenuItem
5228 \begin_layout Plain Layout
5229 Edit\SpecialChar \menuseparator
5238 \begin_layout Chapter
5239 Installing New Document Classes, Layouts, and Templates
5240 \begin_inset CommandInset label
5242 name "cha:Installing-New-Document"
5250 \begin_layout Plain Layout
5251 Installing New Document Classes
5259 \begin_layout Standard
5260 In this chapter, we describe the procedures for creating and installing
5261 new LyX layout and template files, as well as offer a refresher on correctly
5262 installing new LaTeX document classes.
5266 \begin_layout Standard
5267 First, let us a say a few words about how one ought to think about the relation
5268 between LyX and LaTeX.
5269 The thing to understand is that, in a certain sense, LyX doesn't know anything
5271 Indeed, from LyX's point of view, LaTeX is just one of several
5272 \begin_inset Quotes eld
5276 \begin_inset Quotes erd
5279 in which it is capable of producing output.
5280 Other such formats are DocBook, plaintext, and XHTML.
5281 LaTeX is, of course, a particularly important format, but very little of
5282 the information LyX has about LaTeX is actually contained in the program
5287 \begin_layout Plain Layout
5288 Some commands are sufficiently complex that they are
5289 \begin_inset Quotes eld
5293 \begin_inset Quotes erd
5297 But the developers generally regard this as a Bad Thing.
5302 Rather, that information, even for the standard classes like
5303 \begin_inset Flex CharStyle:Code
5306 \begin_layout Plain Layout
5312 , is contained in `layout files'.
5313 Similarly, LyX itself does not know much about DocBook or XHTML.
5314 What it knows is contained in layout files.
5317 \begin_layout Standard
5318 You can think of the layout file for a given document class as a translation
5319 manual between LyX constructs---paragraphs with their corresponding styles,
5320 certain sorts of insets, etc---and the corresponding LaTeX, DocBook, or
5322 Almost everything LyX knows about
5323 \begin_inset Flex CharStyle:Code
5326 \begin_layout Plain Layout
5332 , for example, is contained in the file
5333 \begin_inset Flex CharStyle:Code
5336 \begin_layout Plain Layout
5342 and in various other files it includes.
5343 For this reason, anyone intending to write layout files should plan to
5344 study the existing files.
5345 A good place to start is with
5346 \begin_inset Flex CharStyle:Code
5349 \begin_layout Plain Layout
5355 , which is included in
5356 \begin_inset Flex CharStyle:Code
5359 \begin_layout Plain Layout
5366 \begin_inset Flex CharStyle:Code
5369 \begin_layout Plain Layout
5375 , and many of the other layout files for document classes.
5376 This file is where sections and the like are defined:
5377 \begin_inset Flex CharStyle:Code
5380 \begin_layout Plain Layout
5386 tells LyX how paragraphs that are marked with the Section, Subsection,
5387 etc, styles can be translated into corresponding LaTeX, DocBook, and XHTML
5390 \begin_inset Flex CharStyle:Code
5393 \begin_layout Plain Layout
5399 file basically just includes several of these
5400 \begin_inset Flex CharStyle:Code
5403 \begin_layout Plain Layout
5412 \begin_layout Standard
5413 Defining the LyX--LaTeX correspondence is not the only thing layout files
5415 Their other job is to define how the LyX constructs themselves will appear
5417 The fact that layout files have these two jobs is often a source of confusion,
5418 because they are completely separate.
5419 Telling LyX how to translate a certain paragraph style into LaTeX does
5420 not tell LyX how to display it; conversely, telling LyX how to display
5421 a certain paragraph style does not tell LyX how to translate it into LaTeX
5422 (let alone tell LaTeX how to display it).
5423 So, in general, when you define a new LyX construct, you must always do
5424 two quite separate things: (i)
5425 \begin_inset space ~
5428 tell LyX how to translate it into LaTeX and (ii)
5429 \begin_inset space ~
5432 tell LyX how to display it.
5435 \begin_layout Standard
5436 Much the same is true, of course, as regards LyX's other backend formats,
5437 though XHTML is in some ways different, because in that case LyX
5441 able, to some extent, to use information about how it should display a
5442 paragraph on the screen to output information (in the form of CSS) about
5443 how the paragraph should be displayed in a browser.
5444 Even in this case, however, the distinction between what LyX does internally
5445 and how things are rendered externally remains in force, and the two can
5446 be controlled separately.
5448 \begin_inset CommandInset ref
5449 LatexCommand prettyref
5450 reference "sec:Tags-for-XHTML"
5457 \begin_layout Section
5458 Installing new LaTeX files
5461 \begin_layout Standard
5462 Some installations may not include a LaTeX package or class file that you
5463 would like to use within LyX.
5464 For example, you might need FoilTeX, a package for preparing slides for
5465 overhead projectors.
5466 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5467 a user interface for installing such packages.
5468 For example, with MiKTeX, you start the program
5469 \begin_inset Quotes eld
5473 \begin_inset Quotes erd
5476 to get a list of available packages.
5477 To install one, right click on it or use the toolbar button to install
5482 \begin_layout Standard
5483 If your LaTeX distribution doesn't provide such a `package manager', or
5484 if the file is not available from your distribution, then you can follow
5485 these steps to install it manually.
5488 \begin_layout Enumerate
5489 Get the package from
5490 \begin_inset CommandInset href
5493 target "http://www.ctan.org/"
5500 \begin_layout Enumerate
5501 You can install the package in several different places.
5502 If you want it to be available for all users on your system, then you should
5503 install it in your `local' TeX tree; if you want (or need) it to be available
5504 just for you, then you can install it in your own `user' TeX tree.
5505 Where these trees should be created, if they do not already exist, depends
5506 upon the details of your system.
5507 To find out where they are, look in the file
5508 \begin_inset Flex CharStyle:Code
5511 \begin_layout Plain Layout
5521 \begin_layout Plain Layout
5522 This usually lives in the directory
5523 \begin_inset Flex CharStyle:Code
5526 \begin_layout Plain Layout
5532 , though you can run
5533 \begin_inset Flex CharStyle:Code
5536 \begin_layout Plain Layout
5547 The location of the `local' TeX tree is defined by the
5548 \begin_inset Flex CharStyle:Code
5551 \begin_layout Plain Layout
5557 variable; this is usually somewhere like
5558 \begin_inset Flex URL
5561 \begin_layout Plain Layout
5563 /usr/local/share/texmf/
5569 The location of the `user' TeX tree is defined by
5570 \begin_inset Flex CharStyle:Code
5573 \begin_layout Plain Layout
5580 \begin_inset Flex CharStyle:Code
5583 \begin_layout Plain Layout
5590 (If these variables are not predefined, you can define them.) You'll probably
5591 need root permissions to create or modify the `local' tree, but your `user'
5592 tree shouldn't have such limitations.
5595 \begin_layout Enumerate
5597 \begin_inset Flex CharStyle:Code
5600 \begin_layout Plain Layout
5607 \begin_inset Flex CharStyle:Code
5610 \begin_layout Plain Layout
5617 \begin_inset Flex CharStyle:Code
5620 \begin_layout Plain Layout
5627 \begin_inset space \thinspace{}
5631 \begin_inset Newline newline
5635 \begin_inset Flex CharStyle:Code
5638 \begin_layout Plain Layout
5639 TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
5645 \begin_inset Newline newline
5651 \begin_layout Enumerate
5652 Your local and user trees
5656 have the same sort of directory structure as your main existing
5657 \begin_inset Flex CharStyle:Code
5660 \begin_layout Plain Layout
5666 directory, which will be found at
5667 \begin_inset Flex CharStyle:Code
5670 \begin_layout Plain Layout
5677 \begin_inset Flex CharStyle:Code
5680 \begin_layout Plain Layout
5686 .) For example, latex packages should go under
5687 \begin_inset Flex CharStyle:Code
5690 \begin_layout Plain Layout
5691 $TEXMFLOCAL/tex/latex/
5697 \begin_inset Flex CharStyle:Code
5700 \begin_layout Plain Layout
5701 $TEXMFHOME/tex/latex/
5707 If you do not put them here, they probably will not work.
5710 \begin_layout Enumerate
5711 Once your tree is properly set up, you can install the package into an appropria
5713 If you are lucky, your package will have been provided as a so-called `TDS'
5714 (TeX Directory Structure) zip file.
5715 To install it, you want to unzip it from the top of your tree.
5716 So, for example, you can copy the file
5717 \begin_inset Flex CharStyle:Code
5720 \begin_layout Plain Layout
5727 \begin_inset Flex CharStyle:Code
5730 \begin_layout Plain Layout
5731 /home/yourname/texmf/
5736 and then, from inside that directory, just run:
5737 \begin_inset Flex CharStyle:Code
5740 \begin_layout Plain Layout
5747 This will extract the needed files and copy them where they need to be.
5748 \begin_inset Newline newline
5751 If you do not have a TDS file, then you have to do this manually.
5752 For example, you might install the FoilTeX files into
5753 \begin_inset Flex URL
5756 \begin_layout Plain Layout
5758 $TEXMFLOCAL/tex/latex/contrib/foiltex
5764 Why there? The CTAN download directories are themselves organized much
5765 like a TeX tree, and it isn't a bad idea to follow its structure when you
5766 install your own files.
5767 FoilTeX, as it happens, is found at
5768 \begin_inset Flex URL
5771 \begin_layout Plain Layout
5773 http://ctan.org/texarchive/macros/latex/contrib/foiltex/
5782 \begin_layout Enumerate
5783 Finally, you must update the database TeX uses to find files.
5784 On MiKTeX, this is done by pressing the button
5787 \begin_inset space ~
5792 that you find in MiKTeX's
5793 \begin_inset Quotes eld
5797 \begin_inset Quotes erd
5802 \begin_inset Flex CharStyle:Code
5805 \begin_layout Plain Layout
5806 $TEXMFLOCAL/tex/latex/
5812 Under TeXLive and the like, you should run
5813 \begin_inset Flex CharStyle:Code
5816 \begin_layout Plain Layout
5822 from a terminal, with root permissions if necessary.
5826 \begin_layout Standard
5827 Your package is now installed and available to LaTeX.
5828 You can verify this from a terminal by typing `
5829 \begin_inset Flex CharStyle:Code
5832 \begin_layout Plain Layout
5833 kpsewhich yourfile.ext
5839 To make LyX aware of it, however, you will need to reconfigure (
5840 \begin_inset Flex CharStyle:MenuItem
5843 \begin_layout Plain Layout
5844 Tools\SpecialChar \menuseparator
5850 ) and then restart LyX.
5851 If the new package was a document class, such as FoilTeX again, you will
5852 now see it available under
5853 \begin_inset Flex CharStyle:MenuItem
5856 \begin_layout Plain Layout
5857 Document\SpecialChar \menuseparator
5858 Settings\SpecialChar \menuseparator
5865 \begin_inset Flex CharStyle:MenuItem
5868 \begin_layout Plain Layout
5877 \begin_layout Standard
5878 What if there isn't a layout file is available for your new document class?
5879 Then, unfortunately, LyX will know nothing about it until you create a
5880 layout file yourself (or get someone else to do it).
5881 That is the topic of the next section.
5884 \begin_layout Section
5885 Types of layout files
5888 \begin_layout Standard
5889 This section describes the various sorts of LyX files that contain layout
5891 These files describe various paragraph and character styles, determining
5892 how LyX should display them and how they should be translated into LaTeX,
5893 DocBook, XHTML, or whatever output format is being used.
5897 \begin_layout Standard
5898 We shall try to provide a thorough description of the process of writing
5900 However, there are so many different types of documents supported even
5901 by just LaTeX that we can't hope to cover every different possibility or
5902 problem you might encounter.
5903 The LyX users' list is frequented by people with lots of experience with
5904 layout design who are willing to share what they've learned, so please
5905 feel free to ask questions there.
5908 \begin_layout Standard
5909 As you prepare to write a new layout, it is extremely helpful to look at
5910 the layouts distributed with LyX.
5911 If you write a LyX layout for a LaTeX document class that might also be
5912 used by others, or write a module that might be useful to others, then
5913 you should consider posting your layout to the
5914 \begin_inset CommandInset href
5916 name "layout section on the LyX wiki"
5917 target "http://wiki.lyx.org/Layouts/Layouts"
5921 or even to the LyX developers' list, so that it might be included in LyX
5926 \begin_layout Plain Layout
5927 Note that LyX is licensed under the General Public License, so any material
5928 that is contribued to LyX must be similarly licensed.
5936 \begin_layout Subsection
5938 \begin_inset CommandInset label
5940 name "sub:Layout-modules"
5947 \begin_layout Standard
5948 We have spoken to this point about `layout files'.
5949 But there are different sorts of files that contain layout information.
5950 Layout files, strictly so called, have the
5951 \begin_inset Flex CharStyle:Code
5954 \begin_layout Plain Layout
5960 extension and provide LyX with information about document classes.
5961 As of LyX 1.6, however, layout information can also be contained in layout
5967 \begin_inset Flex CharStyle:Code
5970 \begin_layout Plain Layout
5977 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
5978 some modules—such as the
5979 \begin_inset Flex CharStyle:Code
5982 \begin_layout Plain Layout
5988 module—specifcally provide support for one package.
5989 In a sense, layout modules are similar to included
5993 \begin_layout Plain Layout
5994 These can have any extension, but by convention have the
5995 \begin_inset Flex CharStyle:Code
5998 \begin_layout Plain Layout
6010 \begin_inset Flex CharStyle:Code
6013 \begin_layout Plain Layout
6019 —in that modules are not specific to a given document class but may be used
6020 with many different classes.
6021 The difference is that using an included file with
6022 \begin_inset Flex CharStyle:Code
6025 \begin_layout Plain Layout
6031 requires editing that file.
6032 Modules, by contrast, are selected in the
6033 \begin_inset Flex CharStyle:MenuItem
6036 \begin_layout Plain Layout
6037 Document\SpecialChar \menuseparator
6046 \begin_layout Standard
6047 Building modules is the easiest way to get started with layout editing,
6048 since it can be as simple as adding a single new paragraph style or flex
6050 But modules may, in principle, contain anything a layout file can contain.
6053 \begin_layout Standard
6054 After creating a new module and copying it to the
6055 \begin_inset Flex CharStyle:Code
6058 \begin_layout Plain Layout
6064 folder, you will need to reconfigure and then restart LyX for the module
6065 to appear in the menu.
6066 However, changes you make to the module will be seen immediately, if you
6068 \begin_inset Flex CharStyle:MenuItem
6071 \begin_layout Plain Layout
6072 Document\SpecialChar \menuseparator
6078 , highlight something, and then hit
6079 \begin_inset Quotes eld
6083 \begin_inset Quotes erd
6089 It is strongly recommended that you save your work before doing this
6094 it is strongly recommended that you not attempt to edit modules while simultaneo
6095 usly working on actual documents
6098 Though of course the developers strive to keep LyX stable in such situations,
6099 syntax errors and the like in your module file could cause strange behavior.
6102 \begin_layout Subsection
6104 \begin_inset Flex CharStyle:MenuItem
6107 \begin_layout Plain Layout
6116 \begin_layout Standard
6117 There are two situations you are likely to encounter when wanting to support
6118 a new LaTeX document class, involving LaTeX2e class (
6119 \begin_inset Flex CharStyle:Code
6122 \begin_layout Plain Layout
6129 \begin_inset Flex CharStyle:Code
6132 \begin_layout Plain Layout
6139 Supporting a style file is usually fairly easy.
6140 Supporting a new class file is a bit harder.
6141 We'll discuss the former in this section and the latter in the next.
6142 Similar remarks apply, of course, if you want to support a new DocBook
6146 \begin_layout Standard
6147 The easier case is the one in which your new document class is provided
6148 as a style file that is to be used in conjunction with an already supported
6150 For the sake of the example, we'll assume that the style file is called
6152 \begin_inset Flex CharStyle:MenuItem
6155 \begin_layout Plain Layout
6161 and that it is meant to be used with
6162 \begin_inset Flex CharStyle:MenuItem
6165 \begin_layout Plain Layout
6171 , which is a standard class.
6175 \begin_layout Standard
6176 Start by copying the existing class's layout file into your local directory:
6180 \begin_layout Plain Layout
6181 Of course, which directory is your local directory will vary by platform,
6182 and LyX allows you to specify your local directory on startup, too, using
6184 \begin_inset Flex CharStyle:Code
6187 \begin_layout Plain Layout
6201 \begin_layout LyX-Code
6202 cp report.layout ~/.lyx/layouts/myclass.layout
6205 \begin_layout Standard
6207 \begin_inset Flex CharStyle:Code
6210 \begin_layout Plain Layout
6216 and change the line:
6219 \begin_layout LyX-Code
6222 DeclareLaTeXClass{report}
6225 \begin_layout Standard
6229 \begin_layout LyX-Code
6232 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6235 \begin_layout Standard
6239 \begin_layout LyX-Code
6241 \begin_inset Newline newline
6247 \begin_inset Newline newline
6253 \begin_layout Standard
6254 near the top of the file.
6257 \begin_layout Standard
6258 Start LyX and select
6259 \begin_inset Flex CharStyle:MenuItem
6262 \begin_layout Plain Layout
6263 Tools\SpecialChar \menuseparator
6270 Then restart LyX and try creating a new document.
6272 \begin_inset Flex CharStyle:MenuItem
6275 \begin_layout Plain Layout
6281 " as a document class option in the
6282 \begin_inset Flex CharStyle:MenuItem
6285 \begin_layout Plain Layout
6286 Document\SpecialChar \menuseparator
6293 It is likely that some of the sectioning commands and such in your new
6294 class will work differently from how they worked in the base class—
6295 \begin_inset Flex CharStyle:Code
6298 \begin_layout Plain Layout
6304 in this example—so you can fiddle around with the settings for the different
6305 sections if you wish.
6306 The layout information for sections is contained in
6307 \begin_inset Flex CharStyle:Code
6310 \begin_layout Plain Layout
6316 , but you do not need to copy and change this file.
6317 Instead, you can simply add your changes to your layout file, after the
6319 \begin_inset Flex CharStyle:Code
6322 \begin_layout Plain Layout
6328 , which itself includes
6329 \begin_inset Flex CharStyle:Code
6332 \begin_layout Plain Layout
6339 For example, you might add these lines:
6342 \begin_layout LyX-Code
6346 \begin_layout LyX-Code
6350 \begin_layout LyX-Code
6354 \begin_layout LyX-Code
6358 \begin_layout LyX-Code
6362 \begin_layout Standard
6363 to change the font for chapter headings to sans-serif.
6364 This will override (or, in this case, add to) the existing declaration
6365 for the Chapter style.
6369 \begin_layout Standard
6370 Your new package may also provide commands or environments not present in
6372 In this case, you will want to add these to the layout file.
6374 \begin_inset CommandInset ref
6376 reference "sec:TextClass"
6380 for information on how to do so.
6383 \begin_layout Standard
6385 \begin_inset Flex CharStyle:MenuItem
6388 \begin_layout Plain Layout
6394 can be used with several different document classes, and even if it cannot,
6395 you might find it easiest just to write a module that you can load with
6397 The simplest possible such module would be:
6400 \begin_layout LyX-Code
6403 DeclareLyXModule{My Package}
6406 \begin_layout LyX-Code
6410 \begin_layout LyX-Code
6411 #Support for mypkg.sty.
6414 \begin_layout LyX-Code
6416 \begin_inset Newline newline
6422 \begin_layout LyX-Code
6424 \begin_inset Newline newline
6430 \begin_layout LyX-Code
6432 \begin_inset Newline newline
6438 \begin_inset Newline newline
6444 \begin_layout Standard
6445 A more complex module might modify the behavior of some existing constructs
6446 or define some new ones.
6448 \begin_inset CommandInset ref
6450 reference "sec:TextClass"
6457 \begin_layout Subsection
6459 \begin_inset Flex CharStyle:MenuItem
6462 \begin_layout Plain Layout
6471 \begin_layout Standard
6472 There are two possibilities here.
6473 One is that the class file is itself based upon an existing document class.
6474 For example, many thesis classes are based upon
6475 \begin_inset Flex CharStyle:MenuItem
6478 \begin_layout Plain Layout
6485 To see whether yours is, look for a line like
6488 \begin_layout LyX-Code
6494 \begin_layout Standard
6496 If so, then you may proceed largely as in the previous section, though
6498 \begin_inset Flex CharStyle:Code
6501 \begin_layout Plain Layout
6507 line will be different.
6508 If your new class is
6509 \begin_inset Flex CharStyle:Code
6512 \begin_layout Plain Layout
6518 and it is based upon
6519 \begin_inset Flex CharStyle:Code
6522 \begin_layout Plain Layout
6528 , then the line should read:
6532 \begin_layout Plain Layout
6533 And it will be easiest if you save the file to
6534 \begin_inset Flex CharStyle:Code
6537 \begin_layout Plain Layout
6543 : LyX assumes that the document class has the same name as the layout file.
6552 \begin_layout LyX-Code
6555 DeclareLaTeXClass[thesis,book]{thesis}
6558 \begin_layout Standard
6559 If, on the other hand, the new class is not based upon an existing class,
6560 you will probably have to
6561 \begin_inset Quotes eld
6565 \begin_inset Quotes erd
6569 We strongly suggest copying an existing layout file which uses a similar
6570 LaTeX class and then modifying it, if you can do so.
6571 At least use an existing file as a starting point so you can find out what
6572 items you need to worry about.
6573 Again, the specifics are covered below.
6576 \begin_layout Subsection
6578 \begin_inset CommandInset label
6580 name "sub:Creating-Templates"
6587 \begin_layout Standard
6588 Once you have written a layout file for a new document class, you might
6589 want to consider writing a
6594 A template acts as a kind of tutorial for your layout, showing how it might
6595 be used, though containing dummy content.
6596 You can of course look at the various templates included with LyX for ideas.
6599 \begin_layout Standard
6600 Templates are created just like usual documents: using LyX.
6601 The only difference is that usual documents contain all possible settings,
6602 including the font scheme and the paper size.
6603 Usually a user doesn't want a template to overwrite his preferred settings
6604 for such parameters.
6605 For that reason, the designer of a template should remove the corresponding
6607 \begin_inset Flex CharStyle:Code
6610 \begin_layout Plain Layout
6619 \begin_inset Flex CharStyle:Code
6622 \begin_layout Plain Layout
6630 from the template LyX file.
6631 This can be done with any simple text-editor, for example
6632 \begin_inset Flex CharStyle:Code
6635 \begin_layout Plain Layout
6642 \begin_inset Flex CharStyle:Code
6645 \begin_layout Plain Layout
6655 \begin_layout Standard
6656 Put the edited template files you create in
6657 \begin_inset Flex CharStyle:Code
6660 \begin_layout Plain Layout
6666 , copy the ones you use from the global template directory in
6667 \begin_inset Flex CharStyle:Code
6670 \begin_layout Plain Layout
6676 to the same place, and redefine the template path in the
6677 \begin_inset Flex CharStyle:MenuItem
6680 \begin_layout Plain Layout
6681 Tools\SpecialChar \menuseparator
6682 Preferences\SpecialChar \menuseparator
6691 \begin_layout Standard
6692 Note, by the way, that there is a template which has a particular meaning:
6694 \begin_inset Flex CharStyle:Code
6697 \begin_layout Plain Layout
6704 This template is loaded every time you create a new document with
6705 \begin_inset Flex CharStyle:MenuItem
6708 \begin_layout Plain Layout
6709 File\SpecialChar \menuseparator
6715 in order to provide useful defaults.
6716 To create this template from inside LyX, all you have to do is to open
6717 a document with the correct settings, and use the
6718 \begin_inset Flex CharStyle:MenuItem
6721 \begin_layout Plain Layout
6722 Save as Document Defaults
6730 \begin_layout Subsection
6731 Upgrading old layout files
6734 \begin_layout Standard
6735 The format of layout files changes with each LyX release, so old layout
6736 files need to be converted to the new format.
6737 This process has been automated since LyX 1.4: If LyX reads a layout file
6738 in an older format, it automatically calls the script
6739 \begin_inset Flex CharStyle:Code
6742 \begin_layout Plain Layout
6748 to convert it to a temporary file in current format.
6749 The original file is left untouched.
6750 If you use the layout file often, then, you may want to convert it permanently,
6751 so that LyX does not have to do so itself every time.
6752 To do this, you can call the converter manually:
6755 \begin_layout LyX-Code
6756 mv myclass.layout myclass.old
6759 \begin_layout LyX-Code
6760 python LyXDir/scripts/layout2layout.py myclass.old myclass.layout
6763 \begin_layout Standard
6765 \begin_inset Flex CharStyle:Code
6768 \begin_layout Plain Layout
6774 with the name of your LyX system directory, of course.
6777 \begin_layout Standard
6778 Note that manual conversion does not affect included files, so these will
6779 have to be converted separately.
6782 \begin_layout Section
6783 \begin_inset CommandInset label
6785 name "sec:TextClass"
6789 The layout file format
6792 \begin_layout Standard
6793 When it's finally time to get your hands dirty and create or edit your own
6794 layout file, the following sections describe what you're up against.
6795 Our advice is to go slowly, save and test often, listen to soothing music,
6796 and enjoy one or two of your favorite adult beverages; more if you are
6797 getting particularly stuck.
6798 It's really not that hard, except that the multitude of options can become
6799 overwhelming if you try to do too much in one sitting.
6800 Go have another adult beverage, just for good measure.
6803 \begin_layout Standard
6804 Note that all the tags used in layout files are case-insensitive.
6806 \begin_inset Flex CharStyle:Code
6809 \begin_layout Plain Layout
6816 \begin_inset Flex CharStyle:Code
6819 \begin_layout Plain Layout
6826 \begin_inset Flex CharStyle:Code
6829 \begin_layout Plain Layout
6835 are really the same tag.
6836 The possible values are printed in brackets after the feature's name.
6837 The default value if a feature isn't specified inside a text class-description
6839 \begin_inset Flex CharStyle:Code
6842 \begin_layout Plain Layout
6851 If the argument has a data type like
6852 \begin_inset Quotes eld
6856 \begin_inset Quotes erd
6860 \begin_inset Quotes eld
6864 \begin_inset Quotes erd
6867 , the default is shown like this:
6868 \begin_inset Flex CharStyle:Code
6871 \begin_layout Plain Layout
6882 \begin_layout Subsection
6883 The document class declaration
6886 \begin_layout Standard
6887 Lines in a layout file which begin with
6888 \begin_inset Flex CharStyle:Code
6891 \begin_layout Plain Layout
6898 There is one exception to this rule.
6900 \begin_inset Flex CharStyle:Code
6903 \begin_layout Plain Layout
6909 files should begin with a line like:
6912 \begin_layout LyX-Code
6915 #% Do not delete the line below; configure depends on this
6918 \begin_layout LyX-Code
6923 DeclareLaTeXClass{article}
6926 \begin_layout Standard
6927 The second line is used when you (re)configure LyX.
6928 The layout file is read by the LaTeX script
6929 \begin_inset Flex CharStyle:Code
6932 \begin_layout Plain Layout
6938 , in a special mode where
6939 \begin_inset Flex CharStyle:Code
6942 \begin_layout Plain Layout
6949 The first line is just a LaTeX comment, and the second one contains the
6950 declaration of the text class.
6951 If these lines appear in a file named
6952 \begin_inset Flex CharStyle:Code
6955 \begin_layout Plain Layout
6961 , then they define a text class of name
6962 \begin_inset Flex CharStyle:Code
6965 \begin_layout Plain Layout
6971 (the name of the layout file) which uses the LaTeX document class
6972 \begin_inset Flex CharStyle:Code
6975 \begin_layout Plain Layout
6981 (the default is to use the same name as the layout).
6983 \begin_inset Quotes eld
6987 \begin_inset Quotes erd
6990 that appears above is used as a description of the text class in the
6991 \begin_inset Flex CharStyle:MenuItem
6994 \begin_layout Plain Layout
6995 Document\SpecialChar \menuseparator
7004 \begin_layout Standard
7005 Let's assume that you wrote your own text class that uses the
7006 \begin_inset Flex CharStyle:Code
7009 \begin_layout Plain Layout
7015 document class, but where you changed the appearance of the section headings.
7016 If you put it in a file
7017 \begin_inset Flex CharStyle:Code
7020 \begin_layout Plain Layout
7026 , the header of this file should be:
7029 \begin_layout LyX-Code
7032 #% Do not delete the line below; configure depends on this
7035 \begin_layout LyX-Code
7040 DeclareLaTeXClass[article]{article (with my own headings)}
7043 \begin_layout Standard
7044 This declares a text class
7045 \begin_inset Flex CharStyle:Code
7048 \begin_layout Plain Layout
7054 , associated with the LaTeX document class
7055 \begin_inset Flex CharStyle:Code
7058 \begin_layout Plain Layout
7065 \begin_inset Quotes eld
7068 article (with my own headings)
7069 \begin_inset Quotes erd
7073 If your text class depends on several packages, you can declare it as:
7076 \begin_layout LyX-Code
7079 #% Do not delete the line below; configure depends on this
7082 \begin_layout LyX-Code
7087 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
7090 \begin_layout Standard
7091 This indicates that your text class uses the
7092 \begin_inset Flex CharStyle:Code
7095 \begin_layout Plain Layout
7102 Finally, it is also possible to declare classes for DocBook code.
7103 Typical declarations will look like:
7106 \begin_layout LyX-Code
7109 #% Do not delete the line below; configure depends on this
7112 \begin_layout LyX-Code
7117 DeclareDocBookClass[article]{SGML (DocBook article)}
7120 \begin_layout Standard
7121 Note that these declarations can also be given an optional parameter declaring
7122 the name of the document class (but not a list).
7125 \begin_layout Standard
7126 So, to be as explicit as possible, the form of the layout declaration is:
7129 \begin_layout LyX-Code
7134 DeclareLaTeXClass[class,package.sty]{layout description}
7137 \begin_layout Standard
7138 The class need only be specified if the name of the LaTeX class file and
7139 the name of the layout file are different; if the name of the class file
7140 is not specified, then LyX will simply assume that it is the same as the
7141 name of the layout file.
7144 \begin_layout Standard
7145 When the text class has been modified to your taste, all you have to do
7146 is to copy it either to
7147 \begin_inset Flex CharStyle:Code
7150 \begin_layout Plain Layout
7157 \begin_inset Flex CharStyle:Code
7160 \begin_layout Plain Layout
7167 \begin_inset Flex CharStyle:MenuItem
7170 \begin_layout Plain Layout
7171 Tools\SpecialChar \menuseparator
7177 , exit LyX and restart.
7178 Then your new text class should be available along with the others.
7181 \begin_layout Standard
7182 Once the layout file is installed, you can edit it and see your changes
7183 without having to reconfigure or to restart LyX.
7188 \begin_layout Plain Layout
7189 In versions of LyX prior to 1.6, this was not true.
7190 As a result, editing layout files was very time consuming, since you had
7191 constantly to restart LyX to see changes.
7196 You can force a reload of the current layout by using the LyX function
7198 \begin_inset Flex CharStyle:MenuItem
7201 \begin_layout Plain Layout
7208 There is no default binding for this function—though, of course, you can
7209 bind it to a key yourself.
7210 But you will normally use this function simply by entering it in the mini-buffe
7215 \begin_layout Standard
7221 \begin_inset Flex CharStyle:MenuItem
7224 \begin_layout Plain Layout
7230 is very much an `advanced feature'.
7235 recommended that you save your work before using this function.
7240 recommended that you not attempt to edit layout information while simultaneousl
7241 y working on a document that you care about.
7242 Use a test document.
7243 Syntax errors and the like in your layout file could cause peculiar behavior.
7244 In particular, such errors could cause LyX to regard the current layout
7245 as invalid and to attempt to switch to some other layout.
7249 \begin_layout Plain Layout
7250 Really bad syntax errors may even caused LyX to exit.
7251 This is because certain sorts of errors may make LyX unable to read
7261 The LyX team strives to keep LyX stable in such situations, but safe is
7266 \begin_layout Plain Layout
7267 While we're giving advice: make regular backups.
7268 And be nice to your mother.
7276 \begin_layout Subsection
7277 The Module declaration
7280 \begin_layout Standard
7281 A module must begin with a line like the following:
7284 \begin_layout LyX-Code
7287 DeclareLyXModule[endnotes.sty]{Endnotes}
7290 \begin_layout Standard
7291 The mandatory argument, in curly brackets, is the name of the module, as
7293 \begin_inset Flex CharStyle:MenuItem
7296 \begin_layout Plain Layout
7297 Document\SpecialChar \menuseparator
7304 The argument in square brackets is optional: It declares any LaTeX packages
7305 on which the module depends.
7306 Please note that only packages about which LyX knows should be listed in
7307 the square brackets.
7311 \begin_layout Plain Layout
7312 The list of such packages is documented only in the source code.
7317 LyX will not check for arbitrary packages.
7318 It is also possible to use the form
7319 \begin_inset Flex CharStyle:MenuItem
7322 \begin_layout Plain Layout
7328 as an optional argument, which declares that the module can only be used
7329 when there exists a conversion chain between the formats `
7330 \begin_inset Flex CharStyle:Code
7333 \begin_layout Plain Layout
7340 \begin_inset Flex CharStyle:Code
7343 \begin_layout Plain Layout
7352 \begin_layout Standard
7353 The module declaration should then be followed by lines like the following:
7356 \begin_layout LyX-Code
7360 \begin_layout LyX-Code
7361 #Adds an endnote command, in addition to footnotes.
7365 \begin_layout LyX-Code
7366 #You will need to add
7368 theendnotes in TeX code where you
7371 \begin_layout LyX-Code
7372 #want the endnotes to appear.
7376 \begin_layout LyX-Code
7380 \begin_layout LyX-Code
7381 #Requires: somemodule | othermodule
7384 \begin_layout LyX-Code
7385 #Excludes: badmodule
7388 \begin_layout Standard
7389 The description is used in
7390 \begin_inset Flex CharStyle:MenuItem
7393 \begin_layout Plain Layout
7394 Document\SpecialChar \menuseparator
7400 to provide the user with information about what the module does.
7402 \begin_inset Flex CharStyle:Code
7405 \begin_layout Plain Layout
7411 line is used to identify other modules with which this one must be used;
7413 \begin_inset Flex CharStyle:Code
7416 \begin_layout Plain Layout
7422 line is used to identify modules with which this one may not be used.
7423 Both are optional, and, as shown, multiple modules should be separated
7424 with the pipe symbol: |.
7425 Note that the required modules are treated disjunctively:
7429 of the required modules must be used.
7434 excluded module may be used.
7435 Note that modules are identified here by their
7440 \begin_inset Flex CharStyle:Code
7443 \begin_layout Plain Layout
7451 \begin_inset Flex CharStyle:Code
7454 \begin_layout Plain Layout
7461 \begin_inset Flex CharStyle:Code
7464 \begin_layout Plain Layout
7473 \begin_layout Subsection
7477 \begin_layout Standard
7478 The first non-comment line of any layout file, included file, or module
7483 contain the file format number:
7486 \begin_layout Description
7487 \begin_inset Flex CharStyle:Code
7490 \begin_layout Plain Layout
7497 \begin_inset Flex CharStyle:Code
7500 \begin_layout Plain Layout
7506 ] The format of the layout file.
7509 \begin_layout Standard
7510 This tag was introduced with LyX 1.4.0.
7511 Layout files from LyX 1.3.x and earlier don't have an explicit file format
7512 and are considered to be of format 1.
7513 The format for the present version of LyX is format 21.
7514 But each version of LyX is capable of reading earlier versions' layout
7515 files, just as they are capable of reading files produced by earlier versions
7517 There is, however, no provision for converting to earlier formats.
7518 So LyX 1.6.x will not read layout files in format 21 but only files in format
7522 \begin_layout Subsection
7523 \begin_inset CommandInset label
7525 name "sub:General-text-class"
7529 General text class parameters
7532 \begin_layout Standard
7533 These are general parameters that govern the behavior of an entire document
7539 mean that they must appear in
7540 \begin_inset Flex CharStyle:Code
7543 \begin_layout Plain Layout
7549 files rather than in modules.
7550 A module can contain any layout tag.)
7553 \begin_layout Description
7554 \begin_inset Flex CharStyle:Code
7557 \begin_layout Plain Layout
7563 Adds information that will be output in the
7564 \begin_inset Flex CharStyle:Code
7567 \begin_layout Plain Layout
7573 block when this document class is output to XHTML.
7574 Typically, this would be used to output CSS style information, but it can
7575 be used for anything that can appear in
7576 \begin_inset Flex CharStyle:Code
7579 \begin_layout Plain Layout
7587 \begin_inset Quotes eld
7591 \begin_inset Flex CharStyle:Code
7594 \begin_layout Plain Layout
7601 \begin_inset Quotes erd
7607 \begin_layout Description
7608 \begin_inset Flex CharStyle:Code
7611 \begin_layout Plain Layout
7617 Adds information to the document preamble.
7619 \begin_inset Quotes eld
7623 \begin_inset Flex CharStyle:Code
7626 \begin_layout Plain Layout
7633 \begin_inset Quotes erd
7639 \begin_layout Description
7640 \begin_inset Flex CharStyle:Code
7643 \begin_layout Plain Layout
7649 Defines formats for use in the display of bibliographic information.
7651 \begin_inset CommandInset ref
7653 reference "sub:Citation-format-description"
7659 \begin_inset Quotes eld
7663 \begin_inset Flex CharStyle:Code
7666 \begin_layout Plain Layout
7673 \begin_inset Quotes erd
7679 \begin_layout Description
7680 \begin_inset Flex CharStyle:Code
7683 \begin_layout Plain Layout
7689 Describes various global options supported by the document class.
7691 \begin_inset space ~
7695 \begin_inset CommandInset ref
7697 reference "sub:ClassOptions"
7703 \begin_inset Quotes eld
7707 \begin_inset Flex CharStyle:Code
7710 \begin_layout Plain Layout
7717 \begin_inset Quotes erd
7723 \begin_layout Description
7724 \begin_inset Flex CharStyle:Code
7727 \begin_layout Plain Layout
7734 \begin_inset Flex CharStyle:Code
7737 \begin_layout Plain Layout
7746 \begin_inset Flex CharStyle:Code
7749 \begin_layout Plain Layout
7755 ] Whether the class should
7759 to having one or two columns.
7760 Can be changed in the
7761 \begin_inset Flex CharStyle:MenuItem
7764 \begin_layout Plain Layout
7765 Document\SpecialChar \menuseparator
7774 \begin_layout Description
7775 \begin_inset Flex CharStyle:Code
7778 \begin_layout Plain Layout
7785 \begin_inset Flex CharStyle:Code
7788 \begin_layout Plain Layout
7794 ] This sequence defines the properties for a counter.
7795 If the counter does not yet exist, it is created; if it does exist, it
7798 \begin_inset Quotes eld
7802 \begin_inset Flex CharStyle:Code
7805 \begin_layout Plain Layout
7812 \begin_inset Quotes erd
7816 \begin_inset Newline newline
7820 \begin_inset space ~
7824 \begin_inset CommandInset ref
7826 reference "sub:Counters"
7830 for details on counters.
7833 \begin_layout Description
7834 \begin_inset Flex CharStyle:Code
7837 \begin_layout Plain Layout
7843 Sets the default font used to display the document.
7845 \begin_inset space ~
7849 \begin_inset CommandInset ref
7851 reference "sub:Font-description"
7855 for how to declare fonts.
7857 \begin_inset Quotes eld
7861 \begin_inset Flex CharStyle:Code
7864 \begin_layout Plain Layout
7871 \begin_inset Quotes erd
7877 \begin_layout Description
7878 \begin_inset Flex CharStyle:Code
7881 \begin_layout Plain Layout
7888 \begin_inset Flex CharStyle:Code
7891 \begin_layout Plain Layout
7897 Specifies a module to be included by default with this document class.
7898 The module should be specified by filename without the
7899 \begin_inset Flex CharStyle:Code
7902 \begin_layout Plain Layout
7909 The user can still remove the module, but it will be active at the outset.
7910 (This applies only when new files are created, or when this class is chosen
7911 for an existing document.)
7914 \begin_layout Description
7915 \begin_inset Flex CharStyle:Code
7918 \begin_layout Plain Layout
7925 \begin_inset Flex CharStyle:Code
7928 \begin_layout Plain Layout
7934 ] This is the style that will be assigned to new paragraphs, usually
7935 \begin_inset Flex CharStyle:MenuItem
7938 \begin_layout Plain Layout
7945 This will default to the first defined style if not given, but you are
7946 encouraged to use this directive.
7949 \begin_layout Description
7950 \begin_inset Flex CharStyle:Code
7953 \begin_layout Plain Layout
7960 \begin_inset Flex CharStyle:Code
7963 \begin_layout Plain Layout
7969 ] This tag indicates that the module in question—which should be specified
7970 by filename without the
7971 \begin_inset Flex CharStyle:Code
7974 \begin_layout Plain Layout
7980 extension—cannot be used with this document class.
7981 This might be used in a journal-specific layout file to prevent, say, the
7983 \begin_inset Flex CharStyle:Code
7986 \begin_layout Plain Layout
7992 module that numbers theorems by section.
7997 be used in a module.
7998 Modules have their own way of excluding other modules (see
7999 \begin_inset CommandInset ref
8001 reference "sub:Layout-modules"
8008 \begin_layout Description
8009 \begin_inset Flex CharStyle:Code
8012 \begin_layout Plain Layout
8018 Defines a new float.
8020 \begin_inset space ~
8024 \begin_inset CommandInset ref
8026 reference "sub:Floats"
8032 \begin_inset Quotes eld
8036 \begin_inset Flex CharStyle:Code
8039 \begin_layout Plain Layout
8046 \begin_inset Quotes erd
8052 \begin_layout Description
8053 \begin_inset Flex CharStyle:Code
8056 \begin_layout Plain Layout
8062 Sets the information that will be output in the
8063 \begin_inset Flex CharStyle:Code
8066 \begin_layout Plain Layout
8072 block when this document class is output to XHTML.
8073 Note that this will completely override any prior
8074 \begin_inset Flex CharStyle:Code
8077 \begin_layout Plain Layout
8084 \begin_inset Flex CharStyle:Code
8087 \begin_layout Plain Layout
8095 \begin_inset Flex CharStyle:Code
8098 \begin_layout Plain Layout
8104 if you just want to add material to the preamble.) Must end with
8105 \begin_inset Quotes eld
8109 \begin_inset Flex CharStyle:Code
8112 \begin_layout Plain Layout
8119 \begin_inset Quotes erd
8125 \begin_layout Description
8126 \begin_inset Flex CharStyle:Code
8129 \begin_layout Plain Layout
8136 \begin_inset Flex CharStyle:Code
8139 \begin_layout Plain Layout
8145 ] The layout to use for the table of contents, bibliography, and so forth,
8146 when the document is output to HTML.
8147 For articles, this should normally be Section; for books, Chapter.
8148 If it is not given, then LyX will attempt to figure out which layout to
8152 \begin_layout Description
8153 \begin_inset Flex CharStyle:Code
8156 \begin_layout Plain Layout
8163 \begin_inset Flex CharStyle:Code
8166 \begin_layout Plain Layout
8172 ] Modifies the properties of the given counter.
8173 If the counter does not exist, the section is ignored.
8175 \begin_inset Quotes eld
8179 \begin_inset Flex CharStyle:Code
8182 \begin_layout Plain Layout
8189 \begin_inset Quotes erd
8193 \begin_inset Newline newline
8197 \begin_inset space ~
8201 \begin_inset CommandInset ref
8203 reference "sub:Counters"
8207 for details on counters.
8210 \begin_layout Description
8211 \begin_inset Flex CharStyle:Code
8214 \begin_layout Plain Layout
8221 \begin_inset Flex CharStyle:Code
8224 \begin_layout Plain Layout
8230 ] Modifies the properties of the given paragraph style.
8231 If the style does not exist, the section is ignored.
8233 \begin_inset Quotes eld
8237 \begin_inset Flex CharStyle:Code
8240 \begin_layout Plain Layout
8247 \begin_inset Quotes erd
8253 \begin_layout Description
8254 \begin_inset Flex CharStyle:Code
8257 \begin_layout Plain Layout
8263 As its name implies, this command allows you to include another layout
8264 definition file within yours to avoid duplicating commands.
8265 Common examples are the standard layout files, for example,
8266 \begin_inset Flex CharStyle:Code
8269 \begin_layout Plain Layout
8275 , which contains most of the basic layouts.
8278 \begin_layout Description
8279 \begin_inset Flex CharStyle:Code
8282 \begin_layout Plain Layout
8288 This section (re-)defines the layout of an inset.
8289 It can be applied to an existing inset or to a new, user-defined inset,
8290 e.g., a new character style.
8292 \begin_inset Quotes eld
8296 \begin_inset Flex CharStyle:Code
8299 \begin_layout Plain Layout
8306 \begin_inset Quotes erd
8310 \begin_inset Newline newline
8314 \begin_inset space ~
8318 \begin_inset CommandInset ref
8320 reference "sub:Flex-insets-and"
8324 for more information.
8328 \begin_layout Description
8329 \begin_inset Flex CharStyle:Code
8332 \begin_layout Plain Layout
8339 \begin_inset Flex CharStyle:Code
8342 \begin_layout Plain Layout
8348 ] A string that indicates the width of the left margin on the screen, for
8350 \begin_inset Quotes eld
8354 \begin_inset Quotes erd
8358 (Note that this is not a `length', like
8359 \begin_inset Quotes eld
8363 \begin_inset Quotes erd
8369 \begin_layout Description
8370 \begin_inset Flex CharStyle:Code
8373 \begin_layout Plain Layout
8379 This command deletes an existing float.
8380 This is particularly useful when you want to suppress a float that has
8381 been defined in an input file.
8384 \begin_layout Description
8385 \begin_inset Flex CharStyle:Code
8388 \begin_layout Plain Layout
8394 This command deletes an existing style.
8395 This is particularly useful when you want to suppress a style that has
8396 be defined in an input file.
8399 \begin_layout Description
8400 \begin_inset Flex CharStyle:Code
8403 \begin_layout Plain Layout
8409 A string indicating the file format (as defined in the Preferences dialog)
8410 produced by this class.
8411 It is mainly useful when
8412 \begin_inset Flex CharStyle:Code
8415 \begin_layout Plain Layout
8421 is `literate' and one wants to define a new type of literate document.
8422 This string is reset to `docbook', `latex', or `literate' when the correspondin
8424 \begin_inset Flex CharStyle:Code
8427 \begin_layout Plain Layout
8433 parameter is encountered.
8436 \begin_layout Description
8437 \begin_inset Flex CharStyle:Code
8440 \begin_layout Plain Layout
8446 A string indicating what sort of output documents using this class will
8448 At present, the options are: `docbook', `latex', and `literate'.
8451 \begin_layout Description
8452 \begin_inset Flex CharStyle:Code
8455 \begin_layout Plain Layout
8462 \begin_inset Flex CharStyle:Code
8465 \begin_layout Plain Layout
8474 \begin_inset Flex CharStyle:Code
8477 \begin_layout Plain Layout
8484 \begin_inset Flex CharStyle:Code
8487 \begin_layout Plain Layout
8493 ] The default pagestyle.
8494 Can be changed in the
8495 \begin_inset Flex CharStyle:MenuItem
8498 \begin_layout Plain Layout
8499 Document\SpecialChar \menuseparator
8508 \begin_layout Description
8509 \begin_inset Flex CharStyle:Code
8512 \begin_layout Plain Layout
8518 Sets the preamble for the LaTeX document.
8519 Note that this will completely override any prior
8520 \begin_inset Flex CharStyle:Code
8523 \begin_layout Plain Layout
8530 \begin_inset Flex CharStyle:Code
8533 \begin_layout Plain Layout
8541 \begin_inset Flex CharStyle:Code
8544 \begin_layout Plain Layout
8550 if you just want to add material to the preamble.) Must end with
8551 \begin_inset Quotes eld
8555 \begin_inset Flex CharStyle:Code
8558 \begin_layout Plain Layout
8565 \begin_inset Quotes erd
8571 \begin_layout Description
8572 \begin_inset Flex CharStyle:Code
8575 \begin_layout Plain Layout
8582 \begin_inset Flex CharStyle:Code
8585 \begin_layout Plain Layout
8592 \begin_inset Flex CharStyle:Code
8595 \begin_layout Plain Layout
8604 \begin_inset Flex CharStyle:Code
8607 \begin_layout Plain Layout
8613 ] Whether the class already provides the feature
8614 \begin_inset Flex CharStyle:Code
8617 \begin_layout Plain Layout
8624 A feature is in general the name of a package (
8625 \begin_inset Flex CharStyle:Code
8628 \begin_layout Plain Layout
8635 \begin_inset Flex CharStyle:Code
8638 \begin_layout Plain Layout
8644 , \SpecialChar \ldots{}
8646 \begin_inset Flex CharStyle:Code
8649 \begin_layout Plain Layout
8656 \begin_inset Flex CharStyle:Code
8659 \begin_layout Plain Layout
8665 ,\SpecialChar \ldots{}
8666 ); the complete list of supported features is unfortunately not documented
8667 outside the LyX source code—but see
8668 \begin_inset Flex CharStyle:Code
8671 \begin_layout Plain Layout
8677 if you're interested.
8679 \begin_inset Flex CharStyle:MenuItem
8682 \begin_layout Plain Layout
8683 Help\SpecialChar \menuseparator
8689 also gives an overview of the supported packages.
8692 \begin_layout Description
8693 \begin_inset Flex CharStyle:Code
8696 \begin_layout Plain Layout
8703 \begin_inset Flex CharStyle:Code
8706 \begin_layout Plain Layout
8712 ] Indicates that this layout provides the functionality of the module mentioned,
8713 which should be specified by the filename without the
8714 \begin_inset Flex CharStyle:Code
8717 \begin_layout Plain Layout
8724 This will typically be used if the layout includes the module directly,
8725 rather than using the
8726 \begin_inset Flex CharStyle:Code
8729 \begin_layout Plain Layout
8735 tag to indicate that it ought to be used.
8736 It could also be used in a module that provided an alternate implementation
8737 of the same functionality.
8740 \begin_layout Description
8741 \begin_inset Flex CharStyle:Code
8744 \begin_layout Plain Layout
8751 \begin_inset Flex CharStyle:Code
8754 \begin_layout Plain Layout
8760 ] Whether the class requires the feature
8761 \begin_inset Flex CharStyle:Code
8764 \begin_layout Plain Layout
8771 Multiple features must be separated by commas.
8772 Note that you can only request supported features.
8774 \begin_inset Flex CharStyle:Code
8777 \begin_layout Plain Layout
8783 for a list of these.)
8786 \begin_layout Description
8787 \begin_inset Flex CharStyle:Code
8790 \begin_layout Plain Layout
8796 A string that indicates the width of the right margin on the screen, for
8798 \begin_inset Quotes eld
8802 \begin_inset Quotes erd
8808 \begin_layout Description
8809 \begin_inset Flex CharStyle:Code
8812 \begin_layout Plain Layout
8818 Sets which divisions get numbered.
8820 \begin_inset Flex CharStyle:Code
8823 \begin_layout Plain Layout
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
8855 \begin_inset Flex CharStyle:Code
8858 \begin_layout Plain Layout
8864 ] Whether the class-default should be printing on one or both sides of the
8866 Can be changed in the
8867 \begin_inset Flex CharStyle:MenuItem
8870 \begin_layout Plain Layout
8871 Document\SpecialChar \menuseparator
8880 \begin_layout Description
8881 \begin_inset Flex CharStyle:Code
8884 \begin_layout Plain Layout
8890 This sequence defines a paragraph style.
8891 If the style does not yet exist, it is created; if it does exist, its parameter
8894 \begin_inset Quotes eld
8898 \begin_inset Flex CharStyle:Code
8901 \begin_layout Plain Layout
8908 \begin_inset Quotes erd
8912 \begin_inset Newline newline
8916 \begin_inset space ~
8920 \begin_inset CommandInset ref
8922 reference "sub:Paragraph-Styles"
8926 for details on paragraph styles.
8929 \begin_layout Description
8930 \begin_inset Flex CharStyle:Code
8933 \begin_layout Plain Layout
8940 \begin_inset Flex CharStyle:Code
8943 \begin_layout Plain Layout
8949 ] The name of the command or environment to be used with
8950 \begin_inset Flex CharStyle:Code
8953 \begin_layout Plain Layout
8962 \begin_layout Description
8963 \begin_inset Flex CharStyle:Code
8966 \begin_layout Plain Layout
8973 \begin_inset Flex CharStyle:Code
8976 \begin_layout Plain Layout
8985 \begin_inset Flex CharStyle:Code
8988 \begin_layout Plain Layout
8994 ] Indicates what kind of markup is used to define the title of a document.
8996 \begin_inset Flex CharStyle:Code
8999 \begin_layout Plain Layout
9005 means that the macro with name
9006 \begin_inset Flex CharStyle:Code
9009 \begin_layout Plain Layout
9015 will be inserted after the last layout which has
9016 \begin_inset Quotes eld
9020 \begin_inset Flex CharStyle:Code
9023 \begin_layout Plain Layout
9030 \begin_inset Quotes erd
9035 \begin_inset Flex CharStyle:Code
9038 \begin_layout Plain Layout
9044 corresponds to the case where the block of paragraphs which have
9045 \begin_inset Quotes eld
9049 \begin_inset Flex CharStyle:Code
9052 \begin_layout Plain Layout
9059 \begin_inset Quotes erd
9062 should be enclosed into the
9063 \begin_inset Flex CharStyle:Code
9066 \begin_layout Plain Layout
9075 \begin_layout Description
9076 \begin_inset Flex CharStyle:Code
9079 \begin_layout Plain Layout
9085 Sets which divisions are included in the table of contents.
9087 \begin_inset Flex CharStyle:Code
9090 \begin_layout Plain Layout
9099 \begin_layout Subsection
9100 \begin_inset Flex CharStyle:Code
9103 \begin_layout Plain Layout
9110 \begin_inset CommandInset label
9112 name "sub:ClassOptions"
9119 \begin_layout Standard
9121 \begin_inset Flex CharStyle:Code
9124 \begin_layout Plain Layout
9130 section can contain the following entries:
9133 \begin_layout Description
9134 \begin_inset Flex CharStyle:Code
9137 \begin_layout Plain Layout
9144 \begin_inset Flex CharStyle:Code
9147 \begin_layout Plain Layout
9153 ] The list of available font sizes for the document's main font, separated
9155 \begin_inset Quotes eld
9159 \begin_inset Flex CharStyle:Code
9162 \begin_layout Plain Layout
9169 \begin_inset Quotes erd
9175 \begin_layout Description
9176 \begin_inset Flex CharStyle:Code
9179 \begin_layout Plain Layout
9185 Used to set the DTD line with XML-based output classes.
9187 \begin_inset space \thinspace{}
9191 \begin_inset Quotes eld
9194 -//OASIS//DTD DocBook V4.2//EN
9195 \begin_inset Quotes erd
9201 \begin_layout Description
9202 \begin_inset Flex CharStyle:Code
9205 \begin_layout Plain Layout
9212 \begin_inset Flex CharStyle:Code
9215 \begin_layout Plain Layout
9216 string="empty|plain|headings|fancy"
9221 ] The list of available page styles, separated by
9222 \begin_inset Quotes eld
9226 \begin_inset Flex CharStyle:Code
9229 \begin_layout Plain Layout
9236 \begin_inset Quotes erd
9242 \begin_layout Description
9243 \begin_inset Flex CharStyle:Code
9246 \begin_layout Plain Layout
9253 \begin_inset Flex CharStyle:Code
9256 \begin_layout Plain Layout
9262 ] Some document class options, separated by a comma, that will be added
9263 to the optional part of the
9264 \begin_inset Flex CharStyle:Code
9267 \begin_layout Plain Layout
9278 \begin_layout Standard
9280 \begin_inset Flex CharStyle:Code
9283 \begin_layout Plain Layout
9289 section must end with
9290 \begin_inset Quotes eld
9294 \begin_inset Flex CharStyle:Code
9297 \begin_layout Plain Layout
9304 \begin_inset Quotes erd
9310 \begin_layout Subsection
9312 \begin_inset CommandInset label
9314 name "sub:Paragraph-Styles"
9321 \begin_layout Standard
9322 A paragraph style description looks like this:
9326 \begin_layout Plain Layout
9327 Note that this will either define a new layout or modify an existing one.
9335 \begin_layout LyX-Code
9342 \begin_layout LyX-Code
9346 \begin_layout LyX-Code
9350 \begin_layout Standard
9351 where the following commands are allowed:
9354 \begin_layout Description
9355 \begin_inset Flex CharStyle:Code
9358 \begin_layout Plain Layout
9365 \begin_inset Flex CharStyle:Code
9368 \begin_layout Plain Layout
9373 , left, right, center
9378 ] Paragraph alignment.
9381 \begin_layout Description
9382 \begin_inset Flex CharStyle:Code
9385 \begin_layout Plain Layout
9392 \begin_inset Flex CharStyle:Code
9395 \begin_layout Plain Layout
9400 , left, right, center
9405 ] A comma separated list of permitted alignments.
9406 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
9408 For example a right-aligned or centered enumeration isn't possible.)
9411 \begin_layout Description
9412 \begin_inset Flex CharStyle:Code
9415 \begin_layout Plain Layout
9421 Language dependent information to be included in the LaTeX preamble when
9423 Note that this will completely override any prior
9424 \begin_inset Flex CharStyle:Code
9427 \begin_layout Plain Layout
9435 \begin_inset Quotes eld
9439 \begin_inset Flex CharStyle:Code
9442 \begin_layout Plain Layout
9449 \begin_inset Quotes erd
9453 The contents of this tag will occur once in the LaTeX preamble for each
9454 language used by the document.
9455 Each time, the following substitutions are made:
9459 \begin_layout Itemize
9460 \begin_inset Flex CharStyle:Code
9463 \begin_layout Plain Layout
9469 is replaced by the language name (as used by the babel package).
9472 \begin_layout Itemize
9474 \begin_inset Quotes eld
9478 \begin_inset Quotes erd
9482 \begin_inset Flex CharStyle:Code
9485 \begin_layout Plain Layout
9491 replaces its argument by the translation of the argument to the current
9495 \begin_layout Standard
9496 This preamble snippet will only be used if the document contains more than
9497 one language and the babel package is used.
9501 \begin_layout Description
9502 \begin_inset Flex CharStyle:Code
9505 \begin_layout Plain Layout
9512 \begin_inset Flex CharStyle:Code
9515 \begin_layout Plain Layout
9525 \begin_layout Plain Layout
9526 Note that a `float' here is a real number, such as: 1.5.
9531 The vertical space with which the last of a chain of paragraphs with this
9532 layout is separated from the following paragraph.
9533 If the next paragraph has another layout, the separations are not simply
9534 added, but the maximum is taken.
9537 \begin_layout Description
9538 \begin_inset Flex CharStyle:Code
9541 \begin_layout Plain Layout
9548 \begin_inset Flex CharStyle:Code
9551 \begin_layout Plain Layout
9557 The category for this style.
9558 This is used to group related styles in the Layout combobox on the toolbar.
9559 Any string can be used, but you may want to use existing categories with
9564 \begin_layout Description
9565 \begin_inset Flex CharStyle:Code
9568 \begin_layout Plain Layout
9574 Depth of XML command.
9575 Used only with XML-type formats.
9578 \begin_layout Description
9579 \begin_inset Flex CharStyle:Code
9582 \begin_layout Plain Layout
9589 \begin_inset CommandInset label
9591 name "des:CopyStyle"
9596 \begin_inset Flex CharStyle:Code
9599 \begin_layout Plain Layout
9605 Copies all the features of an existing style into the current one.
9609 \begin_layout Description
9610 \begin_inset Flex CharStyle:Code
9613 \begin_layout Plain Layout
9619 The name of a style whose preamble should be output
9624 This allows to ensure some ordering of the preamble snippets when macros
9625 definitions depend on one another.
9629 \begin_layout Plain Layout
9630 Note that, besides that functionality, there is no way to ensure any ordering
9632 The ordering that you see in a given version of LyX may change without
9633 warning in later versions.
9641 \begin_layout Description
9642 \begin_inset Flex CharStyle:Code
9645 \begin_layout Plain Layout
9652 \begin_inset Flex CharStyle:Code
9655 \begin_layout Plain Layout
9660 , Box, Filled_Box, Static
9665 ] The type of label that stands at the end of the paragraph (or sequence
9667 \begin_inset Flex CharStyle:Code
9670 \begin_layout Plain Layout
9677 \begin_inset Flex CharStyle:Code
9680 \begin_layout Plain Layout
9687 \begin_inset Flex CharStyle:Code
9690 \begin_layout Plain Layout
9697 \begin_inset Flex CharStyle:Code
9700 \begin_layout Plain Layout
9708 \begin_inset Flex CharStyle:Code
9711 \begin_layout Plain Layout
9718 \begin_inset Quotes eld
9722 \begin_inset Quotes erd
9726 \begin_inset Flex CharStyle:Code
9729 \begin_layout Plain Layout
9736 \begin_inset Flex CharStyle:Code
9739 \begin_layout Plain Layout
9740 \begin_inset space ~
9749 \begin_inset space ~
9752 black) square suitable for end of proof markers,
9753 \begin_inset Flex CharStyle:Code
9756 \begin_layout Plain Layout
9762 is an explicit text string.
9765 \begin_layout Description
9766 \begin_inset Flex CharStyle:Code
9769 \begin_layout Plain Layout
9776 \begin_inset Flex CharStyle:Code
9779 \begin_layout Plain Layout
9785 ] The string used for a label with a
9786 \begin_inset Flex CharStyle:Code
9789 \begin_layout Plain Layout
9796 \begin_inset Flex CharStyle:Code
9799 \begin_layout Plain Layout
9809 \begin_layout Description
9810 \begin_inset Flex CharStyle:Code
9813 \begin_layout Plain Layout
9820 \begin_inset Flex CharStyle:Code
9823 \begin_layout Plain Layout
9834 \begin_inset Flex CharStyle:Code
9837 \begin_layout Plain Layout
9846 \begin_layout Description
9847 \begin_inset Flex CharStyle:Code
9850 \begin_layout Plain Layout
9857 \begin_inset Flex CharStyle:Code
9860 \begin_layout Plain Layout
9870 ] With this parameter the
9871 \begin_inset Flex CharStyle:MenuItem
9874 \begin_layout Plain Layout
9881 \begin_inset Quotes eld
9884 Vertical space above
9885 \begin_inset Quotes erd
9889 \begin_inset Flex CharStyle:MenuItem
9892 \begin_layout Plain Layout
9893 Edit\SpecialChar \menuseparator
9895 \begin_inset space ~
9903 dialog can be set when initializing a paragraph with this style.
9907 \begin_layout Plain Layout
9910 Note from Jean-Marc:
9912 I'm not sure that this setting has much use, and it should probably be
9913 removed in later versions.
9921 \begin_layout Description
9922 \begin_inset Flex CharStyle:Code
9925 \begin_layout Plain Layout
9931 The font used for both the text body
9937 \begin_inset space ~
9941 \begin_inset CommandInset ref
9943 reference "sub:Font-description"
9948 Note that defining this font automatically defines the
9949 \begin_inset Flex CharStyle:Code
9952 \begin_layout Plain Layout
9959 So you should define this one first if you also want to define
9960 \begin_inset Flex CharStyle:Code
9963 \begin_layout Plain Layout
9972 \begin_layout Description
9973 \begin_inset Flex CharStyle:Code
9976 \begin_layout Plain Layout
9983 \begin_inset CommandInset label
9985 name "des:FreeSpacing"
9990 \begin_inset Flex CharStyle:Code
9993 \begin_layout Plain Layout
10002 \begin_inset Flex CharStyle:Code
10005 \begin_layout Plain Layout
10011 ] Usually LyX doesn't allow you to insert more than one space between words,
10012 since a space is considered as the separation between two words, not a
10013 character or symbol of its own.
10014 This is a very fine thing but sometimes annoying, for example, when typing
10015 program code or plain LaTeX code.
10017 \begin_inset Flex CharStyle:Code
10020 \begin_layout Plain Layout
10027 Note that LyX will create protected blanks for the additional blanks when
10028 in another mode than LaTeX-mode.
10031 \begin_layout Description
10032 \begin_inset Flex CharStyle:Code
10035 \begin_layout Plain Layout
10041 These tags are used with XHTML output.
10043 \begin_inset CommandInset ref
10044 LatexCommand prettyref
10045 reference "sub:Paragraph-Style-XHTML"
10052 \begin_layout Description
10053 \begin_inset Flex CharStyle:Code
10056 \begin_layout Plain Layout
10062 [[FIXME]] (Used only with XML-type formats.)
10065 \begin_layout Description
10066 \begin_inset Flex CharStyle:Code
10069 \begin_layout Plain Layout
10076 \begin_inset Flex CharStyle:Code
10079 \begin_layout Plain Layout
10085 If 1, marks the layout as to be included in the document preamble rather
10086 than in the document body.
10087 This is useful for document classes that want such information as the title
10088 and author to appear in the preamble.
10091 \begin_layout Description
10092 \begin_inset Flex CharStyle:Code
10095 \begin_layout Plain Layout
10102 \begin_inset Flex CharStyle:Code
10105 \begin_layout Plain Layout
10111 If 1, marks the layout as being part of a title block (see also the
10112 \begin_inset Flex CharStyle:Code
10115 \begin_layout Plain Layout
10122 \begin_inset Flex CharStyle:Code
10125 \begin_layout Plain Layout
10134 \begin_layout Description
10135 \begin_inset Flex CharStyle:Code
10138 \begin_layout Plain Layout
10145 \begin_inset Flex CharStyle:Code
10148 \begin_layout Plain Layout
10154 ] This provides extra space between paragraphs that have the same layout.
10155 If you put other layouts into an environment, each is separated with the
10157 \begin_inset Flex CharStyle:Code
10160 \begin_layout Plain Layout
10167 But the whole items of the environment are additionally separated with
10169 \begin_inset Flex CharStyle:Code
10172 \begin_layout Plain Layout
10179 Note that this is a
10184 \begin_layout Description
10185 \begin_inset Flex CharStyle:Code
10188 \begin_layout Plain Layout
10194 [[FIXME]] (Used only with XML-type formats.)
10197 \begin_layout Description
10198 \begin_inset Flex CharStyle:Code
10201 \begin_layout Plain Layout
10208 \begin_inset CommandInset label
10210 name "des:KeepEmpty"
10215 \begin_inset Flex CharStyle:Code
10218 \begin_layout Plain Layout
10227 \begin_inset Flex CharStyle:Code
10230 \begin_layout Plain Layout
10236 ] Usually LyX does not allow you to leave a paragraph empty, since it would
10237 lead to empty LaTeX output.
10238 There are some cases where this could be desirable however: in a letter
10239 template, the required fields can be provided as empty fields, so that
10240 people do not forget them; in some special classes, a layout can be used
10241 as some kind of break, which does not contain actual text.
10244 \begin_layout Description
10245 \begin_inset Flex CharStyle:Code
10248 \begin_layout Plain Layout
10254 [float=0] The vertical space between the label and the text body.
10255 Only used for labels that are above the text body (
10256 \begin_inset Flex CharStyle:Code
10259 \begin_layout Plain Layout
10266 \begin_inset Flex CharStyle:Code
10269 \begin_layout Plain Layout
10270 Centered_Top_Environment
10278 \begin_layout Description
10279 \begin_inset Flex CharStyle:Code
10282 \begin_layout Plain Layout
10289 \begin_inset Flex CharStyle:Code
10292 \begin_layout Plain Layout
10299 \begin_inset Newline newline
10302 The name of the counter for automatic numbering.
10304 \begin_inset Newline newline
10312 \begin_inset Flex CharStyle:Code
10315 \begin_layout Plain Layout
10322 \begin_inset Flex CharStyle:Code
10325 \begin_layout Plain Layout
10332 In that case, the counter will be stepped each time the layout appears.
10334 \begin_inset Newline newline
10342 \begin_inset Flex CharStyle:Code
10345 \begin_layout Plain Layout
10352 \begin_inset Flex CharStyle:Code
10355 \begin_layout Plain Layout
10361 , though this case is a bit complicated.
10362 Suppose you declare
10363 \begin_inset Quotes eld
10367 \begin_inset Flex CharStyle:Code
10370 \begin_layout Plain Layout
10371 LabelCounter myenum
10377 \begin_inset Quotes erd
10381 Then the actual counters used are
10382 \begin_inset Flex CharStyle:Code
10385 \begin_layout Plain Layout
10392 \begin_inset Flex CharStyle:Code
10395 \begin_layout Plain Layout
10402 \begin_inset Flex CharStyle:Code
10405 \begin_layout Plain Layout
10412 \begin_inset Flex CharStyle:Code
10415 \begin_layout Plain Layout
10421 , much as in LaTeX.
10422 These counters must all be declared separately.
10423 \begin_inset Newline newline
10427 \begin_inset CommandInset ref
10429 reference "sub:Counters"
10433 for details on counters.
10436 \begin_layout Description
10437 \begin_inset Flex CharStyle:Code
10440 \begin_layout Plain Layout
10446 The font used for the label.
10448 \begin_inset space ~
10452 \begin_inset CommandInset ref
10454 reference "sub:Font-description"
10461 \begin_layout Description
10462 \begin_inset Flex CharStyle:Code
10465 \begin_layout Plain Layout
10471 Text that indicates how far a label should be indented.
10474 \begin_layout Description
10475 \begin_inset Flex CharStyle:Code
10478 \begin_layout Plain Layout
10485 \begin_inset Flex CharStyle:Code
10488 \begin_layout Plain Layout
10494 ] The horizontal space between the label and the text body.
10495 Only used for labels that are not above the text body.
10498 \begin_layout Description
10499 \begin_inset Flex CharStyle:Code
10502 \begin_layout Plain Layout
10509 \begin_inset Flex CharStyle:Code
10512 \begin_layout Plain Layout
10518 ] The string used for a label with a
10519 \begin_inset Flex CharStyle:Code
10522 \begin_layout Plain Layout
10530 \begin_inset Flex CharStyle:Code
10533 \begin_layout Plain Layout
10539 is set, this string can be contain the special formatting commands described
10541 \begin_inset CommandInset ref
10543 reference "sub:Counters"
10551 \begin_layout Plain Layout
10552 For the sake of backwards compatibility, the string
10553 \begin_inset Flex CharStyle:Code
10556 \begin_layout Plain Layout
10566 will be replaced by the expanded
10567 \begin_inset Flex CharStyle:Code
10570 \begin_layout Plain Layout
10577 \begin_inset Flex CharStyle:Code
10580 \begin_layout Plain Layout
10589 This feature is now obsolete and should be replaced by the mechanisms of
10591 \begin_inset CommandInset ref
10593 reference "sub:Counters"
10605 \begin_layout Description
10606 \begin_inset Flex CharStyle:Code
10609 \begin_layout Plain Layout
10610 LabelStringAppendix
10616 \begin_inset Flex CharStyle:Code
10619 \begin_layout Plain Layout
10625 ] This is used inside the appendix instead of
10626 \begin_inset Flex CharStyle:Code
10629 \begin_layout Plain Layout
10637 \begin_inset Flex CharStyle:Code
10640 \begin_layout Plain Layout
10647 \begin_inset Flex CharStyle:Code
10650 \begin_layout Plain Layout
10651 LabelStringAppendix
10659 \begin_layout Description
10660 \begin_inset Flex CharStyle:Code
10663 \begin_layout Plain Layout
10669 [FIXME] (Used only with XML-type formats.)
10672 \begin_layout Description
10673 \begin_inset Flex CharStyle:Code
10676 \begin_layout Plain Layout
10683 \begin_inset Flex CharStyle:Code
10686 \begin_layout Plain Layout
10691 , Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
10692 Enumerate, Itemize, Bibliography
10701 \begin_layout Itemize
10702 \begin_inset Flex CharStyle:Code
10705 \begin_layout Plain Layout
10711 means the label is the very first word (up to the first real blank).
10712 Use protected spaces (like
10713 \begin_inset space ~
10716 that one) if you want more than one word as the label.
10720 \begin_layout Itemize
10721 \begin_inset Flex CharStyle:Code
10724 \begin_layout Plain Layout
10730 means the label is simply whatever
10731 \begin_inset Flex CharStyle:Code
10734 \begin_layout Plain Layout
10741 Note that this really is `static'.
10744 \begin_layout Itemize
10745 \begin_inset Flex CharStyle:Code
10748 \begin_layout Plain Layout
10755 \begin_inset Flex CharStyle:Code
10758 \begin_layout Plain Layout
10759 Centered_Top_Environment
10764 are special cases of
10765 \begin_inset Flex CharStyle:Code
10768 \begin_layout Plain Layout
10775 The label will be printed above the paragraph, but only at the top of an
10776 environment or the top of a chain of paragraphs with this layout.
10777 This might be used with the
10778 \begin_inset Flex CharStyle:MenuItem
10781 \begin_layout Plain Layout
10787 layout, for example.
10790 \begin_layout Itemize
10791 \begin_inset Flex CharStyle:Code
10794 \begin_layout Plain Layout
10800 is a special case for the caption-labels
10801 \begin_inset Quotes eld
10805 \begin_inset Quotes erd
10809 \begin_inset Quotes eld
10813 \begin_inset Quotes erd
10818 \begin_inset Flex CharStyle:Code
10821 \begin_layout Plain Layout
10827 means the (hardcoded) label string depends on the kind of float: It is
10828 hardcoded to be `FloatType N', where N is the value of the counter associated
10832 \begin_layout Itemize
10834 \begin_inset Flex CharStyle:Code
10837 \begin_layout Plain Layout
10843 label type defines automatically numbered labels.
10845 \begin_inset Flex CharStyle:Code
10848 \begin_layout Plain Layout
10854 will be expanded to resolve any counter references it contains: For example,
10856 \begin_inset Quotes eld
10860 \begin_inset Flex CharStyle:Code
10863 \begin_layout Plain Layout
10874 \begin_inset Quotes erd
10879 \begin_inset CommandInset ref
10881 reference "sub:Counters"
10885 for more information on counters.
10888 \begin_layout Itemize
10889 \begin_inset Flex CharStyle:Code
10892 \begin_layout Plain Layout
10898 produces the usual sort of enumeration labels.
10899 At present, it is hardcoded to use Arabic numerals, lowercase letters,
10900 small Roman numerals, and uppercase letters for the four possible depths.
10903 \begin_layout Itemize
10904 \begin_inset Flex CharStyle:Code
10907 \begin_layout Plain Layout
10913 produces various bullets at the different levels.
10914 It is also hardcoded.
10917 \begin_layout Itemize
10918 \begin_inset Flex CharStyle:Code
10921 \begin_layout Plain Layout
10927 is used internally by LyX and should be used only with
10928 \begin_inset Flex CharStyle:Code
10931 \begin_layout Plain Layout
10932 LatexType BibEnvironment
10941 \begin_layout Description
10942 \begin_inset Flex CharStyle:Code
10945 \begin_layout Plain Layout
10952 \begin_inset Flex CharStyle:Code
10955 \begin_layout Plain Layout
10961 , but this preamble snippet occurs independently from the babel package,
10962 and only for the document language.
10964 \begin_inset Quotes eld
10968 \begin_inset Flex CharStyle:Code
10971 \begin_layout Plain Layout
10978 \begin_inset Quotes erd
10985 \begin_layout Standard
10986 If the style defines text that appears in the typeset document, it may use
10988 \begin_inset Flex CharStyle:Code
10991 \begin_layout Plain Layout
10998 \begin_inset Flex CharStyle:Code
11001 \begin_layout Plain Layout
11007 to support non-english and even multilanguage documents correctly.
11008 The following excerpt (from the
11009 \begin_inset Flex CharStyle:Code
11012 \begin_layout Plain Layout
11018 file) shows how this works:
11021 \begin_layout LyX-Code
11025 \begin_layout LyX-Code
11028 theoremstyle{remark}
11031 \begin_layout LyX-Code
11034 newtheorem{claim}[thm]{
11041 \begin_layout LyX-Code
11045 \begin_layout LyX-Code
11049 \begin_layout LyX-Code
11054 claimname}{_(Claim)}
11057 \begin_layout LyX-Code
11061 \begin_layout LyX-Code
11065 \begin_layout LyX-Code
11069 \begin_layout LyX-Code
11078 claimname}{_(Claim)}}
11081 \begin_layout LyX-Code
11085 \begin_layout Standard
11086 The key to correct translation of the user visible text is the definition
11088 \begin_inset Flex CharStyle:Code
11091 \begin_layout Plain Layout
11099 in the language preamble.
11100 This command holds the name of the theorem that will appear in the output.
11102 \begin_inset Flex CharStyle:Code
11105 \begin_layout Plain Layout
11111 then uses the commands offered by the babel package to redefine
11112 \begin_inset Flex CharStyle:Code
11115 \begin_layout Plain Layout
11123 for each used language in multilanguage documents.
11127 \begin_layout Description
11128 \begin_inset Flex CharStyle:Code
11131 \begin_layout Plain Layout
11137 The name of the corresponding LaTeX stuff.
11138 Either the environment or command name.
11141 \begin_layout Description
11142 \begin_inset Flex CharStyle:Code
11145 \begin_layout Plain Layout
11151 An optional parameter for the corresponding
11152 \begin_inset Flex CharStyle:Code
11155 \begin_layout Plain Layout
11162 This parameter cannot be changed from within LyX.
11165 \begin_layout Description
11166 \begin_inset Flex CharStyle:Code
11169 \begin_layout Plain Layout
11176 \begin_inset CommandInset label
11178 name "des:LatexType"
11183 \begin_inset Flex CharStyle:Code
11186 \begin_layout Plain Layout
11191 , Command, Environment, Item_Environment,
11197 \begin_inset Flex CharStyle:Code
11200 \begin_layout Plain Layout
11201 List_Environment, Bib_Environment
11206 ] How the layout should be translated into LaTeX.
11210 \begin_layout Plain Layout
11211 \begin_inset Flex CharStyle:Code
11214 \begin_layout Plain Layout
11220 is perhaps a bit misleading, since these rules apply to SGML classes, too.
11221 Visit the SGML class files for specific examples.
11230 \begin_layout Itemize
11231 \begin_inset Flex CharStyle:Code
11234 \begin_layout Plain Layout
11240 means nothing special.
11244 \begin_layout Itemize
11245 \begin_inset Flex CharStyle:Code
11248 \begin_layout Plain Layout
11255 \begin_inset Flex CharStyle:Code
11258 \begin_layout Plain Layout
11265 {\SpecialChar \ldots{}
11274 \begin_layout Itemize
11275 \begin_inset Flex CharStyle:Code
11278 \begin_layout Plain Layout
11285 \begin_inset Flex CharStyle:Code
11288 \begin_layout Plain Layout
11295 }\SpecialChar \ldots{}
11311 \begin_layout Itemize
11312 \begin_inset Flex CharStyle:Code
11315 \begin_layout Plain Layout
11322 \begin_inset Flex CharStyle:Code
11325 \begin_layout Plain Layout
11332 \begin_inset Flex CharStyle:Code
11335 \begin_layout Plain Layout
11343 is generated for each paragraph of this environment.
11347 \begin_layout Itemize
11348 \begin_inset Flex CharStyle:Code
11351 \begin_layout Plain Layout
11358 \begin_inset Flex CharStyle:Code
11361 \begin_layout Plain Layout
11368 \begin_inset Flex CharStyle:Code
11371 \begin_layout Plain Layout
11377 is passed as an argument to the environment.
11379 \begin_inset Flex CharStyle:Code
11382 \begin_layout Plain Layout
11388 can be defined in the
11389 \begin_inset Flex CharStyle:MenuItem
11392 \begin_layout Plain Layout
11397 ayout\SpecialChar \menuseparator
11411 \begin_layout Standard
11412 Putting the last few things together, the LaTeX output will be either:
11415 \begin_layout LyX-Code
11418 latexname[latexparam]{\SpecialChar \ldots{}
11422 \begin_layout Standard
11426 \begin_layout LyX-Code
11429 begin{latexname}[latexparam] \SpecialChar \ldots{}
11435 \begin_layout Standard
11436 depending upon the LaTeX type.
11440 \begin_layout Description
11441 \begin_inset Flex CharStyle:Code
11444 \begin_layout Plain Layout
11451 \begin_inset Flex CharStyle:Code
11454 \begin_layout Plain Layout
11460 ] If you put layouts into environments, the leftmargins are not simply added,
11461 but added with a factor
11462 \begin_inset Formula $\frac{4}{depth+4}$
11466 Note that this parameter is also used when the margin is defined as
11467 \begin_inset Flex CharStyle:Code
11470 \begin_layout Plain Layout
11477 \begin_inset Flex CharStyle:Code
11480 \begin_layout Plain Layout
11487 Then it is added to the manual or dynamic margin.
11489 \begin_inset Newline newline
11492 The argument is passed as a string.
11494 \begin_inset Quotes eld
11498 \begin_inset Flex CharStyle:Code
11501 \begin_layout Plain Layout
11508 \begin_inset Quotes erd
11511 means that the paragraph is indented with the width of
11512 \begin_inset Quotes eld
11516 \begin_inset Flex CharStyle:Code
11519 \begin_layout Plain Layout
11526 \begin_inset Quotes erd
11529 in the normal font.
11530 You can get a negative width by prefixing the string with
11531 \begin_inset Quotes eld
11535 \begin_inset Flex CharStyle:Code
11538 \begin_layout Plain Layout
11545 \begin_inset Quotes erd
11549 This way was chosen so that the look is the same with each used screen
11554 \begin_layout Description
11555 \begin_inset Flex CharStyle:Code
11558 \begin_layout Plain Layout
11565 \begin_inset Flex CharStyle:Code
11568 \begin_layout Plain Layout
11573 , Manual, Dynamic, First_Dynamic, Right_Address_Box
11579 \begin_inset Newline newline
11582 The kind of margin that the layout has on the left side.
11584 \begin_inset Flex CharStyle:Code
11587 \begin_layout Plain Layout
11593 just means a fixed margin.
11595 \begin_inset Flex CharStyle:Code
11598 \begin_layout Plain Layout
11604 means that the left margin depends on the string entered in the
11605 \begin_inset Flex CharStyle:MenuItem
11608 \begin_layout Plain Layout
11609 Edit\SpecialChar \menuseparator
11611 \begin_inset space ~
11620 This is used to typeset nice lists without tabulators.
11622 \begin_inset Flex CharStyle:Code
11625 \begin_layout Plain Layout
11631 means that the margin depends on the size of the label.
11632 This is used for automatic enumerated headlines.
11633 It is obvious that the headline
11634 \begin_inset Quotes eld
11637 5.4.3.2.1 Very long headline
11638 \begin_inset Quotes erd
11641 must have a wider left margin (as wide as
11642 \begin_inset Quotes eld
11646 \begin_inset Quotes erd
11649 plus the space) than
11650 \begin_inset Quotes eld
11653 3.2 Very long headline
11654 \begin_inset Quotes erd
11658 \begin_inset Quotes eld
11662 \begin_inset Quotes erd
11665 are not able to do this.
11667 \begin_inset Flex CharStyle:Code
11670 \begin_layout Plain Layout
11676 is similar, but only the very first row of the paragraph is dynamic, while
11677 the others are static; this is used, for example, for descriptions.
11679 \begin_inset Flex CharStyle:Code
11682 \begin_layout Plain Layout
11688 means the margin is chosen in a way that the longest row of this paragraph
11689 fits to the right margin.
11690 This is used to typeset an address on the right edge of the page.
11693 \begin_layout Description
11694 \begin_inset Flex CharStyle:Code
11697 \begin_layout Plain Layout
11704 \begin_inset Flex CharStyle:Code
11707 \begin_layout Plain Layout
11716 \begin_inset Flex CharStyle:Code
11719 \begin_layout Plain Layout
11725 ] Whether fragile commands in this layout should be
11726 \begin_inset Flex CharStyle:Code
11729 \begin_layout Plain Layout
11742 whether this command should itself be protected.)
11745 \begin_layout Description
11746 \begin_inset Flex CharStyle:Code
11749 \begin_layout Plain Layout
11756 \begin_inset Flex CharStyle:Code
11759 \begin_layout Plain Layout
11766 \begin_inset Flex CharStyle:Code
11769 \begin_layout Plain Layout
11777 ] Whether newlines are translated into LaTeX newlines (
11778 \begin_inset Flex CharStyle:Code
11781 \begin_layout Plain Layout
11792 The translation can be switched off to allow more comfortable LaTeX editing
11796 \begin_layout Description
11797 \begin_inset Flex CharStyle:Code
11800 \begin_layout Plain Layout
11807 \begin_inset Flex CharStyle:Code
11810 \begin_layout Plain Layout
11817 \begin_inset Flex CharStyle:Code
11820 \begin_layout Plain Layout
11828 ] Whether the following Paragraph is allowed to indent its very first row.
11830 \begin_inset Flex CharStyle:Code
11833 \begin_layout Plain Layout
11839 means that it is not allowed to do so;
11840 \begin_inset Flex CharStyle:Code
11843 \begin_layout Plain Layout
11849 means it could do so if it wants to.
11852 \begin_layout Description
11853 \begin_inset Flex CharStyle:Code
11856 \begin_layout Plain Layout
11862 Name of a layout that has replaced this layout.
11863 This is used to rename a layout, while keeping backward compatibility.
11866 \begin_layout Description
11867 \begin_inset Flex CharStyle:Code
11870 \begin_layout Plain Layout
11877 \begin_inset Flex CharStyle:Code
11880 \begin_layout Plain Layout
11886 ] The number of optional arguments that can be used with this layout.
11887 This is useful for things like section headings, and only makes sense with
11891 \begin_layout Description
11892 \begin_inset Flex CharStyle:Code
11895 \begin_layout Plain Layout
11902 \begin_inset Flex CharStyle:Code
11905 \begin_layout Plain Layout
11911 ] The indent of the very first line of a paragraph.
11913 \begin_inset Flex CharStyle:Code
11916 \begin_layout Plain Layout
11922 will be fixed for a certain layout.
11923 The exception is Standard layout, since the indentation of a Standard layout
11924 paragraph can be prohibited with
11925 \begin_inset Flex CharStyle:Code
11928 \begin_layout Plain Layout
11935 Also, Standard layout paragraphs inside environments use the
11936 \begin_inset Flex CharStyle:Code
11939 \begin_layout Plain Layout
11945 of the environment, not their native one.
11946 For example, Standard paragraphs inside an enumeration are not indented.
11949 \begin_layout Description
11950 \begin_inset Flex CharStyle:Code
11953 \begin_layout Plain Layout
11960 \begin_inset Flex CharStyle:Code
11963 \begin_layout Plain Layout
11969 ] The vertical space between two paragraphs of this layout.
11972 \begin_layout Description
11973 \begin_inset Flex CharStyle:Code
11976 \begin_layout Plain Layout
11983 \begin_inset Flex CharStyle:Code
11986 \begin_layout Plain Layout
11992 ] LyX allows the user to choose either
11993 \begin_inset Quotes eld
11997 \begin_inset Quotes erd
12001 \begin_inset Quotes eld
12005 \begin_inset Quotes erd
12008 to typeset a document.
12010 \begin_inset Quotes eld
12014 \begin_inset Quotes erd
12017 is chosen, this value is completely ignored.
12019 \begin_inset Quotes eld
12023 \begin_inset Quotes erd
12026 is chosen, the parindent of a LaTeXtype
12027 \begin_inset Quotes eld
12031 \begin_inset Quotes erd
12034 layout is ignored and all paragraphs are separated by this parskip argument.
12035 The vertical space is calculated with
12036 \begin_inset Flex CharStyle:Code
12039 \begin_layout Plain Layout
12041 \begin_inset space ~
12050 \begin_inset Flex CharStyle:Code
12053 \begin_layout Plain Layout
12059 is the height of a row with the normal font.
12060 This way, the look stays the same with different screen fonts.
12063 \begin_layout Description
12064 \begin_inset Flex CharStyle:Code
12067 \begin_layout Plain Layout
12074 \begin_inset CommandInset label
12076 name "des:PathThru"
12081 \begin_inset Flex CharStyle:Code
12084 \begin_layout Plain Layout
12093 \begin_inset Flex CharStyle:Code
12096 \begin_layout Plain Layout
12102 ] Whether the contents of this paragraph should be output in raw form, meaning
12103 without special translations that LaTeX would require.
12106 \begin_layout Description
12107 \begin_inset Flex CharStyle:Code
12110 \begin_layout Plain Layout
12117 \begin_inset CommandInset label
12119 name "des:Preamble"
12123 Information to be included in the LaTeX preamble when this style is used.
12124 Used to define macros, load packages, etc., required by this particular
12127 \begin_inset Quotes eld
12131 \begin_inset Flex CharStyle:Code
12134 \begin_layout Plain Layout
12141 \begin_inset Quotes erd
12147 \begin_layout Description
12148 \begin_inset Flex CharStyle:Code
12151 \begin_layout Plain Layout
12158 \begin_inset Flex CharStyle:Code
12161 \begin_layout Plain Layout
12167 ] The prefix to use when creating labels referring to paragraphs of this
12169 This allows the use of formatted references.
12172 \begin_layout Description
12173 \begin_inset Flex CharStyle:Code
12176 \begin_layout Plain Layout
12183 \begin_inset Flex CharStyle:Code
12186 \begin_layout Plain Layout
12193 \begin_inset CommandInset label
12195 name "des:Requires"
12199 Whether the layout requires the feature
12200 \begin_inset Flex CharStyle:Code
12203 \begin_layout Plain Layout
12210 See the description of
12211 \begin_inset Flex CharStyle:Code
12214 \begin_layout Plain Layout
12221 \begin_inset CommandInset ref
12222 LatexCommand pageref
12223 reference "des:FreeSpacing"
12227 ) for information on `features'.
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 Flex CharStyle:Code
12255 \begin_layout Plain Layout
12264 \begin_layout Description
12265 \begin_inset Flex CharStyle:Code
12268 \begin_layout Plain Layout
12275 \begin_inset Flex CharStyle:Code
12278 \begin_layout Plain Layout
12283 , onehalf, double, other
12292 ] This defines what the default spacing should be in the layout.
12294 \begin_inset Flex CharStyle:Code
12297 \begin_layout Plain Layout
12304 \begin_inset Flex CharStyle:Code
12307 \begin_layout Plain Layout
12314 \begin_inset Flex CharStyle:Code
12317 \begin_layout Plain Layout
12323 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
12324 If you specify the argument
12325 \begin_inset Flex CharStyle:Code
12328 \begin_layout Plain Layout
12334 , then you should also provide a numerical argument which will be the actual
12336 Note that, contrary to other parameters,
12337 \begin_inset Flex CharStyle:Code
12340 \begin_layout Plain Layout
12346 implies the generation of specific LaTeX code, using the package
12349 \begin_inset Flex CharStyle:Code
12352 \begin_layout Plain Layout
12361 \begin_layout Description
12362 \begin_inset Flex CharStyle:Code
12365 \begin_layout Plain Layout
12372 \begin_inset Flex CharStyle:Code
12375 \begin_layout Plain Layout
12382 \begin_inset Flex CharStyle:Code
12385 \begin_layout Plain Layout
12393 ] Spellcheck paragraphs of this style.
12397 \begin_layout Description
12398 \begin_inset Flex CharStyle:Code
12401 \begin_layout Plain Layout
12407 The font used for the text body .
12409 \begin_inset CommandInset ref
12411 reference "sub:Font-description"
12418 \begin_layout Description
12419 \begin_inset Flex CharStyle:Code
12422 \begin_layout Plain Layout
12431 \begin_inset Flex CharStyle:Code
12434 \begin_layout Plain Layout
12444 The level of the style in the table of contents.
12445 This is used for automatic numbering of section headings.
12448 \begin_layout Description
12449 \begin_inset Flex CharStyle:Code
12452 \begin_layout Plain Layout
12459 \begin_inset Flex CharStyle:Code
12462 \begin_layout Plain Layout
12468 ] The vertical space with which the very first of a chain of paragraphs
12469 with this layout is separated from the previous paragraph.
12470 If the previous paragraph has another layout, the separations are not simply
12471 added, but the maximum is taken.
12474 \begin_layout Subsection
12476 \begin_inset CommandInset label
12485 \begin_layout Standard
12486 Since version 1.3.0 of LyX, it is has been both possible and necessary to
12487 define the floats (
12488 \begin_inset Flex CharStyle:MenuItem
12491 \begin_layout Plain Layout
12498 \begin_inset Flex CharStyle:MenuItem
12501 \begin_layout Plain Layout
12507 , \SpecialChar \ldots{}
12508 ) in the text class itself.
12509 Standard floats are included in the file
12510 \begin_inset Flex CharStyle:Code
12513 \begin_layout Plain Layout
12519 , so you may have to do no more than add
12522 \begin_layout LyX-Code
12523 Input stdfloats.inc
12526 \begin_layout Standard
12527 to your layout file.
12528 If you want to implement a text class that proposes some other float types
12529 (like the AGU class bundled with LyX), the information below will hopefully
12533 \begin_layout Description
12534 \begin_inset Flex CharStyle:Code
12537 \begin_layout Plain Layout
12544 \begin_inset Flex CharStyle:Code
12547 \begin_layout Plain Layout
12554 \begin_inset Quotes erd
12558 \begin_inset Quotes erd
12561 ] The file name extension of an auxiliary file for the list of figures (or
12563 LaTeX writes the captions to this file.
12566 \begin_layout Description
12567 \begin_inset Flex CharStyle:Code
12570 \begin_layout Plain Layout
12577 \begin_inset Flex CharStyle:Code
12580 \begin_layout Plain Layout
12587 \begin_inset Quotes erd
12591 \begin_inset Quotes erd
12594 ] The string that will be used in the menus and also for the caption.
12595 This is translated to the current language if babel is used.
12598 \begin_layout Description
12599 \begin_inset Flex CharStyle:Code
12602 \begin_layout Plain Layout
12608 These are used for XHTML output.
12610 \begin_inset CommandInset ref
12612 reference "sec:Tags-for-XHTML"
12619 \begin_layout Description
12620 \begin_inset Flex CharStyle:Code
12623 \begin_layout Plain Layout
12630 \begin_inset Flex CharStyle:Code
12633 \begin_layout Plain Layout
12640 \begin_inset Quotes erd
12644 \begin_inset Quotes erd
12647 ] The command used to generate a list of floats of this type; the leading
12650 ' should be omitted.
12656 \begin_inset Flex CharStyle:Code
12659 \begin_layout Plain Layout
12665 is false, since there is no standard way to generate this command.
12667 \begin_inset Flex CharStyle:Code
12670 \begin_layout Plain Layout
12676 is true, since in that case there is a standard way.
12679 \begin_layout Description
12680 \begin_inset Flex CharStyle:Code
12683 \begin_layout Plain Layout
12690 \begin_inset Flex CharStyle:Code
12693 \begin_layout Plain Layout
12700 \begin_inset Quotes erd
12704 \begin_inset Quotes erd
12707 ] A title for a list of floats of this kind (list of figures, tables, or
12709 It is used for the screen label within LyX; it is passed to LaTeX for use
12710 as the title there; and it is used as the title in XHTML output.
12711 It will be translated to the document language.
12714 \begin_layout Description
12715 \begin_inset Flex CharStyle:Code
12718 \begin_layout Plain Layout
12725 \begin_inset Flex CharStyle:Code
12728 \begin_layout Plain Layout
12735 \begin_inset Flex CharStyle:Code
12738 \begin_layout Plain Layout
12746 ] Indicates whether the float is already defined in the document class or
12747 if we instead need to load
12748 \begin_inset Flex CharStyle:Code
12751 \begin_layout Plain Layout
12757 and use what it provides.
12759 \begin_inset Flex CharStyle:Code
12762 \begin_layout Plain Layout
12769 \begin_inset Flex CharStyle:Code
12772 \begin_layout Plain Layout
12779 It should be set to
12780 \begin_inset Flex CharStyle:Code
12783 \begin_layout Plain Layout
12789 if the float is already defined by the LaTeX document class.
12792 \begin_layout Description
12793 \begin_inset Flex CharStyle:Code
12796 \begin_layout Plain Layout
12803 \begin_inset Flex CharStyle:Code
12806 \begin_layout Plain Layout
12813 \begin_inset Quotes erd
12817 \begin_inset Quotes erd
12820 ] This (optional) argument determines whether floats of this class will
12821 be numbered within some sectional unit of the document.
12822 For example, if within is equal to
12823 \begin_inset Flex CharStyle:Code
12826 \begin_layout Plain Layout
12832 , the floats will be numbered within chapters.
12836 \begin_layout Description
12837 \begin_inset Flex CharStyle:Code
12840 \begin_layout Plain Layout
12847 \begin_inset Flex CharStyle:Code
12850 \begin_layout Plain Layout
12857 \begin_inset Quotes erd
12861 \begin_inset Quotes erd
12864 ] The default placement for the given class of floats.
12865 The string should be as in standard LaTeX:
12866 \begin_inset Flex CharStyle:Code
12869 \begin_layout Plain Layout
12876 \begin_inset Flex CharStyle:Code
12879 \begin_layout Plain Layout
12886 \begin_inset Flex CharStyle:Code
12889 \begin_layout Plain Layout
12896 \begin_inset Flex CharStyle:Code
12899 \begin_layout Plain Layout
12905 for top, bottom, page, and here, respectively.
12909 \begin_layout Plain Layout
12910 Note that the order of these letters in the string is irrelevant, like in
12916 On top of that there is a new type,
12917 \begin_inset Flex CharStyle:Code
12920 \begin_layout Plain Layout
12926 , which does not really correspond to a float, since it means: put it
12927 \begin_inset Quotes eld
12931 \begin_inset Quotes erd
12935 Note however that the
12936 \begin_inset Flex CharStyle:Code
12939 \begin_layout Plain Layout
12945 specifier is special and, because of implementation details, cannot be
12946 used in non-built in float types.
12947 If you do not understand what this means, just use
12948 \begin_inset Quotes eld
12952 \begin_inset Flex CharStyle:Code
12955 \begin_layout Plain Layout
12962 \begin_inset Quotes erd
12968 \begin_layout Description
12969 \begin_inset Flex CharStyle:Code
12972 \begin_layout Plain Layout
12979 \begin_inset Flex CharStyle:Code
12982 \begin_layout Plain Layout
12988 ] The prefix to use when creating labels referring to floats of this type.
12989 This allows the use of formatted references.
12992 \begin_layout Description
12993 \begin_inset Flex CharStyle:Code
12996 \begin_layout Plain Layout
13003 \begin_inset Flex CharStyle:Code
13006 \begin_layout Plain Layout
13013 \begin_inset Quotes erd
13017 \begin_inset Quotes erd
13020 ] The style used when defining the float using
13021 \begin_inset Flex CharStyle:Code
13024 \begin_layout Plain Layout
13035 \begin_layout Description
13036 \begin_inset Flex CharStyle:Code
13039 \begin_layout Plain Layout
13046 \begin_inset Flex CharStyle:Code
13049 \begin_layout Plain Layout
13056 \begin_inset Quotes erd
13060 \begin_inset Quotes erd
13064 \begin_inset Quotes eld
13068 \begin_inset Quotes erd
13071 of the new class of floats, like program or algorithm.
13072 After the appropriate
13073 \begin_inset Flex CharStyle:Code
13076 \begin_layout Plain Layout
13085 \begin_inset Flex CharStyle:Code
13088 \begin_layout Plain Layout
13097 \begin_inset Flex CharStyle:Code
13100 \begin_layout Plain Layout
13111 \begin_layout Standard
13112 Note that defining a float with type
13113 \begin_inset Flex CharStyle:Code
13116 \begin_layout Plain Layout
13124 automatically defines the corresponding counter with name
13125 \begin_inset Flex CharStyle:Code
13128 \begin_layout Plain Layout
13139 \begin_layout Subsection
13140 Flex insets and InsetLayout
13141 \begin_inset CommandInset label
13143 name "sub:Flex-insets-and"
13150 \begin_layout Standard
13151 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
13152 these are called Flex insets.
13156 \begin_layout Standard
13157 Flex insets come in three different kinds:
13160 \begin_layout Itemize
13162 \begin_inset Flex CharStyle:Code
13165 \begin_layout Plain Layout
13171 ): These define semantic markup corresponding to such LaTeX commands as
13173 \begin_inset Flex CharStyle:Code
13176 \begin_layout Plain Layout
13185 \begin_inset Flex CharStyle:Code
13188 \begin_layout Plain Layout
13199 \begin_layout Itemize
13201 \begin_inset Flex CharStyle:Code
13204 \begin_layout Plain Layout
13210 ): These can be used to define custom collapsible insets, similar to TeX
13211 code, footnote, and the like.
13212 An obvious example is an endnote inset, which is defined in the
13213 \begin_inset Flex CharStyle:Code
13216 \begin_layout Plain Layout
13225 \begin_layout Itemize
13227 \begin_inset Flex CharStyle:Code
13230 \begin_layout Plain Layout
13236 ): For use with DocBook classes.
13239 \begin_layout Standard
13240 Flex insets are defined using the
13241 \begin_inset Flex CharStyle:Code
13244 \begin_layout Plain Layout
13250 tag, which shall be explained in a moment.
13253 \begin_layout Standard
13255 \begin_inset Flex CharStyle:Code
13258 \begin_layout Plain Layout
13264 tag also serves another function: It can be used to customize the general
13265 layout of many different types of insets.
13267 \begin_inset Flex CharStyle:Code
13270 \begin_layout Plain Layout
13276 can be used to customize the layout parameters for footnotes, marginal
13277 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
13278 boxes, tables, algorithms, URLs, and optional arguments, as well as to
13279 define Flex insets.
13282 \begin_layout Standard
13284 \begin_inset Flex CharStyle:Code
13287 \begin_layout Plain Layout
13293 definition must begin with a line of the form:
13296 \begin_layout LyX-Code
13300 \begin_layout Standard
13302 \begin_inset Flex CharStyle:Code
13305 \begin_layout Plain Layout
13311 indicates the inset whose layout is being defined, and here there are two
13315 \begin_layout Enumerate
13316 The layout for a pre-existing inset is being modified.
13317 In this case, can be
13318 \begin_inset Flex CharStyle:Code
13321 \begin_layout Plain Layout
13327 any one of the following:
13328 \begin_inset Flex CharStyle:Code
13331 \begin_layout Plain Layout
13338 \begin_inset Flex CharStyle:Code
13341 \begin_layout Plain Layout
13348 \begin_inset Flex CharStyle:Code
13351 \begin_layout Plain Layout
13358 \begin_inset Flex CharStyle:Code
13361 \begin_layout Plain Layout
13368 \begin_inset Flex CharStyle:Code
13371 \begin_layout Plain Layout
13378 \begin_inset Flex CharStyle:Code
13381 \begin_layout Plain Layout
13388 \begin_inset Flex CharStyle:Code
13391 \begin_layout Plain Layout
13398 \begin_inset Flex CharStyle:Code
13401 \begin_layout Plain Layout
13408 \begin_inset Flex CharStyle:Code
13411 \begin_layout Plain Layout
13418 \begin_inset Flex CharStyle:Code
13421 \begin_layout Plain Layout
13428 \begin_inset Flex CharStyle:Code
13431 \begin_layout Plain Layout
13438 \begin_inset Flex CharStyle:Code
13441 \begin_layout Plain Layout
13448 \begin_inset Flex CharStyle:Code
13451 \begin_layout Plain Layout
13458 \begin_inset Flex CharStyle:Code
13461 \begin_layout Plain Layout
13468 \begin_inset Flex CharStyle:Code
13471 \begin_layout Plain Layout
13478 \begin_inset Flex CharStyle:Code
13481 \begin_layout Plain Layout
13488 \begin_inset Flex CharStyle:Code
13491 \begin_layout Plain Layout
13498 \begin_inset Flex CharStyle:Code
13501 \begin_layout Plain Layout
13508 \begin_inset Flex CharStyle:Code
13511 \begin_layout Plain Layout
13518 \begin_inset Flex CharStyle:Code
13521 \begin_layout Plain Layout
13530 \begin_layout Enumerate
13531 The layout for a Flex inset is being defined.
13533 \begin_inset Flex CharStyle:Code
13536 \begin_layout Plain Layout
13542 can be any valid identifier not used by a pre-existing inset.
13543 Note that the definition of a flex inset
13548 \begin_inset Flex CharStyle:Code
13551 \begin_layout Plain Layout
13557 entry, declaring which type of inset this is.
13560 \begin_layout Standard
13562 \begin_inset Flex CharStyle:Code
13565 \begin_layout Plain Layout
13571 definition can contain the following entries:
13574 \begin_layout Description
13575 \begin_inset Flex CharStyle:Code
13578 \begin_layout Plain Layout
13584 The color for the inset's background.
13585 The valid colors are defined in
13586 \begin_inset Flex CharStyle:Code
13589 \begin_layout Plain Layout
13598 \begin_layout Description
13599 \begin_inset Flex CharStyle:Code
13602 \begin_layout Plain Layout
13609 \begin_inset Flex CharStyle:Code
13612 \begin_layout Plain Layout
13621 \begin_inset Flex CharStyle:Code
13624 \begin_layout Plain Layout
13630 ] Whether to use the content of the inset as the label, when the inset is
13635 \begin_layout Description
13636 \begin_inset Flex CharStyle:Code
13639 \begin_layout Plain Layout
13645 As with paragraph styles (see page
13646 \begin_inset CommandInset ref
13648 reference "des:CopyStyle"
13655 \begin_layout Description
13656 \begin_inset Flex CharStyle:Code
13659 \begin_layout Plain Layout
13666 \begin_inset Flex CharStyle:Code
13669 \begin_layout Plain Layout
13678 \begin_inset Flex CharStyle:Code
13681 \begin_layout Plain Layout
13687 ] Indicates whether the user may employ the Paragraph Settings dialog to
13688 customize the paragraph.
13691 \begin_layout Description
13692 \begin_inset Flex CharStyle:Code
13695 \begin_layout Plain Layout
13702 \begin_inset Flex CharStyle:Code
13705 \begin_layout Plain Layout
13712 \begin_inset Flex CharStyle:Code
13715 \begin_layout Plain Layout
13722 \begin_inset Flex CharStyle:Code
13725 \begin_layout Plain Layout
13731 , describing the rendering style used for the inset's frame and buttons.
13732 Footnotes generally use
13733 \begin_inset Flex CharStyle:Code
13736 \begin_layout Plain Layout
13742 , ERT insets generally
13743 \begin_inset Flex CharStyle:Code
13746 \begin_layout Plain Layout
13752 , and character styles
13753 \begin_inset Flex CharStyle:Code
13756 \begin_layout Plain Layout
13765 \begin_layout Description
13766 \begin_inset Flex CharStyle:Code
13769 \begin_layout Plain Layout
13775 Required at the end of the InsetLayout declarations.
13778 \begin_layout Description
13779 \begin_inset Flex CharStyle:Code
13782 \begin_layout Plain Layout
13788 The font used for both the text body
13794 \begin_inset space ~
13798 \begin_inset CommandInset ref
13800 reference "sub:Font-description"
13805 Note that defining this font automatically defines the
13806 \begin_inset Flex CharStyle:Code
13809 \begin_layout Plain Layout
13815 to the same value, so define this first and define
13816 \begin_inset Flex CharStyle:Code
13819 \begin_layout Plain Layout
13825 later if you want them to be different.
13828 \begin_layout Description
13829 \begin_inset Flex CharStyle:Code
13832 \begin_layout Plain Layout
13839 \begin_inset Quotes eld
13843 \begin_inset Quotes erd
13846 language, leading to Left-to-Right (latin) output, e.
13847 \begin_inset space \thinspace{}
13851 \begin_inset space \space{}
13854 in TeX code or URL.
13858 \begin_layout Description
13859 \begin_inset Flex CharStyle:Code
13862 \begin_layout Plain Layout
13869 \begin_inset Flex CharStyle:Code
13872 \begin_layout Plain Layout
13881 \begin_inset Flex CharStyle:Code
13884 \begin_layout Plain Layout
13890 ] Indicates whether the PlainLayout should be used or, instead, the user
13891 can change the paragraph style used in the inset.
13895 \begin_layout Description
13896 \begin_inset Flex CharStyle:Code
13899 \begin_layout Plain Layout
13905 As with paragraph styles (see page
13906 \begin_inset CommandInset ref
13907 LatexCommand pageref
13908 reference "des:FreeSpacing"
13916 \begin_layout Description
13917 \begin_inset Flex CharStyle:Code
13920 \begin_layout Plain Layout
13926 These tags control XHTML output.
13930 \begin_layout Description
13931 \begin_inset Flex CharStyle:Code
13934 \begin_layout Plain Layout
13941 \begin_inset Flex CharStyle:Code
13944 \begin_layout Plain Layout
13953 \begin_inset Flex CharStyle:Code
13956 \begin_layout Plain Layout
13962 ] Whether to include the contents of this inset in the strings generated
13963 for the `Outline' pane.
13964 One would not, for example, want the content of a footnote in a section
13965 header to be included in the TOC displayed in the outline, but one would
13966 normally want the content of a character style displayed.
13967 Default is false: not to include.
13970 \begin_layout Description
13971 \begin_inset Flex CharStyle:Code
13974 \begin_layout Plain Layout
13980 As with paragraph styles (see page
13981 \begin_inset CommandInset ref
13982 LatexCommand pageref
13983 reference "des:KeepEmpty"
13991 \begin_layout Description
13992 \begin_inset Flex CharStyle:Code
13995 \begin_layout Plain Layout
14001 The font used for the label.
14003 \begin_inset space ~
14007 \begin_inset CommandInset ref
14009 reference "sub:Font-description"
14014 Note that this definition can never appear before
14015 \begin_inset Flex CharStyle:Code
14018 \begin_layout Plain Layout
14024 , lest it be ineffective.
14027 \begin_layout Description
14028 \begin_inset Flex CharStyle:Code
14031 \begin_layout Plain Layout
14037 What will be displayed on the button or elsewhere as the inset label.
14038 Some inset types (TeX code and Branch) modify this label on the fly.
14041 \begin_layout Description
14042 \begin_inset Flex CharStyle:Code
14045 \begin_layout Plain Layout
14051 The name of the corresponding LaTeX stuff.
14052 Either the environment or command name.
14055 \begin_layout Description
14056 \begin_inset Flex CharStyle:Code
14059 \begin_layout Plain Layout
14065 The optional parameter for the corresponding
14066 \begin_inset Flex CharStyle:Code
14069 \begin_layout Plain Layout
14075 stuff, including possible bracket pairs like
14076 \begin_inset Flex CharStyle:Code
14079 \begin_layout Plain Layout
14086 This parameter cannot be changed from within LyX.
14089 \begin_layout Description
14090 \begin_inset Flex CharStyle:Code
14093 \begin_layout Plain Layout
14099 As with paragraph styles (see page
14100 \begin_inset CommandInset ref
14101 LatexCommand pageref
14102 reference "des:LatexType"
14109 \begin_layout Description
14110 \begin_inset Flex CharStyle:Code
14113 \begin_layout Plain Layout
14120 \begin_inset Flex CharStyle:Code
14123 \begin_layout Plain Layout
14130 \begin_inset Flex CharStyle:Code
14133 \begin_layout Plain Layout
14140 \begin_inset Flex CharStyle:Code
14143 \begin_layout Plain Layout
14150 \begin_inset Flex CharStyle:Code
14153 \begin_layout Plain Layout
14159 (indicating a dummy definition ending definitions of charstyles, etc).
14160 This entry is required in and is only meaningful for Flex insets.
14161 Among other things, it determines on which menu this inset will appear.
14163 \begin_inset Flex CharStyle:Code
14166 \begin_layout Plain Layout
14173 \begin_inset Flex CharStyle:Code
14176 \begin_layout Plain Layout
14183 \begin_inset Flex CharStyle:Code
14186 \begin_layout Plain Layout
14194 \begin_inset Flex CharStyle:Code
14197 \begin_layout Plain Layout
14203 can be set to true for charstyle insets, if you wish, by setting it
14208 \begin_inset Flex CharStyle:Code
14211 \begin_layout Plain Layout
14220 \begin_layout Description
14221 \begin_inset Flex CharStyle:Code
14224 \begin_layout Plain Layout
14231 \begin_inset Flex CharStyle:Code
14234 \begin_layout Plain Layout
14243 \begin_inset Flex CharStyle:Code
14246 \begin_layout Plain Layout
14252 ] Whether multiple paragraphs are permitted in this inset.
14254 \begin_inset Flex CharStyle:Code
14257 \begin_layout Plain Layout
14263 to the same value and
14264 \begin_inset Flex CharStyle:Code
14267 \begin_layout Plain Layout
14273 to the opposite value.
14274 These can be reset to other values, if they are used
14279 \begin_inset Flex CharStyle:Code
14282 \begin_layout Plain Layout
14292 \begin_layout Description
14293 \begin_inset Flex CharStyle:Code
14296 \begin_layout Plain Layout
14303 \begin_inset Flex CharStyle:Code
14306 \begin_layout Plain Layout
14315 \begin_inset Flex CharStyle:Code
14318 \begin_layout Plain Layout
14324 ] Whether fragile commands in this layout should be
14325 \begin_inset Flex CharStyle:Code
14328 \begin_layout Plain Layout
14341 whether the command should itself be protected.) Default is false.
14344 \begin_layout Description
14345 \begin_inset Flex CharStyle:Code
14348 \begin_layout Plain Layout
14355 \begin_inset Flex CharStyle:Code
14358 \begin_layout Plain Layout
14367 \begin_inset Flex CharStyle:Code
14370 \begin_layout Plain Layout
14376 ] As with paragraph styles (see page
14377 \begin_inset CommandInset ref
14378 LatexCommand pageref
14379 reference "des:PathThru"
14387 \begin_layout Description
14388 \begin_inset Flex CharStyle:Code
14391 \begin_layout Plain Layout
14397 As with paragraph styles (see page
14398 \begin_inset CommandInset ref
14399 LatexCommand pageref
14400 reference "des:Preamble"
14407 \begin_layout Description
14408 \begin_inset Flex CharStyle:Code
14411 \begin_layout Plain Layout
14418 \begin_inset Flex CharStyle:Code
14421 \begin_layout Plain Layout
14427 ] The prefix to use when creating labels referring to insets of this type.
14428 This allows the use of formatted references.
14431 \begin_layout Description
14432 \begin_inset Flex CharStyle:Code
14435 \begin_layout Plain Layout
14442 \begin_inset Flex CharStyle:Code
14445 \begin_layout Plain Layout
14451 ] As with paragraph styles (see page
14452 \begin_inset CommandInset ref
14453 LatexCommand pageref
14454 reference "des:Requires"
14461 \begin_layout Description
14462 \begin_inset Flex CharStyle:Code
14465 \begin_layout Plain Layout
14472 \begin_inset Flex CharStyle:Code
14475 \begin_layout Plain Layout
14482 \begin_inset Flex CharStyle:Code
14485 \begin_layout Plain Layout
14493 ] Spellcheck the contents of this inset.
14497 \begin_layout Subsection
14499 \begin_inset CommandInset label
14501 name "sub:Counters"
14508 \begin_layout Standard
14509 Since version 1.3.0 of LyX, it is both possible and necessary to define the
14511 \begin_inset Flex CharStyle:MenuItem
14514 \begin_layout Plain Layout
14521 \begin_inset Flex CharStyle:MenuItem
14524 \begin_layout Plain Layout
14530 , \SpecialChar \ldots{}
14531 ) in the text class itself.
14532 The standard counters are defined in the file
14533 \begin_inset Flex CharStyle:Code
14536 \begin_layout Plain Layout
14542 , so you may have to do no more than add
14545 \begin_layout LyX-Code
14546 Input stdcounters.inc
14549 \begin_layout Standard
14550 to your layout file to get them to work.
14551 But if you want to define custom counters, then you can do so.
14552 The counter declaration must begin with:
14555 \begin_layout LyX-Code
14556 Counter CounterName
14559 \begin_layout Standard
14561 \begin_inset Flex CharStyle:Code
14564 \begin_layout Plain Layout
14570 ' is replaced by the name of the counter.
14571 And it must end with
14572 \begin_inset Quotes eld
14576 \begin_inset Flex CharStyle:Code
14579 \begin_layout Plain Layout
14586 \begin_inset Quotes erd
14590 The following parameters can also be used:
14593 \begin_layout Description
14594 \begin_inset Flex CharStyle:Code
14597 \begin_layout Plain Layout
14604 \begin_inset Flex CharStyle:Code
14607 \begin_layout Plain Layout
14614 \begin_inset Quotes erd
14618 \begin_inset Quotes erd
14621 ] When defined, this string defines how the counter is displayed.
14622 Setting this value sets
14623 \begin_inset Flex CharStyle:Code
14626 \begin_layout Plain Layout
14627 LabelStringAppendix
14633 The following special constructs can be used in the string:
14637 \begin_layout Itemize
14638 \begin_inset Flex CharStyle:Code
14641 \begin_layout Plain Layout
14649 will be replaced by the expansion of the
14650 \begin_inset Flex CharStyle:Code
14653 \begin_layout Plain Layout
14660 \begin_inset Flex CharStyle:Code
14663 \begin_layout Plain Layout
14664 LabelStringAppendix
14670 \begin_inset Flex CharStyle:Code
14673 \begin_layout Plain Layout
14683 \begin_layout Itemize
14684 counter values can be expressed using LaTeX-like macros
14685 \begin_inset Flex CharStyle:Code
14688 \begin_layout Plain Layout
14705 \begin_inset Flex CharStyle:Code
14708 \begin_layout Plain Layout
14720 \begin_layout Plain Layout
14730 Actually, the situation is a bit more complicated: any
14749 other than those described below will produce arabic numerals.
14750 It would not be surprising to see this change in the future.
14756 \begin_inset Flex CharStyle:Code
14759 \begin_layout Plain Layout
14765 : 1, 2, 3,\SpecialChar \ldots{}
14767 \begin_inset Flex CharStyle:Code
14770 \begin_layout Plain Layout
14776 for lower-case letters: a, b, c, \SpecialChar \ldots{}
14778 \begin_inset Flex CharStyle:Code
14781 \begin_layout Plain Layout
14787 for upper-case letters: A, B, C, \SpecialChar \ldots{}
14789 \begin_inset Flex CharStyle:Code
14792 \begin_layout Plain Layout
14798 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
14800 \begin_inset Flex CharStyle:Code
14803 \begin_layout Plain Layout
14809 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
14811 \begin_inset Flex CharStyle:Code
14814 \begin_layout Plain Layout
14820 for hebrew numerals.
14824 \begin_layout Standard
14825 If LabelString is not defined, a default value is constructed as follows:
14826 if the counter has a master counter
14827 \begin_inset Flex CharStyle:Code
14830 \begin_layout Plain Layout
14837 \begin_inset Flex CharStyle:Code
14840 \begin_layout Plain Layout
14847 \begin_inset Flex CharStyle:Code
14850 \begin_layout Plain Layout
14860 is used; otherwise the string
14861 \begin_inset Flex CharStyle:Code
14864 \begin_layout Plain Layout
14875 \begin_layout Description
14876 \begin_inset Flex CharStyle:Code
14879 \begin_layout Plain Layout
14880 LabelStringAppendix
14886 \begin_inset Flex CharStyle:Code
14889 \begin_layout Plain Layout
14896 \begin_inset Quotes erd
14900 \begin_inset Quotes erd
14904 \begin_inset Flex CharStyle:Code
14907 \begin_layout Plain Layout
14913 , but for use in the Appendix.
14916 \begin_layout Description
14917 \begin_inset Flex CharStyle:Code
14920 \begin_layout Plain Layout
14927 \begin_inset Flex CharStyle:Code
14930 \begin_layout Plain Layout
14937 \begin_inset Quotes erd
14941 \begin_inset Quotes erd
14944 ] A format for use with formatted references to this counter.
14945 For example, one might want to have references to section numbers appear
14947 \begin_inset Quotes eld
14951 \begin_inset Quotes erd
14955 The string should contain
14956 \begin_inset Quotes eld
14960 \begin_inset Quotes erd
14964 This will be replaced by the counter number itself.
14965 So, for sections, it would be: Section ##.
14968 \begin_layout Description
14969 \begin_inset Flex CharStyle:Code
14972 \begin_layout Plain Layout
14979 \begin_inset Flex CharStyle:Code
14982 \begin_layout Plain Layout
14989 \begin_inset Quotes erd
14993 \begin_inset Quotes erd
14996 ] If this is set to the name of another counter, the present counter will
14997 be reset every time the other one is increased.
14999 \begin_inset Flex CharStyle:Code
15002 \begin_layout Plain Layout
15009 \begin_inset Flex CharStyle:Code
15012 \begin_layout Plain Layout
15021 \begin_layout Subsection
15023 \begin_inset CommandInset label
15025 name "sub:Font-description"
15032 \begin_layout Standard
15033 A font description looks like this:
15036 \begin_layout LyX-Code
15046 \begin_layout LyX-Code
15050 \begin_layout LyX-Code
15054 \begin_layout Standard
15055 The following commands are available:
15058 \begin_layout Description
15059 \begin_inset Flex CharStyle:Code
15062 \begin_layout Plain Layout
15069 \begin_inset Flex CharStyle:Code
15072 \begin_layout Plain Layout
15081 \begin_inset Flex CharStyle:Code
15084 \begin_layout Plain Layout
15091 \begin_inset Flex CharStyle:Code
15094 \begin_layout Plain Layout
15101 \begin_inset Flex CharStyle:Code
15104 \begin_layout Plain Layout
15111 \begin_inset Flex CharStyle:Code
15114 \begin_layout Plain Layout
15121 \begin_inset Flex CharStyle:Code
15124 \begin_layout Plain Layout
15131 \begin_inset Flex CharStyle:Code
15134 \begin_layout Plain Layout
15141 \begin_inset Flex CharStyle:Code
15144 \begin_layout Plain Layout
15151 \begin_inset Flex CharStyle:Code
15154 \begin_layout Plain Layout
15163 \begin_layout Description
15164 \begin_inset Flex CharStyle:Code
15167 \begin_layout Plain Layout
15174 \begin_inset Flex CharStyle:Code
15177 \begin_layout Plain Layout
15186 \begin_inset Flex CharStyle:Code
15189 \begin_layout Plain Layout
15196 \begin_inset Flex CharStyle:Code
15199 \begin_layout Plain Layout
15208 \begin_layout Description
15209 \begin_inset Flex CharStyle:Code
15212 \begin_layout Plain Layout
15219 \begin_inset Flex CharStyle:Code
15222 \begin_layout Plain Layout
15228 ] Valid arguments are:
15229 \begin_inset Flex CharStyle:Code
15232 \begin_layout Plain Layout
15239 \begin_inset Flex CharStyle:Code
15242 \begin_layout Plain Layout
15249 \begin_inset Flex CharStyle:Code
15252 \begin_layout Plain Layout
15259 \begin_inset Flex CharStyle:Code
15262 \begin_layout Plain Layout
15269 \begin_inset Flex CharStyle:Code
15272 \begin_layout Plain Layout
15279 \begin_inset Flex CharStyle:Code
15282 \begin_layout Plain Layout
15289 Each of these turns on or off the corresponding attribute.
15291 \begin_inset Flex CharStyle:Code
15294 \begin_layout Plain Layout
15300 turns on emphasis, and
15301 \begin_inset Flex CharStyle:Code
15304 \begin_layout Plain Layout
15312 \begin_inset Newline newline
15315 If the latter seems puzzling, remember that the font settings for the present
15316 context are generally inherited from the surrounding context.
15318 \begin_inset Flex CharStyle:Code
15321 \begin_layout Plain Layout
15327 would turn off the emphasis that was anyway in effect, say, in a theorem
15331 \begin_layout Description
15332 \begin_inset Flex CharStyle:Code
15335 \begin_layout Plain Layout
15342 \begin_inset Flex CharStyle:Code
15345 \begin_layout Plain Layout
15354 \begin_inset Flex CharStyle:Code
15357 \begin_layout Plain Layout
15366 \begin_layout Description
15367 \begin_inset Flex CharStyle:Code
15370 \begin_layout Plain Layout
15377 \begin_inset Flex CharStyle:Code
15380 \begin_layout Plain Layout
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 Flex CharStyle:Code
15412 \begin_layout Plain Layout
15421 \begin_layout Description
15422 \begin_inset Flex CharStyle:Code
15425 \begin_layout Plain Layout
15432 \begin_inset Flex CharStyle:Code
15435 \begin_layout Plain Layout
15442 \begin_inset Flex CharStyle:Code
15445 \begin_layout Plain Layout
15452 \begin_inset Flex CharStyle:Code
15455 \begin_layout Plain Layout
15464 \begin_inset Flex CharStyle:Code
15467 \begin_layout Plain Layout
15474 \begin_inset Flex CharStyle:Code
15477 \begin_layout Plain Layout
15484 \begin_inset Flex CharStyle:Code
15487 \begin_layout Plain Layout
15494 \begin_inset Flex CharStyle:Code
15497 \begin_layout Plain Layout
15504 \begin_inset Flex CharStyle:Code
15507 \begin_layout Plain Layout
15516 \begin_layout Subsection
15517 \begin_inset CommandInset label
15519 name "sub:Citation-format-description"
15523 Citation format description
15526 \begin_layout Standard
15528 \begin_inset Flex CharStyle:Code
15531 \begin_layout Plain Layout
15537 blocks are used to describe how bibliographic information should be displayed,
15538 both within LyX itself (in the citation dialog and in tooltips, for example)
15539 and in XHTML output.
15540 Such a block might look like this:
15543 \begin_layout LyX-Code
15547 \begin_layout LyX-Code
15551 \begin_layout LyX-Code
15555 \begin_layout LyX-Code
15559 \begin_layout Standard
15560 The individual lines define how the bibliographic information associated
15561 with an article or book, respectively, is to be displayed, and such a definitio
15562 n can be given for any `entry type' that might be present in a BibTeX file.
15563 LyX defines a default format in the source code that will be used if no
15564 specific definition has been given.
15565 LyX predefines several formats in the file
15566 \begin_inset Flex CharStyle:Code
15569 \begin_layout Plain Layout
15575 , which is included in most of LyX's document classes.
15578 \begin_layout Standard
15579 The definitions use a simple language that allows BibTeX keys to be replaced
15581 Keys should be enclosed in % signs, e.g.:
15582 \begin_inset Flex CharStyle:Code
15585 \begin_layout Plain Layout
15592 So a simple definition might look like this:
15595 \begin_layout LyX-Code
15597 \begin_inset Quotes eld
15601 \begin_inset Quotes erd
15607 \begin_layout Standard
15608 This would print the author, followed by a comma, followed by the title,
15609 in quotes, followed by a period.
15612 \begin_layout Standard
15613 Of course, sometimes you may want to print a key only if it exists.
15614 This can be done by using a conditional construction, such as:
15615 \begin_inset Flex CharStyle:Code
15618 \begin_layout Plain Layout
15620 \begin_inset space ~
15630 \begin_inset Flex CharStyle:Code
15633 \begin_layout Plain Layout
15639 key exists, then print
15640 \begin_inset Quotes eld
15644 \begin_inset space ~
15648 \begin_inset Quotes erd
15651 followed by the volume key.
15652 It is also possible to have an else clause in the conditional, such as:
15654 \begin_inset Flex CharStyle:Code
15657 \begin_layout Plain Layout
15658 {%author%[[%author%]][[%editor%, ed.]]}
15665 \begin_inset Flex CharStyle:Code
15668 \begin_layout Plain Layout
15674 key is printed if it exists; otherwise, the editor key is printed, followed
15676 \begin_inset Quotes eld
15680 \begin_inset space ~
15684 \begin_inset Quotes erd
15687 Note that the key is again enclosed in % signs; the entire conditional
15688 is enclosed in braces; and the if and else clauses are enclosed in double
15690 \begin_inset Quotes eld
15694 \begin_inset Quotes eld
15698 \begin_inset Quotes eld
15702 \begin_inset Quotes erd
15706 There must be no space between any of these.
15709 \begin_layout Standard
15710 There is one other piece of syntax available in definitions, which looks
15712 \begin_inset Flex CharStyle:Code
15715 \begin_layout Plain Layout
15722 This defines a piece of formatting information that is to be used when
15724 \begin_inset Quotes eld
15728 \begin_inset Quotes erd
15732 Obviously, we do not want to output HTML tags when writing plain text,
15733 so they should be wrapped in
15734 \begin_inset Quotes eld
15738 \begin_inset Quotes erd
15742 \begin_inset Quotes eld
15746 \begin_inset Quotes erd
15752 \begin_layout Standard
15753 Two special sorts of definitions are also possible in a
15754 \begin_inset Flex CharStyle:Code
15757 \begin_layout Plain Layout
15764 An example of the first would be:
15767 \begin_layout LyX-Code
15769 \begin_inset Quotes eld
15773 \begin_inset Quotes erd
15779 \begin_layout Standard
15780 This is an abbreviation, or macro, and it can be used by treating it as
15782 \begin_inset Flex CharStyle:Code
15785 \begin_layout Plain Layout
15793 \begin_inset Flex CharStyle:Code
15796 \begin_layout Plain Layout
15802 exactly as it would treat its definition.
15803 So, let us issue the obvious
15811 \begin_layout LyX-Code
15815 \begin_layout Standard
15816 or anything like it.
15817 LyX shouldn't go into an infinite loop, but it may go into a long one before
15821 \begin_layout Standard
15822 The second sort of special definition might look like this:
15825 \begin_layout LyX-Code
15829 \begin_layout Standard
15830 This defines a translatable piece of text, which allows relevant parts of
15831 the bibliography to be translated.
15832 It can be included in a definition by treating it as a key:
15833 \begin_inset Flex CharStyle:Code
15836 \begin_layout Plain Layout
15843 Several of these are predefined in
15844 \begin_inset Flex CharStyle:Code
15847 \begin_layout Plain Layout
15854 Note that these are not macros, in the sense just defined.
15855 They will not be expanded.
15858 \begin_layout Standard
15859 So here then is an example that use all these features:
15862 \begin_layout LyX-Code
15863 !authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
15866 \begin_layout Standard
15867 The defines a macro that prints the author, followed by a comma, if the
15869 \begin_inset Flex CharStyle:Code
15872 \begin_layout Plain Layout
15878 key is defined, or else prints the name of the editor, followed by the
15880 \begin_inset Flex CharStyle:Code
15883 \begin_layout Plain Layout
15889 or its translation (it is by default
15890 \begin_inset Quotes eld
15894 \begin_inset Quotes erd
15898 \begin_inset Flex CharStyle:Code
15901 \begin_layout Plain Layout
15908 Note that this is in fact defined in
15909 \begin_inset Flex CharStyle:Code
15912 \begin_layout Plain Layout
15918 , so you can use it in your own definitions, or re-definitions, if you load
15922 \begin_layout Section
15923 \begin_inset CommandInset label
15925 name "sec:Tags-for-XHTML"
15929 Tags for XHTML output
15932 \begin_layout Standard
15933 As with LaTeX or DocBook, the format of LyX's XHTML output is also controlled
15934 by layout information.
15935 In general, LyX provides sensible defaults and, as mentioned earlier, it
15936 will even construct default CSS style rules from the other layout tags.
15937 For example, LyX will attempt to use the information provided in the
15938 \begin_inset Flex CharStyle:Code
15941 \begin_layout Plain Layout
15947 declaration for the Chapter style to write CSS that will appropriately
15948 format chapter headings.
15951 \begin_layout Standard
15952 In many cases, then, you may not have to do anything at all to get acceptable
15953 XHTML output for your own environments, custom insets, and so forth.
15954 But in some cases you will, and so LyX provides a number of layout tags
15955 that can be used to customize the XHTML and CSS that are generated.
15958 \begin_layout Standard
15959 Note that there are two tags,
15960 \begin_inset Flex CharStyle:Code
15963 \begin_layout Plain Layout
15970 \begin_inset Flex CharStyle:Code
15973 \begin_layout Plain Layout
15979 that may appear outside style and inset declarations.
15981 \begin_inset CommandInset ref
15982 LatexCommand prettyref
15983 reference "sub:General-text-class"
15987 for details on these.
15990 \begin_layout Subsection
15991 \begin_inset CommandInset label
15993 name "sub:Paragraph-Style-XHTML"
16000 \begin_layout Standard
16001 The sort of XHTML LyX outputs for a paragraph depends upon whether we are
16002 dealing with a normal paragraph, a command, or an environment, where this
16003 is itself determined by the contents of the corresponding
16004 \begin_inset Flex CharStyle:Code
16007 \begin_layout Plain Layout
16017 \begin_layout Standard
16018 For a command or normal paragraph, the output XHTML has the following form:
16021 \begin_layout LyX-Code
16023 \begin_inset Quotes erd
16027 \begin_inset Quotes erd
16033 \begin_layout LyX-Code
16035 \begin_inset Quotes erd
16039 \begin_inset Quotes erd
16045 \begin_layout LyX-Code
16046 Contents of the paragraph.
16049 \begin_layout LyX-Code
16053 \begin_layout Standard
16054 The label tags are of course omitted if the paragraph does not have a label.
16057 \begin_layout Standard
16058 For an environment that is not some sort of list, the XHTML takes this form:
16061 \begin_layout LyX-Code
16063 \begin_inset Quotes erd
16067 \begin_inset Quotes erd
16073 \begin_layout LyX-Code
16075 \begin_inset Quotes erd
16079 \begin_inset Quotes erd
16083 \begin_inset Quotes erd
16087 \begin_inset Quotes erd
16090 >Environment Label</labeltag>First paragraph.</itemtag>
16093 \begin_layout LyX-Code
16094 <itemtag>Second paragraph.</itemtag>
16097 \begin_layout LyX-Code
16101 \begin_layout Standard
16102 Note that the label is output only for the first paragraph, as it should
16103 be for a theorem, for example.
16107 \begin_layout Standard
16108 For a list, we have one of these forms:
16111 \begin_layout LyX-Code
16113 \begin_inset Quotes erd
16117 \begin_inset Quotes erd
16123 \begin_layout LyX-Code
16125 \begin_inset Quotes erd
16129 \begin_inset Quotes erd
16133 \begin_inset Quotes erd
16137 \begin_inset Quotes erd
16140 >List Label</labeltag>First item.</itemtag>
16143 \begin_layout LyX-Code
16145 \begin_inset Quotes erd
16149 \begin_inset Quotes erd
16153 \begin_inset Quotes erd
16157 \begin_inset Quotes erd
16160 >List Label</labeltag>Second item.</itemtag>
16163 \begin_layout LyX-Code
16167 \begin_layout LyX-Code
16171 \begin_layout LyX-Code
16173 \begin_inset Quotes erd
16177 \begin_inset Quotes erd
16183 \begin_layout LyX-Code
16185 \begin_inset Quotes erd
16189 \begin_inset Quotes erd
16192 >List Label</labeltag><itemtag attr=
16193 \begin_inset Quotes erd
16197 \begin_inset Quotes erd
16200 >First item.</itemtag>
16203 \begin_layout LyX-Code
16205 \begin_inset Quotes erd
16209 \begin_inset Quotes erd
16212 >List Label</labeltag><itemtag attr=
16213 \begin_inset Quotes erd
16217 \begin_inset Quotes erd
16220 >Second item.</itemtag>
16223 \begin_layout LyX-Code
16227 \begin_layout Standard
16228 Note the different orders of
16229 \begin_inset Flex CharStyle:Code
16232 \begin_layout Plain Layout
16239 \begin_inset Flex CharStyle:Code
16242 \begin_layout Plain Layout
16249 Which order we get depends upon the setting of
16250 \begin_inset Flex CharStyle:Code
16253 \begin_layout Plain Layout
16260 \begin_inset Flex CharStyle:Code
16263 \begin_layout Plain Layout
16269 is false (the default), you get the first of these, with the label within
16270 the item; if true, you get the second, with the label outside the item.
16273 \begin_layout Standard
16274 The specific tags and attributes output for each paragraph type can be controlle
16275 d by means of the layout tags we are about to describe.
16276 As mentioned earlier, however, LyX uses sensible defaults for many of these,
16277 so you often may not need to do very much to get good XHTML output.
16278 Think of the available tags as there so you can tweak things to your liking.
16281 \begin_layout Description
16282 \begin_inset Flex CharStyle:Code
16285 \begin_layout Plain Layout
16292 \begin_inset Flex CharStyle:Code
16295 \begin_layout Plain Layout
16301 ] Specifies attribute information to be output with the main tag.
16303 \begin_inset Quotes eld
16307 \begin_inset Flex CharStyle:Code
16310 \begin_layout Plain Layout
16317 \begin_inset Quotes erd
16321 By default, LyX will output
16322 \begin_inset Quotes eld
16326 \begin_inset Flex CharStyle:Code
16329 \begin_layout Plain Layout
16336 \begin_inset Quotes erd
16340 \begin_inset Flex CharStyle:Code
16343 \begin_layout Plain Layout
16349 is the LyX name of the layout, made lowercase, for example: chapter.
16352 \begin_layout Description
16353 \begin_inset Flex CharStyle:Code
16356 \begin_layout Plain Layout
16363 \begin_inset Flex CharStyle:Code
16366 \begin_layout Plain Layout
16376 ] Whether to output the default CSS information LyX generates for this layout,
16377 even if additional information is explicitly provided via
16378 \begin_inset Flex CharStyle:Code
16381 \begin_layout Plain Layout
16389 \begin_inset Flex CharStyle:Code
16392 \begin_layout Plain Layout
16398 allows you to alter or augment the generated CSS, rather than to override
16401 \begin_inset Flex CharStyle:Code
16404 \begin_layout Plain Layout
16413 \begin_layout Description
16414 \begin_inset Flex CharStyle:Code
16417 \begin_layout Plain Layout
16424 \begin_inset Flex CharStyle:Code
16427 \begin_layout Plain Layout
16433 ] The tag to be used for individual paragraphs of environments, replacing
16435 \begin_inset Flex CharStyle:Code
16438 \begin_layout Plain Layout
16444 in the examples above.
16446 \begin_inset Flex CharStyle:Code
16449 \begin_layout Plain Layout
16458 \begin_layout Description
16459 \begin_inset Flex CharStyle:Code
16462 \begin_layout Plain Layout
16469 \begin_inset Flex CharStyle:Code
16472 \begin_layout Plain Layout
16478 ] Attributes for the item tag.
16480 \begin_inset Quotes eld
16484 \begin_inset Flex CharStyle:Code
16487 \begin_layout Plain Layout
16488 class=`layoutname_item'
16494 \begin_inset Quotes erd
16500 \begin_layout Description
16501 \begin_inset Flex CharStyle:Code
16504 \begin_layout Plain Layout
16511 \begin_inset Flex CharStyle:Code
16514 \begin_layout Plain Layout
16520 ] The tag to be used for paragraph and item labels, replacing
16521 \begin_inset Flex CharStyle:Code
16524 \begin_layout Plain Layout
16530 in the examples above.
16532 \begin_inset Flex CharStyle:Code
16535 \begin_layout Plain Layout
16544 \begin_layout Description
16545 \begin_inset Flex CharStyle:Code
16548 \begin_layout Plain Layout
16555 \begin_inset Flex CharStyle:Code
16558 \begin_layout Plain Layout
16564 ] Attributes for the label tag.
16566 \begin_inset Quotes eld
16570 \begin_inset Flex CharStyle:Code
16573 \begin_layout Plain Layout
16574 class=`layoutname_label'
16580 \begin_inset Quotes erd
16586 \begin_layout Description
16587 \begin_inset Flex CharStyle:Code
16590 \begin_layout Plain Layout
16597 \begin_inset Flex CharStyle:Code
16600 \begin_layout Plain Layout
16610 ] Meaningful only for list-like environments, this tag controls whether
16611 the label tag is output before or inside the item tag.
16612 This is used, for example, in the description environment, where we want
16614 \begin_inset Flex CharStyle:Code
16617 \begin_layout Plain Layout
16618 <dt>\SpecialChar \ldots{}
16619 </dt><dd>\SpecialChar \ldots{}
16627 \begin_inset Flex CharStyle:Code
16630 \begin_layout Plain Layout
16636 : The label tag is output inside the item tag.
16639 \begin_layout Description
16640 \begin_inset Flex CharStyle:Code
16643 \begin_layout Plain Layout
16649 Information to be output in the
16650 \begin_inset Flex CharStyle:Code
16653 \begin_layout Plain Layout
16659 section when this style is used.
16660 This might, for example, be used to include a
16661 \begin_inset Flex CharStyle:Code
16664 \begin_layout Plain Layout
16671 \begin_inset Flex CharStyle:Code
16674 \begin_layout Plain Layout
16683 \begin_layout Description
16684 \begin_inset Flex CharStyle:Code
16687 \begin_layout Plain Layout
16693 CSS style information to be included when this style is used.
16694 Note that this will automatically be wrapped in a layout-generated
16695 \begin_inset Flex CharStyle:Code
16698 \begin_layout Plain Layout
16704 block, so only the CSS itself need be included.
16707 \begin_layout Description
16708 \begin_inset Flex CharStyle:Code
16711 \begin_layout Plain Layout
16718 \begin_inset Flex CharStyle:Code
16721 \begin_layout Plain Layout
16727 ] The tag to be used for the main label, replacing
16728 \begin_inset Flex CharStyle:Code
16731 \begin_layout Plain Layout
16737 in the examples above.
16739 \begin_inset Flex CharStyle:Code
16742 \begin_layout Plain Layout
16751 \begin_layout Description
16752 \begin_inset Flex CharStyle:Code
16755 \begin_layout Plain Layout
16762 \begin_inset Flex CharStyle:Code
16765 \begin_layout Plain Layout
16775 ] Marks this style as the one to be used to generate the
16776 \begin_inset Flex CharStyle:Code
16779 \begin_layout Plain Layout
16785 tag for the XHTML file.
16786 By default, it is false.
16788 \begin_inset Flex CharStyle:Code
16791 \begin_layout Plain Layout
16797 file sets it to true for the
16798 \begin_inset Flex CharStyle:Code
16801 \begin_layout Plain Layout
16811 \begin_layout Subsection
16815 \begin_layout Standard
16816 The XHTML output of insets can also be controlled by information in layout
16821 \begin_layout Plain Layout
16822 At present, this is true only for
16823 \begin_inset Quotes eld
16827 \begin_inset Quotes erd
16830 insets (insets you can type into) and is not true for
16831 \begin_inset Quotes eld
16835 \begin_inset Quotes erd
16838 insets (insets that are associated with dialog boxes).
16843 Here, too, LyX tries to provide sensible defaults, and it constructs default
16845 But everything can be customized.
16848 \begin_layout Standard
16849 The XHTML LyX outputs for an inset has the following form:
16852 \begin_layout LyX-Code
16854 \begin_inset Quotes erd
16858 \begin_inset Quotes erd
16864 \begin_layout LyX-Code
16865 <labeltag>Label</labeltag>
16868 \begin_layout LyX-Code
16870 \begin_inset Quotes erd
16874 \begin_inset Quotes erd
16877 >Contents of the inset.</innertag>
16880 \begin_layout LyX-Code
16884 \begin_layout Standard
16885 If the inset permits multiple paragraphs---that is, if
16886 \begin_inset Flex CharStyle:Code
16889 \begin_layout Plain Layout
16895 is true---then the contents of the inset will itself be output as paragraphs
16896 formatted according to the styles used for those paragraphs (standard,
16897 quote, and the like).
16898 The label tag is of course omitted if the paragraph does not have a label
16899 and, at present, is always
16900 \begin_inset Flex CharStyle:Code
16903 \begin_layout Plain Layout
16910 The inner tag is optional and, by default, does not appear.
16913 \begin_layout Standard
16914 The specific tags and attributes output for each inset can be controlled
16915 by means of the following layout tags.
16918 \begin_layout Description
16919 \begin_inset Flex CharStyle:Code
16922 \begin_layout Plain Layout
16929 \begin_inset Flex CharStyle:Code
16932 \begin_layout Plain Layout
16938 ] Specifies attribute information to be output with the main tag.
16940 \begin_inset Quotes eld
16944 \begin_inset Flex CharStyle:Code
16947 \begin_layout Plain Layout
16948 class=`myinset' onclick=`\SpecialChar \ldots{}
16955 \begin_inset Quotes erd
16959 By default, LyX will output
16960 \begin_inset Quotes eld
16964 \begin_inset Flex CharStyle:Code
16967 \begin_layout Plain Layout
16974 \begin_inset Quotes erd
16978 \begin_inset Flex CharStyle:Code
16981 \begin_layout Plain Layout
16987 is the LyX name of the inset, made lowercase and with non-alphanumeric
16988 characters converted to underscores, for example: footnote.
16991 \begin_layout Description
16992 \begin_inset Flex CharStyle:Code
16995 \begin_layout Plain Layout
17002 \begin_inset Flex CharStyle:Code
17005 \begin_layout Plain Layout
17015 ] Whether to output the default CSS information LyX generates for this layout,
17016 even if additional information is explicitly provided via
17017 \begin_inset Flex CharStyle:Code
17020 \begin_layout Plain Layout
17028 \begin_inset Flex CharStyle:Code
17031 \begin_layout Plain Layout
17037 allows you to alter or augment the generated CSS, rather than to override
17042 \begin_layout Description
17043 \begin_inset Flex CharStyle:Code
17046 \begin_layout Plain Layout
17053 \begin_inset Flex CharStyle:Code
17056 \begin_layout Plain Layout
17062 ] Attributes for the inner tag.
17064 \begin_inset Quotes eld
17068 \begin_inset Flex CharStyle:Code
17071 \begin_layout Plain Layout
17072 class=`insetname_inner'
17078 \begin_inset Quotes erd
17084 \begin_layout Description
17085 \begin_inset Flex CharStyle:Code
17088 \begin_layout Plain Layout
17095 \begin_inset Flex CharStyle:Code
17098 \begin_layout Plain Layout
17104 ] The inner tag, replacing
17105 \begin_inset Flex CharStyle:Code
17108 \begin_layout Plain Layout
17114 in the examples above.
17115 By default, there is none.
17118 \begin_layout Description
17119 \begin_inset Flex CharStyle:Code
17122 \begin_layout Plain Layout
17129 \begin_inset Flex CharStyle:Code
17132 \begin_layout Plain Layout
17140 ] Whether this inset represents a standalone block of text (such as a footnote)
17141 or instead represents material that is included in the surrounding text
17142 (such as a branch).
17146 \begin_layout Description
17147 \begin_inset Flex CharStyle:Code
17150 \begin_layout Plain Layout
17157 \begin_inset Flex CharStyle:Code
17160 \begin_layout Plain Layout
17166 ] A label for this inset, possibly including a reference to a counter.
17167 For example, for footnote, it might be:
17168 \begin_inset Flex CharStyle:Code
17171 \begin_layout Plain Layout
17180 This is optional, and there is no default.
17183 \begin_layout Description
17184 \begin_inset Flex CharStyle:Code
17187 \begin_layout Plain Layout
17193 Information to be output in the
17194 \begin_inset Flex CharStyle:Code
17197 \begin_layout Plain Layout
17203 section when this style is used.
17204 This might, for example, be used to include a
17205 \begin_inset Flex CharStyle:Code
17208 \begin_layout Plain Layout
17215 \begin_inset Flex CharStyle:Code
17218 \begin_layout Plain Layout
17227 \begin_layout Description
17228 \begin_inset Flex CharStyle:Code
17231 \begin_layout Plain Layout
17237 CSS style information to be included when this style is used.
17238 Note that this will automatically be wrapped in a layout-generated
17239 \begin_inset Flex CharStyle:Code
17242 \begin_layout Plain Layout
17248 block, so only the CSS itself need be included.
17251 \begin_layout Description
17252 \begin_inset Flex CharStyle:Code
17255 \begin_layout Plain Layout
17262 \begin_inset Flex CharStyle:Code
17265 \begin_layout Plain Layout
17271 ] The tag to be used for the main label, replacing
17272 \begin_inset Flex CharStyle:Code
17275 \begin_layout Plain Layout
17281 in the examples above.
17282 The default depends upon the setting of
17283 \begin_inset Flex CharStyle:Code
17286 \begin_layout Plain Layout
17293 \begin_inset Flex CharStyle:Code
17296 \begin_layout Plain Layout
17302 is true, the default is
17303 \begin_inset Flex CharStyle:Code
17306 \begin_layout Plain Layout
17312 ; if it is false, the default is
17313 \begin_inset Flex CharStyle:Code
17316 \begin_layout Plain Layout
17325 \begin_layout Subsection
17329 \begin_layout Standard
17330 The XHTML output for floats too can be controlled by layout information.
17331 The output has the following form:
17334 \begin_layout LyX-Code
17336 \begin_inset Quotes erd
17340 \begin_inset Quotes erd
17346 \begin_layout LyX-Code
17347 Contents of the float.
17350 \begin_layout LyX-Code
17354 \begin_layout Standard
17355 The caption, if there is one, is a separate inset and will be output as
17357 Its appearance can be controlled via the InsetLayout for caption insets.
17361 \begin_layout Description
17362 \begin_inset Flex CharStyle:Code
17365 \begin_layout Plain Layout
17372 \begin_inset Flex CharStyle:Code
17375 \begin_layout Plain Layout
17381 ] Specifies attribute information to be output with the main tag.
17383 \begin_inset Quotes eld
17387 \begin_inset Flex CharStyle:Code
17390 \begin_layout Plain Layout
17391 class=`myfloat' onclick=`\SpecialChar \ldots{}
17398 \begin_inset Quotes erd
17402 By default, LyX will output
17403 \begin_inset Quotes eld
17407 \begin_inset Flex CharStyle:Code
17410 \begin_layout Plain Layout
17411 class=`float float-floattype'
17417 \begin_inset Quotes erd
17421 \begin_inset Flex CharStyle:Code
17424 \begin_layout Plain Layout
17430 is LyX's name for this type of float, as determined by the float delcaration
17432 \begin_inset CommandInset ref
17434 reference "sub:Floats"
17438 ), though made lowercase and with non-alphanumeric characters converted
17439 to underscores, for example: float-table.
17442 \begin_layout Description
17443 \begin_inset Flex CharStyle:Code
17446 \begin_layout Plain Layout
17452 CSS style information to be included when this float is used.
17453 Note that this will automatically be wrapped in a layout-generated
17454 \begin_inset Flex CharStyle:Code
17457 \begin_layout Plain Layout
17463 block, so only the CSS itself need be included.
17466 \begin_layout Description
17467 \begin_inset Flex CharStyle:Code
17470 \begin_layout Plain Layout
17477 \begin_inset Flex CharStyle:Code
17480 \begin_layout Plain Layout
17486 ] The tag to be used for this float, replacing
17487 \begin_inset Quotes eld
17491 \begin_inset Flex CharStyle:Code
17494 \begin_layout Plain Layout
17501 \begin_inset Quotes erd
17504 in the example above.
17506 \begin_inset Flex CharStyle:Code
17509 \begin_layout Plain Layout
17515 and will rarely need changing.
17518 \begin_layout Subsection
17519 Bibliography formatting
17522 \begin_layout Standard
17523 The bibliography can be formatted using
17524 \begin_inset Flex CharStyle:Code
17527 \begin_layout Plain Layout
17535 \begin_inset CommandInset ref
17537 reference "sub:Citation-format-description"
17544 \begin_layout Subsection
17548 \begin_layout Standard
17549 We have several times mentioned that LyX will generate default CSS style
17550 rules for both insets and paragraph styles, based upon the other layout
17551 information that is provided.
17552 In this section, we shall say a word about which layout information LyX
17556 \begin_layout Standard
17557 At present, LyX auto-generates CSS only for font information, making use
17559 \begin_inset Flex CharStyle:Code
17562 \begin_layout Plain Layout
17569 \begin_inset Flex CharStyle:Code
17572 \begin_layout Plain Layout
17579 \begin_inset Flex CharStyle:Code
17582 \begin_layout Plain Layout
17589 \begin_inset Flex CharStyle:Code
17592 \begin_layout Plain Layout
17599 \begin_inset Flex CharStyle:Code
17602 \begin_layout Plain Layout
17610 \begin_inset CommandInset ref
17612 reference "sub:Font-description"
17616 .) The translation is mostly straightforward and obvious.
17618 \begin_inset Quotes eld
17622 \begin_inset Flex CharStyle:Code
17625 \begin_layout Plain Layout
17632 \begin_inset Quotes erd
17636 \begin_inset Quotes eld
17640 \begin_inset Flex CharStyle:Code
17643 \begin_layout Plain Layout
17644 font-family: sans-serif;
17650 \begin_inset Quotes erd
17654 The correspondence of LyX sizes and CSS sizes is a little less obvious
17655 but nonetheless intuitive.
17657 \begin_inset Flex CharStyle:Code
17660 \begin_layout Plain Layout
17667 \begin_inset Flex URL
17670 \begin_layout Plain Layout
17681 \begin_layout Chapter
17682 Including External Material
17685 \begin_layout Standard
17686 \begin_inset Box Shadowbox
17695 height_special "totalheight"
17698 \begin_layout Plain Layout
17699 WARNING: This portion of the documentation has not been updated for some
17701 We certainly hope that it is still accurate, but there are no guarantees.
17709 \begin_layout Standard
17710 The use of material from sources external to LyX is covered in detail in
17716 This part of the manual covers what needs to happen behind the scenes for
17717 new sorts of material to be included.
17720 \begin_layout Section
17724 \begin_layout Standard
17725 The external material feature is based on the concept of a
17730 A template is a specification of how LyX should interface with a certain
17732 As bundled, LyX comes with predefined templates for Xfig figures, various
17733 raster format images, chess diagrams, and LilyPond music notation.
17734 You can check the actual list by using the menu
17735 \begin_inset Flex CharStyle:MenuItem
17738 \begin_layout Plain Layout
17739 Insert\SpecialChar \menuseparator
17740 File\SpecialChar \menuseparator
17747 Furthermore, it is possible to roll your own template to support a specific
17749 Later we'll describe in more detail what is involved, and hopefully you
17750 will submit all the templates you create so we can include them in a later
17754 \begin_layout Standard
17755 Another basic idea of the external material feature is to distinguish between
17756 the original file that serves as a base for final material and the produced
17757 file that is included in your exported or printed document.
17758 For example, consider the case of a figure produced with
17759 \begin_inset Flex CharStyle:Code
17762 \begin_layout Plain Layout
17769 The Xfig application itself works on an original file with the
17770 \begin_inset Flex CharStyle:Code
17773 \begin_layout Plain Layout
17780 Within Xfig, you create and change your figure, and when you are done,
17782 \begin_inset Flex CharStyle:Code
17785 \begin_layout Plain Layout
17792 When you want to include the figure in your document, you invoke
17793 \begin_inset Flex CharStyle:Code
17796 \begin_layout Plain Layout
17802 in order to create a PostScript file that can readily be included in your
17805 \begin_inset Flex CharStyle:Code
17808 \begin_layout Plain Layout
17814 file is the original file, and the PostScript file is the produced file.
17817 \begin_layout Standard
17818 This distinction is important in order to allow updating of the material
17819 while you are in the process of writing the document.
17820 Furthermore, it provides us with the flexibility that is needed to support
17821 multiple export formats.
17822 For instance, in the case of a plain text file, it is not exactly an award-winn
17823 ing idea to include the figure as raw PostScript.
17824 Instead, you'd either prefer to just include a reference to the figure
17825 or try to invoke some graphics to ASCII converter to make the final result
17826 look similar to the real graphics.
17827 The external material management allows you to do this, because it is parametri
17828 zed on the different export formats that LyX supports.
17831 \begin_layout Standard
17832 Besides supporting the production of different products according to the
17833 exported format, it supports tight integration with editing and viewing
17835 In the case of an Xfig figure, you are able to invoke Xfig on the original
17836 file with a single click from within the external material dialog in LyX,
17837 and also preview the produced PostScript file with Ghostview with another
17839 No more fiddling around with the command line and/or file browsers to locate
17840 and manipulate the original or produced files.
17841 In this way, you are finally able to take full advantage of the many different
17842 applications that are relevant to use when you write your documents, and
17843 ultimately be more productive.
17846 \begin_layout Section
17847 The external template configuration file
17850 \begin_layout Standard
17851 It is relatively easy to add custom external template definitions to LyX.
17852 However, be aware that doing this in an careless manner most probably
17856 introduce an easily exploitable security hole.
17857 So before you do this, please read the discussion about security in section
17859 \begin_inset CommandInset ref
17861 reference "sec:Security-discussion"
17868 \begin_layout Standard
17869 Having said that, we encourage you to submit any interesting templates that
17874 \begin_layout Standard
17875 The external templates are defined in the
17876 \begin_inset Flex CharStyle:Code
17879 \begin_layout Plain Layout
17880 LyXDir/lib/external_templates
17886 You can place your own version in
17887 \begin_inset Flex CharStyle:Code
17890 \begin_layout Plain Layout
17891 UserDir/external_templates
17899 \begin_layout Standard
17900 A typical template looks like this:
17903 \begin_layout LyX-Code
17907 \begin_layout LyX-Code
17908 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
17911 \begin_layout LyX-Code
17915 \begin_layout LyX-Code
17919 \begin_layout LyX-Code
17923 \begin_layout LyX-Code
17927 \begin_layout LyX-Code
17931 \begin_layout LyX-Code
17932 AutomaticProduction true
17935 \begin_layout LyX-Code
17939 \begin_layout LyX-Code
17943 \begin_layout LyX-Code
17947 \begin_layout LyX-Code
17948 TransformCommand Rotate RotationLatexCommand
17951 \begin_layout LyX-Code
17952 TransformCommand Resize ResizeLatexCommand
17955 \begin_layout LyX-Code
17956 Product "$$RotateFront$$ResizeFront
17959 \begin_layout LyX-Code
17964 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
17967 \begin_layout LyX-Code
17968 $$ResizeBack$$RotateBack"
17971 \begin_layout LyX-Code
17975 \begin_layout LyX-Code
17976 UpdateResult "$$AbsPath$$Basename.pstex_t"
17979 \begin_layout LyX-Code
17980 Requirement "graphicx"
17983 \begin_layout LyX-Code
17984 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
17987 \begin_layout LyX-Code
17988 ReferencedFile latex "$$AbsPath$$Basename.eps"
17991 \begin_layout LyX-Code
17992 ReferencedFile dvi "$$AbsPath$$Basename.eps"
17995 \begin_layout LyX-Code
17999 \begin_layout LyX-Code
18003 \begin_layout LyX-Code
18004 TransformCommand Rotate RotationLatexCommand
18007 \begin_layout LyX-Code
18008 TransformCommand Resize ResizeLatexCommand
18011 \begin_layout LyX-Code
18012 Product "$$RotateFront$$ResizeFront
18015 \begin_layout LyX-Code
18020 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
18023 \begin_layout LyX-Code
18024 $$ResizeBack$$RotateBack"
18027 \begin_layout LyX-Code
18028 UpdateFormat pdftex
18031 \begin_layout LyX-Code
18032 UpdateResult "$$AbsPath$$Basename.pdftex_t"
18035 \begin_layout LyX-Code
18036 Requirement "graphicx"
18039 \begin_layout LyX-Code
18040 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
18043 \begin_layout LyX-Code
18044 ReferencedFile latex "$$AbsPath$$Basename.pdf"
18047 \begin_layout LyX-Code
18051 \begin_layout LyX-Code
18055 \begin_layout LyX-Code
18056 Product "$$Contents(
18058 "$$AbsPath$$Basename.asc
18063 \begin_layout LyX-Code
18064 UpdateFormat asciixfig
18067 \begin_layout LyX-Code
18068 UpdateResult "$$AbsPath$$Basename.asc"
18071 \begin_layout LyX-Code
18075 \begin_layout LyX-Code
18079 \begin_layout LyX-Code
18080 Product "<graphic fileref=
18082 "$$AbsOrRelPathMaster$$Basename.eps
18087 \begin_layout LyX-Code
18091 \begin_layout LyX-Code
18095 \begin_layout LyX-Code
18096 UpdateResult "$$AbsPath$$Basename.eps"
18099 \begin_layout LyX-Code
18100 ReferencedFile docbook "$$AbsPath$$Basename.eps"
18103 \begin_layout LyX-Code
18104 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
18107 \begin_layout LyX-Code
18111 \begin_layout LyX-Code
18112 Product "[XFig: $$FName]"
18115 \begin_layout LyX-Code
18119 \begin_layout LyX-Code
18123 \begin_layout Standard
18124 As you can see, the template is enclosed in
18125 \begin_inset Flex CharStyle:Code
18128 \begin_layout Plain Layout
18134 \SpecialChar \ldots{}
18136 \begin_inset Flex CharStyle:Code
18139 \begin_layout Plain Layout
18146 It contains a header specifying some general settings and, for each supported
18147 primary document file format, a section
18148 \begin_inset Flex CharStyle:Code
18151 \begin_layout Plain Layout
18157 \SpecialChar \ldots{}
18159 \begin_inset Flex CharStyle:Code
18162 \begin_layout Plain Layout
18171 \begin_layout Subsection
18172 The template header
18175 \begin_layout Description
18176 \begin_inset Flex CharStyle:Code
18179 \begin_layout Plain Layout
18180 AutomaticProduction
18181 \begin_inset space ~
18189 Whether the file represented by the template must be generated by LyX.
18190 This command must occur exactly once.
18193 \begin_layout Description
18194 \begin_inset Flex CharStyle:Code
18197 \begin_layout Plain Layout
18199 \begin_inset space ~
18207 A glob pattern that is used in the file dialog to filter out the desired
18209 If there is more than one possible file extension (e.
18210 \begin_inset space \thinspace{}
18214 \begin_inset space \space{}
18218 \begin_inset Flex CharStyle:Code
18221 \begin_layout Plain Layout
18228 \begin_inset Flex CharStyle:Code
18231 \begin_layout Plain Layout
18237 ), use something like
18238 \begin_inset Flex CharStyle:Code
18241 \begin_layout Plain Layout
18248 This command must occur exactly once.
18251 \begin_layout Description
18252 \begin_inset Flex CharStyle:Code
18255 \begin_layout Plain Layout
18257 \begin_inset space ~
18265 The text that is displayed on the button.
18266 This command must occur exactly once.
18269 \begin_layout Description
18270 \begin_inset Flex CharStyle:Code
18273 \begin_layout Plain Layout
18275 \begin_inset space ~
18279 \begin_inset space ~
18287 The help text that is used in the External dialog.
18288 Provide enough information to explain to the user just what the template
18289 can provide him with.
18290 This command must occur exactly once.
18293 \begin_layout Description
18294 \begin_inset Flex CharStyle:Code
18297 \begin_layout Plain Layout
18299 \begin_inset space ~
18307 The file format of the original file.
18308 This must be the name of a format that is known to LyX (see section
18309 \begin_inset CommandInset ref
18311 reference "sec:Formats"
18317 \begin_inset Quotes eld
18321 \begin_inset Flex CharStyle:Code
18324 \begin_layout Plain Layout
18331 \begin_inset Quotes erd
18334 if the template can handle original files of more than one format.
18335 LyX will attempt to interrogate the file itself in order to deduce its
18336 format in this case.
18337 This command must occur exactly once.
18340 \begin_layout Description
18341 \begin_inset Flex CharStyle:Code
18344 \begin_layout Plain Layout
18346 \begin_inset space ~
18354 A unique name for the template.
18355 It must not contain substitution macros (see below).
18358 \begin_layout Description
18359 \begin_inset Flex CharStyle:Code
18362 \begin_layout Plain Layout
18364 \begin_inset space ~
18367 Rotate|Resize|Clip|Extra
18372 This command specifies which transformations are supported by this template.
18373 It may occur zero or more times.
18374 This command enables the corresponding tabs in the external dialog.
18376 \begin_inset Flex CharStyle:Code
18379 \begin_layout Plain Layout
18385 command must have either a corresponding
18386 \begin_inset Flex CharStyle:Code
18389 \begin_layout Plain Layout
18396 \begin_inset Flex CharStyle:Code
18399 \begin_layout Plain Layout
18406 \begin_inset Flex CharStyle:Code
18409 \begin_layout Plain Layout
18416 Otherwise the transformation will not be supported by that format.
18419 \begin_layout Subsection
18423 \begin_layout Description
18424 \begin_inset Flex CharStyle:Code
18427 \begin_layout Plain Layout
18429 \begin_inset space ~
18432 LaTeX|PDFLaTeX|PlainText|DocBook
18437 The primary document file format that this format definition is for.
18438 Not every template has a sensible representation in all document file formats.
18439 Please define nevertheless a
18440 \begin_inset Flex CharStyle:Code
18443 \begin_layout Plain Layout
18449 section for all formats.
18450 Use a dummy text when no representation is available.
18451 Then you can at least see a reference to the external material in the exported
18455 \begin_layout Description
18456 \begin_inset Flex CharStyle:Code
18459 \begin_layout Plain Layout
18461 \begin_inset space ~
18465 \begin_inset space ~
18473 This command defines an additional macro
18474 \begin_inset Flex CharStyle:Code
18477 \begin_layout Plain Layout
18483 for substitution in
18484 \begin_inset Flex CharStyle:Code
18487 \begin_layout Plain Layout
18495 \begin_inset Flex CharStyle:Code
18498 \begin_layout Plain Layout
18504 itself may contain substitution macros.
18505 The advantage over using
18506 \begin_inset Flex CharStyle:Code
18509 \begin_layout Plain Layout
18516 \begin_inset Flex CharStyle:Code
18519 \begin_layout Plain Layout
18525 is that the substituted value of
18526 \begin_inset Flex CharStyle:Code
18529 \begin_layout Plain Layout
18535 is sanitized so that it is a valid optional argument in the document format.
18536 This command may occur zero or more times.
18539 \begin_layout Description
18540 \begin_inset Flex CharStyle:Code
18543 \begin_layout Plain Layout
18545 \begin_inset space ~
18553 The text that is inserted in the exported document.
18554 This is actually the most important command and can be quite complex.
18555 This command must occur exactly once.
18558 \begin_layout Description
18559 \begin_inset Flex CharStyle:Code
18562 \begin_layout Plain Layout
18564 \begin_inset space ~
18572 This command specifies a preamble snippet that will be included in the
18574 It has to be defined using
18575 \begin_inset Flex CharStyle:Code
18578 \begin_layout Plain Layout
18584 \SpecialChar \ldots{}
18586 \begin_inset Flex CharStyle:Code
18589 \begin_layout Plain Layout
18596 This command may occur zero or more times.
18599 \begin_layout Description
18600 \begin_inset Flex CharStyle:Code
18603 \begin_layout Plain Layout
18605 \begin_inset space ~
18609 \begin_inset space ~
18617 This command denotes files that are created by the conversion process and
18618 are needed for a particular export format.
18619 If the filename is relative, it is interpreted relative to the master document.
18620 This command may be given zero or more times.
18623 \begin_layout Description
18624 \begin_inset Flex CharStyle:Code
18627 \begin_layout Plain Layout
18629 \begin_inset space ~
18637 The name of a required LaTeX package.
18638 The package is included via
18639 \begin_inset Flex CharStyle:Code
18642 \begin_layout Plain Layout
18650 in the LaTeX preamble.
18651 This command may occur zero or more times.
18654 \begin_layout Description
18655 \begin_inset Flex CharStyle:Code
18658 \begin_layout Plain Layout
18660 \begin_inset space ~
18664 \begin_inset space ~
18667 RotationLatexCommand
18672 This command specifies that the built in LaTeX command should be used for
18674 This command may occur once or not at all.
18677 \begin_layout Description
18678 \begin_inset Flex CharStyle:Code
18681 \begin_layout Plain Layout
18683 \begin_inset space ~
18687 \begin_inset space ~
18695 This command specifies that the built in LaTeX command should be used for
18697 This command may occur once or not at all.
18700 \begin_layout Description
18701 \begin_inset Flex CharStyle:Code
18704 \begin_layout Plain Layout
18706 \begin_inset space ~
18710 \begin_inset space ~
18713 RotationLatexOption
18718 This command specifies that rotation is done via an optional argument.
18719 This command may occur once or not at all.
18722 \begin_layout Description
18723 \begin_inset Flex CharStyle:Code
18726 \begin_layout Plain Layout
18728 \begin_inset space ~
18732 \begin_inset space ~
18740 This command specifies that resizing is done via an optional argument.
18741 This command may occur once or not at all.
18744 \begin_layout Description
18745 \begin_inset Flex CharStyle:Code
18748 \begin_layout Plain Layout
18750 \begin_inset space ~
18754 \begin_inset space ~
18762 This command specifies that clipping is done via an optional argument.
18763 This command may occur once or not at all.
18766 \begin_layout Description
18767 \begin_inset Flex CharStyle:Code
18770 \begin_layout Plain Layout
18772 \begin_inset space ~
18776 \begin_inset space ~
18784 This command specifies that an extra optional argument is used.
18785 This command may occur once or not at all.
18788 \begin_layout Description
18789 \begin_inset Flex CharStyle:Code
18792 \begin_layout Plain Layout
18794 \begin_inset space ~
18802 The file format of the converted file.
18803 This must be the name of a format that is known to LyX (see the
18804 \begin_inset Flex CharStyle:MenuItem
18807 \begin_layout Plain Layout
18812 ools\SpecialChar \menuseparator
18817 references:Conversion
18823 This command must occur exactly once.
18826 \begin_layout Description
18827 \begin_inset Flex CharStyle:Code
18830 \begin_layout Plain Layout
18832 \begin_inset space ~
18840 The file name of the converted file.
18841 The file name must be absolute.
18842 This command must occur exactly once.
18845 \begin_layout Subsection
18846 Preamble definitions
18849 \begin_layout Standard
18850 The external template configuration file may contain additional preamble
18851 definitions enclosed by
18852 \begin_inset Flex CharStyle:Code
18855 \begin_layout Plain Layout
18861 \SpecialChar \ldots{}
18863 \begin_inset Flex CharStyle:Code
18866 \begin_layout Plain Layout
18873 They can be used by the templates in the
18874 \begin_inset Flex CharStyle:Code
18877 \begin_layout Plain Layout
18886 \begin_layout Section
18887 The substitution mechanism
18890 \begin_layout Standard
18891 When the external material facility invokes an external program, it is done
18892 on the basis of a command defined in the template configuration file.
18893 These commands can contain various macros that are expanded before execution.
18894 Execution always take place in the directory of the containing document.
18897 \begin_layout Standard
18898 Also, whenever external material is to be displayed, the name will be produced
18899 by the substitution mechanism, and most other commands in the template
18900 definition support substitution as well.
18903 \begin_layout Standard
18904 The available macros are the following:
18907 \begin_layout Description
18908 \begin_inset Flex CharStyle:Code
18911 \begin_layout Plain Layout
18912 $$AbsOrRelPathMaster
18917 The file path, absolute or relative to the master LyX document.
18920 \begin_layout Description
18921 \begin_inset Flex CharStyle:Code
18924 \begin_layout Plain Layout
18925 $$AbsOrRelPathParent
18930 The file path, absolute or relative to the LyX document.
18933 \begin_layout Description
18934 \begin_inset Flex CharStyle:Code
18937 \begin_layout Plain Layout
18943 The absolute file path.
18946 \begin_layout Description
18947 \begin_inset Flex CharStyle:Code
18950 \begin_layout Plain Layout
18956 The filename without path and without the extension.
18959 \begin_layout Description
18960 \begin_inset Flex CharStyle:Code
18963 \begin_layout Plain Layout
18965 \begin_inset Quotes eld
18969 \begin_inset Quotes erd
18977 This macro will expand to the contents of the file with the name
18978 \begin_inset Flex CharStyle:Code
18981 \begin_layout Plain Layout
18990 \begin_layout Description
18991 \begin_inset Flex CharStyle:Code
18994 \begin_layout Plain Layout
19000 The file extension (including the dot).
19003 \begin_layout Description
19004 \begin_inset Flex CharStyle:Code
19007 \begin_layout Plain Layout
19013 The filename of the file specified in the external material dialog.
19014 This is either an absolute name, or it is relative to the LyX document.
19017 \begin_layout Description
19018 \begin_inset Flex CharStyle:Code
19021 \begin_layout Plain Layout
19028 \begin_inset Flex CharStyle:Code
19031 \begin_layout Plain Layout
19037 (absolute name or relative to the LyX document).
19040 \begin_layout Description
19041 \begin_inset Flex CharStyle:Code
19044 \begin_layout Plain Layout
19050 The file path, relative to the master LyX document.
19053 \begin_layout Description
19054 \begin_inset Flex CharStyle:Code
19057 \begin_layout Plain Layout
19063 The file path, relative to the LyX document.
19066 \begin_layout Description
19067 \begin_inset Flex CharStyle:Code
19070 \begin_layout Plain Layout
19076 This macro will expand to the absolute path of the system directory.
19077 This is typically used to point to the various helper scripts that are
19081 \begin_layout Description
19082 \begin_inset Flex CharStyle:Code
19085 \begin_layout Plain Layout
19091 A name and full path to a temporary file which will be automatically deleted
19092 whenever the containing document is closed, or the external material insertion
19096 \begin_layout Standard
19097 All path macros contain a trailing directory separator, so you can construct
19099 \begin_inset space \thinspace{}
19103 \begin_inset space \space{}
19106 the absolute filename with
19107 \begin_inset Flex CharStyle:Code
19110 \begin_layout Plain Layout
19111 $$AbsPath$$Basename$$Extension
19119 \begin_layout Standard
19120 The macros above are substituted in all commands unless otherwise noted.
19122 \begin_inset Flex CharStyle:Code
19125 \begin_layout Plain Layout
19131 supports additionally the following substitutions if they are enabled by
19133 \begin_inset Flex CharStyle:Code
19136 \begin_layout Plain Layout
19143 \begin_inset Flex CharStyle:Code
19146 \begin_layout Plain Layout
19155 \begin_layout Description
19156 \begin_inset Flex CharStyle:Code
19159 \begin_layout Plain Layout
19165 The front part of the resize command.
19168 \begin_layout Description
19169 \begin_inset Flex CharStyle:Code
19172 \begin_layout Plain Layout
19178 The back part of the resize command.
19181 \begin_layout Description
19182 \begin_inset Flex CharStyle:Code
19185 \begin_layout Plain Layout
19191 The front part of the rotation command.
19194 \begin_layout Description
19195 \begin_inset Flex CharStyle:Code
19198 \begin_layout Plain Layout
19204 The back part of the rotation command.
19207 \begin_layout Standard
19208 The value string of the
19209 \begin_inset Flex CharStyle:Code
19212 \begin_layout Plain Layout
19218 command supports additionally the following substitutions if they are enabled
19220 \begin_inset Flex CharStyle:Code
19223 \begin_layout Plain Layout
19230 \begin_inset Flex CharStyle:Code
19233 \begin_layout Plain Layout
19242 \begin_layout Description
19243 \begin_inset Flex CharStyle:Code
19246 \begin_layout Plain Layout
19255 \begin_layout Description
19256 \begin_inset Flex CharStyle:Code
19259 \begin_layout Plain Layout
19268 \begin_layout Description
19269 \begin_inset Flex CharStyle:Code
19272 \begin_layout Plain Layout
19281 \begin_layout Description
19282 \begin_inset Flex CharStyle:Code
19285 \begin_layout Plain Layout
19291 The rotation option.
19294 \begin_layout Standard
19295 You may ask why there are so many path macros.
19296 There are mainly two reasons:
19299 \begin_layout Enumerate
19300 Relative and absolute file names should remain relative or absolute, respectivel
19302 Users may have reasons to prefer either form.
19303 Relative names are useful for portable documents that should work on different
19304 machines, for example.
19305 Absolute names may be required by some programs.
19308 \begin_layout Enumerate
19309 LaTeX treats relative file names differently than LyX and other programs
19310 in nested included files.
19311 For LyX, a relative file name is always relative to the document that contains
19313 For LaTeX, it is always relative to the master document.
19314 These two definitions are identical if you have only one document, but
19315 differ if you have a master document that includes part documents.
19316 That means that relative filenames must be transformed when presented to
19318 Fortunately LyX does this automatically for you if you choose the right
19322 \begin_layout Standard
19323 So which path macro should be used in new template definitions? The rule
19327 \begin_layout Itemize
19329 \begin_inset Flex CharStyle:Code
19332 \begin_layout Plain Layout
19338 if an absolute path is required.
19341 \begin_layout Itemize
19343 \begin_inset Flex CharStyle:Code
19346 \begin_layout Plain Layout
19347 $$AbsOrRelPathMaster
19352 if the substituted string is some kind of LaTeX input.
19355 \begin_layout Itemize
19357 \begin_inset Flex CharStyle:Code
19360 \begin_layout Plain Layout
19361 $$AbsOrRelPathParent
19366 in order to preserve the user's choice.
19369 \begin_layout Standard
19370 There are special cases where this rule does not work and e.
19371 \begin_inset space \thinspace{}
19375 \begin_inset space \space{}
19378 relative names are needed, but normally it will work just fine.
19379 One example for such a case is the command
19380 \begin_inset Flex CharStyle:Code
19383 \begin_layout Plain Layout
19384 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
19389 in the XFig template above: We can't use the absolute name because the
19391 \begin_inset Flex CharStyle:Code
19394 \begin_layout Plain Layout
19400 files needs the relative name in order to rewrite the file content.
19403 \begin_layout Section
19404 Security discussion
19405 \begin_inset CommandInset label
19407 name "sec:Security-discussion"
19414 \begin_layout Standard
19415 The external material feature interfaces with a lot of external programs
19416 and does so automatically, so we have to consider the security implications
19418 In particular, since you have the option of including your own filenames
19419 and/or parameter strings and those are expanded into a command, it seems
19420 that it would be possible to create a malicious document which executes
19421 arbitrary commands when a user views or prints the document.
19422 This is something we definitely want to avoid.
19425 \begin_layout Standard
19426 However, since the external program commands are specified in the template
19427 configuration file only, there are no security issues if LyX is properly
19428 configured with safe templates only.
19429 This is so because the external programs are invoked with the
19430 \begin_inset Flex CharStyle:Code
19433 \begin_layout Plain Layout
19439 -system call rather than the
19440 \begin_inset Flex CharStyle:Code
19443 \begin_layout Plain Layout
19449 system-call, so it's not possible to execute arbitrary commands from the
19450 filename or parameter section via the shell.
19453 \begin_layout Standard
19454 This also implies that you are restricted in what command strings you can
19455 use in the external material templates.
19456 In particular, pipes and redirection are not readily available.
19457 This has to be so if LyX should remain safe.
19458 If you want to use some of the shell features, you should write a safe
19459 script to do this in a controlled manner, and then invoke the script from
19460 the command string.
19464 \begin_layout Standard
19465 It is possible to design a template that interacts directly with the shell,
19466 but since this would allow a malicious user to execute arbitrary commands
19467 by writing clever filenames and/or parameters, we generally recommend that
19468 you only use safe scripts that work with the
19469 \begin_inset Flex CharStyle:Code
19472 \begin_layout Plain Layout
19478 system call in a controlled manner.
19479 Of course, for use in a controlled environment, it can be tempting to just
19480 fall back to use ordinary shell scripts.
19481 If you do so, be aware that you
19485 provide an easily exploitable security hole in your system.
19486 Of course it stands to reason that such unsafe templates will never be
19487 included in the standard LyX distribution, although we do encourage people
19488 to submit new templates in the open source tradition.
19489 But LyX as shipped from the official distribution channels will never have
19493 \begin_layout Standard
19494 Including external material provides a lot of power, and you have to be
19495 careful not to introduce security hazards with this power.
19496 A subtle error in a single line in an innocent looking script can open
19497 the door to huge security problems.
19498 So if you do not fully understand the issues, we recommend that you consult
19499 a knowledgeable security professional or the LyX development team if you
19500 have any questions about whether a given template is safe or not.
19501 And do this before you use it in an uncontrolled environment.