1 #LyX 2.0.0svn created this file. For more info see http://www.lyx.org/
7 % DO NOT ALTER THIS PREAMBLE!!!
9 % This preamble is designed to ensure that the User's Guide prints
10 % out as advertised. If you mess with this preamble,
11 % parts of the User's Guide may not print out as expected. If you
12 % have problems LaTeXing this file, please contact
13 % the documentation team
14 % email: lyx-docs@lists.lyx.org
16 \usepackage{ifpdf} % part of the hyperref bundle
17 \ifpdf % if pdflatex is used
19 % set fonts for nicer pdf view
20 \IfFileExists{lmodern.sty}
21 {\usepackage{lmodern}}{}
23 \fi % end if pdflatex is used
25 % the pages of the TOC is numbered roman
26 % and a pdf-bookmark for the TOC is added
27 \let\myTOC\tableofcontents
28 \renewcommand\tableofcontents{%
30 \pdfbookmark[1]{\contentsname}{}
34 % redefine the \LyX macro for PDF bookmarks
35 \def\LyX{\texorpdfstring{%
36 L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
39 % used for multi-column text
43 \options fleqn,liststotoc,bibtotoc,idxtotoc,BCOR7.5mm,titlepage,tablecaptionabove
44 \use_default_options false
50 InsetLayout CharStyle:MenuItem
59 \newcommand*{\menuitem}[1]{{\sffamily #1}}
67 \font_typewriter default
68 \font_default_family default
76 \default_output_format default
80 \pdf_title "LyX Configuration Manual"
81 \pdf_author "LyX Team"
82 \pdf_subject "LyX-documentation Customization"
83 \pdf_keywords "LyX, documentation, customization"
85 \pdf_bookmarksnumbered true
86 \pdf_bookmarksopen true
87 \pdf_bookmarksopenlevel 1
92 \pdf_pdfusetitle false
93 \pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true,pdfstartview=XYZ, plainpages=false, pdfpagelabels"
101 \paperorientation portrait
102 \backgroundcolor #ffffff
109 \paragraph_separation indent
111 \quotes_language english
114 \paperpagestyle headings
115 \tracking_changes false
116 \output_changes false
124 Customizing LyX: Features for the Advanced User
132 \begin_layout Plain Layout
134 If you have comments or error corrections, please send them to the LyX Documenta
136 \begin_inset CommandInset href
138 target "lyx-docs@lists.lyx.org"
145 \begin_inset Quotes eld
149 \begin_inset Quotes erd
152 in the subject header, and please cc the current maintainer of this file,
153 Richard Heck <rgheck@comcast.net>.
159 \begin_inset Newline newline
163 \begin_inset Newline newline
169 \begin_layout Standard
170 \begin_inset CommandInset toc
171 LatexCommand tableofcontents
178 \begin_layout Standard
179 \begin_inset Note Note
182 \begin_layout Plain Layout
183 Please use change tracking when modifying this document.
184 This makes it easier for our translators to recognize things that have
185 been changed, and it helps the maintainer keep up-to-date with what's been
194 \begin_layout Chapter
198 \begin_layout Standard
199 This manual covers the customization features present in LyX.
200 In it, we discuss issues like keyboard shortcuts, screen previewing options,
201 printer options, sending commands to LyX via the LyX Server, internationalizati
202 on, installing new LaTeX classes and LyX layouts, etc.
203 We can't possibly hope to touch on everything you can change—our developers
204 add new features faster than we can document them—but we will explain the
205 most common customizations and hopefully point you in the right direction
206 for some of the more obscure ones.
209 \begin_layout Standard
210 \begin_inset Branch OutDated
213 \begin_layout Standard
214 Information from previous versions of this document that now seems to be
215 outdated is contained in the OutDated branch of this document.
216 By default, this information will not appear in the LaTeX output.
224 \begin_layout Chapter
225 LyX configuration files
228 \begin_layout Standard
229 This chapter aims to help you to find your way through the LyX configuration
231 Before continuing to read this chapter, you should find out where your
232 LyX library and user directories are by using
233 \begin_inset Flex CharStyle:MenuItem
236 \begin_layout Plain Layout
237 Help\SpecialChar \menuseparator
248 The library directory is the place where LyX places its system-wide configurati
249 on files; the user directory is where you can place your modified versions.
250 We will call the former
251 \begin_inset Flex CharStyle:Code
254 \begin_layout Plain Layout
261 \begin_inset Flex CharStyle:MenuItem
264 \begin_layout Plain Layout
270 in the remainder of this document.
274 \begin_layout Section
276 \begin_inset Flex CharStyle:Code
279 \begin_layout Plain Layout
288 \begin_layout Standard
289 \begin_inset Flex CharStyle:Code
292 \begin_layout Plain Layout
298 and its sub-directories contain a number of files and that can be used
299 to customize LyX's behavior.
300 You can change many of these files from within LyX itself through the
301 \begin_inset Flex CharStyle:MenuItem
304 \begin_layout Plain Layout
305 Tools\SpecialChar \menuseparator
312 Most customization that you will want to do in LyX is possible through
314 However, many other inner aspects of LyX can be customized by modifying
316 \begin_inset Flex CharStyle:Code
319 \begin_layout Plain Layout
326 These files fall in different categories, described in the following subsection
330 \begin_layout Subsection
331 Automatically generated files
334 \begin_layout Standard
335 The files, which are to be found in
336 \begin_inset Flex CharStyle:MenuItem
339 \begin_layout Plain Layout
345 , are generated when you configure LyX.
346 They contain various default values that are guessed by inspection.
347 In general, it is not a good idea to modify them, since they might be overwritt
351 \begin_layout Labeling
352 \labelwidthstring 00.00.0000
353 \begin_inset Flex CharStyle:Code
356 \begin_layout Plain Layout
362 contains defaults for various commands.
365 \begin_layout Labeling
366 \labelwidthstring 00.00.0000
367 \begin_inset Flex CharStyle:Code
370 \begin_layout Plain Layout
376 contains the list of packages that have been recognized by LyX.
377 It is currently unused by the LyX program itself, but the information extracted
378 , and more, is made available with
379 \begin_inset Flex CharStyle:MenuItem
382 \begin_layout Plain Layout
383 Help\SpecialChar \menuseparator
396 \begin_layout Labeling
397 \labelwidthstring 00.00.0000
398 \begin_inset Flex CharStyle:Code
401 \begin_layout Plain Layout
407 the list of text classes that have been found in your
408 \begin_inset Flex CharStyle:Code
411 \begin_layout Plain Layout
417 directories, along with the associated LaTeX document class and their descripti
421 \begin_layout Labeling
422 \labelwidthstring 00.00.0000
423 \begin_inset Flex CharStyle:Code
426 \begin_layout Plain Layout
432 the list of layout modules found in your
433 \begin_inset Flex CharStyle:Code
436 \begin_layout Plain Layout
445 \begin_layout Labeling
446 \labelwidthstring 00.00.0000
447 \begin_inset Flex CharStyle:Code
450 \begin_layout Plain Layout
456 lists of various sorts of LaTeX-related files found on your system
459 \begin_layout Labeling
460 \labelwidthstring 00.00.0000
461 \begin_inset Flex CharStyle:Code
464 \begin_layout Plain Layout
470 is automatically generated during configuration from the file
471 \begin_inset Flex CharStyle:Code
474 \begin_layout Plain Layout
481 It contains information on your LaTeX configuration.
484 \begin_layout Subsection
488 \begin_layout Standard
489 These directories are duplicated between
490 \begin_inset Flex CharStyle:Code
493 \begin_layout Plain Layout
500 \begin_inset Flex CharStyle:Code
503 \begin_layout Plain Layout
510 If a particular files exists in both places, the one in
511 \begin_inset Flex CharStyle:Code
514 \begin_layout Plain Layout
523 \begin_layout Labeling
524 \labelwidthstring 00.00.0000
525 \begin_inset Flex CharStyle:Code
528 \begin_layout Plain Layout
534 this directory contains files with the extension
535 \begin_inset Flex CharStyle:Code
538 \begin_layout Plain Layout
544 that define the keybindings used in LyX.
545 If there exists an internationalized version of the bind file named
546 \begin_inset Flex CharStyle:Code
549 \begin_layout Plain Layout
555 , that will be used first.
558 \begin_layout Labeling
559 \labelwidthstring 00.00.0000
560 \begin_inset Flex CharStyle:Code
563 \begin_layout Plain Layout
569 contains graphics files that can be included in documents.
573 \begin_layout Labeling
574 \labelwidthstring 00.00.0000
575 \begin_inset Flex CharStyle:Code
578 \begin_layout Plain Layout
584 contains LyX documentation files (including the one you are currently reading).
586 \begin_inset Flex CharStyle:Code
589 \begin_layout Plain Layout
595 deserves special attention, as noted above.
596 The internationalized help docs are in subdirectories
597 \begin_inset Flex CharStyle:Code
600 \begin_layout Plain Layout
607 \begin_inset Quotes eld
611 \begin_inset Quotes erd
614 is the ISO language code.
620 \begin_inset CommandInset ref
622 reference "cha:Internationalizing-LyX"
629 \begin_layout Labeling
630 \labelwidthstring 00.00.0000
631 \begin_inset Flex CharStyle:Code
634 \begin_layout Plain Layout
640 contains example files that explain how to use some features.
641 In the file browser, press the
642 \begin_inset Flex CharStyle:MenuItem
645 \begin_layout Plain Layout
654 \begin_layout Labeling
655 \labelwidthstring 00.00.0000
656 \begin_inset Flex CharStyle:Code
659 \begin_layout Plain Layout
665 contains image files that are used by the
666 \begin_inset Flex CharStyle:MenuItem
669 \begin_layout Plain Layout
676 In addition, it also contains the individual icons used in the toolbar
677 and the banners that can be shown when LyX is launched.
680 \begin_layout Labeling
681 \labelwidthstring 00.00.0000
682 \begin_inset Flex CharStyle:Code
685 \begin_layout Plain Layout
691 contains keyboard keymapping files.
697 \begin_inset CommandInset ref
699 reference "sec:International-Keymap-Stuff"
706 \begin_layout Labeling
707 \labelwidthstring 00.00.0000
708 \begin_inset Flex CharStyle:Code
711 \begin_layout Plain Layout
717 contains the text class and module files described in Chapter
722 \begin_inset CommandInset ref
724 reference "cha:Installing-New-Document"
731 \begin_layout Labeling
732 \labelwidthstring 00.00.0000
733 \begin_inset Flex CharStyle:Code
736 \begin_layout Plain Layout
743 \begin_inset Flex CharStyle:Code
746 \begin_layout Plain Layout
752 Python scripts used to convert between LyX versions.
753 These can be run from the command line if, say, you want to batch-convert
757 \begin_layout Labeling
758 \labelwidthstring 00.00.0000
759 \begin_inset Flex CharStyle:Code
762 \begin_layout Plain Layout
768 contains some files that demonstrate the capabilities of the
769 \begin_inset Flex CharStyle:MenuItem
772 \begin_layout Plain Layout
783 Also contains some scripts used by LyX itself.
786 \begin_layout Labeling
787 \labelwidthstring 00.00.0000
788 \begin_inset Flex CharStyle:Code
791 \begin_layout Plain Layout
797 contains the standard LyX template files described in Chapter
802 \begin_inset CommandInset ref
804 reference "sec:Creating-Templates"
811 \begin_layout Labeling
812 \labelwidthstring 00.00.0000
813 \begin_inset Flex CharStyle:Code
816 \begin_layout Plain Layout
822 contains files with the extension
823 \begin_inset Flex CharStyle:Code
826 \begin_layout Plain Layout
832 that define the user interface to LyX.
833 That is, the files define which items appear in which menus and the items
834 appearing on the toolbar.
837 \begin_layout Subsection
838 Files you don't want to modify
841 \begin_layout Standard
842 These files are used internally by LyX and you generally do not need to
843 modify them unless you are a developer.
846 \begin_layout Labeling
847 \labelwidthstring 00.00.0000
848 \begin_inset Flex CharStyle:Code
851 \begin_layout Plain Layout
857 this file contains the list of LyX developers.
858 The contents are displayed with the menu entry
859 \begin_inset Flex CharStyle:MenuItem
862 \begin_layout Plain Layout
863 Help\SpecialChar \menuseparator
876 \begin_layout Labeling
877 \labelwidthstring 00.00.0000
878 \begin_inset Flex CharStyle:Code
881 \begin_layout Plain Layout
887 this is a LaTeX script used during the configuration process.
891 \begin_layout Labeling
892 \labelwidthstring 00.00.0000
893 \begin_inset Flex CharStyle:Code
896 \begin_layout Plain Layout
902 this is the script that is used to re-configure LyX.
903 It creates configuration files in the directory it was run from.
906 \begin_layout Subsection
907 Other files needing a line or two...
910 \begin_layout Labeling
911 \labelwidthstring 00.00.0000
912 \begin_inset Flex CharStyle:Code
915 \begin_layout Plain Layout
921 this contains tables describing how different character encodings can be
925 \begin_layout Labeling
926 \labelwidthstring 00.00.0000
927 \begin_inset Flex CharStyle:Code
930 \begin_layout Plain Layout
936 this file contains the templates available to the new
937 \begin_inset Flex CharStyle:MenuItem
940 \begin_layout Plain Layout
953 \begin_layout Labeling
954 \labelwidthstring 00.00.0000
955 \begin_inset Flex CharStyle:Code
958 \begin_layout Plain Layout
964 this file contains a list of all the languages currently supported by LyX.
967 \begin_layout Section
968 Your local configuration directory
971 \begin_layout Standard
972 Even if you are using LyX as an unprivileged user, you might want to change
973 LyX configuration for your own use.
975 \begin_inset Flex CharStyle:Code
978 \begin_layout Plain Layout
984 directory contains all your personal configuration files.
985 This is the directory described as
986 \begin_inset Quotes eld
990 \begin_inset Quotes erd
994 \begin_inset Flex CharStyle:MenuItem
997 \begin_layout Plain Layout
998 Help\SpecialChar \menuseparator
1000 \begin_inset space ~
1009 This directory is used as a mirror of
1010 \begin_inset Flex CharStyle:Code
1013 \begin_layout Plain Layout
1019 , which means that every file in
1020 \begin_inset Flex CharStyle:Code
1023 \begin_layout Plain Layout
1029 is a replacement for the corresponding file in
1030 \begin_inset Flex CharStyle:Code
1033 \begin_layout Plain Layout
1040 Any configuration file described in the above sections can be placed either
1041 in the system-wide directory, in which case it will affect all users, or
1042 in your local directory for your own use.
1045 \begin_layout Standard
1046 To make things clearer, let's provide a few examples:
1049 \begin_layout Itemize
1050 The preferences set in the
1051 \begin_inset Flex CharStyle:MenuItem
1054 \begin_layout Plain Layout
1055 Tools\SpecialChar \menuseparator
1061 dialog are saved to a file
1062 \begin_inset Flex CharStyle:Code
1065 \begin_layout Plain Layout
1072 \begin_inset Flex CharStyle:Code
1075 \begin_layout Plain Layout
1084 \begin_layout Itemize
1085 When you reconfigure using
1086 \begin_inset Flex CharStyle:MenuItem
1089 \begin_layout Plain Layout
1090 Tools\SpecialChar \menuseparator
1097 \begin_inset Flex CharStyle:Code
1100 \begin_layout Plain Layout
1106 script, and the resulting files are written in your local configuration
1108 This means that any additional text class file that you might have added
1110 \begin_inset Flex CharStyle:Code
1113 \begin_layout Plain Layout
1119 will be added to the list of classes in the
1120 \begin_inset Flex CharStyle:MenuItem
1123 \begin_layout Plain Layout
1124 Document\SpecialChar \menuseparator
1133 \begin_layout Itemize
1134 If you get some updated documentation from LyX ftp site and cannot install
1135 it because you do not have sysadmin rights on your system, you can just
1137 \begin_inset Flex CharStyle:Code
1140 \begin_layout Plain Layout
1146 and the items in the
1147 \begin_inset Flex CharStyle:MenuItem
1150 \begin_layout Plain Layout
1156 menu will open them!
1159 \begin_layout Section
1160 Running LyX with multiple configurations
1163 \begin_layout Standard
1164 The configuration freedom of the local configuration directory may not suffice
1165 if you want to have more than one configuration at your disposal.
1166 For example, you may want to be use different key bindings or printer settings
1168 You can achieve this by having several such directories.
1169 You then specify which directory to use at run-time.
1172 \begin_layout Standard
1173 Invoking LyX with the command line switch
1174 \begin_inset Flex CharStyle:Code
1177 \begin_layout Plain Layout
1187 instructs the program to read the configuration from that directory, and
1188 not from the default directory.
1189 (You can determine the default directory by running LyX without the
1190 \begin_inset Flex CharStyle:Code
1193 \begin_layout Plain Layout
1199 switch.) If the specified directory does not exist, LyX offers to create
1200 it for you, just like it does for the default directory on the first time
1201 you run the program.
1202 You can modify the configuration options in this additional user directory
1203 exactly as you would for the default directory.
1204 These directories are completely independent (but read on).
1205 Note that setting the environment variable
1206 \begin_inset Flex CharStyle:Code
1209 \begin_layout Plain Layout
1215 to some value has exactly the same effect.
1218 \begin_layout Standard
1219 Having several configurations also requires more maintenance: if you want
1220 to add a new layout to
1221 \begin_inset Flex CharStyle:Code
1224 \begin_layout Plain Layout
1230 which you want available from all your configurations, you must add it
1231 to each directory separately.
1232 You can avoid this with the following trick: after LyX creates the additional
1233 directory, most of the subdirectories (see above) are empty.
1234 If you want the new configuration to mirror an existing one, replace the
1235 empty subdirectory with a symbolic link to the matching subdirectory in
1236 the existing configuration.
1238 \begin_inset Flex CharStyle:Code
1241 \begin_layout Plain Layout
1247 subdirectory, however, since it contains a file written by the configuration
1248 script (also accessible through
1249 \begin_inset Flex CharStyle:MenuItem
1252 \begin_layout Plain Layout
1253 Tools\SpecialChar \menuseparator
1259 ) which is configuration-specific.
1262 \begin_layout Chapter
1263 The Preferences dialog
1266 \begin_layout Standard
1267 All options of the preferences dialog are described in the Appendix
1269 The Preferences Dialog
1276 For some options you might find here more details.
1279 \begin_layout Section
1281 \begin_inset CommandInset label
1290 \begin_layout Standard
1291 The first step is to define your file formats if they are not already defined.
1293 \begin_inset Flex CharStyle:MenuItem
1296 \begin_layout Plain Layout
1297 Tools\SpecialChar \menuseparator
1305 \begin_inset Flex CharStyle:MenuItem
1308 \begin_layout Plain Layout
1309 File Handling\SpecialChar \menuseparator
1316 \begin_inset Flex CharStyle:MenuItem
1319 \begin_layout Plain Layout
1320 New\SpecialChar \ldots{}
1326 button to define your new format.
1328 \begin_inset Flex CharStyle:MenuItem
1331 \begin_layout Plain Layout
1337 field contains the name used to identify the format in the GUI.
1339 \begin_inset Flex CharStyle:MenuItem
1342 \begin_layout Plain Layout
1348 is used to identify the format internally.
1349 You will also need to enter a file extension.
1350 These are all required.
1352 \begin_inset Flex CharStyle:MenuItem
1355 \begin_layout Plain Layout
1361 field is used to provide a keyboard shortcut on the menus.
1362 (For example, pressing
1363 \begin_inset Flex CharStyle:MenuItem
1366 \begin_layout Plain Layout
1373 \begin_inset Flex CharStyle:MenuItem
1376 \begin_layout Plain Layout
1377 View\SpecialChar \menuseparator
1386 \begin_layout Standard
1388 \begin_inset Flex CharStyle:MenuItem
1391 \begin_layout Plain Layout
1398 \begin_inset Flex CharStyle:MenuItem
1401 \begin_layout Plain Layout
1408 For example, you might want to use
1409 \begin_inset Flex CharStyle:MenuItem
1412 \begin_layout Plain Layout
1418 to view PostScript files.
1419 You can enter the command needed to start the program in the corresponding
1421 In defining this command, you can use the four variables listed in the
1423 The viewer is launched when you view an image in LyX or use the
1424 \begin_inset Flex CharStyle:MenuItem
1427 \begin_layout Plain Layout
1434 The editor is for example launched when you press the
1435 \begin_inset Flex CharStyle:MenuItem
1438 \begin_layout Plain Layout
1445 \begin_inset Flex CharStyle:MenuItem
1448 \begin_layout Plain Layout
1455 \begin_inset Flex CharStyle:MenuItem
1458 \begin_layout Plain Layout
1467 \begin_layout Standard
1469 \begin_inset Flex CharStyle:MenuItem
1472 \begin_layout Plain Layout
1478 option tells LyX that a format is suitable for document export.
1479 If this is set and if a suitable conversion route exists (see sec.
1480 \begin_inset space \thinspace{}
1484 \begin_inset CommandInset ref
1486 reference "sec:Converters"
1490 ), the format will appear in the
1491 \begin_inset Flex CharStyle:MenuItem
1494 \begin_layout Plain Layout
1495 File\SpecialChar \menuseparator
1502 The format will also appear in the
1503 \begin_inset Flex CharStyle:MenuItem
1506 \begin_layout Plain Layout
1512 menu if a viewer is specified for the format.
1513 Pure image formats, such as
1514 \begin_inset Flex CharStyle:Code
1517 \begin_layout Plain Layout
1523 , should not use this option.
1524 Formats that can both represent vector graphics and documents like
1525 \begin_inset Flex CharStyle:Code
1528 \begin_layout Plain Layout
1537 \begin_layout Standard
1539 \begin_inset Flex CharStyle:MenuItem
1542 \begin_layout Plain Layout
1543 Vector graphics format
1548 tells LyX that a format can contain vector graphics.
1549 This information is used to determine the target format of included graphics
1551 \begin_inset Flex CharStyle:MenuItem
1554 \begin_layout Plain Layout
1561 Included graphics may need to be converted to either
1562 \begin_inset Flex CharStyle:MenuItem
1565 \begin_layout Plain Layout
1572 \begin_inset Flex CharStyle:MenuItem
1575 \begin_layout Plain Layout
1582 \begin_inset Flex CharStyle:MenuItem
1585 \begin_layout Plain Layout
1592 \begin_inset Flex CharStyle:MenuItem
1595 \begin_layout Plain Layout
1601 cannot handle other image formats.
1602 If an included graphic is not already in
1603 \begin_inset Flex CharStyle:MenuItem
1606 \begin_layout Plain Layout
1613 \begin_inset Flex CharStyle:MenuItem
1616 \begin_layout Plain Layout
1623 \begin_inset Flex CharStyle:MenuItem
1626 \begin_layout Plain Layout
1632 format, it is converted to
1633 \begin_inset Flex CharStyle:MenuItem
1636 \begin_layout Plain Layout
1642 if the vector format option is set, and otherwise to
1643 \begin_inset Flex CharStyle:MenuItem
1646 \begin_layout Plain Layout
1655 \begin_layout Section
1659 \begin_layout Standard
1660 Since all conversions from one format to another take place in LyX's temporary
1661 directory, it is sometimes necessary to modify a file before copying it
1662 to the temporary directory in order that the conversion may be performed.
1666 \begin_layout Plain Layout
1667 For example, the file may refer to other files—images, for example—using
1668 relative file names, and these may become invalid when the file is copied
1669 to the temporary directory.
1674 This is done by a Copier: It copies a file to (or from) the temporary directory
1675 and may modify it in the process.
1678 \begin_layout Standard
1679 The definitions of the copiers may use four variables:
1682 \begin_layout Labeling
1683 \labelwidthstring 00.00.0000
1684 \begin_inset Flex CharStyle:Code
1687 \begin_layout Plain Layout
1693 The LyX system directory (e.
1694 \begin_inset space \thinspace{}
1698 \begin_inset space \space{}
1702 \begin_inset Flex CharStyle:MenuItem
1705 \begin_layout Plain Layout
1714 \begin_layout Labeling
1715 \labelwidthstring 00.00.0000
1716 \begin_inset Flex CharStyle:Code
1719 \begin_layout Plain Layout
1728 \begin_layout Labeling
1729 \labelwidthstring 00.00.0000
1730 \begin_inset Flex CharStyle:Code
1733 \begin_layout Plain Layout
1742 \begin_layout Labeling
1743 \labelwidthstring 00.00.0000
1744 \begin_inset Flex CharStyle:Code
1747 \begin_layout Plain Layout
1756 \begin_layout Standard
1757 The latter should be the filename as it would be used in a LaTeX's
1764 It is relevant only when exporting files suitable for such inclusion.
1767 \begin_layout Standard
1768 Copiers can be used to do almost anything with output files.
1769 For example, suppose you want generated pdf files to be copied to a special
1771 \begin_inset Flex CharStyle:Code
1774 \begin_layout Plain Layout
1781 Then you could write a shell script such as this one:
1784 \begin_layout Standard
1785 \begin_inset listings
1789 \begin_layout Plain Layout
1794 \begin_layout Plain Layout
1799 \begin_layout Plain Layout
1801 TOFILE=`basename $2`
1804 \begin_layout Plain Layout
1806 cp $FROMFILE /home/you/pdf/$TOFILE
1811 Save it in your local LyX directory—say,
1812 \begin_inset Flex CharStyle:Code
1815 \begin_layout Plain Layout
1816 /home/you/.lyx/scripts/pdfcopier.sh
1821 —and make it executable, if you need to do so on your platform.
1823 \begin_inset Flex CharStyle:MenuItem
1826 \begin_layout Plain Layout
1827 Tools\SpecialChar \menuseparator
1833 dialog, select under
1834 \begin_inset Flex CharStyle:MenuItem
1837 \begin_layout Plain Layout
1838 File Handling\SpecialChar \menuseparator
1845 \begin_inset Flex CharStyle:MenuItem
1848 \begin_layout Plain Layout
1854 format—or one of the other pdf formats—and enter
1855 \begin_inset Flex CharStyle:Code
1858 \begin_layout Plain Layout
1859 pdfcopier.sh $$i $$o
1865 \begin_inset Flex CharStyle:MenuItem
1868 \begin_layout Plain Layout
1878 \begin_layout Standard
1879 Copiers are used by LyX in various of its own conversions.
1880 For example, if appropriate programs are found, LyX will automatically
1881 install copiers for the
1882 \begin_inset Flex CharStyle:MenuItem
1885 \begin_layout Plain Layout
1892 \begin_inset Flex CharStyle:MenuItem
1895 \begin_layout Plain Layout
1897 \begin_inset space ~
1906 When these formats are exported, the copier sees that not just the main
1907 HTML file but various associated files (style files, images, etc.) are also
1909 All these files are written to a subdirectory of the directory in which
1910 the original LyX file was found.
1914 \begin_layout Plain Layout
1915 This copier can be customized.
1917 \begin_inset Quotes eld
1921 \begin_inset Quotes erd
1924 argument takes a comma-separated list of extensions to be copied; if it
1925 is omitted, all files will be copied.
1927 \begin_inset Quotes eld
1931 \begin_inset Quotes erd
1934 argument determines the extension added to the generated directory.
1936 \begin_inset Quotes eld
1940 \begin_inset Flex CharStyle:MenuItem
1943 \begin_layout Plain Layout
1950 \begin_inset Quotes erd
1953 , so HTML generated from
1954 \begin_inset Flex CharStyle:MenuItem
1957 \begin_layout Plain Layout
1958 /path/to/filename.lyx
1964 \begin_inset Flex CharStyle:MenuItem
1967 \begin_layout Plain Layout
1968 /path/to/filename.html.LyXconv
1982 \begin_layout Section
1984 \begin_inset CommandInset label
1986 name "sec:Converters"
1993 \begin_layout Standard
1994 You can define your own Converters to convert files between different formats.
1996 \begin_inset Flex CharStyle:MenuItem
1999 \begin_layout Plain Layout
2000 Tools\SpecialChar \menuseparator
2001 Preferences\SpecialChar \menuseparator
2002 File Handling\SpecialChar \menuseparator
2011 \begin_layout Standard
2012 To define a new converter, select the
2013 \begin_inset Flex CharStyle:MenuItem
2016 \begin_layout Plain Layout
2018 \begin_inset space ~
2027 \begin_inset Flex CharStyle:MenuItem
2030 \begin_layout Plain Layout
2032 \begin_inset space ~
2040 from the drop-down lists, enter the command needed for the conversion,
2042 \begin_inset Flex CharStyle:MenuItem
2045 \begin_layout Plain Layout
2052 Several variables can be used in the definition of converters:
2055 \begin_layout Labeling
2056 \labelwidthstring 00.00.0000
2057 \begin_inset Flex CharStyle:Code
2060 \begin_layout Plain Layout
2066 The LyX system directory
2069 \begin_layout Labeling
2070 \labelwidthstring 00.00.0000
2071 \begin_inset Flex CharStyle:Code
2074 \begin_layout Plain Layout
2083 \begin_layout Labeling
2084 \labelwidthstring 00.00.0000
2085 \begin_inset Flex CharStyle:Code
2088 \begin_layout Plain Layout
2097 \begin_layout Labeling
2098 \labelwidthstring 00.00.0000
2099 \begin_inset Flex CharStyle:Code
2102 \begin_layout Plain Layout
2108 The base filename of the input file (i.
2109 \begin_inset space \thinspace{}
2112 g., without the extension)
2115 \begin_layout Labeling
2116 \labelwidthstring 00.00.0000
2117 \begin_inset Flex CharStyle:Code
2120 \begin_layout Plain Layout
2126 The path to the input file
2129 \begin_layout Labeling
2130 \labelwidthstring 00.00.0000
2131 \begin_inset Flex CharStyle:Code
2134 \begin_layout Plain Layout
2140 The path to the original input file (this is different from $$p when a
2141 chain of converters is called).
2144 \begin_layout Standard
2146 \begin_inset Flex CharStyle:MenuItem
2149 \begin_layout Plain Layout
2151 \begin_inset space ~
2159 field you can enter the following flags, separated by commas:
2162 \begin_layout Labeling
2163 \labelwidthstring 00.00.0000
2164 \begin_inset Flex CharStyle:Code
2167 \begin_layout Plain Layout
2173 This converter runs some form of LaTeX.
2174 This will make LyX's LaTeX error logs available.
2177 \begin_layout Labeling
2178 \labelwidthstring 00.00.0000
2179 \begin_inset Flex CharStyle:Code
2182 \begin_layout Plain Layout
2189 \begin_inset Flex CharStyle:MenuItem
2192 \begin_layout Plain Layout
2198 file for the conversion.
2201 \begin_layout Labeling
2202 \labelwidthstring 00.00.0000
2203 \begin_inset Flex CharStyle:Code
2206 \begin_layout Plain Layout
2215 \begin_layout Standard
2216 The following three flags are not really flags at all because they take
2218 \begin_inset Flex CharStyle:MenuItem
2221 \begin_layout Plain Layout
2223 \begin_inset space ~
2227 \begin_inset space ~
2238 \begin_layout Labeling
2239 \labelwidthstring 00.00.0000
2240 \begin_inset Flex CharStyle:Code
2243 \begin_layout Plain Layout
2249 If set, the converter's standard error will be redirected to a file
2250 \begin_inset Flex CharStyle:Code
2253 \begin_layout Plain Layout
2259 , and the script given as argument will be run as:
2260 \begin_inset Flex CharStyle:Code
2263 \begin_layout Plain Layout
2264 script < infile.out > infile.log
2270 The argument may contain
2271 \begin_inset Flex CharStyle:Code
2274 \begin_layout Plain Layout
2283 \begin_layout Labeling
2284 \labelwidthstring 00.00.0000
2285 \begin_inset Flex CharStyle:Code
2288 \begin_layout Plain Layout
2294 The name of the directory in which the converter will dump the generated
2296 LyX will not create this directory, and it does not copy anything into
2297 it, though it will copy this directory to the destination.
2298 The argument may contain
2299 \begin_inset Flex CharStyle:Code
2302 \begin_layout Plain Layout
2308 , which will be replaced by the base name of the input and output files,
2309 respectively, when the directory is copied.
2310 \begin_inset Newline newline
2313 Note that resultdir and usetempdir make no sense together.
2314 The latter will be ignored if the former is given.
2317 \begin_layout Labeling
2318 \labelwidthstring 00.00.0000
2319 \begin_inset Flex CharStyle:Code
2322 \begin_layout Plain Layout
2328 Determines the output file name and may, contain
2329 \begin_inset Flex CharStyle:Code
2332 \begin_layout Plain Layout
2339 Sensible only with resultdir and optional even then; if not given, it defaults
2343 \begin_layout Standard
2344 None of these last three are presently used in any of the converters that
2345 are installed with LyX.
2349 \begin_layout Standard
2350 You do not have to define converters for all formats between which you want
2352 For example, you will note that there is no `LyX to PostScript' converter,
2353 but LyX will export PostScript.
2354 It does so by first creating a LaTeX file (no converter needs to be defined
2355 for this) which is then converted to DVI using the `LaTeX to DVI' converter,
2356 and finally converting the resulting DVI file to PostScript.
2357 LyX finds such `chains' of converters automatically, and it will always
2358 choose the shortest possible chain.
2359 You can, though, still define multiple conversion methods between file
2361 For example, the standard LyX configuration provides three ways to convert
2362 LaTeX to PDF: Directly, using
2363 \begin_inset Flex CharStyle:MenuItem
2366 \begin_layout Plain Layout
2372 ; via (DVI and) PostScript, using
2373 \begin_inset Flex CharStyle:MenuItem
2376 \begin_layout Plain Layout
2383 \begin_inset Flex CharStyle:MenuItem
2386 \begin_layout Plain Layout
2393 To define such alternate chains, you must define multiple target `file
2394 formats', as described in section
2395 \begin_inset CommandInset ref
2397 reference "sec:Formats"
2402 For example, in the standard configuration, the formats named
2403 \begin_inset Flex CharStyle:MenuItem
2406 \begin_layout Plain Layout
2413 \begin_inset Flex CharStyle:MenuItem
2416 \begin_layout Plain Layout
2423 \begin_inset Flex CharStyle:MenuItem
2426 \begin_layout Plain Layout
2432 are defined, all of which share the extension
2433 \begin_inset Flex CharStyle:MenuItem
2436 \begin_layout Plain Layout
2442 , and which correspond to the conversion methods just mentioned.
2445 \begin_layout Chapter
2446 Internationalizing LyX
2447 \begin_inset CommandInset label
2449 name "cha:Internationalizing-LyX"
2456 \begin_layout Standard
2457 LyX supports using a translated interface.
2458 Last time we checked, LyX provided text in thirty languages.
2459 The language of choice is called your
2464 (For further reading on locale settings, see also the documentation for
2465 locale that comes with your operating system.
2466 For Linux, the manual page for
2467 \begin_inset Flex CharStyle:Code
2470 \begin_layout Plain Layout
2476 could be a good place to start).
2479 \begin_layout Standard
2480 Notice that these translations will work, but do contain a few flaws.
2481 In particular, all dialogs have been designed with the English text in
2482 mind, which means that some of the translated text will be too large to
2483 fit within the space allocated.
2484 This is only a display problem and will not cause any harm.
2485 Also, you will find that some of the translations do not define shortcut
2486 keys for everything.
2487 Sometimes, there are simply not enough free letters to do it.
2488 Other times, the translator just hasn't got around to doing it yet.
2489 Our localization team, which you may wish to join,
2493 \begin_layout Plain Layout
2494 If you are a fluent speaker of a language other than English, joining these
2495 teams is a great way to give back to the LyX community!
2500 will of course try to fix these shortcomings in future versions of LyX.
2503 \begin_layout Section
2507 \begin_layout Subsection
2508 Translating the graphical user interface (text messages).
2511 \begin_layout Standard
2513 \begin_inset Flex CharStyle:Code
2516 \begin_layout Plain Layout
2522 library to handle the internationalization of the interface.
2523 To have LyX speak your favorite language in all menus and dialogs, you
2525 \begin_inset Flex CharStyle:Code
2528 \begin_layout Plain Layout
2534 -file for that language.
2535 When this is available, you'll have to generate a
2536 \begin_inset Flex CharStyle:Code
2539 \begin_layout Plain Layout
2545 -file from it and install the
2546 \begin_inset Flex CharStyle:Code
2549 \begin_layout Plain Layout
2556 The process of doing all of this is explained in the documentation for
2558 \begin_inset Flex CharStyle:Code
2561 \begin_layout Plain Layout
2568 It is possible to do this just for yourself, but if you're going to do
2569 it, you might as well share the results of your labors with the rest of
2571 Send a message to the LyX developers' list for more information about how
2575 \begin_layout Standard
2576 In short, this is what you should do (xx denotes the language code):
2579 \begin_layout Itemize
2580 Check out the LyX source code.
2582 \begin_inset CommandInset href
2584 name "information on the web"
2585 target "http://www.lyx.org/devel/cvs.php"
2592 \begin_layout Itemize
2594 \begin_inset Flex CharStyle:Code
2597 \begin_layout Plain Layout
2603 to the folder of the
2604 \begin_inset Flex CharStyle:Code
2607 \begin_layout Plain Layout
2615 \begin_inset Flex CharStyle:Code
2618 \begin_layout Plain Layout
2626 \begin_inset Flex CharStyle:Code
2629 \begin_layout Plain Layout
2635 doesn't exist anywhere, it can be remade with the console command
2636 \begin_inset Flex CharStyle:Code
2639 \begin_layout Plain Layout
2645 in that directory, or you can use an existing po-file for some other language
2649 \begin_layout Itemize
2651 \begin_inset Flex CharStyle:Code
2654 \begin_layout Plain Layout
2664 \begin_layout Plain Layout
2665 This is just a text file, so it can be edited in any text editor.
2666 But there are also specialized programs that support such editing, such
2671 (for all platforms) or
2680 contains a `mode' for editing
2681 \begin_inset Flex CharStyle:Code
2684 \begin_layout Plain Layout
2695 For some menu- and widget-labels, there are also shortcut keys that should
2697 Those keys are marked after a `|', and should be translated according to
2698 the words and phrases of the language.
2699 You should also fill also out the information at the beginning of the new
2701 \begin_inset Flex CharStyle:Code
2704 \begin_layout Plain Layout
2710 -file with your email-address, etc., so people know where to reach you with
2711 suggestions and entertaining flames.
2714 \begin_layout Standard
2715 If you are just doing this on your own, then:
2718 \begin_layout Itemize
2720 \begin_inset Flex CharStyle:Code
2723 \begin_layout Plain Layout
2730 This can be done with
2731 \begin_inset Flex CharStyle:Code
2734 \begin_layout Plain Layout
2735 msgfmt -o xx.mo < xx.po
2743 \begin_layout Itemize
2745 \begin_inset Flex CharStyle:Code
2748 \begin_layout Plain Layout
2754 -file to your locale-tree, at the correct directory for application messages
2759 xx, and under the name
2760 \begin_inset Flex CharStyle:Code
2763 \begin_layout Plain Layout
2770 \begin_inset space \thinspace{}
2774 \begin_inset space \space{}
2778 \begin_inset Flex CharStyle:Code
2781 \begin_layout Plain Layout
2782 /usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
2792 \begin_layout Standard
2793 As said, however, it would be best if the new
2794 \begin_inset Flex CharStyle:Code
2797 \begin_layout Plain Layout
2803 -file could be added to the LyX distribution, so others can use it.
2804 Adding it involves making additional changes to LyX.
2805 So send an email to the developers' mailing list if you're interested in
2809 \begin_layout Subsubsection
2813 \begin_layout Standard
2814 Sometimes it turns out that one English message needs to be translated into
2815 different messages in the target language.
2816 One example is the message
2817 \begin_inset Flex CharStyle:Code
2820 \begin_layout Plain Layout
2826 which has the German translation
2834 , depending upon exactly what the English
2835 \begin_inset Quotes eld
2839 \begin_inset Quotes erd
2844 \begin_inset Flex CharStyle:Code
2847 \begin_layout Plain Layout
2853 does not handle such ambiguous translations.
2854 Therefore you have to add some context information to the message: Instead
2856 \begin_inset Flex CharStyle:Code
2859 \begin_layout Plain Layout
2866 \begin_inset Flex CharStyle:Code
2869 \begin_layout Plain Layout
2870 To[[as in 'From format x to format y']]
2876 \begin_inset Flex CharStyle:Code
2879 \begin_layout Plain Layout
2880 To[[as in 'From page x to page y']].
2885 Now the two occurrences of
2886 \begin_inset Flex CharStyle:Code
2889 \begin_layout Plain Layout
2896 \begin_inset Flex CharStyle:Code
2899 \begin_layout Plain Layout
2905 and can be translated correctly to
2916 \begin_layout Standard
2917 Of course the context information needs to be stripped off the original
2918 message when no translation is used.
2919 Therefore you have to put it in double square brackets at the end of the
2920 message (see the example above).
2921 The translation mechanism of LyX ensures that everything in double square
2922 brackets at the end of messages is removed before displaying the message.
2925 \begin_layout Subsection
2926 Translating the documentation.
2929 \begin_layout Standard
2930 The online documentation (in the
2931 \begin_inset Flex CharStyle:MenuItem
2934 \begin_layout Plain Layout
2940 -menu) can (and should!) be translated.
2941 If there are translated versions of the documentation available
2945 \begin_layout Plain Layout
2946 As of March 2008, at least some of the documents have been translated into
2947 fourteen languages, with the Tutorial available in a few more.
2952 and the locale is set accordingly, these will be used automagically by
2954 LyX looks for translated versions as
2955 \begin_inset Flex CharStyle:Code
2958 \begin_layout Plain Layout
2959 LyXDir/doc/xx/DocName.lyx
2965 \begin_inset Flex CharStyle:Code
2968 \begin_layout Plain Layout
2974 is the code for the language currently in use.
2975 If there are no translated documents, the default English versions will
2977 Note that the translated versions must have the same filenames (
2978 \begin_inset Flex CharStyle:Code
2981 \begin_layout Plain Layout
2987 above) as the original.
2988 If you feel up to translating the documentation (an excellent way to proof-read
2989 the original documentation by the way!), there are a few things you should
2993 \begin_layout Itemize
2995 \begin_inset Flex CharStyle:Code
2998 \begin_layout Plain Layout
3004 , the guide to writing LyX documentation.
3005 Pay special attention to the translator's section.
3008 \begin_layout Itemize
3009 Check out the documentation translation web page at
3010 \begin_inset CommandInset href
3012 name "http://www.lyx.org/Translation"
3013 target "http://www.lyx.org/Translation"
3018 That way, you can find out which (if any) documents have already been translate
3019 d into your language.
3020 You can also find out who (if anyone) is organizing the effort to translate
3021 the documentation into your language.
3022 If no one is organizing the effort, please let us know that you're interested.
3025 \begin_layout Standard
3026 Once you get to actually translating, here's a few hints for you that may
3030 \begin_layout Itemize
3031 Join the documentation team! There is information on how to do that in
3032 \begin_inset Flex CharStyle:Code
3035 \begin_layout Plain Layout
3042 \begin_inset Flex CharStyle:MenuItem
3045 \begin_layout Plain Layout
3046 Help\SpecialChar \menuseparator
3056 ), which by the way is the first document you should translate.
3059 \begin_layout Itemize
3060 Learn the typographic conventions for the language you are translating to.
3061 Typography is an ancient art and over the centuries, a great variety of
3062 conventions have developed throughout different parts of the world.
3063 Also study the professional terminology amongst typographers in your country.
3064 Inventing your own terminology will only confuse the users.
3067 (Warning! Typography is addictive!)
3070 \begin_layout Itemize
3071 Make a copy of the document.
3072 This will be your working copy.
3073 You can use this as your personal translated help-file by placing it in
3075 \begin_inset Flex CharStyle:Code
3078 \begin_layout Plain Layout
3087 \begin_layout Itemize
3088 Sometimes the original document (from the LyX-team) will be updated.
3089 Use the source viewer at
3090 \begin_inset CommandInset href
3092 name "http://www.lyx.org/trac/timeline"
3093 target "http://www.lyx.org/trac/timeline"
3097 to see what has been changed.
3098 That way you can easily see which parts of the translated document need
3102 \begin_layout Standard
3103 If you ever find an error in the original document, fix it and notify the
3104 rest of the documentation team of the changes! (You didn't forget to join
3105 the documentation team, did you?)
3108 \begin_layout Standard
3109 \begin_inset Branch OutDated
3112 \begin_layout Section
3113 International Keyboard Support
3116 \begin_layout Standard
3119 [Editor's Note: The following section is by
3127 It needs to be fixed to conform to the new Documentation Style sheet and
3128 to make use of the new v1.0 features.
3129 The whole thing also needs to be merged with the section following it.-jw
3130 It may also be badly out of date.-rh (2008)]
3133 \begin_layout Subsection
3134 Defining Own Keymaps: Keymap File Format
3137 \begin_layout Standard
3138 Let's look at a keyboard definition file a little closer.
3139 It is a plain text file defining
3142 \begin_layout Itemize
3143 key-to-key or key-to-string translations
3146 \begin_layout Itemize
3150 \begin_layout Itemize
3151 dead keys exceptions
3154 \begin_layout Standard
3155 To define key-to-key or key-to-string translation, use this command:
3158 \begin_layout Quotation
3159 \begin_inset Flex CharStyle:Code
3162 \begin_layout Plain Layout
3171 \begin_inset Flex CharStyle:Code
3174 \begin_layout Plain Layout
3183 \begin_layout Standard
3185 \begin_inset Flex CharStyle:Code
3188 \begin_layout Plain Layout
3194 is the key to be translated and
3195 \begin_inset Flex CharStyle:Code
3198 \begin_layout Plain Layout
3204 is the string to be inserted into the document.
3205 To define dead keys, use:
3208 \begin_layout Quotation
3209 \begin_inset Flex CharStyle:Code
3212 \begin_layout Plain Layout
3221 \begin_inset Flex CharStyle:Code
3224 \begin_layout Plain Layout
3233 \begin_layout Standard
3235 \begin_inset Flex CharStyle:Code
3238 \begin_layout Plain Layout
3244 is a keyboard key and
3245 \begin_inset Flex CharStyle:Code
3248 \begin_layout Plain Layout
3255 The following dead keys are supported (shortcut name is in parentheses):
3258 \begin_layout Quotation
3262 \begin_inset space \hfill{}
3268 \begin_layout Quotation
3270 \begin_inset space \hfill{}
3276 \begin_layout Quotation
3278 \begin_inset space \hfill{}
3284 \begin_layout Quotation
3286 \begin_inset space \hfill{}
3292 \begin_layout Quotation
3294 \begin_inset space \hfill{}
3300 \begin_layout Quotation
3302 \begin_inset space \hfill{}
3309 \begin_layout Plain Layout
3321 \begin_layout Quotation
3323 \begin_inset space \hfill{}
3329 \begin_layout Quotation
3331 \begin_inset space \hfill{}
3338 \begin_layout Plain Layout
3350 \begin_layout Quotation
3352 \begin_inset space \hfill{}
3358 \begin_layout Quotation
3360 \begin_inset space \hfill{}
3366 \begin_layout Quotation
3368 \begin_inset space \hfill{}
3375 \begin_layout Plain Layout
3387 \begin_layout Quotation
3389 \begin_inset space \hfill{}
3396 \begin_layout Plain Layout
3408 \begin_layout Quotation
3410 \begin_inset space \hfill{}
3416 \begin_layout Quotation
3417 hungarian umlaut (hug)
3418 \begin_inset space \hfill{}
3424 \begin_layout Quotation
3426 \begin_inset space \hfill{}
3432 \begin_layout Quotation
3434 \begin_inset space \hfill{}
3441 \begin_layout Plain Layout
3453 \begin_layout Standard
3454 Since in many international keyboards there are exceptions to what some
3455 dead keys should do, you can define them using
3458 \begin_layout Quotation
3459 \begin_inset Flex CharStyle:Code
3462 \begin_layout Plain Layout
3470 deadkey key outstring
3473 \begin_layout Standard
3474 For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
3478 \begin_layout Quotation
3479 \begin_inset Flex CharStyle:Code
3482 \begin_layout Plain Layout
3495 \begin_layout Standard
3496 to make it work correctly.
3497 Also, you have to define as exceptions dead keys over i and j, to remove
3498 the dot from them before inserting an accent mark.
3499 I will change this when the time comes, but so far I haven't had time.
3502 \begin_layout Standard
3503 Oh, and about characters: backslash is escaped, so to enter it, you'll need
3506 \begin_inset Flex CharStyle:Code
3509 \begin_layout Plain Layout
3515 have different meaning.
3517 \begin_inset Flex CharStyle:Code
3520 \begin_layout Plain Layout
3526 marks comments, quotes start and end LaTeX-style commands.
3527 To enter quote, you'll need to use
3528 \begin_inset Flex CharStyle:Code
3531 \begin_layout Plain Layout
3540 \begin_inset Flex CharStyle:Code
3543 \begin_layout Plain Layout
3550 \begin_inset Flex CharStyle:Code
3553 \begin_layout Plain Layout
3564 \begin_layout Standard
3565 If you make a keyboard description file that works for your language, please
3566 mail it to me, so I can include it in the next keymap distribution.
3569 \begin_layout Standard
3570 More keywords will be supported in keymap configuration file in future,
3574 \begin_layout Itemize
3575 \begin_inset Flex CharStyle:Code
3578 \begin_layout Plain Layout
3589 \begin_inset space \hfill{}
3593 \begin_inset Flex CharStyle:Code
3596 \begin_layout Plain Layout
3605 \begin_layout Itemize
3606 \begin_inset Flex CharStyle:Code
3609 \begin_layout Plain Layout
3620 \begin_inset space \hfill{}
3624 \begin_inset Flex CharStyle:Code
3627 \begin_layout Plain Layout
3633 an external keymap translation program
3636 \begin_layout Standard
3637 Also, it should look into
3638 \begin_inset Flex CharStyle:Code
3641 \begin_layout Plain Layout
3647 file for defaults, too (for example, a
3648 \begin_inset Flex CharStyle:Code
3651 \begin_layout Plain Layout
3659 option to include default keyboard).
3667 \begin_layout Section
3668 International Keymap Stuff
3669 \begin_inset CommandInset label
3671 name "sec:International-Keymap-Stuff"
3678 \begin_layout Standard
3679 \begin_inset Note Note
3682 \begin_layout Plain Layout
3683 In doing the revisions on this document in March 2008, I did not look over
3684 this stuff, as I do not understand it.
3685 It would be good if someone else could do so.
3694 \begin_layout Standard
3695 The next two sections describe the
3696 \begin_inset Flex CharStyle:Code
3699 \begin_layout Plain Layout
3708 \begin_inset Flex CharStyle:Code
3711 \begin_layout Plain Layout
3719 file syntax in detail.
3720 These sections should help you design your own key map if the ones provided
3721 do not meet your needs.
3724 \begin_layout Subsection
3728 \begin_layout Standard
3732 \begin_inset Flex CharStyle:Code
3735 \begin_layout Plain Layout
3741 file maps keystrokes to characters or strings.
3742 As the name suggests, it sets a keyboard mapping.
3744 \begin_inset Flex CharStyle:Code
3747 \begin_layout Plain Layout
3758 \begin_inset Flex CharStyle:Code
3761 \begin_layout Plain Layout
3776 \begin_inset Flex CharStyle:Code
3779 \begin_layout Plain Layout
3792 \begin_inset Flex CharStyle:Code
3795 \begin_layout Plain Layout
3804 \begin_inset Flex CharStyle:Code
3807 \begin_layout Plain Layout
3815 are described in this section.
3818 \begin_layout Labeling
3819 \labelwidthstring 00.00.0000
3820 \begin_inset Flex CharStyle:Code
3823 \begin_layout Plain Layout
3831 Map a character to a string
3834 \begin_layout LyX-Code
3849 \begin_layout Standard
3882 the double-quote (")
3899 must be escaped with a preceding backslash (
3910 \begin_layout Standard
3912 \begin_inset Flex CharStyle:MenuItem
3915 \begin_layout Plain Layout
3923 statement to cause the symbol
3924 \begin_inset Flex CharStyle:MenuItem
3927 \begin_layout Plain Layout
3935 to be output for the keystroke
3936 \begin_inset Flex CharStyle:MenuItem
3939 \begin_layout Plain Layout
3950 \begin_layout LyX-Code
3956 \begin_layout Labeling
3957 \labelwidthstring 00.00.0000
3958 \begin_inset Flex CharStyle:Code
3961 \begin_layout Plain Layout
3969 Specify an accent character
3972 \begin_layout LyX-Code
3981 \begin_layout Standard
3982 This will make the cha
4020 This is the dead key
4024 \begin_layout Plain Layout
4031 refers to a key that does not produce a character by itself, but when followed
4032 with another key, produces the desired accent character.
4033 For example, a German characte
4035 r with an umlaut like
4045 can be produced in this manner.
4054 \begin_layout Standard
4067 and then another key not in
4084 followed by the other, not allowed key, as output.
4088 \begin_inset Flex CharStyle:MenuItem
4091 \begin_layout Plain Layout
4099 cancels a dead key, so if
4110 \begin_inset Flex CharStyle:MenuItem
4113 \begin_layout Plain Layout
4122 , the cursor will not go one position backwards but will instead cancel
4138 might have had on the next keystroke.
4142 \begin_layout Standard
4143 The following example specifies that the character ' is to be an acute accent,
4144 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4147 \begin_layout LyX-Code
4150 kmod ' acute aeiouAEIOU
4153 \begin_layout Labeling
4154 \labelwidthstring 00.00.0000
4155 \begin_inset Flex CharStyle:Code
4158 \begin_layout Plain Layout
4164 Specify an exception to the accent character
4167 \begin_layout LyX-Code
4176 \begin_layout Standard
4177 This defines an exce
4218 have been assigned a keystroke with a previous
4221 \begin_inset Flex CharStyle:Code
4224 \begin_layout Plain Layout
4248 must not belong in the
4295 If such a declaration does not exist in
4303 \begin_inset Flex CharStyle:Code
4306 \begin_layout Plain Layout
4340 \begin_inset Flex CharStyle:Code
4343 \begin_layout Plain Layout
4357 \begin_layout Standard
4358 The following command produces causes äi to be produced when you enter acute-i
4362 \begin_layout LyX-Code
4376 \begin_layout Labeling
4377 \labelwidthstring 00.00.0000
4378 \begin_inset Flex CharStyle:Code
4381 \begin_layout Plain Layout
4387 Combine two accent characters
4390 \begin_layout LyX-Code
4396 accent1 accent2 allowed
4399 \begin_layout Standard
4400 This one is getting pretty esoteric.
4401 It allows you to combine the effect
4457 \begin_inset Flex CharStyle:Code
4460 \begin_layout Plain Layout
4488 \begin_layout Standard
4489 Consider this example from the
4490 \begin_inset Flex CharStyle:Code
4493 \begin_layout Plain Layout
4504 \begin_layout LyX-Code
4507 kmod ; acute aeioyvhAEIOYVH
4511 kcomb acute umlaut iyIY
4514 \begin_layout Standard
4515 This allows you to press
4516 \begin_inset Flex CharStyle:MenuItem
4519 \begin_layout Plain Layout
4527 and get the effect of
4528 \begin_inset Flex CharStyle:Code
4531 \begin_layout Plain Layout
4550 in this case cancels the last dead key, so if you press
4551 \begin_inset Flex CharStyle:MenuItem
4554 \begin_layout Plain Layout
4563 \begin_inset Flex CharStyle:Code
4566 \begin_layout Plain Layout
4579 \begin_layout Subsection
4583 \begin_layout Standard
4585 \begin_inset Flex CharStyle:Code
4588 \begin_layout Plain Layout
4596 mapping is performed, a
4597 \begin_inset Flex CharStyle:Code
4600 \begin_layout Plain Layout
4610 file maps the strings that the symbols generate to characters in the current
4612 The LyX distribution currently includes at least the
4613 \begin_inset Flex CharStyle:Code
4616 \begin_layout Plain Layout
4625 \begin_inset Flex CharStyle:Code
4628 \begin_layout Plain Layout
4639 \begin_layout Standard
4641 \begin_inset Flex CharStyle:Code
4644 \begin_layout Plain Layout
4652 file is a sequence of declarations of the form
4655 \begin_layout LyX-Code
4668 \begin_layout Standard
4669 For example, in order to map
4670 \begin_inset Flex CharStyle:MenuItem
4673 \begin_layout Plain Layout
4683 to the corresponding character in the iso-8859-1 set (233), the following
4687 \begin_layout LyX-Code
4695 \begin_layout Standard
4697 \begin_inset Flex CharStyle:Code
4700 \begin_layout Plain Layout
4709 \begin_inset Flex CharStyle:Code
4712 \begin_layout Plain Layout
4730 the same character can apply to more than one string.
4732 \begin_inset Flex CharStyle:Code
4735 \begin_layout Plain Layout
4746 \begin_layout LyX-Code
4758 \begin_inset Newline newline
4774 \begin_layout Standard
4775 If LyX cannot find a mapping for the string produced by the keystroke or
4776 a deadkey sequence, it will check if it looks like an accented char and
4777 try to draw an accent over the character on screen.
4780 \begin_layout Subsection
4784 \begin_layout Standard
4785 There is a second way to add support for international characters through
4786 so-called dead-keys.
4787 A dead-key works in combination with a letter to produce an accented character.
4788 Here, we'll explain how to create a really simple dead-key to illustrate
4792 \begin_layout Standard
4793 Suppose you happen to need the circumflex character,
4794 \begin_inset Quotes eld
4798 \begin_inset Quotes erd
4803 \begin_inset Flex CharStyle:MenuItem
4806 \begin_layout Plain Layout
4813 \begin_inset space ~
4817 \begin_inset Flex CharStyle:MenuItem
4820 \begin_layout Plain Layout
4826 ] to the LyX command
4827 \begin_inset Flex CharStyle:Code
4830 \begin_layout Plain Layout
4837 \begin_inset Flex CharStyle:Code
4840 \begin_layout Plain Layout
4847 Now, whenever you type the
4848 \begin_inset Flex CharStyle:MenuItem
4851 \begin_layout Plain Layout
4857 -key followed by a letter, that letter will have a circumflex accent on
4859 For example, the sequence
4860 \begin_inset Quotes eld
4864 \begin_inset Flex CharStyle:MenuItem
4867 \begin_layout Plain Layout
4874 \begin_inset Quotes erd
4877 produces the letter:
4878 \begin_inset Quotes eld
4882 \begin_inset Quotes erd
4886 If you tried to type
4887 \begin_inset Quotes eld
4891 \begin_inset Flex CharStyle:MenuItem
4894 \begin_layout Plain Layout
4901 \begin_inset Quotes erd
4904 , however, LyX will complain with a beep, since a
4905 \begin_inset Quotes eld
4909 \begin_inset Flex CharStyle:MenuItem
4912 \begin_layout Plain Layout
4919 \begin_inset Quotes erd
4922 never takes a circumflex accent.
4924 \begin_inset Flex CharStyle:MenuItem
4927 \begin_layout Plain Layout
4933 after a dead-key produces the bare-accent.
4934 Please note this last point! If you bind a key to a dead-key, you'll need
4935 to rebind the character on that key to yet another key.
4937 \begin_inset Flex CharStyle:MenuItem
4940 \begin_layout Plain Layout
4946 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
4949 \begin_layout Standard
4950 One common way to bind dead-keys is to use
4951 \begin_inset Flex CharStyle:MenuItem
4954 \begin_layout Plain Layout
4961 \begin_inset Flex CharStyle:MenuItem
4964 \begin_layout Plain Layout
4971 \begin_inset Flex CharStyle:MenuItem
4974 \begin_layout Plain Layout
4980 in combination with an accent, like
4981 \begin_inset Quotes eld
4985 \begin_inset Flex CharStyle:MenuItem
4988 \begin_layout Plain Layout
4995 \begin_inset Quotes erd
4999 \begin_inset Quotes eld
5003 \begin_inset Flex CharStyle:MenuItem
5006 \begin_layout Plain Layout
5013 \begin_inset Quotes erd
5017 \begin_inset Quotes eld
5021 \begin_inset Flex CharStyle:MenuItem
5024 \begin_layout Plain Layout
5031 \begin_inset Quotes erd
5035 Another way involves using
5036 \begin_inset Flex CharStyle:Code
5039 \begin_layout Plain Layout
5046 \begin_inset Flex CharStyle:Code
5049 \begin_layout Plain Layout
5055 to set up the special
5056 \begin_inset Flex CharStyle:Code
5059 \begin_layout Plain Layout
5067 \begin_inset Flex CharStyle:Code
5070 \begin_layout Plain Layout
5076 acts in some ways just like
5077 \begin_inset Flex CharStyle:MenuItem
5080 \begin_layout Plain Layout
5086 and permits you to bind keys to accented characters.
5087 You can also turn keys into dead-keys by binding them to something like
5089 \begin_inset Flex CharStyle:Code
5092 \begin_layout Plain Layout
5098 and then binding this symbolic key to the corresponding LyX command.
5102 \begin_layout Plain Layout
5107 : This is exactly what I do in my
5108 \begin_inset Flex CharStyle:Code
5111 \begin_layout Plain Layout
5118 \begin_inset Flex CharStyle:Code
5121 \begin_layout Plain Layout
5129 \begin_inset Flex CharStyle:MenuItem
5132 \begin_layout Plain Layout
5134 \begin_inset space ~
5143 \begin_inset Flex CharStyle:Code
5146 \begin_layout Plain Layout
5152 and a bunch of these
5153 \begin_inset Quotes eld
5157 \begin_inset Flex CharStyle:Code
5160 \begin_layout Plain Layout
5167 \begin_inset Quotes erd
5170 symbolic keys bound such things as
5171 \begin_inset Flex CharStyle:MenuItem
5174 \begin_layout Plain Layout
5176 \begin_inset space ~
5185 \begin_inset Flex CharStyle:MenuItem
5188 \begin_layout Plain Layout
5190 \begin_inset space ~
5199 This is how I produce my accented characters.
5204 You can make just about anything into the
5205 \begin_inset Flex CharStyle:Code
5208 \begin_layout Plain Layout
5215 \begin_inset Flex CharStyle:MenuItem
5218 \begin_layout Plain Layout
5224 keys, a spare function key, etc.
5225 As for the LyX commands that produce accents, check the entry for
5226 \begin_inset Flex CharStyle:Code
5229 \begin_layout Plain Layout
5240 You'll find the complete list there.
5243 \begin_layout Subsection
5244 Saving your Language Configuration
5247 \begin_layout Standard
5248 You can edit your preferences so that your desired language environment
5249 is automatically configured when LyX starts up, via the
5250 \begin_inset Flex CharStyle:MenuItem
5253 \begin_layout Plain Layout
5254 Edit\SpecialChar \menuseparator
5263 \begin_layout Chapter
5264 Installing New Document Classes, Layouts, and Templates
5265 \begin_inset CommandInset label
5267 name "cha:Installing-New-Document"
5275 \begin_layout Plain Layout
5276 Installing New Document Classes
5284 \begin_layout Standard
5285 In this chapter, we describe the procedures for creating and installing
5286 new LyX layout and template files, as well as offer a refresher on correctly
5287 installing new LaTeX document classes.
5288 Some definitions: a document class is a LaTeX file (usually ending in
5289 \begin_inset Flex CharStyle:Code
5292 \begin_layout Plain Layout
5299 \begin_inset Flex CharStyle:Code
5302 \begin_layout Plain Layout
5308 ) that describes the format of a document such as an article, report, journal
5309 preprint, etc, and all the commands needed to realize that format.
5310 A layout file is a LyX file that corresponds to a LaTeX document class
5311 and that tells LyX how to
5312 \begin_inset Quotes eld
5316 \begin_inset Quotes erd
5319 things on the screen to make the display look something like the final
5321 More precisely, a layout file describes a
5322 \begin_inset Quotes eld
5326 \begin_inset Quotes erd
5329 which is the internal construct LyX uses to render the screen display.
5331 \begin_inset Quotes eld
5335 \begin_inset Quotes erd
5339 \begin_inset Quotes eld
5343 \begin_inset Quotes erd
5346 can be used somewhat interchangeably, but it is better to refer to the
5347 file as the layout, and the thing living in LyX's memory as the text class.
5348 A template file is simply a LyX document that contains a set of predefined
5349 entries for a given document class—entries that are generally required
5351 Templates are especially useful for things like journal manuscripts that
5352 are to be submitted electronically.
5355 \begin_layout Section
5356 Installing a new LaTeX package
5359 \begin_layout Standard
5360 Some installations may not include a LaTeX package that you would like to
5362 For example, you might need FoilTeX, a package for preparing slides or
5363 viewgraphs for overhead projectors.
5364 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5365 a user interface for that.
5366 For example on MiKTeX you start its program
5367 \begin_inset Quotes eld
5371 \begin_inset Quotes erd
5374 to get a list of available packages.
5375 To install one, right click on it or use the installing toolbar button.
5376 When the package you want to install is not in the list, but you have it
5378 \begin_inset Flex CharStyle:Code
5381 \begin_layout Plain Layout
5388 \begin_inset Flex CharStyle:Code
5391 \begin_layout Plain Layout
5397 -file, then copy these files to a subfolder of your LaTeX distribution,
5398 for example to the folder
5407 Then update the file name database of your LaTeX-distribution.
5408 For example on MiKTeX this is done by pressing the button
5411 \begin_inset space ~
5416 that you find in MiKTeX's
5417 \begin_inset Quotes eld
5421 \begin_inset Quotes erd
5425 In both cases you need afterwards to reconfigure LyX using the menu
5426 \begin_inset Flex CharStyle:MenuItem
5429 \begin_layout Plain Layout
5430 Tools\SpecialChar \menuseparator
5436 and then to restart LyX.
5439 \begin_layout Standard
5440 If your LaTeX distribution doesn't provide a user interface, then you can
5441 follow these steps by using a UNIX/Linux console.
5444 \begin_layout Enumerate
5445 Get the package from
5446 \begin_inset CommandInset href
5449 target "http://www.ctan.org/"
5456 \begin_layout Enumerate
5457 You can install this package in several different places.
5458 If you want it to be available for all users on your system, then you should
5459 install it in your `local' TeX tree; if you want (or need) it to be available
5460 just for you, then you can install it in your own `user' TeX tree.
5461 Where these should be created, if they do not already exist, depends upon
5462 the details of your system.
5463 To find out, look in the file
5464 \begin_inset Flex CharStyle:Code
5467 \begin_layout Plain Layout
5477 \begin_layout Plain Layout
5478 This usually lives in the directory
5479 \begin_inset Flex CharStyle:Code
5482 \begin_layout Plain Layout
5488 , though you can run
5489 \begin_inset Flex CharStyle:Code
5492 \begin_layout Plain Layout
5503 The location of the `local' TeX tree is defined by
5504 \begin_inset Flex CharStyle:Code
5507 \begin_layout Plain Layout
5513 ; this is usually somewhere like
5514 \begin_inset Flex CharStyle:Code
5517 \begin_layout Plain Layout
5518 /usr/local/share/texmf/
5524 The `user' TeX tree is defined by
5525 \begin_inset Flex CharStyle:Code
5528 \begin_layout Plain Layout
5535 \begin_inset Flex CharStyle:Code
5538 \begin_layout Plain Layout
5545 (If these variables are not predefined, you can define them.) You'll probably
5546 need root permissions to create or modify the `local' tree; but your `user'
5547 tree shouldn't have such limitations.
5550 \begin_layout Enumerate
5552 \begin_inset Flex CharStyle:Code
5555 \begin_layout Plain Layout
5562 \begin_inset Flex CharStyle:Code
5565 \begin_layout Plain Layout
5572 \begin_inset Flex CharStyle:Code
5575 \begin_layout Plain Layout
5582 \begin_inset space \thinspace{}
5586 \begin_inset Newline newline
5590 \begin_inset Flex CharStyle:Code
5593 \begin_layout Plain Layout
5594 TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
5600 \begin_inset Newline newline
5603 But, again, most of this will
5604 \begin_inset Quotes eld
5608 \begin_inset Quotes erd
5614 \begin_layout Enumerate
5619 \begin_layout Plain Layout
5620 We'll assume henceforth that you're defining `local' TeX tree.
5621 If you're defining a user tree, just adjust as necessary.
5627 You must follow the directory structure of your existing
5628 \begin_inset Flex CharStyle:Code
5631 \begin_layout Plain Layout
5637 directory, which will be found at
5638 \begin_inset Flex CharStyle:Code
5641 \begin_layout Plain Layout
5648 For example, latex packages should go under
5649 \begin_inset Flex CharStyle:Code
5652 \begin_layout Plain Layout
5653 $TEXMFLOCAL/tex/latex/
5661 \begin_layout Enumerate
5662 Install the package.
5663 For example, you would unpack the FoilTeX tarball and copy it to
5664 \begin_inset Flex CharStyle:Code
5667 \begin_layout Plain Layout
5668 $TEXMFLOCAL/tex/latex/foiltex
5675 \begin_inset Flex CharStyle:Code
5678 \begin_layout Plain Layout
5684 directory contains various files.
5687 \begin_layout Enumerate
5689 \begin_inset Flex CharStyle:Code
5692 \begin_layout Plain Layout
5700 \begin_inset Flex CharStyle:Code
5703 \begin_layout Plain Layout
5712 \begin_layout Standard
5713 Your package is now installed and available to LaTeX.
5714 To make it available to LyX, you need to create a Layout file, if one is
5715 not already available.
5716 (See the next section.) Once you have a layout file, you need only reconfigure
5718 \begin_inset Flex CharStyle:MenuItem
5721 \begin_layout Plain Layout
5722 Tools\SpecialChar \menuseparator
5728 ) and then restart LyX.
5729 You should then see your new package—for example
5730 \begin_inset Flex CharStyle:MenuItem
5733 \begin_layout Plain Layout
5740 \begin_inset Flex CharStyle:MenuItem
5743 \begin_layout Plain Layout
5744 Document\SpecialChar \menuseparator
5751 \begin_inset Flex CharStyle:MenuItem
5754 \begin_layout Plain Layout
5764 \begin_layout Section
5768 \begin_layout Standard
5769 This section describes how to write and install your own LyX layout files
5770 and walks through the
5771 \begin_inset Flex CharStyle:Code
5774 \begin_layout Plain Layout
5780 text class format as an example.
5782 \begin_inset Flex CharStyle:Code
5785 \begin_layout Plain Layout
5791 files describe what paragraph and character styles are available for a
5792 given document class and how LyX should display them.
5793 We try to provide a thorough description of the process here; however,
5794 there are so many different types of documents supported by LaTeX classes
5795 that we can't hope to cover every different possibility or problem you
5797 (The LyX users' list is frequented by people with lots of experience with
5798 layout design who are willing to share what they've learned.)
5801 \begin_layout Standard
5802 As you prepare to write a new layout, it is extremely helpful to look at
5803 the example layouts distributed with LyX.
5804 If you use a nice LaTeX document class that might be of interest for others,
5805 too, and have a nice corresponding LyX layout, feel free to contribute
5806 the stuff to us, so we may put it into the distribution.
5808 \begin_inset CommandInset href
5810 name "section on the LyX wiki"
5811 target "http://wiki.lyx.org/Layouts/Layouts"
5815 for this kind of material.
5818 \begin_layout Standard
5819 All the tags described in this chapter are case-insensitive; this means
5821 \begin_inset Flex CharStyle:Code
5824 \begin_layout Plain Layout
5831 \begin_inset Flex CharStyle:Code
5834 \begin_layout Plain Layout
5841 \begin_inset Flex CharStyle:Code
5844 \begin_layout Plain Layout
5850 are really the same command.
5851 The possible values are printed in brackets after the feature's name.
5852 The default value if a feature isn't specified inside a text class-description
5854 \begin_inset Flex CharStyle:Code
5857 \begin_layout Plain Layout
5866 If the argument has a data type like
5867 \begin_inset Quotes eld
5871 \begin_inset Quotes erd
5875 \begin_inset Quotes eld
5879 \begin_inset Quotes erd
5882 , the default is shown like this:
5883 \begin_inset Flex CharStyle:Code
5886 \begin_layout Plain Layout
5897 \begin_layout Subsection
5899 \begin_inset CommandInset label
5901 name "sub:Layout-modules"
5908 \begin_layout Standard
5909 Similar to layout files, and new with LyX 1.6, are layout
5914 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
5915 some modules—such as the endnotes module—provide support for just such
5917 In a sense, layout modules are similar to included files—files like
5918 \begin_inset Flex CharStyle:Code
5921 \begin_layout Plain Layout
5927 —in that modules are not specific to a given document layout but may be
5928 used with many different layouts.
5929 The difference is that using a layout module does not require editing the
5931 Rather, modules are selected in the
5932 \begin_inset Flex CharStyle:MenuItem
5935 \begin_layout Plain Layout
5936 Document\SpecialChar \menuseparator
5945 \begin_layout Standard
5946 Building modules is the easiest way to get started with layout editing,
5947 since it can be as simple as adding a single new paragraph or flex inset.
5948 But modules may, in principle, contain anything a layout file can contain.
5951 \begin_layout Standard
5952 A module must begin with a line like the following:
5955 \begin_layout LyX-Code
5958 DeclareLyXModule[endnotes.sty]{Endnotes}
5961 \begin_layout Standard
5962 The mandatory argument, in curly brackets, is the name of the module, as
5964 \begin_inset Flex CharStyle:MenuItem
5967 \begin_layout Plain Layout
5968 Document\SpecialChar \menuseparator
5975 The argument in square brackets is optional: It declares any LaTeX packages
5976 on which the module depends.
5977 Please note that only packages about which LyX knows should be listed in
5978 the square brackets.
5982 \begin_layout Plain Layout
5983 The list of such packages is documented only in the source code.
5988 LyX will not check for arbitrary packages.
5991 \begin_layout Standard
5992 The module declaration should then be followed by lines like the following:
5995 \begin_layout LyX-Code
5999 \begin_layout LyX-Code
6000 #Adds an endnote command, in addition to footnotes.
6004 \begin_layout LyX-Code
6005 #You will need to add
6007 theendnotes in TeX code where you
6010 \begin_layout LyX-Code
6011 #want the endnotes to appear.
6015 \begin_layout LyX-Code
6019 \begin_layout LyX-Code
6020 #Requires: somemodule | othermodule
6023 \begin_layout LyX-Code
6024 #Excludes: badmodule
6027 \begin_layout Standard
6028 The description is used in
6029 \begin_inset Flex CharStyle:MenuItem
6032 \begin_layout Plain Layout
6033 Document\SpecialChar \menuseparator
6039 to provide the user with information about what the module does.
6041 \begin_inset Flex CharStyle:Code
6044 \begin_layout Plain Layout
6050 line is used to identify other modules with which this one must be used;
6052 \begin_inset Flex CharStyle:Code
6055 \begin_layout Plain Layout
6061 line is used to identify modules with which this one may not be used.
6062 Both are optional, and, as shown, multiple modules should be separated
6063 with the pipe symbol: |.
6064 Note that the required modules are treated disjunctively:
6068 of the required modules must be used.
6073 excluded module may be used.
6074 Note that modules are identified here by their
6078 without the .module extension.
6080 \begin_inset Flex CharStyle:Code
6083 \begin_layout Plain Layout
6090 \begin_inset Flex CharStyle:Code
6093 \begin_layout Plain Layout
6102 \begin_layout Standard
6103 After creating a new module, you will need to reconfigure and then restart
6104 LyX for the module to appear in the menu.
6105 However, changes you make to the module will be seen immediately, if you
6107 \begin_inset Flex CharStyle:MenuItem
6110 \begin_layout Plain Layout
6111 Document\SpecialChar \menuseparator
6117 , highlight something, and then hit
6118 \begin_inset Quotes eld
6122 \begin_inset Quotes erd
6128 It is strongly recommended that you save your work before doing so
6133 it is strongly recommended that you not attempt to edit modules while simultaneo
6134 usly working on documents
6137 Though of course the developers strive to keep LyX stable in such situations,
6138 syntax errors and the like in your module file could cause strange behavior.
6141 \begin_layout Subsection
6142 Supporting new document classes
6145 \begin_layout Standard
6146 There are two situations you are likely to encounter when wanting to support
6147 a new LaTeX document class, involving LaTeX2e class (
6148 \begin_inset Flex CharStyle:Code
6151 \begin_layout Plain Layout
6158 \begin_inset Flex CharStyle:Code
6161 \begin_layout Plain Layout
6168 Supporting a style file is usually fairly easy.
6169 Supporting a new document class is a bit harder.
6172 \begin_layout Subsection
6174 \begin_inset Flex CharStyle:MenuItem
6177 \begin_layout Plain Layout
6186 \begin_layout Standard
6187 If your new document class is provided as a style file that is used in conjuncti
6188 on with an existing, supported document class—for the sake of the example,
6189 we'll assume that the style file is called
6190 \begin_inset Flex CharStyle:MenuItem
6193 \begin_layout Plain Layout
6199 and it is meant to be used with
6200 \begin_inset Flex CharStyle:MenuItem
6203 \begin_layout Plain Layout
6209 , which is a standard class—start by copying the existing class's layout
6210 file into your local directory:
6213 \begin_layout LyX-Code
6214 cp report.layout ~/.lyx/layouts/myclass.layout
6217 \begin_layout Standard
6219 \begin_inset Flex CharStyle:Code
6222 \begin_layout Plain Layout
6228 and change the line:
6231 \begin_layout LyX-Code
6234 DeclareLaTeXClass{report}
6237 \begin_layout Standard
6241 \begin_layout LyX-Code
6244 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6247 \begin_layout Standard
6251 \begin_layout LyX-Code
6253 \begin_inset Newline newline
6259 \begin_inset Newline newline
6265 \begin_layout Standard
6266 near the top of the file.
6269 \begin_layout Standard
6270 Start LyX and select
6271 \begin_inset Flex CharStyle:MenuItem
6274 \begin_layout Plain Layout
6275 Tools\SpecialChar \menuseparator
6282 Then restart LyX and try creating a new document.
6284 \begin_inset Flex CharStyle:MenuItem
6287 \begin_layout Plain Layout
6293 " as a document class option in the
6294 \begin_inset Flex CharStyle:MenuItem
6297 \begin_layout Plain Layout
6298 Document\SpecialChar \menuseparator
6305 It is likely that some of the sectioning commands and such in your new
6306 class will work differently from how they worked in the base class—
6307 \begin_inset Flex CharStyle:Code
6310 \begin_layout Plain Layout
6316 in this example—so you can fiddle around with the settings for the different
6317 sections if you wish.
6320 \begin_layout Subsection
6322 \begin_inset Flex CharStyle:MenuItem
6325 \begin_layout Plain Layout
6334 \begin_layout Standard
6335 There are two possibilities here.
6336 One is that the class file is itself based upon an existing document class.
6337 For example, many thesis classes are based upon
6338 \begin_inset Flex CharStyle:MenuItem
6341 \begin_layout Plain Layout
6348 To see whether yours is, look for a line like
6351 \begin_layout LyX-Code
6357 \begin_layout Standard
6359 If so, then you may proceed largely as in the previous section, though
6360 the DeclareLaTeXClass line will be different.
6361 If your new class is thesis, and it is based upon book, then the line should
6366 \begin_layout Plain Layout
6367 And it will be easiest if you save the file to
6368 \begin_inset Flex CharStyle:Code
6371 \begin_layout Plain Layout
6377 : LyX assumes that the document class has the same name as the layout file.
6386 \begin_layout LyX-Code
6389 DeclareLaTeXClass[thesis,book]{thesis}
6392 \begin_layout Standard
6393 If, on the other hand, the new class is not based upon an existing class,
6394 you will probably have to
6395 \begin_inset Quotes eld
6399 \begin_inset Quotes erd
6403 We strongly suggest copying an existing layout file which uses a similar
6404 LaTeX class and then modifying it, if you can do so.
6405 At least use an existing file as a starting point so you can find out what
6406 items you need to worry about.
6407 Again, the specifics are covered below.
6410 \begin_layout Section
6411 Declaring a new text class
6414 \begin_layout Standard
6415 When it's finally time to get your hands dirty and create or edit your own
6416 layout file, the following sections describe what you're up against.
6417 Our advice is to go slowly, save and test often, listen to soothing music,
6418 and enjoy one or two of your favorite adult beverages; more if you are
6419 getting particularly stuck.
6420 It's really not that hard, except that the multitude of options can become
6421 overwhelming if you try to do to much in one sitting.
6422 Go have another adult beverage, just for good measure.
6425 \begin_layout Standard
6429 \begin_layout Standard
6430 Lines in a layout file which begin with a
6431 \begin_inset Flex CharStyle:Code
6434 \begin_layout Plain Layout
6441 There is one exception to this rule: all layouts should begin with lines
6445 \begin_layout LyX-Code
6448 #% Do not delete the line below; configure depends on this
6451 \begin_layout LyX-Code
6456 DeclareLaTeXClass{article}
6459 \begin_layout Standard
6460 The second line is used when you configure LyX.
6461 The layout file is read by the LaTeX script
6462 \begin_inset Flex CharStyle:Code
6465 \begin_layout Plain Layout
6471 , in a special mode where
6472 \begin_inset Flex CharStyle:Code
6475 \begin_layout Plain Layout
6482 The first line is just a LaTeX comment, and the second one contains the
6483 declaration of the text class.
6484 If these lines appear in a file named
6485 \begin_inset Flex CharStyle:Code
6488 \begin_layout Plain Layout
6494 , then they define a text class of name
6495 \begin_inset Flex CharStyle:Code
6498 \begin_layout Plain Layout
6504 (the name of the layout file) which uses the LaTeX document class
6505 \begin_inset Flex CharStyle:Code
6508 \begin_layout Plain Layout
6514 (the default is to use the same name as the layout).
6516 \begin_inset Quotes eld
6520 \begin_inset Quotes erd
6523 that appears above is used as a description of the text class in the
6524 \begin_inset Flex CharStyle:MenuItem
6527 \begin_layout Plain Layout
6528 Document\SpecialChar \menuseparator
6537 \begin_layout Standard
6538 Let's assume that you wrote your own text class that uses the
6539 \begin_inset Flex CharStyle:Code
6542 \begin_layout Plain Layout
6548 document class, but where you changed the appearance of the section headings.
6549 If you put it in a file
6550 \begin_inset Flex CharStyle:Code
6553 \begin_layout Plain Layout
6559 , the header of this file should be:
6562 \begin_layout LyX-Code
6565 #% Do not delete the line below; configure depends on this
6568 \begin_layout LyX-Code
6573 DeclareLaTeXClass[article]{article (with my own headings)}
6576 \begin_layout Standard
6577 This declares a text class
6578 \begin_inset Flex CharStyle:Code
6581 \begin_layout Plain Layout
6587 , associated with the LaTeX document class
6588 \begin_inset Flex CharStyle:Code
6591 \begin_layout Plain Layout
6598 \begin_inset Quotes eld
6601 article (with my own headings)
6602 \begin_inset Quotes erd
6606 If your text class depends on several packages, you can declare it as:
6609 \begin_layout LyX-Code
6612 #% Do not delete the line below; configure depends on this
6615 \begin_layout LyX-Code
6620 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
6623 \begin_layout Standard
6624 This indicates that your text class uses the foo.sty package.
6625 Finally, it is also possible to declare classes for DocBook code.
6626 Typical declarations will look like
6629 \begin_layout LyX-Code
6632 #% Do not delete the line below; configure depends on this
6635 \begin_layout LyX-Code
6640 DeclareDocBookClass[article]{SGML (DocBook article)}
6643 \begin_layout Standard
6644 Note that these declarations can also be given an optional parameter declaring
6645 the name of the document class (but not a list).
6648 \begin_layout Standard
6649 So, to be as explicit as possible, the form of the layout declaration is:
6652 \begin_layout LyX-Code
6657 DeclareLaTeXClass[class,package.sty]{layout description}
6660 \begin_layout Standard
6661 The class need only be specified if the name of the LaTeX class file and
6662 the name of the layout file are different; if the name of the class file
6663 is not specified, then LyX will simply assume that it is the same as the
6664 name of the layout file.
6667 \begin_layout Standard
6668 When the text class has been modified to your taste, all you have to do
6669 is to copy it either to
6670 \begin_inset Flex CharStyle:Code
6673 \begin_layout Plain Layout
6680 \begin_inset Flex CharStyle:Code
6683 \begin_layout Plain Layout
6690 \begin_inset Flex CharStyle:MenuItem
6693 \begin_layout Plain Layout
6694 Tools\SpecialChar \menuseparator
6700 , exit LyX and restart it.
6701 Then your new text class should be available along with the others.
6704 \begin_layout Standard
6705 In versions of LyX prior to 1.6, you had to restart LyX to see any changes
6706 you made to your layout files.
6707 As a result, editing layout files could be very time consuming.
6708 Beginning with 1.6, however, you can force a reload of the layout currently
6709 in use by using the LyX function
6710 \begin_inset Flex CharStyle:MenuItem
6713 \begin_layout Plain Layout
6720 There is no default binding for this function—though, of course, you can
6721 bind it to a key yourself.
6722 If you want to use this function, then, you should simply enter it in the
6728 : This is very much an `advanced feature'.
6733 recommended that you save your work before using this function.
6738 recommended that you not attempt to edit your layout while simultaneously
6739 working on a document that you care about.
6740 Use a test document.
6741 Syntax errors and the like in your layout file could cause peculiar behavior.
6742 In particular, such errors could cause LyX to regard the current layout
6743 as invalid and to attempt to switch to some other layout.
6744 The LyX team strives to keep LyX stable in such situations, but safe is
6748 \begin_layout Subsection
6752 \begin_layout Standard
6753 The first non-comment line must contain the file format number:
6756 \begin_layout Description
6757 \begin_inset Flex CharStyle:Code
6760 \begin_layout Plain Layout
6767 \begin_inset Flex CharStyle:Code
6770 \begin_layout Plain Layout
6776 ] This tag was introduced with LyX 1.4.0 (layout files of LyX 1.3.x and earlier
6777 don't have an explicit file format).
6778 The file format that is documented here is format 14.
6781 \begin_layout Subsection
6782 General text class parameters
6785 \begin_layout Standard
6786 These are the general parameters which describe the form of the entire document:
6789 \begin_layout Description
6790 \begin_inset Flex CharStyle:Code
6793 \begin_layout Plain Layout
6799 Adds information to the document preamble.
6801 \begin_inset Quotes eld
6805 \begin_inset Flex CharStyle:Code
6808 \begin_layout Plain Layout
6815 \begin_inset Quotes erd
6821 \begin_layout Description
6822 \begin_inset Flex CharStyle:Code
6825 \begin_layout Plain Layout
6831 Describes various global options supported by the document class.
6833 \begin_inset space ~
6837 \begin_inset CommandInset ref
6839 reference "sub:ClassOptions"
6845 \begin_inset Quotes eld
6849 \begin_inset Flex CharStyle:Code
6852 \begin_layout Plain Layout
6859 \begin_inset Quotes erd
6865 \begin_layout Description
6866 \begin_inset Flex CharStyle:Code
6869 \begin_layout Plain Layout
6876 \begin_inset Flex CharStyle:Code
6879 \begin_layout Plain Layout
6888 \begin_inset Flex CharStyle:Code
6891 \begin_layout Plain Layout
6897 ] Whether the class should default to having one or two columns.
6898 Can be changed in the
6899 \begin_inset Flex CharStyle:MenuItem
6902 \begin_layout Plain Layout
6903 Document\SpecialChar \menuseparator
6912 \begin_layout Description
6913 \begin_inset Flex CharStyle:Code
6916 \begin_layout Plain Layout
6922 This sequence defines a new counter.
6924 \begin_inset space ~
6928 \begin_inset CommandInset ref
6930 reference "sub:Counters"
6936 \begin_inset Quotes eld
6940 \begin_inset Flex CharStyle:Code
6943 \begin_layout Plain Layout
6950 \begin_inset Quotes erd
6956 \begin_layout Description
6957 \begin_inset Flex CharStyle:Code
6960 \begin_layout Plain Layout
6966 Sets the default font used to display the document.
6968 \begin_inset space ~
6972 \begin_inset CommandInset ref
6974 reference "sub:Font-description"
6978 for how to declare fonts.
6980 \begin_inset Quotes eld
6984 \begin_inset Flex CharStyle:Code
6987 \begin_layout Plain Layout
6994 \begin_inset Quotes erd
7000 \begin_layout Description
7001 \begin_inset Flex CharStyle:Code
7004 \begin_layout Plain Layout
7011 \begin_inset Flex CharStyle:Code
7014 \begin_layout Plain Layout
7020 Specifies a module to be included by default with this document class,
7021 which should be specified by filename without the
7022 \begin_inset Flex CharStyle:Code
7025 \begin_layout Plain Layout
7032 The user can still remove the module, but it will be active at the outset.
7033 (This applies only when new files are created, or when this class is chosen
7034 for an existing document.)
7037 \begin_layout Description
7038 \begin_inset Flex CharStyle:Code
7041 \begin_layout Plain Layout
7048 \begin_inset Flex CharStyle:Code
7051 \begin_layout Plain Layout
7057 ] This is the style that will be assigned to new paragraphs, usually
7058 \begin_inset Flex CharStyle:MenuItem
7061 \begin_layout Plain Layout
7068 This will default to the first defined style if not given, but you are
7069 highly encouraged to use this directive.
7072 \begin_layout Description
7073 \begin_inset Flex CharStyle:Code
7076 \begin_layout Plain Layout
7083 \begin_inset Flex CharStyle:Code
7086 \begin_layout Plain Layout
7092 ] Indicates that the module in question—which should be specified by filename
7094 \begin_inset Flex CharStyle:Code
7097 \begin_layout Plain Layout
7103 extension—cannot be used with this document class.
7104 This might be used in a journal-specific layout file to prevent, say, the
7106 \begin_inset Flex CharStyle:Code
7109 \begin_layout Plain Layout
7115 module that numbers theorems by section.
7120 be used in a module.
7121 Modules have their own way of excluding other modules (see
7122 \begin_inset CommandInset ref
7124 reference "sub:Layout-modules"
7131 \begin_layout Description
7132 \begin_inset Flex CharStyle:Code
7135 \begin_layout Plain Layout
7141 Defines a new float.
7143 \begin_inset space ~
7147 \begin_inset CommandInset ref
7149 reference "sub:Floats"
7155 \begin_inset Quotes eld
7159 \begin_inset Flex CharStyle:Code
7162 \begin_layout Plain Layout
7169 \begin_inset Quotes erd
7175 \begin_layout Description
7176 \begin_inset Flex CharStyle:Code
7179 \begin_layout Plain Layout
7185 As its name implies, this command allows you to include another layout
7186 definition file within yours to avoid duplicating commands.
7187 Common examples are the standard layout files, for example,
7188 \begin_inset Flex CharStyle:Code
7191 \begin_layout Plain Layout
7197 , which contains most of the basic layouts.
7200 \begin_layout Description
7201 \begin_inset Flex CharStyle:Code
7204 \begin_layout Plain Layout
7210 This section (re-)defines the layout of an inset.
7211 It can be applied to an existing inset of to a new, user-defined inset,
7213 \begin_inset space \thinspace{}
7217 \begin_inset space \space{}
7220 a new character style.
7222 \begin_inset space ~
7226 \begin_inset CommandInset ref
7228 reference "sub:Flex-insets-and"
7232 for more information.
7234 \begin_inset Quotes eld
7238 \begin_inset Flex CharStyle:Code
7241 \begin_layout Plain Layout
7248 \begin_inset Quotes erd
7254 \begin_layout Description
7255 \begin_inset Flex CharStyle:Code
7258 \begin_layout Plain Layout
7264 A string that indicates the width of the left margin on the screen, for
7266 \begin_inset Quotes eld
7270 \begin_inset Quotes erd
7276 \begin_layout Description
7277 \begin_inset Flex CharStyle:Code
7280 \begin_layout Plain Layout
7286 This command deletes an existing float.
7287 This is particularly useful when you want to suppress a float that has
7288 be defined in an input file.
7291 \begin_layout Description
7292 \begin_inset Flex CharStyle:Code
7295 \begin_layout Plain Layout
7301 This command deletes an existing style.
7302 This is particularly useful when you want to suppress a style that has
7303 be defined in an input file.
7306 \begin_layout Description
7307 \begin_inset Flex CharStyle:Code
7310 \begin_layout Plain Layout
7316 A string indicating what sort of output documents using this class will
7318 At present, the options are: `docbook', `latex', and `literate'.
7321 \begin_layout Description
7322 \begin_inset Flex CharStyle:Code
7325 \begin_layout Plain Layout
7336 \begin_inset Flex CharStyle:Code
7339 \begin_layout Plain Layout
7350 \begin_inset Flex CharStyle:Code
7353 \begin_layout Plain Layout
7360 \begin_inset Flex CharStyle:Code
7363 \begin_layout Plain Layout
7369 ] The class default pagestyle.
7370 Can be changed in the
7371 \begin_inset Flex CharStyle:MenuItem
7374 \begin_layout Plain Layout
7375 Document\SpecialChar \menuseparator
7384 \begin_layout Description
7385 \begin_inset Flex CharStyle:Code
7388 \begin_layout Plain Layout
7394 Sets the preamble for the LaTeX document.
7395 Note that this will completely override any prior
7396 \begin_inset Flex CharStyle:Code
7399 \begin_layout Plain Layout
7406 \begin_inset Flex CharStyle:Code
7409 \begin_layout Plain Layout
7417 \begin_inset Quotes eld
7421 \begin_inset Flex CharStyle:Code
7424 \begin_layout Plain Layout
7431 \begin_inset Quotes erd
7437 \begin_layout Description
7438 \begin_inset Flex CharStyle:Code
7441 \begin_layout Plain Layout
7448 \begin_inset Flex CharStyle:Code
7451 \begin_layout Plain Layout
7458 \begin_inset Flex CharStyle:Code
7461 \begin_layout Plain Layout
7470 \begin_inset Flex CharStyle:Code
7473 \begin_layout Plain Layout
7479 ] Whether the class already provides the feature
7480 \begin_inset Flex CharStyle:Code
7483 \begin_layout Plain Layout
7490 A feature is in general the name of a package (
7491 \begin_inset Flex CharStyle:Code
7494 \begin_layout Plain Layout
7501 \begin_inset Flex CharStyle:Code
7504 \begin_layout Plain Layout
7510 , \SpecialChar \ldots{}
7512 \begin_inset Flex CharStyle:Code
7515 \begin_layout Plain Layout
7522 \begin_inset Flex CharStyle:Code
7525 \begin_layout Plain Layout
7531 ,\SpecialChar \ldots{}
7532 ); the complete list of supported features is unfortunately not documented
7533 outside the LyX source code—but see
7534 \begin_inset Flex CharStyle:Code
7537 \begin_layout Plain Layout
7543 if you're interested.
7545 \begin_inset Flex CharStyle:MenuItem
7548 \begin_layout Plain Layout
7549 Help\SpecialChar \menuseparator
7555 also gives an overview of the supported packages.
7558 \begin_layout Description
7559 \begin_inset Flex CharStyle:Code
7562 \begin_layout Plain Layout
7569 \begin_inset Flex CharStyle:Code
7572 \begin_layout Plain Layout
7578 ] Indicates that this layout provides the functionality of the module mentioned,
7579 which should be specified by the filename without the
7580 \begin_inset Flex CharStyle:Code
7583 \begin_layout Plain Layout
7590 This will typically be used if the layout includes the module directly,
7591 rather than using the
7592 \begin_inset Flex CharStyle:Code
7595 \begin_layout Plain Layout
7601 tag to indicate that it ought to be used.
7602 It could be used in a module that provided an alternate implementation
7603 of the same functionality.
7606 \begin_layout Description
7607 \begin_inset Flex CharStyle:Code
7610 \begin_layout Plain Layout
7617 \begin_inset Flex CharStyle:Code
7620 \begin_layout Plain Layout
7626 ] Whether the class requires the feature
7627 \begin_inset Flex CharStyle:Code
7630 \begin_layout Plain Layout
7637 Multiple features must be separated by commas.
7638 Note that you can only request supported features.
7641 \begin_layout Description
7642 \begin_inset Flex CharStyle:Code
7645 \begin_layout Plain Layout
7651 A string that indicates the width of the right margin on the screen, for
7653 \begin_inset Quotes eld
7657 \begin_inset Quotes erd
7663 \begin_layout Description
7664 \begin_inset Flex CharStyle:Code
7667 \begin_layout Plain Layout
7673 Sets which divisions get numbered.
7675 \begin_inset Flex CharStyle:Code
7678 \begin_layout Plain Layout
7687 \begin_layout Description
7688 \begin_inset Flex CharStyle:Code
7691 \begin_layout Plain Layout
7700 \begin_inset Flex CharStyle:Code
7703 \begin_layout Plain Layout
7714 \begin_inset Flex CharStyle:Code
7717 \begin_layout Plain Layout
7723 ] Whether the class-default should be printing on one or both sides of the
7725 Can be changed in the
7726 \begin_inset Flex CharStyle:MenuItem
7729 \begin_layout Plain Layout
7730 Document\SpecialChar \menuseparator
7739 \begin_layout Description
7740 \begin_inset Flex CharStyle:Code
7743 \begin_layout Plain Layout
7749 This sequence defines a new paragraph style.
7750 If the style already exists, it will redefine some of its parameters instead.
7752 \begin_inset space ~
7756 \begin_inset CommandInset ref
7758 reference "sub:Paragraph-Styles"
7764 \begin_inset Quotes eld
7768 \begin_inset Flex CharStyle:Code
7771 \begin_layout Plain Layout
7778 \begin_inset Quotes erd
7784 \begin_layout Description
7785 \begin_inset Flex CharStyle:Code
7788 \begin_layout Plain Layout
7795 \begin_inset Flex CharStyle:Code
7798 \begin_layout Plain Layout
7804 ] The name of the command or environment to be used with
7805 \begin_inset Flex CharStyle:Code
7808 \begin_layout Plain Layout
7817 \begin_layout Description
7818 \begin_inset Flex CharStyle:Code
7821 \begin_layout Plain Layout
7828 \begin_inset Flex CharStyle:Code
7831 \begin_layout Plain Layout
7840 \begin_inset Flex CharStyle:Code
7843 \begin_layout Plain Layout
7849 ] Indicates what kind of markup is used to define the title of a document.
7851 \begin_inset Flex CharStyle:Code
7854 \begin_layout Plain Layout
7860 means that the macro with name
7861 \begin_inset Flex CharStyle:Code
7864 \begin_layout Plain Layout
7870 will be inserted after the last layout which has
7871 \begin_inset Quotes eld
7875 \begin_inset Flex CharStyle:Code
7878 \begin_layout Plain Layout
7885 \begin_inset Quotes erd
7890 \begin_inset Flex CharStyle:Code
7893 \begin_layout Plain Layout
7899 corresponds to the case where the block of paragraphs which have
7900 \begin_inset Quotes eld
7904 \begin_inset Flex CharStyle:Code
7907 \begin_layout Plain Layout
7914 \begin_inset Quotes erd
7917 should be enclosed into the
7918 \begin_inset Flex CharStyle:Code
7921 \begin_layout Plain Layout
7930 \begin_layout Description
7931 \begin_inset Flex CharStyle:Code
7934 \begin_layout Plain Layout
7940 Sets which divisions are included in the table of contents.
7942 \begin_inset Flex CharStyle:Code
7945 \begin_layout Plain Layout
7954 \begin_layout Subsection
7955 \begin_inset Flex CharStyle:Code
7958 \begin_layout Plain Layout
7965 \begin_inset CommandInset label
7967 name "sub:ClassOptions"
7974 \begin_layout Standard
7976 \begin_inset Flex CharStyle:Code
7979 \begin_layout Plain Layout
7985 section can contain the following entries:
7988 \begin_layout Description
7989 \begin_inset Flex CharStyle:Code
7992 \begin_layout Plain Layout
7999 \begin_inset Flex CharStyle:Code
8002 \begin_layout Plain Layout
8008 ] The list of available font sizes for the document's main font, separated
8010 \begin_inset Quotes eld
8014 \begin_inset Flex CharStyle:Code
8017 \begin_layout Plain Layout
8024 \begin_inset Quotes erd
8030 \begin_layout Description
8031 \begin_inset Flex CharStyle:Code
8034 \begin_layout Plain Layout
8040 Used to set the DTD line with XML-based output classes.
8042 \begin_inset space \thinspace{}
8046 \begin_inset Quotes eld
8049 -//OASIS//DTD DocBook V4.2//EN
8050 \begin_inset Quotes erd
8056 \begin_layout Description
8057 \begin_inset Flex CharStyle:Code
8060 \begin_layout Plain Layout
8067 \begin_inset Flex CharStyle:Code
8070 \begin_layout Plain Layout
8071 string="empty|plain|headings|fancy"
8076 ] The list of available page styles, separated by
8077 \begin_inset Quotes eld
8081 \begin_inset Flex CharStyle:Code
8084 \begin_layout Plain Layout
8091 \begin_inset Quotes erd
8097 \begin_layout Description
8098 \begin_inset Flex CharStyle:Code
8101 \begin_layout Plain Layout
8108 \begin_inset Flex CharStyle:Code
8111 \begin_layout Plain Layout
8117 ] Some document class options, separated by a comma, that will be added
8118 to the optional part of the
8119 \begin_inset Flex CharStyle:Code
8122 \begin_layout Plain Layout
8133 \begin_layout Standard
8135 \begin_inset Flex CharStyle:Code
8138 \begin_layout Plain Layout
8144 section must end with
8145 \begin_inset Quotes eld
8149 \begin_inset Flex CharStyle:Code
8152 \begin_layout Plain Layout
8159 \begin_inset Quotes erd
8165 \begin_layout Subsection
8167 \begin_inset CommandInset label
8169 name "sub:Paragraph-Styles"
8176 \begin_layout Standard
8177 A paragraph style description looks like this:
8181 \begin_layout Plain Layout
8182 Note that this will either define a new layout or modify an existing one.
8190 \begin_layout LyX-Code
8197 \begin_layout LyX-Code
8201 \begin_layout LyX-Code
8205 \begin_layout Standard
8206 where the following commands are allowed:
8209 \begin_layout Description
8210 \begin_inset Flex CharStyle:Code
8213 \begin_layout Plain Layout
8220 \begin_inset Flex CharStyle:Code
8223 \begin_layout Plain Layout
8228 , left, right, center
8233 ] Paragraph alignment.
8236 \begin_layout Description
8237 \begin_inset Flex CharStyle:Code
8240 \begin_layout Plain Layout
8247 \begin_inset Flex CharStyle:Code
8250 \begin_layout Plain Layout
8255 , left, right, center
8260 ] A comma separated list of permitted alignments.
8261 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
8263 For example a right-aligned or centered enumeration isn't possible.)
8266 \begin_layout Description
8267 \begin_inset Flex CharStyle:Code
8270 \begin_layout Plain Layout
8277 \begin_inset Flex CharStyle:Code
8280 \begin_layout Plain Layout
8290 \begin_layout Plain Layout
8291 Note that a `float' here is a real number, such as: 1.5.
8296 The vertical space with which the last of a chain of paragraphs with this
8297 layout is separated from the following paragraph.
8298 If the next paragraph has another layout, the separations are not simply
8299 added, but the maximum is taken.
8302 \begin_layout Description
8303 \begin_inset Flex CharStyle:Code
8306 \begin_layout Plain Layout
8313 \begin_inset Flex CharStyle:Code
8316 \begin_layout Plain Layout
8322 The category for this style.
8323 This is used to group related styles in the Layout combobox on the toolbar.
8324 Any string can be used, but you may want to use existing categories with
8329 \begin_layout Description
8330 \begin_inset Flex CharStyle:Code
8333 \begin_layout Plain Layout
8339 Depth of XML command.
8340 Used only with XML-type formats.
8343 \begin_layout Description
8344 \begin_inset Flex CharStyle:Code
8347 \begin_layout Plain Layout
8354 \begin_inset CommandInset label
8356 name "des:CopyStyle"
8361 \begin_inset Flex CharStyle:Code
8364 \begin_layout Plain Layout
8370 Copies all the features of an existing style into the current one.
8374 \begin_layout Description
8375 \begin_inset Flex CharStyle:Code
8378 \begin_layout Plain Layout
8384 The name of a style whose preamble should be output
8389 This allows to ensure some ordering of the preamble snippets when macros
8390 definitions depend on one another.
8394 \begin_layout Plain Layout
8395 Note that, besides that functionality, there is no way to ensure any ordering
8397 The ordering that you see in a given version of LyX may change without
8398 warning in later versions.
8406 \begin_layout Description
8407 \begin_inset Flex CharStyle:Code
8410 \begin_layout Plain Layout
8417 \begin_inset Flex CharStyle:Code
8420 \begin_layout Plain Layout
8425 , Box, Filled_Box, Static
8430 ] The type of label that stands at the end of the paragraph (or sequence
8432 \begin_inset Flex CharStyle:Code
8435 \begin_layout Plain Layout
8442 \begin_inset Flex CharStyle:Code
8445 \begin_layout Plain Layout
8452 \begin_inset Flex CharStyle:Code
8455 \begin_layout Plain Layout
8462 \begin_inset Flex CharStyle:Code
8465 \begin_layout Plain Layout
8473 \begin_inset Flex CharStyle:Code
8476 \begin_layout Plain Layout
8483 \begin_inset Quotes eld
8487 \begin_inset Quotes erd
8491 \begin_inset Flex CharStyle:Code
8494 \begin_layout Plain Layout
8501 \begin_inset Flex CharStyle:Code
8504 \begin_layout Plain Layout
8505 \begin_inset space ~
8514 \begin_inset space ~
8517 black) square suitable for end of proof markers,
8518 \begin_inset Flex CharStyle:Code
8521 \begin_layout Plain Layout
8527 is an explicit text string.
8530 \begin_layout Description
8531 \begin_inset Flex CharStyle:Code
8534 \begin_layout Plain Layout
8541 \begin_inset Flex CharStyle:Code
8544 \begin_layout Plain Layout
8550 ] The string used for a label with a
8551 \begin_inset Flex CharStyle:Code
8554 \begin_layout Plain Layout
8561 \begin_inset Flex CharStyle:Code
8564 \begin_layout Plain Layout
8574 \begin_layout Description
8575 \begin_inset Flex CharStyle:Code
8578 \begin_layout Plain Layout
8585 \begin_inset Flex CharStyle:Code
8588 \begin_layout Plain Layout
8599 \begin_inset Flex CharStyle:Code
8602 \begin_layout Plain Layout
8611 \begin_layout Description
8612 \begin_inset Flex CharStyle:Code
8615 \begin_layout Plain Layout
8622 \begin_inset Flex CharStyle:Code
8625 \begin_layout Plain Layout
8635 ] With this parameter the
8636 \begin_inset Flex CharStyle:MenuItem
8639 \begin_layout Plain Layout
8646 \begin_inset Quotes eld
8649 Vertical space above
8650 \begin_inset Quotes erd
8654 \begin_inset Flex CharStyle:MenuItem
8657 \begin_layout Plain Layout
8658 Edit\SpecialChar \menuseparator
8660 \begin_inset space ~
8668 dialog can be set when initializing a paragraph with this style.
8672 \begin_layout Plain Layout
8675 Note from Jean-Marc:
8677 I'm not sure that this setting has much use, and it should probably be
8678 removed in later versions.
8686 \begin_layout Description
8687 \begin_inset Flex CharStyle:Code
8690 \begin_layout Plain Layout
8696 The font used for both the text body
8702 \begin_inset space ~
8706 \begin_inset CommandInset ref
8708 reference "sub:Font-description"
8713 Note that defining this font automatically defines the
8714 \begin_inset Flex CharStyle:Code
8717 \begin_layout Plain Layout
8724 So you should define this one first if you also want to define
8725 \begin_inset Flex CharStyle:Code
8728 \begin_layout Plain Layout
8737 \begin_layout Description
8738 \begin_inset Flex CharStyle:Code
8741 \begin_layout Plain Layout
8748 \begin_inset CommandInset label
8750 name "des:FreeSpacing"
8757 \begin_inset Flex CharStyle:Code
8760 \begin_layout Plain Layout
8771 \begin_inset Flex CharStyle:Code
8774 \begin_layout Plain Layout
8780 ] Usually LyX doesn't allow you to insert more than one space between words,
8781 since a space is considered as the separation between two words, not a
8782 character or symbol of its own.
8783 This is a very fine thing but sometimes annoying, for example, when typing
8784 program code or plain LaTeX code.
8786 \begin_inset Flex CharStyle:Code
8789 \begin_layout Plain Layout
8796 Note that LyX will create protected blanks for the additional blanks when
8797 in another mode than LaTeX-mode.
8800 \begin_layout Description
8801 \begin_inset Flex CharStyle:Code
8804 \begin_layout Plain Layout
8810 Language dependent information to be included in the LaTeX preamble when
8812 Note that this will completely override any prior
8813 \begin_inset Flex CharStyle:Code
8816 \begin_layout Plain Layout
8824 \begin_inset Quotes eld
8828 \begin_inset Flex CharStyle:Code
8831 \begin_layout Plain Layout
8838 \begin_inset Quotes erd
8842 The contents of this tag will occur once in the LaTeX preamble for each
8843 language used by the document.
8844 Each time, the following substitutions are made:
8848 \begin_layout Itemize
8849 \begin_inset Flex CharStyle:Code
8852 \begin_layout Plain Layout
8858 is replaced by the language name (as used by the babel package).
8861 \begin_layout Itemize
8863 \begin_inset Quotes eld
8867 \begin_inset Quotes erd
8871 \begin_inset Flex CharStyle:Code
8874 \begin_layout Plain Layout
8880 replaces its argument by the translation of the argument to the current
8884 \begin_layout Standard
8885 This preamble snippet will only be used if the document contains more than
8886 one language and the babel package is used.
8890 \begin_layout Description
8891 \begin_inset Flex CharStyle:Code
8894 \begin_layout Plain Layout
8901 \begin_inset Flex CharStyle:Code
8904 \begin_layout Plain Layout
8910 , but this preamble snippet occurs independently from the babel package,
8911 and only for the document language.
8913 \begin_inset Quotes eld
8917 \begin_inset Flex CharStyle:Code
8920 \begin_layout Plain Layout
8927 \begin_inset Quotes erd
8934 \begin_layout Standard
8935 If the style defines text that appears in the typeset document, it may use
8937 \begin_inset Flex CharStyle:Code
8940 \begin_layout Plain Layout
8947 \begin_inset Flex CharStyle:Code
8950 \begin_layout Plain Layout
8956 to support non-english and even multilanguage documents correctly.
8957 The following excerpt (from the
8958 \begin_inset Flex CharStyle:Code
8961 \begin_layout Plain Layout
8967 file) shows how this works:
8970 \begin_layout LyX-Code
8974 \begin_layout LyX-Code
8977 theoremstyle{remark}
8980 \begin_layout LyX-Code
8983 newtheorem{claim}[thm]{
8990 \begin_layout LyX-Code
8994 \begin_layout LyX-Code
8998 \begin_layout LyX-Code
9003 claimname}{_(Claim)}
9006 \begin_layout LyX-Code
9010 \begin_layout LyX-Code
9014 \begin_layout LyX-Code
9018 \begin_layout LyX-Code
9027 claimname}{_(Claim)}}
9030 \begin_layout LyX-Code
9034 \begin_layout Standard
9035 The key to correct translation of the user visible text is the definition
9037 \begin_inset Flex CharStyle:Code
9040 \begin_layout Plain Layout
9048 in the language preamble.
9049 This command holds the name of the theorem that will appear in the output.
9051 \begin_inset Flex CharStyle:Code
9054 \begin_layout Plain Layout
9060 then uses the commands offered by the babel package to redefine
9061 \begin_inset Flex CharStyle:Code
9064 \begin_layout Plain Layout
9072 for each used language in multilanguage documents.
9076 \begin_layout Description
9077 \begin_inset Flex CharStyle:Code
9080 \begin_layout Plain Layout
9086 [[FIXME]] (Used only with XML-type formats.)
9089 \begin_layout Description
9090 \begin_inset Flex CharStyle:Code
9093 \begin_layout Plain Layout
9100 \begin_inset Flex CharStyle:Code
9103 \begin_layout Plain Layout
9109 If 1, marks the layout as being part of a title block (see also the
9110 \begin_inset Flex CharStyle:Code
9113 \begin_layout Plain Layout
9120 \begin_inset Flex CharStyle:Code
9123 \begin_layout Plain Layout
9132 \begin_layout Description
9133 \begin_inset Flex CharStyle:Code
9136 \begin_layout Plain Layout
9143 \begin_inset Flex CharStyle:Code
9146 \begin_layout Plain Layout
9152 ] This provides extra space between paragraphs that have the same layout.
9153 If you put other layouts into an environment, each is separated with the
9155 \begin_inset Flex CharStyle:Code
9158 \begin_layout Plain Layout
9165 But the whole items of the environment are additionally separated with
9167 \begin_inset Flex CharStyle:Code
9170 \begin_layout Plain Layout
9182 \begin_layout Description
9183 \begin_inset Flex CharStyle:Code
9186 \begin_layout Plain Layout
9192 [[FIXME]] (Used only with XML-type formats.)
9195 \begin_layout Description
9196 \begin_inset Flex CharStyle:Code
9199 \begin_layout Plain Layout
9206 \begin_inset CommandInset label
9208 name "des:KeepEmpty"
9215 \begin_inset Flex CharStyle:Code
9218 \begin_layout Plain Layout
9229 \begin_inset Flex CharStyle:Code
9232 \begin_layout Plain Layout
9238 ] Usually LyX does not allow you to leave a paragraph empty, since it would
9239 lead to empty LaTeX output.
9240 There are some cases where this could be desirable however: in a letter
9241 template, the required fields can be provided as empty fields, so that
9242 people do not forget them; in some special classes, a layout can be used
9243 as some kind of break, which does not contain actual text.
9246 \begin_layout Description
9247 \begin_inset Flex CharStyle:Code
9250 \begin_layout Plain Layout
9256 [float=0] The vertical space between the label and the text body.
9257 Only used for labels that are above the text body (
9258 \begin_inset Flex CharStyle:Code
9261 \begin_layout Plain Layout
9268 \begin_inset Flex CharStyle:Code
9271 \begin_layout Plain Layout
9272 Centered_Top_Environment
9280 \begin_layout Description
9281 \begin_inset Flex CharStyle:Code
9284 \begin_layout Plain Layout
9291 \begin_inset Flex CharStyle:Code
9294 \begin_layout Plain Layout
9301 \begin_inset Newline newline
9304 The name of the counter for automatic numbering (see Section
9305 \begin_inset CommandInset ref
9307 reference "sub:Counters"
9312 This must be given if
9313 \begin_inset Flex CharStyle:Code
9316 \begin_layout Plain Layout
9323 \begin_inset Flex CharStyle:Code
9326 \begin_layout Plain Layout
9335 \begin_layout Description
9336 \begin_inset Flex CharStyle:Code
9339 \begin_layout Plain Layout
9345 The font used for the label.
9347 \begin_inset space ~
9351 \begin_inset CommandInset ref
9353 reference "sub:Font-description"
9360 \begin_layout Description
9361 \begin_inset Flex CharStyle:Code
9364 \begin_layout Plain Layout
9370 Text that indicates how far a label should be indented.
9373 \begin_layout Description
9374 \begin_inset Flex CharStyle:Code
9377 \begin_layout Plain Layout
9384 \begin_inset Flex CharStyle:Code
9387 \begin_layout Plain Layout
9393 ] The horizontal space between the label and the text body.
9394 Only used for labels that are not above the text body.
9397 \begin_layout Description
9398 \begin_inset Flex CharStyle:Code
9401 \begin_layout Plain Layout
9408 \begin_inset Flex CharStyle:Code
9411 \begin_layout Plain Layout
9417 ] The string used for a label with a
9418 \begin_inset Flex CharStyle:Code
9421 \begin_layout Plain Layout
9429 \begin_inset Flex CharStyle:Code
9432 \begin_layout Plain Layout
9438 is set, this string can be contain the special formatting commands described
9440 \begin_inset CommandInset ref
9442 reference "sub:Counters"
9450 \begin_layout Plain Layout
9451 For the sake of backwards compatibility, the string
9452 \begin_inset Flex CharStyle:Code
9455 \begin_layout Plain Layout
9465 will be replaced by the expanded
9466 \begin_inset Flex CharStyle:Code
9469 \begin_layout Plain Layout
9476 \begin_inset Flex CharStyle:Code
9479 \begin_layout Plain Layout
9488 This feature is now obsolete and should be replaced by the mechanisms of
9490 \begin_inset CommandInset ref
9492 reference "sub:Counters"
9504 \begin_layout Description
9505 \begin_inset Flex CharStyle:Code
9508 \begin_layout Plain Layout
9515 \begin_inset Flex CharStyle:Code
9518 \begin_layout Plain Layout
9524 ] This is used inside the appendix instead of
9525 \begin_inset Flex CharStyle:Code
9528 \begin_layout Plain Layout
9536 \begin_inset Flex CharStyle:Code
9539 \begin_layout Plain Layout
9546 \begin_inset Flex CharStyle:Code
9549 \begin_layout Plain Layout
9558 \begin_layout Description
9559 \begin_inset Flex CharStyle:Code
9562 \begin_layout Plain Layout
9568 [FIXME] (Used only with XML-type formats.)
9571 \begin_layout Description
9572 \begin_inset Flex CharStyle:Code
9575 \begin_layout Plain Layout
9582 \begin_inset Flex CharStyle:Code
9585 \begin_layout Plain Layout
9590 , Manual, Static, Top_Environment,
9591 \begin_inset Newline newline
9594 Centered_Top_Environment, Sensitive, Counter
9600 \begin_inset Newline newline
9604 \begin_inset Flex CharStyle:Code
9607 \begin_layout Plain Layout
9613 means the label is the very first word (up to the first real blank).
9617 \begin_layout Plain Layout
9618 Use protected spaces if you want more than one word as the label.
9624 \begin_inset Flex CharStyle:Code
9627 \begin_layout Plain Layout
9633 means it is defined in the layout (see
9634 \begin_inset Flex CharStyle:Code
9637 \begin_layout Plain Layout
9645 \begin_inset Flex CharStyle:Code
9648 \begin_layout Plain Layout
9655 \begin_inset Flex CharStyle:Code
9658 \begin_layout Plain Layout
9659 Centered_Top_Environment
9664 are special cases of
9665 \begin_inset Flex CharStyle:Code
9668 \begin_layout Plain Layout
9675 The label will be printed above the paragraph, but only at the top of an
9676 environment or the top of a chain of paragraphs with this layout.
9677 Usage is for example the
9678 \begin_inset Flex CharStyle:MenuItem
9681 \begin_layout Plain Layout
9688 \begin_inset Flex CharStyle:MenuItem
9691 \begin_layout Plain Layout
9698 This is also the case for
9699 \begin_inset Flex CharStyle:Code
9702 \begin_layout Plain Layout
9708 labels with latex type
9709 \begin_inset Flex CharStyle:Code
9712 \begin_layout Plain Layout
9718 , in order to make layouts for theorems work correctly.
9720 \begin_inset Flex CharStyle:Code
9723 \begin_layout Plain Layout
9729 is a special case for the caption-labels
9730 \begin_inset Quotes eld
9734 \begin_inset Quotes erd
9738 \begin_inset Quotes eld
9742 \begin_inset Quotes erd
9747 \begin_inset Flex CharStyle:Code
9750 \begin_layout Plain Layout
9756 means the (hardcoded) label string depends on the kind of float.
9758 \begin_inset Flex CharStyle:Code
9761 \begin_layout Plain Layout
9767 label type defines automatically numbered labels.
9769 \begin_inset CommandInset ref
9771 reference "sub:Counters"
9778 \begin_layout Description
9779 \begin_inset Flex CharStyle:Code
9782 \begin_layout Plain Layout
9788 The name of the corresponding LaTeX stuff.
9789 Either the environment or command name.
9792 \begin_layout Description
9793 \begin_inset Flex CharStyle:Code
9796 \begin_layout Plain Layout
9802 An optional parameter for the corresponding
9803 \begin_inset Flex CharStyle:Code
9806 \begin_layout Plain Layout
9813 This parameter cannot be changed from within LyX.
9816 \begin_layout Description
9817 \begin_inset Flex CharStyle:Code
9820 \begin_layout Plain Layout
9827 \begin_inset CommandInset label
9829 name "des:LatexType"
9834 \begin_inset Flex CharStyle:Code
9837 \begin_layout Plain Layout
9842 , Command, Environment, Item_Environment,
9848 \begin_inset Flex CharStyle:Code
9851 \begin_layout Plain Layout
9857 ] How the layout should be translated into LaTeX.
9859 \begin_inset Flex CharStyle:Code
9862 \begin_layout Plain Layout
9868 means nothing special.
9870 \begin_inset Flex CharStyle:Code
9873 \begin_layout Plain Layout
9880 \begin_inset Flex CharStyle:Code
9883 \begin_layout Plain Layout
9890 {\SpecialChar \ldots{}
9897 \begin_inset Flex CharStyle:Code
9900 \begin_layout Plain Layout
9907 \begin_inset Flex CharStyle:Code
9910 \begin_layout Plain Layout
9917 }\SpecialChar \ldots{}
9931 \begin_inset Flex CharStyle:Code
9934 \begin_layout Plain Layout
9941 \begin_inset Flex CharStyle:Code
9944 \begin_layout Plain Layout
9951 \begin_inset Flex CharStyle:Code
9954 \begin_layout Plain Layout
9962 is generated for each paragraph of this environment.
9964 \begin_inset Flex CharStyle:Code
9967 \begin_layout Plain Layout
9974 \begin_inset Flex CharStyle:Code
9977 \begin_layout Plain Layout
9984 \begin_inset Flex CharStyle:Code
9987 \begin_layout Plain Layout
9993 is passed as an argument to the environment.
9995 \begin_inset Flex CharStyle:Code
9998 \begin_layout Plain Layout
10004 can be defined in the
10005 \begin_inset Flex CharStyle:MenuItem
10008 \begin_layout Plain Layout
10013 ayout\SpecialChar \menuseparator
10025 \begin_inset Flex CharStyle:Code
10028 \begin_layout Plain Layout
10036 is perhaps a bit misleading, since these rules apply to SGML classes, too.
10037 Visit the SGML class files for specific examples.
10040 \begin_layout Standard
10041 Putting the last few things together, the LaTeX output will be either:
10044 \begin_layout LyX-Code
10047 latexname[latexparam]{\SpecialChar \ldots{}
10051 \begin_layout Standard
10055 \begin_layout LyX-Code
10058 begin{latexname}[latexparam] \SpecialChar \ldots{}
10064 \begin_layout Standard
10065 depending upon the LaTeX type.
10068 \begin_layout Description
10069 \begin_inset Flex CharStyle:Code
10072 \begin_layout Plain Layout
10079 \begin_inset Flex CharStyle:Code
10082 \begin_layout Plain Layout
10088 ] If you put layouts into environments, the leftmargins are not simply added,
10089 but added with a factor
10090 \begin_inset Formula $\frac{4}{depth+4}$
10094 Note that this parameter is also used when the margin is defined as
10095 \begin_inset Flex CharStyle:Code
10098 \begin_layout Plain Layout
10105 \begin_inset Flex CharStyle:Code
10108 \begin_layout Plain Layout
10115 Then it is added to the manual or dynamic margin.
10117 \begin_inset Newline newline
10120 The argument is passed as a string.
10122 \begin_inset Quotes eld
10126 \begin_inset Flex CharStyle:Code
10129 \begin_layout Plain Layout
10136 \begin_inset Quotes erd
10139 means that the paragraph is indented with the width of
10140 \begin_inset Quotes eld
10144 \begin_inset Flex CharStyle:Code
10147 \begin_layout Plain Layout
10154 \begin_inset Quotes erd
10157 in the normal font.
10158 You can get a negative width by prefixing the string with
10159 \begin_inset Quotes eld
10163 \begin_inset Flex CharStyle:Code
10166 \begin_layout Plain Layout
10173 \begin_inset Quotes erd
10177 This way was chosen so that the look is the same with each used screen
10182 \begin_layout Description
10183 \begin_inset Flex CharStyle:Code
10186 \begin_layout Plain Layout
10193 \begin_inset Flex CharStyle:Code
10196 \begin_layout Plain Layout
10201 , Manual, Dynamic, First_Dynamic, Right_Address_Box
10207 \begin_inset Newline newline
10210 The kind of margin that the layout has on the left side.
10212 \begin_inset Flex CharStyle:Code
10215 \begin_layout Plain Layout
10221 just means a fixed margin.
10223 \begin_inset Flex CharStyle:Code
10226 \begin_layout Plain Layout
10232 means that the left margin depends on the string entered in the
10233 \begin_inset Flex CharStyle:MenuItem
10236 \begin_layout Plain Layout
10237 Edit\SpecialChar \menuseparator
10239 \begin_inset space ~
10248 This is used to typeset nice lists without tabulators.
10250 \begin_inset Flex CharStyle:Code
10253 \begin_layout Plain Layout
10259 means that the margin depends on the size of the label.
10260 This is used for automatic enumerated headlines.
10261 It is obvious that the headline
10262 \begin_inset Quotes eld
10265 5.4.3.2.1 Very long headline
10266 \begin_inset Quotes erd
10269 must have a wider left margin (as wide as
10270 \begin_inset Quotes eld
10274 \begin_inset Quotes erd
10277 plus the space) than
10278 \begin_inset Quotes eld
10281 3.2 Very long headline
10282 \begin_inset Quotes erd
10286 \begin_inset Quotes eld
10290 \begin_inset Quotes erd
10293 are not able to do this.
10295 \begin_inset Flex CharStyle:Code
10298 \begin_layout Plain Layout
10304 is similar, but only the very first row of the paragraph is dynamic, while
10305 the others are static; this is used, for example, for descriptions.
10307 \begin_inset Flex CharStyle:Code
10310 \begin_layout Plain Layout
10316 means the margin is chosen in a way that the longest row of this paragraph
10317 fits to the right margin.
10318 This is used to typeset an address on the right edge of the page.
10321 \begin_layout Description
10322 \begin_inset Flex CharStyle:Code
10325 \begin_layout Plain Layout
10332 \begin_inset Flex CharStyle:Code
10335 \begin_layout Plain Layout
10344 \begin_inset Flex CharStyle:Code
10347 \begin_layout Plain Layout
10353 ] Whether fragile commands in this layout should be
10354 \begin_inset Flex CharStyle:Code
10357 \begin_layout Plain Layout
10370 whether this command should itself be protected.)
10373 \begin_layout Description
10374 \begin_inset Flex CharStyle:Code
10377 \begin_layout Plain Layout
10384 \begin_inset Flex CharStyle:Code
10387 \begin_layout Plain Layout
10394 \begin_inset Flex CharStyle:Code
10397 \begin_layout Plain Layout
10405 ] Whether newlines are translated into LaTeX newlines (
10406 \begin_inset Flex CharStyle:Code
10409 \begin_layout Plain Layout
10420 The translation can be switched off to allow more comfortable LaTeX editing
10424 \begin_layout Description
10425 \begin_inset Flex CharStyle:Code
10428 \begin_layout Plain Layout
10435 \begin_inset Flex CharStyle:Code
10438 \begin_layout Plain Layout
10445 \begin_inset Flex CharStyle:Code
10448 \begin_layout Plain Layout
10456 ] Whether the following Paragraph is allowed to indent its very first row.
10458 \begin_inset Flex CharStyle:Code
10461 \begin_layout Plain Layout
10467 means that it is not allowed to do so;
10468 \begin_inset Flex CharStyle:Code
10471 \begin_layout Plain Layout
10477 means it could do so if it wants to.
10480 \begin_layout Description
10481 \begin_inset Flex CharStyle:Code
10484 \begin_layout Plain Layout
10490 Name of a layout that has replaced this layout.
10491 This is used to rename a layout, while keeping backward compatibility.
10494 \begin_layout Description
10495 \begin_inset Flex CharStyle:Code
10498 \begin_layout Plain Layout
10505 \begin_inset Flex CharStyle:Code
10508 \begin_layout Plain Layout
10514 ] The number of optional arguments that can be used with this layout.
10515 This is useful for things like section headings, and only makes sense with
10519 \begin_layout Description
10520 \begin_inset Flex CharStyle:Code
10523 \begin_layout Plain Layout
10530 \begin_inset Flex CharStyle:Code
10533 \begin_layout Plain Layout
10539 ] The indent of the very first line of a paragraph.
10541 \begin_inset Flex CharStyle:Code
10544 \begin_layout Plain Layout
10550 will be fixed for a certain layout.
10551 The exception is Standard layout, since the indentation of a Standard layout
10552 paragraph can be prohibited with
10553 \begin_inset Flex CharStyle:Code
10556 \begin_layout Plain Layout
10563 Also, Standard layout paragraphs inside environments use the
10564 \begin_inset Flex CharStyle:Code
10567 \begin_layout Plain Layout
10573 of the environment, not their native one.
10574 For example, Standard paragraphs inside an enumeration are not indented.
10577 \begin_layout Description
10578 \begin_inset Flex CharStyle:Code
10581 \begin_layout Plain Layout
10588 \begin_inset Flex CharStyle:Code
10591 \begin_layout Plain Layout
10597 ] The vertical space between two paragraphs of this layout.
10600 \begin_layout Description
10601 \begin_inset Flex CharStyle:Code
10604 \begin_layout Plain Layout
10611 \begin_inset Flex CharStyle:Code
10614 \begin_layout Plain Layout
10620 ] LyX allows the user to choose either
10621 \begin_inset Quotes eld
10625 \begin_inset Quotes erd
10629 \begin_inset Quotes eld
10633 \begin_inset Quotes erd
10636 to typeset a document.
10638 \begin_inset Quotes eld
10642 \begin_inset Quotes erd
10645 is chosen, this value is completely ignored.
10647 \begin_inset Quotes eld
10651 \begin_inset Quotes erd
10654 is chosen, the parindent of a LaTeXtype
10655 \begin_inset Quotes eld
10659 \begin_inset Quotes erd
10662 layout is ignored and all paragraphs are separated by this parskip argument.
10663 The vertical space is calculated with
10664 \begin_inset Flex CharStyle:Code
10667 \begin_layout Plain Layout
10669 \begin_inset space ~
10678 \begin_inset Flex CharStyle:Code
10681 \begin_layout Plain Layout
10687 is the height of a row with the normal font.
10688 This way, the look stays the same with different screen fonts.
10691 \begin_layout Description
10692 \begin_inset Flex CharStyle:Code
10695 \begin_layout Plain Layout
10702 \begin_inset CommandInset label
10704 name "des:PathThru"
10711 \begin_inset Flex CharStyle:Code
10714 \begin_layout Plain Layout
10725 \begin_inset Flex CharStyle:Code
10728 \begin_layout Plain Layout
10734 ] Whether the contents of this paragraph should be output in raw form, meaning
10735 without special translations that LaTeX would require.
10738 \begin_layout Description
10739 \begin_inset Flex CharStyle:Code
10742 \begin_layout Plain Layout
10749 \begin_inset CommandInset label
10751 name "des:Preamble"
10755 Information to be included in the LaTeX preamble when this style is used.
10756 Used to define macros, load packages, etc., required by this particular
10759 \begin_inset Quotes eld
10763 \begin_inset Flex CharStyle:Code
10766 \begin_layout Plain Layout
10773 \begin_inset Quotes erd
10779 \begin_layout Description
10780 \begin_inset Flex CharStyle:Code
10783 \begin_layout Plain Layout
10790 \begin_inset Flex CharStyle:Code
10793 \begin_layout Plain Layout
10800 \begin_inset CommandInset label
10802 name "des:Requires"
10806 Whether the layout requires the feature
10807 \begin_inset Flex CharStyle:Code
10810 \begin_layout Plain Layout
10817 See the description of
10818 \begin_inset Flex CharStyle:Code
10821 \begin_layout Plain Layout
10828 \begin_inset CommandInset ref
10829 LatexCommand pageref
10830 reference "des:FreeSpacing"
10834 ) for information on `features'.
10838 \begin_layout Description
10839 \begin_inset Flex CharStyle:Code
10842 \begin_layout Plain Layout
10849 \begin_inset Flex CharStyle:Code
10852 \begin_layout Plain Layout
10859 \begin_inset Flex CharStyle:Code
10862 \begin_layout Plain Layout
10871 \begin_layout Description
10872 \begin_inset Flex CharStyle:Code
10875 \begin_layout Plain Layout
10882 \begin_inset Flex CharStyle:Code
10885 \begin_layout Plain Layout
10890 , onehalf, double, other
10899 ] This defines what the default spacing should be in the layout.
10901 \begin_inset Flex CharStyle:Code
10904 \begin_layout Plain Layout
10911 \begin_inset Flex CharStyle:Code
10914 \begin_layout Plain Layout
10921 \begin_inset Flex CharStyle:Code
10924 \begin_layout Plain Layout
10930 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
10931 If you specify the argument
10932 \begin_inset Flex CharStyle:Code
10935 \begin_layout Plain Layout
10941 , then you should also provide a numerical argument which will be the actual
10943 Note that, contrary to other parameters,
10944 \begin_inset Flex CharStyle:Code
10947 \begin_layout Plain Layout
10953 implies the generation of specific LaTeX code, using the package
10956 \begin_inset Flex CharStyle:Code
10959 \begin_layout Plain Layout
10968 \begin_layout Description
10969 \begin_inset Flex CharStyle:Code
10972 \begin_layout Plain Layout
10978 The font used for the text body .
10980 \begin_inset CommandInset ref
10982 reference "sub:Font-description"
10989 \begin_layout Description
10990 \begin_inset Flex CharStyle:Code
10993 \begin_layout Plain Layout
11001 The level of the style in the table of contents.
11002 This is used for automatic numbering of section headings.
11005 \begin_layout Description
11006 \begin_inset Flex CharStyle:Code
11009 \begin_layout Plain Layout
11016 \begin_inset Flex CharStyle:Code
11019 \begin_layout Plain Layout
11025 ] The vertical space with which the very first of a chain of paragraphs
11026 with this layout is separated from the previous paragraph.
11027 If the previous paragraph has another layout, the separations are not simply
11028 added, but the maximum is taken.
11031 \begin_layout Subsection
11033 \begin_inset CommandInset label
11042 \begin_layout Standard
11043 Since version 1.3.0 of LyX, it is has been both possible and necessary to
11044 define the floats (
11045 \begin_inset Flex CharStyle:MenuItem
11048 \begin_layout Plain Layout
11055 \begin_inset Flex CharStyle:MenuItem
11058 \begin_layout Plain Layout
11064 , \SpecialChar \ldots{}
11065 ) in the text class itself.
11066 Standard floats are included in the file
11067 \begin_inset Flex CharStyle:Code
11070 \begin_layout Plain Layout
11076 , so you may have to do no more than add
11079 \begin_layout LyX-Code
11080 Input stdfloats.inc
11083 \begin_layout Standard
11084 to your layout file.
11085 If you want to implement a text class that proposes some other float types
11086 (like the AGU class bundled with LyX), the information below will hopefully
11090 \begin_layout Description
11091 \begin_inset Flex CharStyle:Code
11094 \begin_layout Plain Layout
11101 \begin_inset Flex CharStyle:Code
11104 \begin_layout Plain Layout
11111 \begin_inset Quotes erd
11115 \begin_inset Quotes erd
11118 ] The file name extension of an auxiliary file for the list of figures (or
11120 LaTeX writes the captions to this file.
11123 \begin_layout Description
11124 \begin_inset Flex CharStyle:Code
11127 \begin_layout Plain Layout
11134 \begin_inset Flex CharStyle:Code
11137 \begin_layout Plain Layout
11144 \begin_inset Quotes erd
11148 \begin_inset Quotes erd
11151 ] The string that will be used in the menus and also for the caption.
11154 \begin_layout Description
11155 \begin_inset Flex CharStyle:Code
11158 \begin_layout Plain Layout
11165 \begin_inset Flex CharStyle:Code
11168 \begin_layout Plain Layout
11177 \begin_inset Flex CharStyle:Code
11180 \begin_layout Plain Layout
11187 \begin_inset Flex CharStyle:Code
11190 \begin_layout Plain Layout
11196 if the float is already defined by the LaTeX document class.
11198 \begin_inset Flex CharStyle:Code
11201 \begin_layout Plain Layout
11207 , the float will be defined using the LaTeX package
11208 \begin_inset Flex CharStyle:Code
11211 \begin_layout Plain Layout
11220 \begin_layout Description
11221 \begin_inset Flex CharStyle:Code
11224 \begin_layout Plain Layout
11231 \begin_inset Flex CharStyle:Code
11234 \begin_layout Plain Layout
11241 \begin_inset Quotes erd
11245 \begin_inset Quotes erd
11248 ] The heading used for the list of floats.
11251 \begin_layout Description
11252 \begin_inset Flex CharStyle:Code
11255 \begin_layout Plain Layout
11262 \begin_inset Flex CharStyle:Code
11265 \begin_layout Plain Layout
11272 \begin_inset Quotes erd
11276 \begin_inset Quotes erd
11279 ] This (optional) argument determines whether floats of this class will
11280 be numbered within some sectional unit of the document.
11281 For example, if within is equal to
11282 \begin_inset Flex CharStyle:Code
11285 \begin_layout Plain Layout
11291 , the floats will be numbered within chapters.
11295 \begin_layout Description
11296 \begin_inset Flex CharStyle:Code
11299 \begin_layout Plain Layout
11306 \begin_inset Flex CharStyle:Code
11309 \begin_layout Plain Layout
11316 \begin_inset Quotes erd
11320 \begin_inset Quotes erd
11323 ] The default placement for the given class of floats.
11324 The string should be as in standard LaTeX:
11325 \begin_inset Flex CharStyle:Code
11328 \begin_layout Plain Layout
11335 \begin_inset Flex CharStyle:Code
11338 \begin_layout Plain Layout
11345 \begin_inset Flex CharStyle:Code
11348 \begin_layout Plain Layout
11355 \begin_inset Flex CharStyle:Code
11358 \begin_layout Plain Layout
11364 for top, bottom, page, and here, respectively.
11368 \begin_layout Plain Layout
11369 Note that the order of these letters in the string is irrelevant, like in
11375 On top of that there is a new type,
11376 \begin_inset Flex CharStyle:Code
11379 \begin_layout Plain Layout
11385 , which does not really correspond to a float, since it means: put it
11386 \begin_inset Quotes eld
11390 \begin_inset Quotes erd
11394 Note however that the
11395 \begin_inset Flex CharStyle:Code
11398 \begin_layout Plain Layout
11404 specifier is special and, because of implementation details, cannot be
11405 used in non-built in float types.
11406 If you do not understand what this means, just use
11407 \begin_inset Quotes eld
11411 \begin_inset Flex CharStyle:Code
11414 \begin_layout Plain Layout
11421 \begin_inset Quotes erd
11427 \begin_layout Description
11428 \begin_inset Flex CharStyle:Code
11431 \begin_layout Plain Layout
11438 \begin_inset Flex CharStyle:Code
11441 \begin_layout Plain Layout
11448 \begin_inset Quotes erd
11452 \begin_inset Quotes erd
11455 ] The style used when defining the float using
11456 \begin_inset Flex CharStyle:Code
11459 \begin_layout Plain Layout
11470 \begin_layout Description
11471 \begin_inset Flex CharStyle:Code
11474 \begin_layout Plain Layout
11481 \begin_inset Flex CharStyle:Code
11484 \begin_layout Plain Layout
11491 \begin_inset Quotes erd
11495 \begin_inset Quotes erd
11499 \begin_inset Quotes eld
11503 \begin_inset Quotes erd
11506 of the new class of floats, like program or algorithm.
11507 After the appropriate
11508 \begin_inset Flex CharStyle:Code
11511 \begin_layout Plain Layout
11520 \begin_inset Flex CharStyle:Code
11523 \begin_layout Plain Layout
11532 \begin_inset Flex CharStyle:Code
11535 \begin_layout Plain Layout
11546 \begin_layout Standard
11547 Note that defining a float with type
11548 \begin_inset Flex CharStyle:Code
11551 \begin_layout Plain Layout
11559 automatically defines the corresponding counter with name
11560 \begin_inset Flex CharStyle:Code
11563 \begin_layout Plain Layout
11574 \begin_layout Subsection
11575 Flex insets and InsetLayout
11576 \begin_inset CommandInset label
11578 name "sub:Flex-insets-and"
11585 \begin_layout Standard
11586 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
11587 these are called Flex insets.
11591 \begin_layout Standard
11592 Flex insets come in three different kinds:
11595 \begin_layout Itemize
11597 \begin_inset Flex CharStyle:Code
11600 \begin_layout Plain Layout
11606 ): These define semantic markup corresponding to such LaTeX commands as
11608 \begin_inset Flex CharStyle:Code
11611 \begin_layout Plain Layout
11620 \begin_inset Flex CharStyle:Code
11623 \begin_layout Plain Layout
11634 \begin_layout Itemize
11636 \begin_inset Flex CharStyle:Code
11639 \begin_layout Plain Layout
11645 ): These can be used to define custom collapsible insets, similar to TeX
11646 code, footnote, and the like.
11647 An obvious example is an endnote inset, which is defined in the
11648 \begin_inset Flex CharStyle:Code
11651 \begin_layout Plain Layout
11660 \begin_layout Itemize
11662 \begin_inset Flex CharStyle:Code
11665 \begin_layout Plain Layout
11671 ): For use with DocBook classes.
11674 \begin_layout Standard
11675 Flex insets are defined using the
11676 \begin_inset Flex CharStyle:Code
11679 \begin_layout Plain Layout
11685 tag, which shall be explained in a moment.
11688 \begin_layout Standard
11690 \begin_inset Flex CharStyle:Code
11693 \begin_layout Plain Layout
11699 tag also serves another function: It can be used to customize the general
11700 layout of many different types of insets.
11702 \begin_inset Flex CharStyle:Code
11705 \begin_layout Plain Layout
11711 can be used to customize the layout parameters for footnotes, marginal
11712 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
11713 boxes, tables, algorithms, URLs, and optional arguments, as well as to
11714 define Flex insets.
11717 \begin_layout Standard
11719 \begin_inset Flex CharStyle:Code
11722 \begin_layout Plain Layout
11728 definition must begin with a line of the form:
11731 \begin_layout LyX-Code
11735 \begin_layout Standard
11737 \begin_inset Flex CharStyle:Code
11740 \begin_layout Plain Layout
11746 indicates the inset whose layout is being defined, and here there are two
11750 \begin_layout Enumerate
11751 The layout for a pre-existing inset is being modified.
11752 In this case, can be
11753 \begin_inset Flex CharStyle:Code
11756 \begin_layout Plain Layout
11762 any one of the following:
11763 \begin_inset Flex CharStyle:Code
11766 \begin_layout Plain Layout
11773 \begin_inset Flex CharStyle:Code
11776 \begin_layout Plain Layout
11783 \begin_inset Flex CharStyle:Code
11786 \begin_layout Plain Layout
11793 \begin_inset Flex CharStyle:Code
11796 \begin_layout Plain Layout
11803 \begin_inset Flex CharStyle:Code
11806 \begin_layout Plain Layout
11813 \begin_inset Flex CharStyle:Code
11816 \begin_layout Plain Layout
11823 \begin_inset Flex CharStyle:Code
11826 \begin_layout Plain Layout
11833 \begin_inset Flex CharStyle:Code
11836 \begin_layout Plain Layout
11843 \begin_inset Flex CharStyle:Code
11846 \begin_layout Plain Layout
11853 \begin_inset Flex CharStyle:Code
11856 \begin_layout Plain Layout
11863 \begin_inset Flex CharStyle:Code
11866 \begin_layout Plain Layout
11873 \begin_inset Flex CharStyle:Code
11876 \begin_layout Plain Layout
11883 \begin_inset Flex CharStyle:Code
11886 \begin_layout Plain Layout
11893 \begin_inset Flex CharStyle:Code
11896 \begin_layout Plain Layout
11903 \begin_inset Flex CharStyle:Code
11906 \begin_layout Plain Layout
11913 \begin_inset Flex CharStyle:Code
11916 \begin_layout Plain Layout
11923 \begin_inset Flex CharStyle:Code
11926 \begin_layout Plain Layout
11933 \begin_inset Flex CharStyle:Code
11936 \begin_layout Plain Layout
11943 \begin_inset Flex CharStyle:Code
11946 \begin_layout Plain Layout
11953 \begin_inset Flex CharStyle:Code
11956 \begin_layout Plain Layout
11966 \begin_layout Enumerate
11967 The layout for a Flex inset is being defined.
11969 \begin_inset Flex CharStyle:Code
11972 \begin_layout Plain Layout
11978 can be any valid identifier not used by a pre-existing inset.
11979 Note that the definition of a flex inset must
11984 \begin_inset Flex CharStyle:Code
11987 \begin_layout Plain Layout
11996 \begin_layout Standard
11998 \begin_inset Flex CharStyle:Code
12001 \begin_layout Plain Layout
12007 definition can contain the following entries:
12010 \begin_layout Description
12011 \begin_inset Flex CharStyle:Code
12014 \begin_layout Plain Layout
12020 The color for the inset's background.
12021 The valid colors are defined in
12022 \begin_inset Flex CharStyle:Code
12025 \begin_layout Plain Layout
12034 \begin_layout Description
12035 \begin_inset Flex CharStyle:Code
12038 \begin_layout Plain Layout
12044 As with paragraph styles (see page
12045 \begin_inset CommandInset ref
12047 reference "des:CopyStyle"
12054 \begin_layout Description
12055 \begin_inset Flex CharStyle:Code
12058 \begin_layout Plain Layout
12065 \begin_inset Flex CharStyle:Code
12068 \begin_layout Plain Layout
12077 \begin_inset Flex CharStyle:Code
12080 \begin_layout Plain Layout
12086 ] Indicates whether the user may employ the Paragraph Settings dialog to
12087 customize the paragraph.
12090 \begin_layout Description
12091 \begin_inset Flex CharStyle:Code
12094 \begin_layout Plain Layout
12101 \begin_inset Flex CharStyle:Code
12104 \begin_layout Plain Layout
12111 \begin_inset Flex CharStyle:Code
12114 \begin_layout Plain Layout
12121 \begin_inset Flex CharStyle:Code
12124 \begin_layout Plain Layout
12130 , describing the rendering style used for the inset's frame and buttons.
12131 Footnotes generally use
12132 \begin_inset Flex CharStyle:Code
12135 \begin_layout Plain Layout
12141 , ERT insets generally
12142 \begin_inset Flex CharStyle:Code
12145 \begin_layout Plain Layout
12151 , and character styles
12152 \begin_inset Flex CharStyle:Code
12155 \begin_layout Plain Layout
12164 \begin_layout Description
12165 \begin_inset Flex CharStyle:Code
12168 \begin_layout Plain Layout
12174 Required at the end of the InsetLayout declarations.
12177 \begin_layout Description
12178 \begin_inset Flex CharStyle:Code
12181 \begin_layout Plain Layout
12187 The font used for both the text body
12193 \begin_inset space ~
12197 \begin_inset CommandInset ref
12199 reference "sub:Font-description"
12204 Note that defining this font automatically defines the
12205 \begin_inset Flex CharStyle:Code
12208 \begin_layout Plain Layout
12214 to the same value, so define this first and define
12215 \begin_inset Flex CharStyle:Code
12218 \begin_layout Plain Layout
12224 later if you want them to be different.
12227 \begin_layout Description
12228 \begin_inset Flex CharStyle:Code
12231 \begin_layout Plain Layout
12238 \begin_inset Quotes eld
12242 \begin_inset Quotes erd
12245 language, leading to Left-to-Right (latin) output, e.
12246 \begin_inset space \thinspace{}
12250 \begin_inset space \space{}
12253 in TeX code or URL.
12257 \begin_layout Description
12258 \begin_inset Flex CharStyle:Code
12261 \begin_layout Plain Layout
12268 \begin_inset Flex CharStyle:Code
12271 \begin_layout Plain Layout
12280 \begin_inset Flex CharStyle:Code
12283 \begin_layout Plain Layout
12289 ] Indicates whether the PlainLayout should be used or, instead, the user
12290 can change the paragraph style used in the inset.
12293 \begin_layout Description
12294 \begin_inset Flex CharStyle:Code
12297 \begin_layout Plain Layout
12303 As with paragraph styles (see page
12304 \begin_inset CommandInset ref
12305 LatexCommand pageref
12306 reference "des:FreeSpacing"
12313 \begin_layout Description
12314 \begin_inset Flex CharStyle:Code
12317 \begin_layout Plain Layout
12324 \begin_inset Flex CharStyle:Code
12327 \begin_layout Plain Layout
12336 \begin_inset Flex CharStyle:Code
12339 \begin_layout Plain Layout
12345 ] Whether to include the contents of this inset in the strings generated
12346 for the `Outline' pane.
12347 One would not, for example, want the content of a footnote in a section
12348 header to be included in the TOC displayed in the outline, but one would
12349 normally want the content of a character style displayed.
12350 Default is false: not to include.
12353 \begin_layout Description
12354 \begin_inset Flex CharStyle:Code
12357 \begin_layout Plain Layout
12363 As with paragraph styles (see page
12364 \begin_inset CommandInset ref
12365 LatexCommand pageref
12366 reference "des:KeepEmpty"
12373 \begin_layout Description
12374 \begin_inset Flex CharStyle:Code
12377 \begin_layout Plain Layout
12383 The font used for the label.
12385 \begin_inset space ~
12389 \begin_inset CommandInset ref
12391 reference "sub:Font-description"
12396 Note that this definition can never appear before
12397 \begin_inset Flex CharStyle:Code
12400 \begin_layout Plain Layout
12406 , lest it be ineffective.
12409 \begin_layout Description
12410 \begin_inset Flex CharStyle:Code
12413 \begin_layout Plain Layout
12419 What will be displayed on the button or elsewhere as the inset label.
12420 Some inset types (TeX code and Branch) modify this label on the fly.
12423 \begin_layout Description
12424 \begin_inset Flex CharStyle:Code
12427 \begin_layout Plain Layout
12433 The name of the corresponding LaTeX stuff.
12434 Either the environment or command name.
12437 \begin_layout Description
12438 \begin_inset Flex CharStyle:Code
12441 \begin_layout Plain Layout
12447 The optional parameter for the corresponding
12448 \begin_inset Flex CharStyle:Code
12451 \begin_layout Plain Layout
12457 stuff, including possible bracket pairs like
12458 \begin_inset Flex CharStyle:Code
12461 \begin_layout Plain Layout
12468 This parameter cannot be changed from within LyX.
12471 \begin_layout Description
12472 \begin_inset Flex CharStyle:Code
12475 \begin_layout Plain Layout
12481 As with paragraph styles (see page
12482 \begin_inset CommandInset ref
12483 LatexCommand pageref
12484 reference "des:LatexType"
12491 \begin_layout Description
12492 \begin_inset Flex CharStyle:Code
12495 \begin_layout Plain Layout
12502 \begin_inset Flex CharStyle:Code
12505 \begin_layout Plain Layout
12512 \begin_inset Flex CharStyle:Code
12515 \begin_layout Plain Layout
12522 \begin_inset Flex CharStyle:Code
12525 \begin_layout Plain Layout
12532 \begin_inset Flex CharStyle:Code
12535 \begin_layout Plain Layout
12541 (indicating a dummy definition ending definitions of charstyles, etc).
12542 This entry is required in and is only meaningful for Flex insets.
12543 Among other things, it determines on which menu this inset will appear.
12546 \begin_layout Description
12547 \begin_inset Flex CharStyle:Code
12550 \begin_layout Plain Layout
12557 \begin_inset Flex CharStyle:Code
12560 \begin_layout Plain Layout
12569 \begin_inset Flex CharStyle:Code
12572 \begin_layout Plain Layout
12578 ] Whether multiple paragraphs are permitted in this inset.
12579 This will also set CustomPars to the same value and ForcePlain to the opposite
12581 These can be reset to other values, if they are used
12588 \begin_layout Description
12589 \begin_inset Flex CharStyle:Code
12592 \begin_layout Plain Layout
12599 \begin_inset Flex CharStyle:Code
12602 \begin_layout Plain Layout
12611 \begin_inset Flex CharStyle:Code
12614 \begin_layout Plain Layout
12620 ] Whether fragile commands in this layout should be
12621 \begin_inset Flex CharStyle:Code
12624 \begin_layout Plain Layout
12637 whether the command should itself be protected.)
12640 \begin_layout Description
12641 \begin_inset Flex CharStyle:Code
12644 \begin_layout Plain Layout
12651 \begin_inset Flex CharStyle:Code
12654 \begin_layout Plain Layout
12663 \begin_inset Flex CharStyle:Code
12666 \begin_layout Plain Layout
12672 ] As with paragraph styles (see page
12673 \begin_inset CommandInset ref
12675 reference "des:PathThru"
12682 \begin_layout Description
12683 \begin_inset Flex CharStyle:Code
12686 \begin_layout Plain Layout
12692 As with paragraph styles (see page
12693 \begin_inset CommandInset ref
12694 LatexCommand pageref
12695 reference "des:Preamble"
12702 \begin_layout Description
12703 \begin_inset Flex CharStyle:Code
12706 \begin_layout Plain Layout
12713 \begin_inset Flex CharStyle:Code
12716 \begin_layout Plain Layout
12722 ] As with paragraph styles (see page
12723 \begin_inset CommandInset ref
12724 LatexCommand pageref
12725 reference "des:Requires"
12732 \begin_layout Subsection
12734 \begin_inset CommandInset label
12736 name "sub:Counters"
12743 \begin_layout Standard
12744 Since version 1.3.0 of LyX, it is both possible and necessary to define the
12746 \begin_inset Flex CharStyle:MenuItem
12749 \begin_layout Plain Layout
12756 \begin_inset Flex CharStyle:MenuItem
12759 \begin_layout Plain Layout
12765 , \SpecialChar \ldots{}
12766 ) in the text class itself.
12767 The standard counters are defined in the file
12768 \begin_inset Flex CharStyle:Code
12771 \begin_layout Plain Layout
12777 , so you may have to do no more than add
12780 \begin_layout LyX-Code
12781 Input stdcounters.inc
12784 \begin_layout Standard
12785 to your layout file to get them to work.
12786 But if you want to define custom counters, then you can do so.
12787 The counter declaration must begin with:
12790 \begin_layout LyX-Code
12794 \begin_layout Standard
12795 where of course `name' is replaced by the name of the counter.
12796 And it must end with
12797 \begin_inset Quotes eld
12801 \begin_inset Flex CharStyle:Code
12804 \begin_layout Plain Layout
12811 \begin_inset Quotes erd
12815 The following parameters can also be used:
12818 \begin_layout Description
12819 \begin_inset Flex CharStyle:Code
12822 \begin_layout Plain Layout
12823 LabelString [string=""]
12828 when this is defined, this string defines how the counter is displayed.
12829 Setting this value sets
12830 \begin_inset Flex CharStyle:Code
12833 \begin_layout Plain Layout
12834 LabelStringAppendix
12840 The following special constructs can be used in the string:
12844 \begin_layout Itemize
12845 \begin_inset Flex CharStyle:Code
12848 \begin_layout Plain Layout
12856 will be replaced by the expansion of the
12857 \begin_inset Flex CharStyle:Code
12860 \begin_layout Plain Layout
12867 \begin_inset Flex CharStyle:Code
12870 \begin_layout Plain Layout
12871 LabelStringAppendix
12877 \begin_inset Flex CharStyle:Code
12880 \begin_layout Plain Layout
12890 \begin_layout Itemize
12891 counter values can be expressed using LaTeX-like macros
12892 \begin_inset Flex CharStyle:Code
12895 \begin_layout Plain Layout
12912 \begin_inset Flex CharStyle:Code
12915 \begin_layout Plain Layout
12927 \begin_layout Plain Layout
12937 Actually, the situation is a bit more complicated: any
12956 other than those described below will produce arabic numerals.
12957 It would not be surprising to see this change in the future.
12963 \begin_inset Flex CharStyle:Code
12966 \begin_layout Plain Layout
12972 : 1, 2, 3,\SpecialChar \ldots{}
12974 \begin_inset Flex CharStyle:Code
12977 \begin_layout Plain Layout
12983 for lower-case letters: a, b, c, \SpecialChar \ldots{}
12985 \begin_inset Flex CharStyle:Code
12988 \begin_layout Plain Layout
12994 for upper-case letters: A, B, C, \SpecialChar \ldots{}
12996 \begin_inset Flex CharStyle:Code
12999 \begin_layout Plain Layout
13005 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
13007 \begin_inset Flex CharStyle:Code
13010 \begin_layout Plain Layout
13016 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
13018 \begin_inset Flex CharStyle:Code
13021 \begin_layout Plain Layout
13027 for hebrew numerals.
13031 \begin_layout Standard
13032 If LabelString is not defined, a default value is constructed as follows:
13033 if the counter has a master counter
13034 \begin_inset Flex CharStyle:Code
13037 \begin_layout Plain Layout
13044 \begin_inset Flex CharStyle:Code
13047 \begin_layout Plain Layout
13054 \begin_inset Flex CharStyle:Code
13057 \begin_layout Plain Layout
13067 is used; otherwise the string
13068 \begin_inset Flex CharStyle:Code
13071 \begin_layout Plain Layout
13082 \begin_layout Description
13083 \begin_inset Flex CharStyle:Code
13086 \begin_layout Plain Layout
13087 LabelStringAppendix [string=""]
13093 \begin_inset Flex CharStyle:Code
13096 \begin_layout Plain Layout
13102 , but for use in the Appendix.
13105 \begin_layout Description
13106 \begin_inset Flex CharStyle:Code
13109 \begin_layout Plain Layout
13116 \begin_inset Flex CharStyle:Code
13119 \begin_layout Plain Layout
13126 \begin_inset Quotes erd
13130 \begin_inset Quotes erd
13133 ] If this is set to the name of another counter, the present counter will
13134 be reset every time the other one is increased.
13136 \begin_inset Flex CharStyle:Code
13139 \begin_layout Plain Layout
13146 \begin_inset Flex CharStyle:Code
13149 \begin_layout Plain Layout
13158 \begin_layout Subsection
13160 \begin_inset CommandInset label
13162 name "sub:Font-description"
13169 \begin_layout Standard
13170 A font description looks like this:
13173 \begin_layout LyX-Code
13183 \begin_layout LyX-Code
13187 \begin_layout LyX-Code
13191 \begin_layout Standard
13192 The following commands are available:
13195 \begin_layout Description
13196 \begin_inset Flex CharStyle:Code
13199 \begin_layout Plain Layout
13206 \begin_inset Flex CharStyle:Code
13209 \begin_layout Plain Layout
13218 \begin_inset Flex CharStyle:Code
13221 \begin_layout Plain Layout
13228 \begin_inset Flex CharStyle:Code
13231 \begin_layout Plain Layout
13238 \begin_inset Flex CharStyle:Code
13241 \begin_layout Plain Layout
13248 \begin_inset Flex CharStyle:Code
13251 \begin_layout Plain Layout
13258 \begin_inset Flex CharStyle:Code
13261 \begin_layout Plain Layout
13268 \begin_inset Flex CharStyle:Code
13271 \begin_layout Plain Layout
13278 \begin_inset Flex CharStyle:Code
13281 \begin_layout Plain Layout
13288 \begin_inset Flex CharStyle:Code
13291 \begin_layout Plain Layout
13300 \begin_layout Description
13301 \begin_inset Flex CharStyle:Code
13304 \begin_layout Plain Layout
13313 \begin_inset Flex CharStyle:Code
13316 \begin_layout Plain Layout
13327 \begin_inset Flex CharStyle:Code
13330 \begin_layout Plain Layout
13337 \begin_inset Flex CharStyle:Code
13340 \begin_layout Plain Layout
13349 \begin_layout Description
13350 \begin_inset Flex CharStyle:Code
13353 \begin_layout Plain Layout
13360 \begin_inset Flex CharStyle:Code
13363 \begin_layout Plain Layout
13369 ] Valid argument are:
13370 \begin_inset Flex CharStyle:Code
13373 \begin_layout Plain Layout
13380 \begin_inset Flex CharStyle:Code
13383 \begin_layout Plain Layout
13390 \begin_inset Flex CharStyle:Code
13393 \begin_layout Plain Layout
13400 \begin_inset Flex CharStyle:Code
13403 \begin_layout Plain Layout
13410 \begin_inset Flex CharStyle:Code
13413 \begin_layout Plain Layout
13420 \begin_inset Flex CharStyle:Code
13423 \begin_layout Plain Layout
13430 Each of these turns on or off the corresponding attribute.
13433 \begin_layout Description
13434 \begin_inset Flex CharStyle:Code
13437 \begin_layout Plain Layout
13446 \begin_inset Flex CharStyle:Code
13449 \begin_layout Plain Layout
13460 \begin_inset Flex CharStyle:Code
13463 \begin_layout Plain Layout
13472 \begin_layout Description
13473 \begin_inset Flex CharStyle:Code
13476 \begin_layout Plain Layout
13485 \begin_inset Flex CharStyle:Code
13488 \begin_layout Plain Layout
13499 \begin_inset Flex CharStyle:Code
13502 \begin_layout Plain Layout
13509 \begin_inset Flex CharStyle:Code
13512 \begin_layout Plain Layout
13519 \begin_inset Flex CharStyle:Code
13522 \begin_layout Plain Layout
13531 \begin_layout Description
13532 \begin_inset Flex CharStyle:Code
13535 \begin_layout Plain Layout
13542 \begin_inset Flex CharStyle:Code
13545 \begin_layout Plain Layout
13552 \begin_inset Flex CharStyle:Code
13555 \begin_layout Plain Layout
13562 \begin_inset Flex CharStyle:Code
13565 \begin_layout Plain Layout
13574 \begin_inset Flex CharStyle:Code
13577 \begin_layout Plain Layout
13584 \begin_inset Flex CharStyle:Code
13587 \begin_layout Plain Layout
13594 \begin_inset Flex CharStyle:Code
13597 \begin_layout Plain Layout
13604 \begin_inset Flex CharStyle:Code
13607 \begin_layout Plain Layout
13614 \begin_inset Flex CharStyle:Code
13617 \begin_layout Plain Layout
13626 \begin_layout Subsection
13627 Upgrading old layout files
13630 \begin_layout Standard
13631 The file format of layout files changes from time to time, so old layout
13632 files need to be converted.
13633 This process has been automated since LyX 1.4.0: If LyX reads an old format
13634 layout file it will call the conversion tool
13635 \begin_inset Flex CharStyle:Code
13638 \begin_layout Plain Layout
13639 LyXDir/scripts/layout2layout.py
13644 and convert it to a temporary file in current format.
13645 The original file is left untouched.
13646 If you want to convert the layout file permanently, just call the converter
13650 \begin_layout LyX-Code
13651 python $LyXDir/scripts/layout2layout.py myclass.layout myclassnew.layout
13654 \begin_layout Standard
13655 (You need to replace
13656 \begin_inset Flex CharStyle:Code
13659 \begin_layout Plain Layout
13665 with the name of your LyX system directory, unless you happen to have defined
13666 such an environment variable.) Then copy
13667 \begin_inset Flex CharStyle:Code
13670 \begin_layout Plain Layout
13677 \begin_inset Flex CharStyle:Code
13680 \begin_layout Plain Layout
13689 \begin_layout Standard
13690 The automatic conversion only handles syntax changes.
13691 It cannot handle the case where the contents of included files was changed,
13692 so these will have to be converted separately.
13695 \begin_layout Section
13697 \begin_inset CommandInset label
13699 name "sec:Creating-Templates"
13706 \begin_layout Standard
13707 Templates are created just like usual documents.
13708 The only difference is that usual documents contain all possible settings,
13709 including the font scheme and the paper size.
13710 Usually a user doesn't want a template to overwrite his defaults in these
13712 For that reason, the designer of a template should remove the corresponding
13714 \begin_inset Flex CharStyle:Code
13717 \begin_layout Plain Layout
13726 \begin_inset Flex CharStyle:Code
13729 \begin_layout Plain Layout
13737 from the template LyX file.
13738 This can be done with any simple text-editor, for example
13739 \begin_inset Flex CharStyle:Code
13742 \begin_layout Plain Layout
13749 \begin_inset Flex CharStyle:Code
13752 \begin_layout Plain Layout
13762 \begin_layout Standard
13763 Put the edited template files you create in
13764 \begin_inset Flex CharStyle:Code
13767 \begin_layout Plain Layout
13773 , copy the ones you use from the global template directory in
13774 \begin_inset Flex CharStyle:Code
13777 \begin_layout Plain Layout
13783 to the same place, and redefine the template path in the
13784 \begin_inset Flex CharStyle:MenuItem
13787 \begin_layout Plain Layout
13788 Tools\SpecialChar \menuseparator
13789 Preferences\SpecialChar \menuseparator
13798 \begin_layout Standard
13799 Note that there is a template which has a particular meaning:
13800 \begin_inset Flex CharStyle:Code
13803 \begin_layout Plain Layout
13810 This template is loaded every time you create a new document with
13811 \begin_inset Flex CharStyle:MenuItem
13814 \begin_layout Plain Layout
13815 File\SpecialChar \menuseparator
13821 in order to provide useful defaults.
13822 To create this template from inside LyX, all you have to do is to open
13823 a document with the correct settings, and use the
13824 \begin_inset Flex CharStyle:MenuItem
13827 \begin_layout Plain Layout
13828 Save as Document Defaults
13836 \begin_layout Chapter
13837 Including External Material
13840 \begin_layout Standard
13841 \begin_inset Box Shadowbox
13850 height_special "totalheight"
13853 \begin_layout Plain Layout
13854 WARNING: This portion of the documentation has not been updated for some
13856 We certainly hope that it is still accurate, but there are no guarantees.
13864 \begin_layout Standard
13865 The use of material from sources external to LyX is covered in detail in
13871 This part of the manual covers what needs to happen behind the scenes for
13872 new sorts of material to be included.
13875 \begin_layout Section
13879 \begin_layout Standard
13880 The external material feature is based on the concept of a
13885 A template is a specification of how LyX should interface with a certain
13887 As bundled, LyX comes with predefined templates for Xfig figures, various
13888 raster format images, chess diagrams, and LilyPond music notation.
13889 You can check the actual list by using the menu
13890 \begin_inset Flex CharStyle:MenuItem
13893 \begin_layout Plain Layout
13894 Insert\SpecialChar \menuseparator
13895 File\SpecialChar \menuseparator
13902 Furthermore, it is possible to roll your own template to support a specific
13904 Later we'll describe in more detail what is involved, and hopefully you
13905 will submit all the templates you create so we can include them in a later
13909 \begin_layout Standard
13910 Another basic idea of the external material feature is to distinguish between
13911 the original file that serves as a base for final material and the produced
13912 file that is included in your exported or printed document.
13913 For example, consider the case of a figure produced with
13914 \begin_inset Flex CharStyle:Code
13917 \begin_layout Plain Layout
13924 The Xfig application itself works on an original file with the
13925 \begin_inset Flex CharStyle:Code
13928 \begin_layout Plain Layout
13935 Within Xfig, you create and change your figure, and when you are done,
13937 \begin_inset Flex CharStyle:Code
13940 \begin_layout Plain Layout
13947 When you want to include the figure in your document, you invoke
13948 \begin_inset Flex CharStyle:Code
13951 \begin_layout Plain Layout
13957 in order to create a PostScript file that can readily be included in your
13960 \begin_inset Flex CharStyle:Code
13963 \begin_layout Plain Layout
13969 file is the original file, and the PostScript file is the produced file.
13972 \begin_layout Standard
13973 This distinction is important in order to allow updating of the material
13974 while you are in the process of writing the document.
13975 Furthermore, it provides us with the flexibility that is needed to support
13976 multiple export formats.
13977 For instance, in the case of a plain text file, it is not exactly an award-winn
13978 ing idea to include the figure as raw PostScript.
13979 Instead, you'd either prefer to just include a reference to the figure
13980 or try to invoke some graphics to ASCII converter to make the final result
13981 look similar to the real graphics.
13982 The external material management allows you to do this, because it is parametri
13983 zed on the different export formats that LyX supports.
13986 \begin_layout Standard
13987 Besides supporting the production of different products according to the
13988 exported format, it supports tight integration with editing and viewing
13990 In the case of an Xfig figure, you are able to invoke Xfig on the original
13991 file with a single click from within the external material dialog in LyX,
13992 and also preview the produced PostScript file with Ghostview with another
13994 No more fiddling around with the command line and/or file browsers to locate
13995 and manipulate the original or produced files.
13996 In this way, you are finally able to take full advantage of the many different
13997 applications that are relevant to use when you write your documents, and
13998 ultimately be more productive.
14001 \begin_layout Section
14002 The external template configuration file
14005 \begin_layout Standard
14006 It is relatively easy to add custom external template definitions to LyX.
14007 However, be aware that doing this in an careless manner most probably
14011 introduce an easily exploitable security hole.
14012 So before you do this, please read the discussion about security in section
14014 \begin_inset CommandInset ref
14016 reference "sec:Security-discussion"
14023 \begin_layout Standard
14024 Having said that, we encourage you to submit any interesting templates that
14029 \begin_layout Standard
14030 The external templates are defined in the
14031 \begin_inset Flex CharStyle:Code
14034 \begin_layout Plain Layout
14035 LyXDir/lib/external_templates
14041 You can place your own version in
14042 \begin_inset Flex CharStyle:Code
14045 \begin_layout Plain Layout
14046 UserDir/external_templates
14054 \begin_layout Standard
14055 A typical template looks like this:
14058 \begin_layout LyX-Code
14062 \begin_layout LyX-Code
14063 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
14066 \begin_layout LyX-Code
14070 \begin_layout LyX-Code
14074 \begin_layout LyX-Code
14078 \begin_layout LyX-Code
14082 \begin_layout LyX-Code
14086 \begin_layout LyX-Code
14087 AutomaticProduction true
14090 \begin_layout LyX-Code
14094 \begin_layout LyX-Code
14098 \begin_layout LyX-Code
14102 \begin_layout LyX-Code
14103 TransformCommand Rotate RotationLatexCommand
14106 \begin_layout LyX-Code
14107 TransformCommand Resize ResizeLatexCommand
14110 \begin_layout LyX-Code
14111 Product "$$RotateFront$$ResizeFront
14114 \begin_layout LyX-Code
14119 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
14122 \begin_layout LyX-Code
14123 $$ResizeBack$$RotateBack"
14126 \begin_layout LyX-Code
14130 \begin_layout LyX-Code
14131 UpdateResult "$$AbsPath$$Basename.pstex_t"
14134 \begin_layout LyX-Code
14135 Requirement "graphicx"
14138 \begin_layout LyX-Code
14139 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
14142 \begin_layout LyX-Code
14143 ReferencedFile latex "$$AbsPath$$Basename.eps"
14146 \begin_layout LyX-Code
14147 ReferencedFile dvi "$$AbsPath$$Basename.eps"
14150 \begin_layout LyX-Code
14154 \begin_layout LyX-Code
14158 \begin_layout LyX-Code
14159 TransformCommand Rotate RotationLatexCommand
14162 \begin_layout LyX-Code
14163 TransformCommand Resize ResizeLatexCommand
14166 \begin_layout LyX-Code
14167 Product "$$RotateFront$$ResizeFront
14170 \begin_layout LyX-Code
14175 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
14178 \begin_layout LyX-Code
14179 $$ResizeBack$$RotateBack"
14182 \begin_layout LyX-Code
14183 UpdateFormat pdftex
14186 \begin_layout LyX-Code
14187 UpdateResult "$$AbsPath$$Basename.pdftex_t"
14190 \begin_layout LyX-Code
14191 Requirement "graphicx"
14194 \begin_layout LyX-Code
14195 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
14198 \begin_layout LyX-Code
14199 ReferencedFile latex "$$AbsPath$$Basename.pdf"
14202 \begin_layout LyX-Code
14206 \begin_layout LyX-Code
14210 \begin_layout LyX-Code
14211 Product "$$Contents(
14213 "$$AbsPath$$Basename.asc
14218 \begin_layout LyX-Code
14219 UpdateFormat asciixfig
14222 \begin_layout LyX-Code
14223 UpdateResult "$$AbsPath$$Basename.asc"
14226 \begin_layout LyX-Code
14230 \begin_layout LyX-Code
14234 \begin_layout LyX-Code
14235 Product "<graphic fileref=
14237 "$$AbsOrRelPathMaster$$Basename.eps
14242 \begin_layout LyX-Code
14246 \begin_layout LyX-Code
14250 \begin_layout LyX-Code
14251 UpdateResult "$$AbsPath$$Basename.eps"
14254 \begin_layout LyX-Code
14255 ReferencedFile docbook "$$AbsPath$$Basename.eps"
14258 \begin_layout LyX-Code
14259 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
14262 \begin_layout LyX-Code
14266 \begin_layout LyX-Code
14267 Product "[XFig: $$FName]"
14270 \begin_layout LyX-Code
14274 \begin_layout LyX-Code
14278 \begin_layout Standard
14279 As you can see, the template is enclosed in
14280 \begin_inset Flex CharStyle:Code
14283 \begin_layout Plain Layout
14289 \SpecialChar \ldots{}
14291 \begin_inset Flex CharStyle:Code
14294 \begin_layout Plain Layout
14301 It contains a header specifying some general settings and, for each supported
14302 primary document file format, a section
14303 \begin_inset Flex CharStyle:Code
14306 \begin_layout Plain Layout
14312 \SpecialChar \ldots{}
14314 \begin_inset Flex CharStyle:Code
14317 \begin_layout Plain Layout
14326 \begin_layout Subsection
14327 The template header
14330 \begin_layout Description
14331 \begin_inset Flex CharStyle:Code
14334 \begin_layout Plain Layout
14335 AutomaticProduction
14336 \begin_inset space ~
14344 Whether the file represented by the template must be generated by LyX.
14345 This command must occur exactly once.
14348 \begin_layout Description
14349 \begin_inset Flex CharStyle:Code
14352 \begin_layout Plain Layout
14354 \begin_inset space ~
14362 A glob pattern that is used in the file dialog to filter out the desired
14364 If there is more than one possible file extension (e.
14365 \begin_inset space \thinspace{}
14369 \begin_inset space \space{}
14373 \begin_inset Flex CharStyle:Code
14376 \begin_layout Plain Layout
14383 \begin_inset Flex CharStyle:Code
14386 \begin_layout Plain Layout
14392 ), use something like
14393 \begin_inset Flex CharStyle:Code
14396 \begin_layout Plain Layout
14403 This command must occur exactly once.
14406 \begin_layout Description
14407 \begin_inset Flex CharStyle:Code
14410 \begin_layout Plain Layout
14412 \begin_inset space ~
14420 The text that is displayed on the button.
14421 This command must occur exactly once.
14424 \begin_layout Description
14425 \begin_inset Flex CharStyle:Code
14428 \begin_layout Plain Layout
14430 \begin_inset space ~
14434 \begin_inset space ~
14442 The help text that is used in the External dialog.
14443 Provide enough information to explain to the user just what the template
14444 can provide him with.
14445 This command must occur exactly once.
14448 \begin_layout Description
14449 \begin_inset Flex CharStyle:Code
14452 \begin_layout Plain Layout
14454 \begin_inset space ~
14462 The file format of the original file.
14463 This must be the name of a format that is known to LyX (see section
14464 \begin_inset CommandInset ref
14466 reference "sec:Formats"
14472 \begin_inset Quotes eld
14476 \begin_inset Flex CharStyle:Code
14479 \begin_layout Plain Layout
14486 \begin_inset Quotes erd
14489 if the template can handle original files of more than one format.
14490 LyX will attempt to interrogate the file itself in order to deduce its
14491 format in this case.
14492 This command must occur exactly once.
14495 \begin_layout Description
14496 \begin_inset Flex CharStyle:Code
14499 \begin_layout Plain Layout
14501 \begin_inset space ~
14509 A unique name for the template.
14510 It must not contain substitution macros (see below).
14513 \begin_layout Description
14514 \begin_inset Flex CharStyle:Code
14517 \begin_layout Plain Layout
14519 \begin_inset space ~
14522 Rotate|Resize|Clip|Extra
14527 This command specifies which transformations are supported by this template.
14528 It may occur zero or more times.
14529 This command enables the corresponding tabs in the external dialog.
14531 \begin_inset Flex CharStyle:Code
14534 \begin_layout Plain Layout
14540 command must have either a corresponding
14541 \begin_inset Flex CharStyle:Code
14544 \begin_layout Plain Layout
14551 \begin_inset Flex CharStyle:Code
14554 \begin_layout Plain Layout
14561 \begin_inset Flex CharStyle:Code
14564 \begin_layout Plain Layout
14571 Otherwise the transformation will not be supported by that format.
14574 \begin_layout Subsection
14578 \begin_layout Description
14579 \begin_inset Flex CharStyle:Code
14582 \begin_layout Plain Layout
14584 \begin_inset space ~
14587 LaTeX|PDFLaTeX|PlainText|DocBook
14592 The primary document file format that this format definition is for.
14593 Not every template has a sensible representation in all document file formats.
14594 Please define nevertheless a
14595 \begin_inset Flex CharStyle:Code
14598 \begin_layout Plain Layout
14604 section for all formats.
14605 Use a dummy text when no representation is available.
14606 Then you can at least see a reference to the external material in the exported
14610 \begin_layout Description
14611 \begin_inset Flex CharStyle:Code
14614 \begin_layout Plain Layout
14616 \begin_inset space ~
14620 \begin_inset space ~
14628 This command defines an additional macro
14629 \begin_inset Flex CharStyle:Code
14632 \begin_layout Plain Layout
14638 for substitution in
14639 \begin_inset Flex CharStyle:Code
14642 \begin_layout Plain Layout
14650 \begin_inset Flex CharStyle:Code
14653 \begin_layout Plain Layout
14659 itself may contain substitution macros.
14660 The advantage over using
14661 \begin_inset Flex CharStyle:Code
14664 \begin_layout Plain Layout
14671 \begin_inset Flex CharStyle:Code
14674 \begin_layout Plain Layout
14680 is that the substituted value of
14681 \begin_inset Flex CharStyle:Code
14684 \begin_layout Plain Layout
14690 is sanitized so that it is a valid optional argument in the document format.
14691 This command may occur zero or more times.
14694 \begin_layout Description
14695 \begin_inset Flex CharStyle:Code
14698 \begin_layout Plain Layout
14700 \begin_inset space ~
14708 The text that is inserted in the exported document.
14709 This is actually the most important command and can be quite complex.
14710 This command must occur exactly once.
14713 \begin_layout Description
14714 \begin_inset Flex CharStyle:Code
14717 \begin_layout Plain Layout
14719 \begin_inset space ~
14727 This command specifies a preamble snippet that will be included in the
14729 It has to be defined using
14730 \begin_inset Flex CharStyle:Code
14733 \begin_layout Plain Layout
14739 \SpecialChar \ldots{}
14741 \begin_inset Flex CharStyle:Code
14744 \begin_layout Plain Layout
14751 This command may occur zero or more times.
14754 \begin_layout Description
14755 \begin_inset Flex CharStyle:Code
14758 \begin_layout Plain Layout
14760 \begin_inset space ~
14764 \begin_inset space ~
14772 This command denotes files that are created by the conversion process and
14773 are needed for a particular export format.
14774 If the filename is relative, it is interpreted relative to the master document.
14775 This command may be given zero or more times.
14778 \begin_layout Description
14779 \begin_inset Flex CharStyle:Code
14782 \begin_layout Plain Layout
14784 \begin_inset space ~
14792 The name of a required LaTeX package.
14793 The package is included via
14794 \begin_inset Flex CharStyle:Code
14797 \begin_layout Plain Layout
14805 in the LaTeX preamble.
14806 This command may occur zero or more times.
14809 \begin_layout Description
14810 \begin_inset Flex CharStyle:Code
14813 \begin_layout Plain Layout
14815 \begin_inset space ~
14819 \begin_inset space ~
14822 RotationLatexCommand
14827 This command specifies that the built in LaTeX command should be used for
14829 This command may occur once or not at all.
14832 \begin_layout Description
14833 \begin_inset Flex CharStyle:Code
14836 \begin_layout Plain Layout
14838 \begin_inset space ~
14842 \begin_inset space ~
14850 This command specifies that the built in LaTeX command should be used for
14852 This command may occur once or not at all.
14855 \begin_layout Description
14856 \begin_inset Flex CharStyle:Code
14859 \begin_layout Plain Layout
14861 \begin_inset space ~
14865 \begin_inset space ~
14868 RotationLatexOption
14873 This command specifies that rotation is done via an optional argument.
14874 This command may occur once or not at all.
14877 \begin_layout Description
14878 \begin_inset Flex CharStyle:Code
14881 \begin_layout Plain Layout
14883 \begin_inset space ~
14887 \begin_inset space ~
14895 This command specifies that resizing is done via an optional argument.
14896 This command may occur once or not at all.
14899 \begin_layout Description
14900 \begin_inset Flex CharStyle:Code
14903 \begin_layout Plain Layout
14905 \begin_inset space ~
14909 \begin_inset space ~
14917 This command specifies that clipping is done via an optional argument.
14918 This command may occur once or not at all.
14921 \begin_layout Description
14922 \begin_inset Flex CharStyle:Code
14925 \begin_layout Plain Layout
14927 \begin_inset space ~
14931 \begin_inset space ~
14939 This command specifies that an extra optional argument is used.
14940 This command may occur once or not at all.
14943 \begin_layout Description
14944 \begin_inset Flex CharStyle:Code
14947 \begin_layout Plain Layout
14949 \begin_inset space ~
14957 The file format of the converted file.
14958 This must be the name of a format that is known to LyX (see the
14959 \begin_inset Flex CharStyle:MenuItem
14962 \begin_layout Plain Layout
14967 ools\SpecialChar \menuseparator
14972 references:Conversion
14978 This command must occur exactly once.
14981 \begin_layout Description
14982 \begin_inset Flex CharStyle:Code
14985 \begin_layout Plain Layout
14987 \begin_inset space ~
14995 The file name of the converted file.
14996 The file name must be absolute.
14997 This command must occur exactly once.
15000 \begin_layout Subsection
15001 Preamble definitions
15004 \begin_layout Standard
15005 The external template configuration file may contain additional preamble
15006 definitions enclosed by
15007 \begin_inset Flex CharStyle:Code
15010 \begin_layout Plain Layout
15016 \SpecialChar \ldots{}
15018 \begin_inset Flex CharStyle:Code
15021 \begin_layout Plain Layout
15028 They can be used by the templates in the
15029 \begin_inset Flex CharStyle:Code
15032 \begin_layout Plain Layout
15041 \begin_layout Section
15042 The substitution mechanism
15045 \begin_layout Standard
15046 When the external material facility invokes an external program, it is done
15047 on the basis of a command defined in the template configuration file.
15048 These commands can contain various macros that are expanded before execution.
15049 Execution always take place in the directory of the containing document.
15052 \begin_layout Standard
15053 Also, whenever external material is to be displayed, the name will be produced
15054 by the substitution mechanism, and most other commands in the template
15055 definition support substitution as well.
15058 \begin_layout Standard
15059 The available macros are the following:
15062 \begin_layout Description
15063 \begin_inset Flex CharStyle:Code
15066 \begin_layout Plain Layout
15067 $$AbsOrRelPathMaster
15072 The file path, absolute or relative to the master LyX document.
15075 \begin_layout Description
15076 \begin_inset Flex CharStyle:Code
15079 \begin_layout Plain Layout
15080 $$AbsOrRelPathParent
15085 The file path, absolute or relative to the LyX document.
15088 \begin_layout Description
15089 \begin_inset Flex CharStyle:Code
15092 \begin_layout Plain Layout
15098 The absolute file path.
15101 \begin_layout Description
15102 \begin_inset Flex CharStyle:Code
15105 \begin_layout Plain Layout
15111 The filename without path and without the extension.
15114 \begin_layout Description
15115 \begin_inset Flex CharStyle:Code
15118 \begin_layout Plain Layout
15120 \begin_inset Quotes eld
15124 \begin_inset Quotes erd
15132 This macro will expand to the contents of the file with the name
15133 \begin_inset Flex CharStyle:Code
15136 \begin_layout Plain Layout
15145 \begin_layout Description
15146 \begin_inset Flex CharStyle:Code
15149 \begin_layout Plain Layout
15155 The file extension (including the dot).
15158 \begin_layout Description
15159 \begin_inset Flex CharStyle:Code
15162 \begin_layout Plain Layout
15168 The filename of the file specified in the external material dialog.
15169 This is either an absolute name, or it is relative to the LyX document.
15172 \begin_layout Description
15173 \begin_inset Flex CharStyle:Code
15176 \begin_layout Plain Layout
15183 \begin_inset Flex CharStyle:Code
15186 \begin_layout Plain Layout
15192 (absolute name or relative to the LyX document).
15195 \begin_layout Description
15196 \begin_inset Flex CharStyle:Code
15199 \begin_layout Plain Layout
15205 The file path, relative to the master LyX document.
15208 \begin_layout Description
15209 \begin_inset Flex CharStyle:Code
15212 \begin_layout Plain Layout
15218 The file path, relative to the LyX document.
15221 \begin_layout Description
15222 \begin_inset Flex CharStyle:Code
15225 \begin_layout Plain Layout
15231 This macro will expand to the absolute path of the system directory.
15232 This is typically used to point to the various helper scripts that are
15236 \begin_layout Description
15237 \begin_inset Flex CharStyle:Code
15240 \begin_layout Plain Layout
15246 A name and full path to a temporary file which will be automatically deleted
15247 whenever the containing document is closed, or the external material insertion
15251 \begin_layout Standard
15252 All path macros contain a trailing directory separator, so you can construct
15254 \begin_inset space \thinspace{}
15258 \begin_inset space \space{}
15261 the absolute filename with
15262 \begin_inset Flex CharStyle:Code
15265 \begin_layout Plain Layout
15266 $$AbsPath$$Basename$$Extension
15274 \begin_layout Standard
15275 The macros above are substituted in all commands unless otherwise noted.
15277 \begin_inset Flex CharStyle:Code
15280 \begin_layout Plain Layout
15286 supports additionally the following substitutions if they are enabled by
15288 \begin_inset Flex CharStyle:Code
15291 \begin_layout Plain Layout
15298 \begin_inset Flex CharStyle:Code
15301 \begin_layout Plain Layout
15310 \begin_layout Description
15311 \begin_inset Flex CharStyle:Code
15314 \begin_layout Plain Layout
15320 The front part of the resize command.
15323 \begin_layout Description
15324 \begin_inset Flex CharStyle:Code
15327 \begin_layout Plain Layout
15333 The back part of the resize command.
15336 \begin_layout Description
15337 \begin_inset Flex CharStyle:Code
15340 \begin_layout Plain Layout
15346 The front part of the rotation command.
15349 \begin_layout Description
15350 \begin_inset Flex CharStyle:Code
15353 \begin_layout Plain Layout
15359 The back part of the rotation command.
15362 \begin_layout Standard
15363 The value string of the
15364 \begin_inset Flex CharStyle:Code
15367 \begin_layout Plain Layout
15373 command supports additionally the following substitutions if they are enabled
15375 \begin_inset Flex CharStyle:Code
15378 \begin_layout Plain Layout
15385 \begin_inset Flex CharStyle:Code
15388 \begin_layout Plain Layout
15397 \begin_layout Description
15398 \begin_inset Flex CharStyle:Code
15401 \begin_layout Plain Layout
15410 \begin_layout Description
15411 \begin_inset Flex CharStyle:Code
15414 \begin_layout Plain Layout
15423 \begin_layout Description
15424 \begin_inset Flex CharStyle:Code
15427 \begin_layout Plain Layout
15436 \begin_layout Description
15437 \begin_inset Flex CharStyle:Code
15440 \begin_layout Plain Layout
15446 The rotation option.
15449 \begin_layout Standard
15450 You may ask why there are so many path macros.
15451 There are mainly two reasons:
15454 \begin_layout Enumerate
15455 Relative and absolute file names should remain relative or absolute, respectivel
15457 Users may have reasons to prefer either form.
15458 Relative names are useful for portable documents that should work on different
15459 machines, for example.
15460 Absolute names may be required by some programs.
15463 \begin_layout Enumerate
15464 LaTeX treats relative file names differently than LyX and other programs
15465 in nested included files.
15466 For LyX, a relative file name is always relative to the document that contains
15468 For LaTeX, it is always relative to the master document.
15469 These two definitions are identical if you have only one document, but
15470 differ if you have a master document that includes part documents.
15471 That means that relative filenames must be transformed when presented to
15473 Fortunately LyX does this automatically for you if you choose the right
15477 \begin_layout Standard
15478 So which path macro should be used in new template definitions? The rule
15482 \begin_layout Itemize
15484 \begin_inset Flex CharStyle:Code
15487 \begin_layout Plain Layout
15493 if an absolute path is required.
15496 \begin_layout Itemize
15498 \begin_inset Flex CharStyle:Code
15501 \begin_layout Plain Layout
15502 $$AbsOrRelPathMaster
15507 if the substituted string is some kind of LaTeX input.
15510 \begin_layout Itemize
15512 \begin_inset Flex CharStyle:Code
15515 \begin_layout Plain Layout
15516 $$AbsOrRelPathParent
15521 in order to preserve the user's choice.
15524 \begin_layout Standard
15525 There are special cases where this rule does not work and e.
15526 \begin_inset space \thinspace{}
15530 \begin_inset space \space{}
15533 relative names are needed, but normally it will work just fine.
15534 One example for such a case is the command
15535 \begin_inset Flex CharStyle:Code
15538 \begin_layout Plain Layout
15539 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
15544 in the XFig template above: We can't use the absolute name because the
15546 \begin_inset Flex CharStyle:Code
15549 \begin_layout Plain Layout
15555 files needs the relative name in order to rewrite the file content.
15558 \begin_layout Section
15559 Security discussion
15560 \begin_inset CommandInset label
15562 name "sec:Security-discussion"
15569 \begin_layout Standard
15570 The external material feature interfaces with a lot of external programs
15571 and does so automatically, so we have to consider the security implications
15573 In particular, since you have the option of including your own filenames
15574 and/or parameter strings and those are expanded into a command, it seems
15575 that it would be possible to create a malicious document which executes
15576 arbitrary commands when a user views or prints the document.
15577 This is something we definitely want to avoid.
15580 \begin_layout Standard
15581 However, since the external program commands are specified in the template
15582 configuration file only, there are no security issues if LyX is properly
15583 configured with safe templates only.
15584 This is so because the external programs are invoked with the
15585 \begin_inset Flex CharStyle:Code
15588 \begin_layout Plain Layout
15594 -system call rather than the
15595 \begin_inset Flex CharStyle:Code
15598 \begin_layout Plain Layout
15604 system-call, so it's not possible to execute arbitrary commands from the
15605 filename or parameter section via the shell.
15608 \begin_layout Standard
15609 This also implies that you are restricted in what command strings you can
15610 use in the external material templates.
15611 In particular, pipes and redirection are not readily available.
15612 This has to be so if LyX should remain safe.
15613 If you want to use some of the shell features, you should write a safe
15614 script to do this in a controlled manner, and then invoke the script from
15615 the command string.
15619 \begin_layout Standard
15620 It is possible to design a template that interacts directly with the shell,
15621 but since this would allow a malicious user to execute arbitrary commands
15622 by writing clever filenames and/or parameters, we generally recommend that
15623 you only use safe scripts that work with the
15624 \begin_inset Flex CharStyle:Code
15627 \begin_layout Plain Layout
15633 system call in a controlled manner.
15634 Of course, for use in a controlled environment, it can be tempting to just
15635 fall back to use ordinary shell scripts.
15636 If you do so, be aware that you
15640 provide an easily exploitable security hole in your system.
15641 Of course it stands to reason that such unsafe templates will never be
15642 included in the standard LyX distribution, although we do encourage people
15643 to submit new templates in the open source tradition.
15644 But LyX as shipped from the official distribution channels will never have
15648 \begin_layout Standard
15649 Including external material provides a lot of power, and you have to be
15650 careful not to introduce security hazards with this power.
15651 A subtle error in a single line in an innocent looking script can open
15652 the door to huge security problems.
15653 So if you do not fully understand the issues, we recommend that you consult
15654 a knowledgeable security professional or the LyX development team if you
15655 have any questions about whether a given template is safe or not.
15656 And do this before you use it in an uncontrolled environment.