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:keymap"
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 named 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 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 that 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 chain
2141 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 between all the formats between which
2351 you want to convert.
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 \begin_inset CommandInset label
3674 International Keymap Stuff
3677 \begin_layout Standard
3678 \begin_inset Note Note
3681 \begin_layout Plain Layout
3682 In doing the revisions on this document in March 2008, I did not look over
3683 this stuff, as I do not understand it.
3684 It would be good if someone else could do so.
3693 \begin_layout Standard
3694 The next two sections describe the
3695 \begin_inset Flex CharStyle:Code
3698 \begin_layout Plain Layout
3707 \begin_inset Flex CharStyle:Code
3710 \begin_layout Plain Layout
3718 file syntax in detail.
3719 These sections should help you design your own key map if the ones provided
3720 do not meet your needs.
3723 \begin_layout Subsection
3727 \begin_layout Standard
3731 \begin_inset Flex CharStyle:Code
3734 \begin_layout Plain Layout
3740 file maps keystrokes to characters or strings.
3741 As the name suggests, it sets a keyboard mapping.
3743 \begin_inset Flex CharStyle:Code
3746 \begin_layout Plain Layout
3757 \begin_inset Flex CharStyle:Code
3760 \begin_layout Plain Layout
3775 \begin_inset Flex CharStyle:Code
3778 \begin_layout Plain Layout
3791 \begin_inset Flex CharStyle:Code
3794 \begin_layout Plain Layout
3803 \begin_inset Flex CharStyle:Code
3806 \begin_layout Plain Layout
3814 are described in this section.
3817 \begin_layout Labeling
3818 \labelwidthstring 00.00.0000
3819 \begin_inset Flex CharStyle:Code
3822 \begin_layout Plain Layout
3830 Map a character to a string
3833 \begin_layout LyX-Code
3848 \begin_layout Standard
3881 the double-quote (")
3898 must be escaped with a preceding backslash (
3909 \begin_layout Standard
3911 \begin_inset Flex CharStyle:MenuItem
3914 \begin_layout Plain Layout
3922 statement to cause the symbol
3923 \begin_inset Flex CharStyle:MenuItem
3926 \begin_layout Plain Layout
3934 to be output for the keystroke
3935 \begin_inset Flex CharStyle:MenuItem
3938 \begin_layout Plain Layout
3949 \begin_layout LyX-Code
3955 \begin_layout Labeling
3956 \labelwidthstring 00.00.0000
3957 \begin_inset Flex CharStyle:Code
3960 \begin_layout Plain Layout
3968 Specify an accent character
3971 \begin_layout LyX-Code
3980 \begin_layout Standard
3981 This will make the cha
4019 This is the dead key
4023 \begin_layout Plain Layout
4030 refers to a key that does not produce a character by itself, but when followed
4031 with another key, produces the desired accent character.
4032 For example, a German characte
4034 r with an umlaut like
4044 can be produced in this manner.
4053 \begin_layout Standard
4066 and then another key not in
4083 followed by the other, not allowed key, as output.
4087 \begin_inset Flex CharStyle:MenuItem
4090 \begin_layout Plain Layout
4098 cancels a dead key, so if
4109 \begin_inset Flex CharStyle:MenuItem
4112 \begin_layout Plain Layout
4121 , the cursor will not go one position backwards but will instead cancel
4137 might have had on the next keystroke.
4141 \begin_layout Standard
4142 The following example specifies that the character ' is to be an acute accent,
4143 allowed on the characters a, e, i, o, u, A, E, I, O, and U:
4146 \begin_layout LyX-Code
4149 kmod ' acute aeiouAEIOU
4152 \begin_layout Labeling
4153 \labelwidthstring 00.00.0000
4154 \begin_inset Flex CharStyle:Code
4157 \begin_layout Plain Layout
4163 Specify an exception to the accent character
4166 \begin_layout LyX-Code
4175 \begin_layout Standard
4176 This defines an exce
4217 have been assigned a keystroke with a previous
4220 \begin_inset Flex CharStyle:Code
4223 \begin_layout Plain Layout
4247 must not belong in the
4294 If such a declaration does not exist in
4302 \begin_inset Flex CharStyle:Code
4305 \begin_layout Plain Layout
4339 \begin_inset Flex CharStyle:Code
4342 \begin_layout Plain Layout
4356 \begin_layout Standard
4357 The following command produces causes äi to be produced when you enter acute-i
4361 \begin_layout LyX-Code
4375 \begin_layout Labeling
4376 \labelwidthstring 00.00.0000
4377 \begin_inset Flex CharStyle:Code
4380 \begin_layout Plain Layout
4386 Combine two accent characters
4389 \begin_layout LyX-Code
4395 accent1 accent2 allowed
4398 \begin_layout Standard
4399 This one is getting pretty esoteric.
4400 It allows you to combine the effect
4456 \begin_inset Flex CharStyle:Code
4459 \begin_layout Plain Layout
4487 \begin_layout Standard
4488 Consider this example from the
4489 \begin_inset Flex CharStyle:Code
4492 \begin_layout Plain Layout
4503 \begin_layout LyX-Code
4506 kmod ; acute aeioyvhAEIOYVH
4510 kcomb acute umlaut iyIY
4513 \begin_layout Standard
4514 This allows you to press
4515 \begin_inset Flex CharStyle:MenuItem
4518 \begin_layout Plain Layout
4526 and get the effect of
4527 \begin_inset Flex CharStyle:Code
4530 \begin_layout Plain Layout
4549 in this case cancels the last dead key, so if you press
4550 \begin_inset Flex CharStyle:MenuItem
4553 \begin_layout Plain Layout
4562 \begin_inset Flex CharStyle:Code
4565 \begin_layout Plain Layout
4578 \begin_layout Subsection
4582 \begin_layout Standard
4584 \begin_inset Flex CharStyle:Code
4587 \begin_layout Plain Layout
4595 mapping is performed, a
4596 \begin_inset Flex CharStyle:Code
4599 \begin_layout Plain Layout
4609 file maps the strings that the symbols generate to characters in the current
4611 The LyX distribution currently includes at least the
4612 \begin_inset Flex CharStyle:Code
4615 \begin_layout Plain Layout
4624 \begin_inset Flex CharStyle:Code
4627 \begin_layout Plain Layout
4638 \begin_layout Standard
4640 \begin_inset Flex CharStyle:Code
4643 \begin_layout Plain Layout
4651 file is a sequence of declarations of the form
4654 \begin_layout LyX-Code
4667 \begin_layout Standard
4668 For example, in order to map
4669 \begin_inset Flex CharStyle:MenuItem
4672 \begin_layout Plain Layout
4682 to the corresponding character in the iso-8859-1 set (233), the following
4686 \begin_layout LyX-Code
4694 \begin_layout Standard
4696 \begin_inset Flex CharStyle:Code
4699 \begin_layout Plain Layout
4708 \begin_inset Flex CharStyle:Code
4711 \begin_layout Plain Layout
4729 the same character can apply to more than one string.
4731 \begin_inset Flex CharStyle:Code
4734 \begin_layout Plain Layout
4745 \begin_layout LyX-Code
4757 \begin_inset Newline newline
4773 \begin_layout Standard
4774 If LyX cannot find a mapping for the string produced by the keystroke or
4775 a deadkey sequence, it will check if it looks like an accented char and
4776 try to draw an accent over the character on screen.
4779 \begin_layout Subsection
4783 \begin_layout Standard
4784 There is a second way to add support for international characters through
4785 so-called dead-keys.
4786 A dead-key works in combination with a letter to produce an accented character.
4787 Here, we'll explain how to create a really simple dead-key to illustrate
4791 \begin_layout Standard
4792 Suppose you happen to need the circumflex character,
4793 \begin_inset Quotes eld
4797 \begin_inset Quotes erd
4802 \begin_inset Flex CharStyle:MenuItem
4805 \begin_layout Plain Layout
4812 \begin_inset space ~
4816 \begin_inset Flex CharStyle:MenuItem
4819 \begin_layout Plain Layout
4825 ] to the LyX command
4826 \begin_inset Flex CharStyle:Code
4829 \begin_layout Plain Layout
4836 \begin_inset Flex CharStyle:Code
4839 \begin_layout Plain Layout
4846 Now, whenever you type the
4847 \begin_inset Flex CharStyle:MenuItem
4850 \begin_layout Plain Layout
4856 -key followed by a letter, that letter will have a circumflex accent on
4858 For example, the sequence
4859 \begin_inset Quotes eld
4863 \begin_inset Flex CharStyle:MenuItem
4866 \begin_layout Plain Layout
4873 \begin_inset Quotes erd
4876 produces the letter:
4877 \begin_inset Quotes eld
4881 \begin_inset Quotes erd
4885 If you tried to type
4886 \begin_inset Quotes eld
4890 \begin_inset Flex CharStyle:MenuItem
4893 \begin_layout Plain Layout
4900 \begin_inset Quotes erd
4903 , however, LyX will complain with a beep, since a
4904 \begin_inset Quotes eld
4908 \begin_inset Flex CharStyle:MenuItem
4911 \begin_layout Plain Layout
4918 \begin_inset Quotes erd
4921 never takes a circumflex accent.
4923 \begin_inset Flex CharStyle:MenuItem
4926 \begin_layout Plain Layout
4932 after a dead-key produces the bare-accent.
4933 Please note this last point! If you bind a key to a dead-key, you'll need
4934 to rebind the character on that key to yet another key.
4936 \begin_inset Flex CharStyle:MenuItem
4939 \begin_layout Plain Layout
4945 to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
4948 \begin_layout Standard
4949 One common way to bind dead-keys is to use
4950 \begin_inset Flex CharStyle:MenuItem
4953 \begin_layout Plain Layout
4960 \begin_inset Flex CharStyle:MenuItem
4963 \begin_layout Plain Layout
4970 \begin_inset Flex CharStyle:MenuItem
4973 \begin_layout Plain Layout
4979 in combination with an accent, like
4980 \begin_inset Quotes eld
4984 \begin_inset Flex CharStyle:MenuItem
4987 \begin_layout Plain Layout
4994 \begin_inset Quotes erd
4998 \begin_inset Quotes eld
5002 \begin_inset Flex CharStyle:MenuItem
5005 \begin_layout Plain Layout
5012 \begin_inset Quotes erd
5016 \begin_inset Quotes eld
5020 \begin_inset Flex CharStyle:MenuItem
5023 \begin_layout Plain Layout
5030 \begin_inset Quotes erd
5034 Another way involves using
5035 \begin_inset Flex CharStyle:Code
5038 \begin_layout Plain Layout
5045 \begin_inset Flex CharStyle:Code
5048 \begin_layout Plain Layout
5054 to set up the special
5055 \begin_inset Flex CharStyle:Code
5058 \begin_layout Plain Layout
5066 \begin_inset Flex CharStyle:Code
5069 \begin_layout Plain Layout
5075 acts in some ways just like
5076 \begin_inset Flex CharStyle:MenuItem
5079 \begin_layout Plain Layout
5085 and permits you to bind keys to accented characters.
5086 You can also turn keys into dead-keys by binding them to something like
5088 \begin_inset Flex CharStyle:Code
5091 \begin_layout Plain Layout
5097 and then binding this symbolic key to the corresponding LyX command.
5101 \begin_layout Plain Layout
5106 : This is exactly what I do in my
5107 \begin_inset Flex CharStyle:Code
5110 \begin_layout Plain Layout
5117 \begin_inset Flex CharStyle:Code
5120 \begin_layout Plain Layout
5128 \begin_inset Flex CharStyle:MenuItem
5131 \begin_layout Plain Layout
5133 \begin_inset space ~
5142 \begin_inset Flex CharStyle:Code
5145 \begin_layout Plain Layout
5151 and a bunch of these
5152 \begin_inset Quotes eld
5156 \begin_inset Flex CharStyle:Code
5159 \begin_layout Plain Layout
5166 \begin_inset Quotes erd
5169 symbolic keys bound such things as
5170 \begin_inset Flex CharStyle:MenuItem
5173 \begin_layout Plain Layout
5175 \begin_inset space ~
5184 \begin_inset Flex CharStyle:MenuItem
5187 \begin_layout Plain Layout
5189 \begin_inset space ~
5198 This is how I produce my accented characters.
5203 You can make just about anything into the
5204 \begin_inset Flex CharStyle:Code
5207 \begin_layout Plain Layout
5214 \begin_inset Flex CharStyle:MenuItem
5217 \begin_layout Plain Layout
5223 keys, a spare function key, etc.
5224 As for the LyX commands that produce accents, check the entry for
5225 \begin_inset Flex CharStyle:Code
5228 \begin_layout Plain Layout
5239 You'll find the complete list there.
5242 \begin_layout Subsection
5243 Saving your Language Configuration
5246 \begin_layout Standard
5247 You can edit your preferences so that your desired language environment
5248 is automatically configured when LyX starts up, via the
5249 \begin_inset Flex CharStyle:MenuItem
5252 \begin_layout Plain Layout
5253 Edit\SpecialChar \menuseparator
5262 \begin_layout Chapter
5263 Installing New Document Classes, Layouts, and Templates
5264 \begin_inset CommandInset label
5266 name "cha:Installing-New-Document"
5274 \begin_layout Plain Layout
5275 Installing New Document Classes
5283 \begin_layout Standard
5284 In this chapter, we describe the procedures for creating and installing
5285 new LyX layout and template files, as well as offer a refresher on correctly
5286 installing new LaTeX document classes.
5287 Some definitions: a document class is a LaTeX file (usually ending in
5288 \begin_inset Flex CharStyle:Code
5291 \begin_layout Plain Layout
5298 \begin_inset Flex CharStyle:Code
5301 \begin_layout Plain Layout
5307 ) that describes the format of a document such as an article, report, journal
5308 preprint, etc, and all the commands needed to realize that format.
5309 A layout file is a LyX file that corresponds to a LaTeX document class
5310 and that tells LyX how to
5311 \begin_inset Quotes eld
5315 \begin_inset Quotes erd
5318 things on the screen to make the display look something like the final
5320 More precisely, a layout file describes a
5321 \begin_inset Quotes eld
5325 \begin_inset Quotes erd
5328 which is the internal construct LyX uses to render the screen display.
5330 \begin_inset Quotes eld
5334 \begin_inset Quotes erd
5338 \begin_inset Quotes eld
5342 \begin_inset Quotes erd
5345 can be used somewhat interchangeably, but it is better to refer to the
5346 file as the layout, and the thing living in LyX's memory as the text class.
5347 A template file is simply a LyX document that contains a set of predefined
5348 entries for a given document class—entries that are generally required
5350 Templates are especially useful for things like journal manuscripts that
5351 are to be submitted electronically.
5354 \begin_layout Section
5355 Installing a new LaTeX package
5358 \begin_layout Standard
5359 Some installations may not include a LaTeX package that you would like to
5361 For example, you might need FoilTeX, a package for preparing slides or
5362 viewgraphs for overhead projectors.
5363 Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
5364 a user interface for that.
5365 For example on MiKTeX you start its program
5366 \begin_inset Quotes eld
5370 \begin_inset Quotes erd
5373 to get a list of available packages.
5374 To install one, right click on it or use the installing toolbar button.
5375 When the package you want to install is not in the list, but you have it
5377 \begin_inset Flex CharStyle:Code
5380 \begin_layout Plain Layout
5387 \begin_inset Flex CharStyle:Code
5390 \begin_layout Plain Layout
5396 -file, then copy these files to a subfolder of your LaTeX distribution,
5397 for example to the folder
5406 Then update the file name database of your LaTeX-distribution.
5407 For example on MiKTeX this is done by pressing the button
5410 \begin_inset space ~
5415 that you find in MiKTeX's
5416 \begin_inset Quotes eld
5420 \begin_inset Quotes erd
5424 In both cases you need afterwards to reconfigure LyX using the menu
5425 \begin_inset Flex CharStyle:MenuItem
5428 \begin_layout Plain Layout
5429 Tools\SpecialChar \menuseparator
5435 and then to restart LyX.
5438 \begin_layout Standard
5439 If your LaTeX distribution doesn't provide a user interface, then you can
5440 follow these steps by using a UNIX/Linux console.
5443 \begin_layout Enumerate
5444 Get the package from
5445 \begin_inset CommandInset href
5448 target "http://www.ctan.org/"
5455 \begin_layout Enumerate
5456 You can install this package in several different places.
5457 If you want it to be available for all users on your system, then you should
5458 install it in your `local' TeX tree; if you want (or need) it to be available
5459 just for you, then you can install it in your own `user' TeX tree.
5460 Where these should be created, if they do not already exist, depends upon
5461 the details of your system.
5462 To find out, look in the file
5463 \begin_inset Flex CharStyle:Code
5466 \begin_layout Plain Layout
5476 \begin_layout Plain Layout
5477 This usually lives in the directory
5478 \begin_inset Flex CharStyle:Code
5481 \begin_layout Plain Layout
5487 , though you can run
5488 \begin_inset Flex CharStyle:Code
5491 \begin_layout Plain Layout
5502 The location of the `local' TeX tree is defined by
5503 \begin_inset Flex CharStyle:Code
5506 \begin_layout Plain Layout
5512 ; this is usually somewhere like
5513 \begin_inset Flex CharStyle:Code
5516 \begin_layout Plain Layout
5517 /usr/local/share/texmf/
5523 The `user' TeX tree is defined by
5524 \begin_inset Flex CharStyle:Code
5527 \begin_layout Plain Layout
5534 \begin_inset Flex CharStyle:Code
5537 \begin_layout Plain Layout
5544 (If these variables are not predefined, you can define them.) You'll probably
5545 need root permissions to create or modify the `local' tree; but your `user'
5546 tree shouldn't have such limitations.
5549 \begin_layout Enumerate
5551 \begin_inset Flex CharStyle:Code
5554 \begin_layout Plain Layout
5561 \begin_inset Flex CharStyle:Code
5564 \begin_layout Plain Layout
5571 \begin_inset Flex CharStyle:Code
5574 \begin_layout Plain Layout
5581 \begin_inset space \thinspace{}
5585 \begin_inset Newline newline
5589 \begin_inset Flex CharStyle:Code
5592 \begin_layout Plain Layout
5593 TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
5599 \begin_inset Newline newline
5602 But, again, most of this will
5603 \begin_inset Quotes eld
5607 \begin_inset Quotes erd
5613 \begin_layout Enumerate
5618 \begin_layout Plain Layout
5619 We'll assume henceforth that you're defining `local' TeX tree.
5620 If you're defining a user tree, just adjust as necessary.
5626 You must follow the directory structure of your existing
5627 \begin_inset Flex CharStyle:Code
5630 \begin_layout Plain Layout
5636 directory, which will be found at
5637 \begin_inset Flex CharStyle:Code
5640 \begin_layout Plain Layout
5647 For example, latex packages should go under
5648 \begin_inset Flex CharStyle:Code
5651 \begin_layout Plain Layout
5652 $TEXMFLOCAL/tex/latex/
5660 \begin_layout Enumerate
5661 Install the package.
5662 For example, you would unpack the FoilTeX tarball and copy it to
5663 \begin_inset Flex CharStyle:Code
5666 \begin_layout Plain Layout
5667 $TEXMFLOCAL/tex/latex/foiltex
5674 \begin_inset Flex CharStyle:Code
5677 \begin_layout Plain Layout
5683 directory contains various files.
5686 \begin_layout Enumerate
5688 \begin_inset Flex CharStyle:Code
5691 \begin_layout Plain Layout
5699 \begin_inset Flex CharStyle:Code
5702 \begin_layout Plain Layout
5711 \begin_layout Standard
5712 Your package is now installed and available to LaTeX.
5713 To make it available to LyX, you need to create a Layout file, if one is
5714 not already available.
5715 (See the next section.) Once you have a layout file, you need only reconfigure
5717 \begin_inset Flex CharStyle:MenuItem
5720 \begin_layout Plain Layout
5721 Tools\SpecialChar \menuseparator
5727 ) and then restart LyX.
5728 You should then see your new package—for example
5729 \begin_inset Flex CharStyle:MenuItem
5732 \begin_layout Plain Layout
5739 \begin_inset Flex CharStyle:MenuItem
5742 \begin_layout Plain Layout
5743 Document\SpecialChar \menuseparator
5750 \begin_inset Flex CharStyle:MenuItem
5753 \begin_layout Plain Layout
5763 \begin_layout Section
5767 \begin_layout Standard
5768 This section describes how to write and install your own LyX layout files
5769 and walks through the
5770 \begin_inset Flex CharStyle:Code
5773 \begin_layout Plain Layout
5779 text class format as an example.
5781 \begin_inset Flex CharStyle:Code
5784 \begin_layout Plain Layout
5790 files describe what paragraph and character styles are available for a
5791 given document class and how LyX should display them.
5792 We try to provide a thorough description of the process here; however,
5793 there are so many different types of documents supported by LaTeX classes
5794 that we can't hope to cover every different possibility or problem you
5796 (The LyX users' list is frequented by people with lots of experience with
5797 layout design who are willing to share what they've learned.)
5800 \begin_layout Standard
5801 As you prepare to write a new layout, it is extremely helpful to look at
5802 the example layouts distributed with LyX.
5803 If you use a nice LaTeX document class that might be of interest for others,
5804 too, and have a nice corresponding LyX layout, feel free to contribute
5805 the stuff to us, so we may put it into the distribution.
5807 \begin_inset CommandInset href
5809 name "section on the LyX wiki"
5810 target "http://wiki.lyx.org/Layouts/Layouts"
5814 for this kind of material.
5817 \begin_layout Standard
5818 All the tags described in this chapter are case-insensitive; this means
5820 \begin_inset Flex CharStyle:Code
5823 \begin_layout Plain Layout
5830 \begin_inset Flex CharStyle:Code
5833 \begin_layout Plain Layout
5840 \begin_inset Flex CharStyle:Code
5843 \begin_layout Plain Layout
5849 are really the same command.
5850 The possible values are printed in brackets after the feature's name.
5851 The default value if a feature isn't specified inside a text class-description
5853 \begin_inset Flex CharStyle:Code
5856 \begin_layout Plain Layout
5865 If the argument has a data type like
5866 \begin_inset Quotes eld
5870 \begin_inset Quotes erd
5874 \begin_inset Quotes eld
5878 \begin_inset Quotes erd
5881 , the default is shown like this:
5882 \begin_inset Flex CharStyle:Code
5885 \begin_layout Plain Layout
5896 \begin_layout Subsection
5898 \begin_inset CommandInset label
5900 name "sub:Layout-modules"
5907 \begin_layout Standard
5908 Similar to layout files, and new with LyX 1.6, are layout
5913 Modules are to LaTeX packages much as layouts are to LaTeX classes, and
5914 some modules—such as the endnotes module—provide support for just such
5916 In a sense, layout modules are similar to included files—files like
5917 \begin_inset Flex CharStyle:Code
5920 \begin_layout Plain Layout
5926 —in that modules are not specific to a given document layout but may be
5927 used with many different layouts.
5928 The difference is that using a layout module does not require editing the
5930 Rather, modules are selected in the
5931 \begin_inset Flex CharStyle:MenuItem
5934 \begin_layout Plain Layout
5935 Document\SpecialChar \menuseparator
5944 \begin_layout Standard
5945 Building modules is the easiest way to get started with layout editing,
5946 since it can be as simple as adding a single new paragraph or flex inset.
5947 But modules may, in principle, contain anything a layout file can contain.
5950 \begin_layout Standard
5951 A module must begin with a line like the following:
5954 \begin_layout LyX-Code
5957 DeclareLyXModule[endnotes.sty]{Endnotes}
5960 \begin_layout Standard
5961 The mandatory argument, in curly brackets, is the name of the module, as
5963 \begin_inset Flex CharStyle:MenuItem
5966 \begin_layout Plain Layout
5967 Document\SpecialChar \menuseparator
5974 The argument in square brackets is optional: It declares any LaTeX packages
5975 on which the module depends.
5976 Please note that only packages about which LyX knows should be listed in
5977 the square brackets.
5981 \begin_layout Plain Layout
5982 The list of such packages is documented only in the source code.
5987 LyX will not check for arbitrary packages.
5990 \begin_layout Standard
5991 The module declaration should then be followed by lines like the following:
5994 \begin_layout LyX-Code
5998 \begin_layout LyX-Code
5999 #Adds an endnote command, in addition to footnotes.
6003 \begin_layout LyX-Code
6004 #You will need to add
6006 theendnotes in TeX code where you
6009 \begin_layout LyX-Code
6010 #want the endnotes to appear.
6014 \begin_layout LyX-Code
6018 \begin_layout LyX-Code
6019 #Requires: somemodule | othermodule
6022 \begin_layout LyX-Code
6023 #Excludes: badmodule
6026 \begin_layout Standard
6027 The description is used in
6028 \begin_inset Flex CharStyle:MenuItem
6031 \begin_layout Plain Layout
6032 Document\SpecialChar \menuseparator
6038 to provide the user with information about what the module does.
6040 \begin_inset Flex CharStyle:Code
6043 \begin_layout Plain Layout
6049 line is used to identify other modules with which this one must be used;
6051 \begin_inset Flex CharStyle:Code
6054 \begin_layout Plain Layout
6060 line is used to identify modules with which this one may not be used.
6061 Both are optional, and, as shown, multiple modules should be separated
6062 with the pipe symbol: |.
6063 Note that the required modules are treated disjunctively:
6067 of the required modules must be used.
6072 excluded module may be used.
6073 Note that modules are identified here by their
6077 without the .module extension.
6079 \begin_inset Flex CharStyle:Code
6082 \begin_layout Plain Layout
6089 \begin_inset Flex CharStyle:Code
6092 \begin_layout Plain Layout
6101 \begin_layout Standard
6102 After creating a new module, you will need to reconfigure and then restart
6103 LyX for the module to appear in the menu.
6104 However, changes you make to the module will be seen immediately, if you
6106 \begin_inset Flex CharStyle:MenuItem
6109 \begin_layout Plain Layout
6110 Document\SpecialChar \menuseparator
6116 , highlight something, and then hit
6117 \begin_inset Quotes eld
6121 \begin_inset Quotes erd
6127 It is strongly recommended that you save your work before doing so
6132 it is strongly recommended that you not attempt to edit modules while simultaneo
6133 usly working on documents
6136 Though of course the developers strive to keep LyX stable in such situations,
6137 syntax errors and the like in your module file could cause strange behavior.
6140 \begin_layout Subsection
6141 Supporting new document classes
6144 \begin_layout Standard
6145 There are two situations you are likely to encounter when wanting to support
6146 a new LaTeX document class, involving LaTeX2e class (
6147 \begin_inset Flex CharStyle:Code
6150 \begin_layout Plain Layout
6157 \begin_inset Flex CharStyle:Code
6160 \begin_layout Plain Layout
6167 Supporting a style file is usually fairly easy.
6168 Supporting a new document class is a bit harder.
6171 \begin_layout Subsection
6173 \begin_inset Flex CharStyle:MenuItem
6176 \begin_layout Plain Layout
6185 \begin_layout Standard
6186 If your new document class is provided as a style file that is used in conjuncti
6187 on with an existing, supported document class—for the sake of the example,
6188 we'll assume that the style file is called
6189 \begin_inset Flex CharStyle:MenuItem
6192 \begin_layout Plain Layout
6198 and it is meant to be used with
6199 \begin_inset Flex CharStyle:MenuItem
6202 \begin_layout Plain Layout
6208 , which is a standard class—start by copying the existing class's layout
6209 file into your local directory:
6212 \begin_layout LyX-Code
6213 cp report.layout ~/.lyx/layouts/myclass.layout
6216 \begin_layout Standard
6218 \begin_inset Flex CharStyle:Code
6221 \begin_layout Plain Layout
6227 and change the line:
6230 \begin_layout LyX-Code
6233 DeclareLaTeXClass{report}
6236 \begin_layout Standard
6240 \begin_layout LyX-Code
6243 DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
6246 \begin_layout Standard
6250 \begin_layout LyX-Code
6252 \begin_inset Newline newline
6258 \begin_inset Newline newline
6264 \begin_layout Standard
6265 near the top of the file.
6268 \begin_layout Standard
6269 Start LyX and select
6270 \begin_inset Flex CharStyle:MenuItem
6273 \begin_layout Plain Layout
6274 Tools\SpecialChar \menuseparator
6281 Then restart LyX and try creating a new document.
6283 \begin_inset Flex CharStyle:MenuItem
6286 \begin_layout Plain Layout
6292 " as a document class option in the
6293 \begin_inset Flex CharStyle:MenuItem
6296 \begin_layout Plain Layout
6297 Document\SpecialChar \menuseparator
6304 It is likely that some of the sectioning commands and such in your new
6305 class will work differently from how they worked in the base class—
6306 \begin_inset Flex CharStyle:Code
6309 \begin_layout Plain Layout
6315 in this example—so you can fiddle around with the settings for the different
6316 sections if you wish.
6319 \begin_layout Subsection
6321 \begin_inset Flex CharStyle:MenuItem
6324 \begin_layout Plain Layout
6333 \begin_layout Standard
6334 There are two possibilities here.
6335 One is that the class file is itself based upon an existing document class.
6336 For example, many thesis classes are based upon
6337 \begin_inset Flex CharStyle:MenuItem
6340 \begin_layout Plain Layout
6347 To see whether yours is, look for a line like
6350 \begin_layout LyX-Code
6356 \begin_layout Standard
6358 If so, then you may proceed largely as in the previous section, though
6359 the DeclareLaTeXClass line will be different.
6360 If your new class is thesis, and it is based upon book, then the line should
6365 \begin_layout Plain Layout
6366 And it will be easiest if you save the file to
6367 \begin_inset Flex CharStyle:Code
6370 \begin_layout Plain Layout
6376 : LyX assumes that the document class has the same name as the layout file.
6385 \begin_layout LyX-Code
6388 DeclareLaTeXClass[thesis,book]{thesis}
6391 \begin_layout Standard
6392 If, on the other hand, the new class is not based upon an existing class,
6393 you will probably have to
6394 \begin_inset Quotes eld
6398 \begin_inset Quotes erd
6402 We strongly suggest copying an existing layout file which uses a similar
6403 LaTeX class and then modifying it, if you can do so.
6404 At least use an existing file as a starting point so you can find out what
6405 items you need to worry about.
6406 Again, the specifics are covered below.
6409 \begin_layout Section
6410 Declaring a new text class
6413 \begin_layout Standard
6414 When it's finally time to get your hands dirty and create or edit your own
6415 layout file, the following sections describe what you're up against.
6416 Our advice is to go slowly, save and test often, listen to soothing music,
6417 and enjoy one or two of your favorite adult beverages; more if you are
6418 getting particularly stuck.
6419 It's really not that hard, except that the multitude of options can become
6420 overwhelming if you try to do to much in one sitting.
6421 Go have another adult beverage, just for good measure.
6424 \begin_layout Standard
6428 \begin_layout Standard
6429 Lines in a layout file which begin with a
6430 \begin_inset Flex CharStyle:Code
6433 \begin_layout Plain Layout
6440 There is one exception to this rule: all layouts should begin with lines
6444 \begin_layout LyX-Code
6447 #% Do not delete the line below; configure depends on this
6450 \begin_layout LyX-Code
6455 DeclareLaTeXClass{article}
6458 \begin_layout Standard
6459 The second line is used when you configure LyX.
6460 The layout file is read by the LaTeX script
6461 \begin_inset Flex CharStyle:Code
6464 \begin_layout Plain Layout
6470 , in a special mode where
6471 \begin_inset Flex CharStyle:Code
6474 \begin_layout Plain Layout
6481 The first line is just a LaTeX comment, and the second one contains the
6482 declaration of the text class.
6483 If these lines appear in a file named
6484 \begin_inset Flex CharStyle:Code
6487 \begin_layout Plain Layout
6493 , then they define a text class of name
6494 \begin_inset Flex CharStyle:Code
6497 \begin_layout Plain Layout
6503 (the name of the layout file) which uses the LaTeX document class
6504 \begin_inset Flex CharStyle:Code
6507 \begin_layout Plain Layout
6513 (the default is to use the same name as the layout).
6515 \begin_inset Quotes eld
6519 \begin_inset Quotes erd
6522 that appears above is used as a description of the text class in the
6523 \begin_inset Flex CharStyle:MenuItem
6526 \begin_layout Plain Layout
6527 Document\SpecialChar \menuseparator
6536 \begin_layout Standard
6537 Let's assume that you wrote your own text class that uses the
6538 \begin_inset Flex CharStyle:Code
6541 \begin_layout Plain Layout
6547 document class, but where you changed the appearance of the section headings.
6548 If you put it in a file
6549 \begin_inset Flex CharStyle:Code
6552 \begin_layout Plain Layout
6558 , the header of this file should be:
6561 \begin_layout LyX-Code
6564 #% Do not delete the line below; configure depends on this
6567 \begin_layout LyX-Code
6572 DeclareLaTeXClass[article]{article (with my own headings)}
6575 \begin_layout Standard
6576 This declares a text class
6577 \begin_inset Flex CharStyle:Code
6580 \begin_layout Plain Layout
6586 , associated with the LaTeX document class
6587 \begin_inset Flex CharStyle:Code
6590 \begin_layout Plain Layout
6597 \begin_inset Quotes eld
6600 article (with my own headings)
6601 \begin_inset Quotes erd
6605 If your text class depends on several packages, you can declare it as:
6608 \begin_layout LyX-Code
6611 #% Do not delete the line below; configure depends on this
6614 \begin_layout LyX-Code
6619 DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
6622 \begin_layout Standard
6623 This indicates that your text class uses the foo.sty package.
6624 Finally, it is also possible to declare classes for DocBook code.
6625 Typical declarations will look like
6628 \begin_layout LyX-Code
6631 #% Do not delete the line below; configure depends on this
6634 \begin_layout LyX-Code
6639 DeclareDocBookClass[article]{SGML (DocBook article)}
6642 \begin_layout Standard
6643 Note that these declarations can also be given an optional parameter declaring
6644 the name of the document class (but not a list).
6647 \begin_layout Standard
6648 So, to be as explicit as possible, the form of the layout declaration is:
6651 \begin_layout LyX-Code
6656 DeclareLaTeXClass[class,package.sty]{layout description}
6659 \begin_layout Standard
6660 The class need only be specified if the name of the LaTeX class file and
6661 the name of the layout file are different; if the name of the class file
6662 is not specified, then LyX will simply assume that it is the same as the
6663 name of the layout file.
6666 \begin_layout Standard
6667 When the text class has been modified to your taste, all you have to do
6668 is to copy it either to
6669 \begin_inset Flex CharStyle:Code
6672 \begin_layout Plain Layout
6679 \begin_inset Flex CharStyle:Code
6682 \begin_layout Plain Layout
6689 \begin_inset Flex CharStyle:MenuItem
6692 \begin_layout Plain Layout
6693 Tools\SpecialChar \menuseparator
6699 , exit LyX and restart it.
6700 Then your new text class should be available along with the others.
6703 \begin_layout Standard
6704 In versions of LyX prior to 1.6, you had to restart LyX to see any changes
6705 you made to your layout files.
6706 As a result, editing layout files could be very time consuming.
6707 Beginning with 1.6, however, you can force a reload of the layout currently
6708 in use by using the LyX function
6709 \begin_inset Flex CharStyle:MenuItem
6712 \begin_layout Plain Layout
6719 There is no default binding for this function—though, of course, you can
6720 bind it to a key yourself.
6721 If you want to use this function, then, you should simply enter it in the
6727 : This is very much an `advanced feature'.
6732 recommended that you save your work before using this function.
6737 recommended that you not attempt to edit your layout while simultaneously
6738 working on a document that you care about.
6739 Use a test document.
6740 Syntax errors and the like in your layout file could cause peculiar behavior.
6741 In particular, such errors could cause LyX to regard the current layout
6742 as invalid and to attempt to switch to some other layout.
6743 The LyX team strives to keep LyX stable in such situations, but safe is
6747 \begin_layout Subsection
6751 \begin_layout Standard
6752 The first non-comment line must contain the file format number:
6755 \begin_layout Description
6756 \begin_inset Flex CharStyle:Code
6759 \begin_layout Plain Layout
6766 \begin_inset Flex CharStyle:Code
6769 \begin_layout Plain Layout
6775 ] This tag was introduced with LyX 1.4.0 (layout files of LyX 1.3.x and earlier
6776 don't have an explicit file format).
6777 The file format that is documented here is format 14.
6780 \begin_layout Subsection
6781 General text class parameters
6784 \begin_layout Standard
6785 These are the general parameters which describe the form of the entire document:
6788 \begin_layout Description
6789 \begin_inset Flex CharStyle:Code
6792 \begin_layout Plain Layout
6798 Adds information to the document preamble.
6800 \begin_inset Quotes eld
6804 \begin_inset Flex CharStyle:Code
6807 \begin_layout Plain Layout
6814 \begin_inset Quotes erd
6820 \begin_layout Description
6821 \begin_inset Flex CharStyle:Code
6824 \begin_layout Plain Layout
6830 Describes various global options supported by the document class.
6832 \begin_inset space ~
6836 \begin_inset CommandInset ref
6838 reference "sub:ClassOptions"
6844 \begin_inset Quotes eld
6848 \begin_inset Flex CharStyle:Code
6851 \begin_layout Plain Layout
6858 \begin_inset Quotes erd
6864 \begin_layout Description
6865 \begin_inset Flex CharStyle:Code
6868 \begin_layout Plain Layout
6875 \begin_inset Flex CharStyle:Code
6878 \begin_layout Plain Layout
6887 \begin_inset Flex CharStyle:Code
6890 \begin_layout Plain Layout
6896 ] Whether the class should default to having one or two columns.
6897 Can be changed in the
6898 \begin_inset Flex CharStyle:MenuItem
6901 \begin_layout Plain Layout
6902 Document\SpecialChar \menuseparator
6911 \begin_layout Description
6912 \begin_inset Flex CharStyle:Code
6915 \begin_layout Plain Layout
6921 This sequence defines a new counter.
6923 \begin_inset space ~
6927 \begin_inset CommandInset ref
6929 reference "sub:Counters"
6935 \begin_inset Quotes eld
6939 \begin_inset Flex CharStyle:Code
6942 \begin_layout Plain Layout
6949 \begin_inset Quotes erd
6955 \begin_layout Description
6956 \begin_inset Flex CharStyle:Code
6959 \begin_layout Plain Layout
6965 Sets the default font used to display the document.
6967 \begin_inset space ~
6971 \begin_inset CommandInset ref
6973 reference "sub:Font-description"
6977 for how to declare fonts.
6979 \begin_inset Quotes eld
6983 \begin_inset Flex CharStyle:Code
6986 \begin_layout Plain Layout
6993 \begin_inset Quotes erd
6999 \begin_layout Description
7000 \begin_inset Flex CharStyle:Code
7003 \begin_layout Plain Layout
7010 \begin_inset Flex CharStyle:Code
7013 \begin_layout Plain Layout
7019 Specifies a module to be included by default with this document class,
7020 which should be specified by filename without the
7021 \begin_inset Flex CharStyle:Code
7024 \begin_layout Plain Layout
7031 The user can still remove the module, but it will be active at the outset.
7032 (This applies only when new files are created, or when this class is chosen
7033 for an existing document.)
7036 \begin_layout Description
7037 \begin_inset Flex CharStyle:Code
7040 \begin_layout Plain Layout
7047 \begin_inset Flex CharStyle:Code
7050 \begin_layout Plain Layout
7056 ] This is the style that will be assigned to new paragraphs, usually
7057 \begin_inset Flex CharStyle:MenuItem
7060 \begin_layout Plain Layout
7067 This will default to the first defined style if not given, but you are
7068 highly encouraged to use this directive.
7071 \begin_layout Description
7072 \begin_inset Flex CharStyle:Code
7075 \begin_layout Plain Layout
7082 \begin_inset Flex CharStyle:Code
7085 \begin_layout Plain Layout
7091 ] Indicates that the module in question—which should be specified by filename
7093 \begin_inset Flex CharStyle:Code
7096 \begin_layout Plain Layout
7102 extension—cannot be used with this document class.
7103 This might be used in a journal-specific layout file to prevent, say, the
7105 \begin_inset Flex CharStyle:Code
7108 \begin_layout Plain Layout
7114 module that numbers theorems by section.
7119 be used in a module.
7120 Modules have their own way of excluding other modules (see
7121 \begin_inset CommandInset ref
7123 reference "sub:Layout-modules"
7130 \begin_layout Description
7131 \begin_inset Flex CharStyle:Code
7134 \begin_layout Plain Layout
7140 Defines a new float.
7142 \begin_inset space ~
7146 \begin_inset CommandInset ref
7148 reference "sub:Floats"
7154 \begin_inset Quotes eld
7158 \begin_inset Flex CharStyle:Code
7161 \begin_layout Plain Layout
7168 \begin_inset Quotes erd
7174 \begin_layout Description
7175 \begin_inset Flex CharStyle:Code
7178 \begin_layout Plain Layout
7184 As its name implies, this command allows you to include another layout
7185 definition file within yours to avoid duplicating commands.
7186 Common examples are the standard layout files, for example,
7187 \begin_inset Flex CharStyle:Code
7190 \begin_layout Plain Layout
7196 , which contains most of the basic layouts.
7199 \begin_layout Description
7200 \begin_inset Flex CharStyle:Code
7203 \begin_layout Plain Layout
7209 This section (re-)defines the layout of an inset.
7210 It can be applied to an existing inset of to a new, user-defined inset,
7212 \begin_inset space \thinspace{}
7216 \begin_inset space \space{}
7219 a new character style.
7221 \begin_inset space ~
7225 \begin_inset CommandInset ref
7227 reference "sub:Flex-insets-and"
7231 for more information.
7233 \begin_inset Quotes eld
7237 \begin_inset Flex CharStyle:Code
7240 \begin_layout Plain Layout
7247 \begin_inset Quotes erd
7253 \begin_layout Description
7254 \begin_inset Flex CharStyle:Code
7257 \begin_layout Plain Layout
7263 A string that indicates the width of the left margin on the screen, for
7265 \begin_inset Quotes eld
7269 \begin_inset Quotes erd
7275 \begin_layout Description
7276 \begin_inset Flex CharStyle:Code
7279 \begin_layout Plain Layout
7285 This command deletes an existing float.
7286 This is particularly useful when you want to suppress a float that has
7287 be defined in an input file.
7290 \begin_layout Description
7291 \begin_inset Flex CharStyle:Code
7294 \begin_layout Plain Layout
7300 This command deletes an existing style.
7301 This is particularly useful when you want to suppress a style that has
7302 be defined in an input file.
7305 \begin_layout Description
7306 \begin_inset Flex CharStyle:Code
7309 \begin_layout Plain Layout
7315 A string indicating what sort of output documents using this class will
7317 At present, the options are: `docbook', `latex', and `literate'.
7320 \begin_layout Description
7321 \begin_inset Flex CharStyle:Code
7324 \begin_layout Plain Layout
7335 \begin_inset Flex CharStyle:Code
7338 \begin_layout Plain Layout
7349 \begin_inset Flex CharStyle:Code
7352 \begin_layout Plain Layout
7359 \begin_inset Flex CharStyle:Code
7362 \begin_layout Plain Layout
7368 ] The class default pagestyle.
7369 Can be changed in the
7370 \begin_inset Flex CharStyle:MenuItem
7373 \begin_layout Plain Layout
7374 Document\SpecialChar \menuseparator
7383 \begin_layout Description
7384 \begin_inset Flex CharStyle:Code
7387 \begin_layout Plain Layout
7393 Sets the preamble for the LaTeX document.
7394 Note that this will completely override any prior
7395 \begin_inset Flex CharStyle:Code
7398 \begin_layout Plain Layout
7405 \begin_inset Flex CharStyle:Code
7408 \begin_layout Plain Layout
7416 \begin_inset Quotes eld
7420 \begin_inset Flex CharStyle:Code
7423 \begin_layout Plain Layout
7430 \begin_inset Quotes erd
7436 \begin_layout Description
7437 \begin_inset Flex CharStyle:Code
7440 \begin_layout Plain Layout
7447 \begin_inset Flex CharStyle:Code
7450 \begin_layout Plain Layout
7457 \begin_inset Flex CharStyle:Code
7460 \begin_layout Plain Layout
7469 \begin_inset Flex CharStyle:Code
7472 \begin_layout Plain Layout
7478 ] Whether the class already provides the feature
7479 \begin_inset Flex CharStyle:Code
7482 \begin_layout Plain Layout
7489 A feature is in general the name of a package (
7490 \begin_inset Flex CharStyle:Code
7493 \begin_layout Plain Layout
7500 \begin_inset Flex CharStyle:Code
7503 \begin_layout Plain Layout
7509 , \SpecialChar \ldots{}
7511 \begin_inset Flex CharStyle:Code
7514 \begin_layout Plain Layout
7521 \begin_inset Flex CharStyle:Code
7524 \begin_layout Plain Layout
7530 ,\SpecialChar \ldots{}
7531 ); the complete list of supported features is unfortunately not documented
7532 outside the LyX source code—but see
7533 \begin_inset Flex CharStyle:Code
7536 \begin_layout Plain Layout
7542 if you're interested.
7544 \begin_inset Flex CharStyle:MenuItem
7547 \begin_layout Plain Layout
7548 Help\SpecialChar \menuseparator
7554 also gives an overview of the supported packages.
7557 \begin_layout Description
7558 \begin_inset Flex CharStyle:Code
7561 \begin_layout Plain Layout
7568 \begin_inset Flex CharStyle:Code
7571 \begin_layout Plain Layout
7577 ] Indicates that this layout provides the functionality of the module mentioned,
7578 which should be specified by the filename without the
7579 \begin_inset Flex CharStyle:Code
7582 \begin_layout Plain Layout
7589 This will typically be used if the layout includes the module directly,
7590 rather than using the
7591 \begin_inset Flex CharStyle:Code
7594 \begin_layout Plain Layout
7600 tag to indicate that it ought to be used.
7601 It could be used in a module that provided an alternate implementation
7602 of the same functionality.
7605 \begin_layout Description
7606 \begin_inset Flex CharStyle:Code
7609 \begin_layout Plain Layout
7616 \begin_inset Flex CharStyle:Code
7619 \begin_layout Plain Layout
7625 ] Whether the class requires the feature
7626 \begin_inset Flex CharStyle:Code
7629 \begin_layout Plain Layout
7636 Multiple features must be separated by commas.
7637 Note that you can only request supported features.
7640 \begin_layout Description
7641 \begin_inset Flex CharStyle:Code
7644 \begin_layout Plain Layout
7650 A string that indicates the width of the right margin on the screen, for
7652 \begin_inset Quotes eld
7656 \begin_inset Quotes erd
7662 \begin_layout Description
7663 \begin_inset Flex CharStyle:Code
7666 \begin_layout Plain Layout
7672 Sets which divisions get numbered.
7674 \begin_inset Flex CharStyle:Code
7677 \begin_layout Plain Layout
7686 \begin_layout Description
7687 \begin_inset Flex CharStyle:Code
7690 \begin_layout Plain Layout
7699 \begin_inset Flex CharStyle:Code
7702 \begin_layout Plain Layout
7713 \begin_inset Flex CharStyle:Code
7716 \begin_layout Plain Layout
7722 ] Whether the class-default should be printing on one or both sides of the
7724 Can be changed in the
7725 \begin_inset Flex CharStyle:MenuItem
7728 \begin_layout Plain Layout
7729 Document\SpecialChar \menuseparator
7738 \begin_layout Description
7739 \begin_inset Flex CharStyle:Code
7742 \begin_layout Plain Layout
7748 This sequence defines a new paragraph style.
7749 If the style already exists, it will redefine some of its parameters instead.
7751 \begin_inset space ~
7755 \begin_inset CommandInset ref
7757 reference "sub:Paragraph-Styles"
7763 \begin_inset Quotes eld
7767 \begin_inset Flex CharStyle:Code
7770 \begin_layout Plain Layout
7777 \begin_inset Quotes erd
7783 \begin_layout Description
7784 \begin_inset Flex CharStyle:Code
7787 \begin_layout Plain Layout
7794 \begin_inset Flex CharStyle:Code
7797 \begin_layout Plain Layout
7803 ] The name of the command or environment to be used with
7804 \begin_inset Flex CharStyle:Code
7807 \begin_layout Plain Layout
7816 \begin_layout Description
7817 \begin_inset Flex CharStyle:Code
7820 \begin_layout Plain Layout
7827 \begin_inset Flex CharStyle:Code
7830 \begin_layout Plain Layout
7839 \begin_inset Flex CharStyle:Code
7842 \begin_layout Plain Layout
7848 ] Indicates what kind of markup is used to define the title of a document.
7850 \begin_inset Flex CharStyle:Code
7853 \begin_layout Plain Layout
7859 means that the macro with name
7860 \begin_inset Flex CharStyle:Code
7863 \begin_layout Plain Layout
7869 will be inserted after the last layout which has
7870 \begin_inset Quotes eld
7874 \begin_inset Flex CharStyle:Code
7877 \begin_layout Plain Layout
7884 \begin_inset Quotes erd
7889 \begin_inset Flex CharStyle:Code
7892 \begin_layout Plain Layout
7898 corresponds to the case where the block of paragraphs which have
7899 \begin_inset Quotes eld
7903 \begin_inset Flex CharStyle:Code
7906 \begin_layout Plain Layout
7913 \begin_inset Quotes erd
7916 should be enclosed into the
7917 \begin_inset Flex CharStyle:Code
7920 \begin_layout Plain Layout
7929 \begin_layout Description
7930 \begin_inset Flex CharStyle:Code
7933 \begin_layout Plain Layout
7939 Sets which divisions are included in the table of contents.
7941 \begin_inset Flex CharStyle:Code
7944 \begin_layout Plain Layout
7953 \begin_layout Subsection
7954 \begin_inset Flex CharStyle:Code
7957 \begin_layout Plain Layout
7964 \begin_inset CommandInset label
7966 name "sub:ClassOptions"
7973 \begin_layout Standard
7975 \begin_inset Flex CharStyle:Code
7978 \begin_layout Plain Layout
7984 section can contain the following entries:
7987 \begin_layout Description
7988 \begin_inset Flex CharStyle:Code
7991 \begin_layout Plain Layout
7998 \begin_inset Flex CharStyle:Code
8001 \begin_layout Plain Layout
8007 ] The list of available font sizes for the document's main font, separated
8009 \begin_inset Quotes eld
8013 \begin_inset Flex CharStyle:Code
8016 \begin_layout Plain Layout
8023 \begin_inset Quotes erd
8029 \begin_layout Description
8030 \begin_inset Flex CharStyle:Code
8033 \begin_layout Plain Layout
8039 Used to set the DTD line with XML-based output classes.
8041 \begin_inset space \thinspace{}
8045 \begin_inset Quotes eld
8048 -//OASIS//DTD DocBook V4.2//EN
8049 \begin_inset Quotes erd
8055 \begin_layout Description
8056 \begin_inset Flex CharStyle:Code
8059 \begin_layout Plain Layout
8066 \begin_inset Flex CharStyle:Code
8069 \begin_layout Plain Layout
8070 string="empty|plain|headings|fancy"
8075 ] The list of available page styles, separated by
8076 \begin_inset Quotes eld
8080 \begin_inset Flex CharStyle:Code
8083 \begin_layout Plain Layout
8090 \begin_inset Quotes erd
8096 \begin_layout Description
8097 \begin_inset Flex CharStyle:Code
8100 \begin_layout Plain Layout
8107 \begin_inset Flex CharStyle:Code
8110 \begin_layout Plain Layout
8116 ] Some document class options, separated by a comma, that will be added
8117 to the optional part of the
8118 \begin_inset Flex CharStyle:Code
8121 \begin_layout Plain Layout
8132 \begin_layout Standard
8134 \begin_inset Flex CharStyle:Code
8137 \begin_layout Plain Layout
8143 section must end with
8144 \begin_inset Quotes eld
8148 \begin_inset Flex CharStyle:Code
8151 \begin_layout Plain Layout
8158 \begin_inset Quotes erd
8164 \begin_layout Subsection
8166 \begin_inset CommandInset label
8168 name "sub:Paragraph-Styles"
8175 \begin_layout Standard
8176 A paragraph style description looks like this:
8180 \begin_layout Plain Layout
8181 Note that this will either define a new layout or modify an existing one.
8189 \begin_layout LyX-Code
8196 \begin_layout LyX-Code
8200 \begin_layout LyX-Code
8204 \begin_layout Standard
8205 where the following commands are allowed:
8208 \begin_layout Description
8209 \begin_inset Flex CharStyle:Code
8212 \begin_layout Plain Layout
8219 \begin_inset Flex CharStyle:Code
8222 \begin_layout Plain Layout
8227 , left, right, center
8232 ] Paragraph alignment.
8235 \begin_layout Description
8236 \begin_inset Flex CharStyle:Code
8239 \begin_layout Plain Layout
8246 \begin_inset Flex CharStyle:Code
8249 \begin_layout Plain Layout
8254 , left, right, center
8259 ] A comma separated list of permitted alignments.
8260 (Some LaTeX styles prohibit certain alignments, since those wouldn't make
8262 For example a right-aligned or centered enumeration isn't possible.)
8265 \begin_layout Description
8266 \begin_inset Flex CharStyle:Code
8269 \begin_layout Plain Layout
8276 \begin_inset Flex CharStyle:Code
8279 \begin_layout Plain Layout
8289 \begin_layout Plain Layout
8290 Note that a `float' here is a real number, such as: 1.5.
8295 The vertical space with which the last of a chain of paragraphs with this
8296 layout is separated from the following paragraph.
8297 If the next paragraph has another layout, the separations are not simply
8298 added, but the maximum is taken.
8301 \begin_layout Description
8302 \begin_inset Flex CharStyle:Code
8305 \begin_layout Plain Layout
8312 \begin_inset Flex CharStyle:Code
8315 \begin_layout Plain Layout
8321 The category for this style.
8322 This is used to group related styles in the Layout combobox on the toolbar.
8323 Any string can be used, but you may want to use existing categories with
8328 \begin_layout Description
8329 \begin_inset Flex CharStyle:Code
8332 \begin_layout Plain Layout
8338 Depth of XML command.
8339 Used only with XML-type formats.
8342 \begin_layout Description
8343 \begin_inset Flex CharStyle:Code
8346 \begin_layout Plain Layout
8353 \begin_inset CommandInset label
8355 name "des:CopyStyle"
8360 \begin_inset Flex CharStyle:Code
8363 \begin_layout Plain Layout
8369 Copies all the features of an existing style into the current one.
8373 \begin_layout Description
8374 \begin_inset Flex CharStyle:Code
8377 \begin_layout Plain Layout
8383 The name of a style whose preamble should be output
8388 This allows to ensure some ordering of the preamble snippets when macros
8389 definitions depend on one another.
8393 \begin_layout Plain Layout
8394 Note that, besides that functionality, there is no way to ensure any ordering
8396 The ordering that you see in a given version of LyX may change without
8397 warning in later versions.
8405 \begin_layout Description
8406 \begin_inset Flex CharStyle:Code
8409 \begin_layout Plain Layout
8416 \begin_inset Flex CharStyle:Code
8419 \begin_layout Plain Layout
8424 , Box, Filled_Box, Static
8429 ] The type of label that stands at the end of the paragraph (or sequence
8431 \begin_inset Flex CharStyle:Code
8434 \begin_layout Plain Layout
8441 \begin_inset Flex CharStyle:Code
8444 \begin_layout Plain Layout
8451 \begin_inset Flex CharStyle:Code
8454 \begin_layout Plain Layout
8461 \begin_inset Flex CharStyle:Code
8464 \begin_layout Plain Layout
8472 \begin_inset Flex CharStyle:Code
8475 \begin_layout Plain Layout
8482 \begin_inset Quotes eld
8486 \begin_inset Quotes erd
8490 \begin_inset Flex CharStyle:Code
8493 \begin_layout Plain Layout
8500 \begin_inset Flex CharStyle:Code
8503 \begin_layout Plain Layout
8504 \begin_inset space ~
8513 \begin_inset space ~
8516 black) square suitable for end of proof markers,
8517 \begin_inset Flex CharStyle:Code
8520 \begin_layout Plain Layout
8526 is an explicit text string.
8529 \begin_layout Description
8530 \begin_inset Flex CharStyle:Code
8533 \begin_layout Plain Layout
8540 \begin_inset Flex CharStyle:Code
8543 \begin_layout Plain Layout
8549 ] The string used for a label with a
8550 \begin_inset Flex CharStyle:Code
8553 \begin_layout Plain Layout
8560 \begin_inset Flex CharStyle:Code
8563 \begin_layout Plain Layout
8573 \begin_layout Description
8574 \begin_inset Flex CharStyle:Code
8577 \begin_layout Plain Layout
8584 \begin_inset Flex CharStyle:Code
8587 \begin_layout Plain Layout
8598 \begin_inset Flex CharStyle:Code
8601 \begin_layout Plain Layout
8610 \begin_layout Description
8611 \begin_inset Flex CharStyle:Code
8614 \begin_layout Plain Layout
8621 \begin_inset Flex CharStyle:Code
8624 \begin_layout Plain Layout
8634 ] With this parameter the
8635 \begin_inset Flex CharStyle:MenuItem
8638 \begin_layout Plain Layout
8645 \begin_inset Quotes eld
8648 Vertical space above
8649 \begin_inset Quotes erd
8653 \begin_inset Flex CharStyle:MenuItem
8656 \begin_layout Plain Layout
8657 Edit\SpecialChar \menuseparator
8659 \begin_inset space ~
8667 dialog can be set when initializing a paragraph with this style.
8671 \begin_layout Plain Layout
8674 Note from Jean-Marc:
8676 I'm not sure that this setting has much use, and it should probably be
8677 removed in later versions.
8685 \begin_layout Description
8686 \begin_inset Flex CharStyle:Code
8689 \begin_layout Plain Layout
8695 The font used for both the text body
8701 \begin_inset space ~
8705 \begin_inset CommandInset ref
8707 reference "sub:Font-description"
8712 Note that defining this font automatically defines the
8713 \begin_inset Flex CharStyle:Code
8716 \begin_layout Plain Layout
8723 So you should define this one first if you also want to define
8724 \begin_inset Flex CharStyle:Code
8727 \begin_layout Plain Layout
8736 \begin_layout Description
8737 \begin_inset Flex CharStyle:Code
8740 \begin_layout Plain Layout
8747 \begin_inset CommandInset label
8749 name "des:FreeSpacing"
8756 \begin_inset Flex CharStyle:Code
8759 \begin_layout Plain Layout
8770 \begin_inset Flex CharStyle:Code
8773 \begin_layout Plain Layout
8779 ] Usually LyX doesn't allow you to insert more than one space between words,
8780 since a space is considered as the separation between two words, not a
8781 character or symbol of its own.
8782 This is a very fine thing but sometimes annoying, for example, when typing
8783 program code or plain LaTeX code.
8785 \begin_inset Flex CharStyle:Code
8788 \begin_layout Plain Layout
8795 Note that LyX will create protected blanks for the additional blanks when
8796 in another mode than LaTeX-mode.
8799 \begin_layout Description
8800 \begin_inset Flex CharStyle:Code
8803 \begin_layout Plain Layout
8809 Language dependent information to be included in the LaTeX preamble when
8811 Note that this will completely override any prior
8812 \begin_inset Flex CharStyle:Code
8815 \begin_layout Plain Layout
8823 \begin_inset Quotes eld
8827 \begin_inset Flex CharStyle:Code
8830 \begin_layout Plain Layout
8837 \begin_inset Quotes erd
8841 The contents of this tag will occur once in the LaTeX preamble for each
8842 language used by the document.
8843 Each time, the following substitutions are made:
8847 \begin_layout Itemize
8848 \begin_inset Flex CharStyle:Code
8851 \begin_layout Plain Layout
8857 is replaced by the language name (as used by the babel package).
8860 \begin_layout Itemize
8862 \begin_inset Quotes eld
8866 \begin_inset Quotes erd
8870 \begin_inset Flex CharStyle:Code
8873 \begin_layout Plain Layout
8879 replaces its argument by the translation of the argument to the current
8883 \begin_layout Standard
8884 This preamble snippet will only be used if the document contains more than
8885 one language and the babel package is used.
8889 \begin_layout Description
8890 \begin_inset Flex CharStyle:Code
8893 \begin_layout Plain Layout
8900 \begin_inset Flex CharStyle:Code
8903 \begin_layout Plain Layout
8909 , but this preamble snippet occurs independently from the babel package,
8910 and only for the document language.
8912 \begin_inset Quotes eld
8916 \begin_inset Flex CharStyle:Code
8919 \begin_layout Plain Layout
8926 \begin_inset Quotes erd
8933 \begin_layout Standard
8934 If the style defines text that appears in the typeset document, it may use
8936 \begin_inset Flex CharStyle:Code
8939 \begin_layout Plain Layout
8946 \begin_inset Flex CharStyle:Code
8949 \begin_layout Plain Layout
8955 to support non-english and even multilanguage documents correctly.
8956 The following excerpt (from the
8957 \begin_inset Flex CharStyle:Code
8960 \begin_layout Plain Layout
8966 file) shows how this works:
8969 \begin_layout LyX-Code
8973 \begin_layout LyX-Code
8976 theoremstyle{remark}
8979 \begin_layout LyX-Code
8982 newtheorem{claim}[thm]{
8989 \begin_layout LyX-Code
8993 \begin_layout LyX-Code
8997 \begin_layout LyX-Code
9002 claimname}{_(Claim)}
9005 \begin_layout LyX-Code
9009 \begin_layout LyX-Code
9013 \begin_layout LyX-Code
9017 \begin_layout LyX-Code
9026 claimname}{_(Claim)}}
9029 \begin_layout LyX-Code
9033 \begin_layout Standard
9034 The key to correct translation of the user visible text is the definition
9036 \begin_inset Flex CharStyle:Code
9039 \begin_layout Plain Layout
9047 in the language preamble.
9048 This command holds the name of the theorem that will appear in the output.
9050 \begin_inset Flex CharStyle:Code
9053 \begin_layout Plain Layout
9059 then uses the commands offered by the babel package to redefine
9060 \begin_inset Flex CharStyle:Code
9063 \begin_layout Plain Layout
9071 for each used language in multilanguage documents.
9075 \begin_layout Description
9076 \begin_inset Flex CharStyle:Code
9079 \begin_layout Plain Layout
9085 [[FIXME]] (Used only with XML-type formats.)
9088 \begin_layout Description
9089 \begin_inset Flex CharStyle:Code
9092 \begin_layout Plain Layout
9099 \begin_inset Flex CharStyle:Code
9102 \begin_layout Plain Layout
9108 If 1, marks the layout as being part of a title block (see also the
9109 \begin_inset Flex CharStyle:Code
9112 \begin_layout Plain Layout
9119 \begin_inset Flex CharStyle:Code
9122 \begin_layout Plain Layout
9131 \begin_layout Description
9132 \begin_inset Flex CharStyle:Code
9135 \begin_layout Plain Layout
9142 \begin_inset Flex CharStyle:Code
9145 \begin_layout Plain Layout
9151 ] This provides extra space between paragraphs that have the same layout.
9152 If you put other layouts into an environment, each is separated with the
9154 \begin_inset Flex CharStyle:Code
9157 \begin_layout Plain Layout
9164 But the whole items of the environment are additionally separated with
9166 \begin_inset Flex CharStyle:Code
9169 \begin_layout Plain Layout
9181 \begin_layout Description
9182 \begin_inset Flex CharStyle:Code
9185 \begin_layout Plain Layout
9191 [[FIXME]] (Used only with XML-type formats.)
9194 \begin_layout Description
9195 \begin_inset Flex CharStyle:Code
9198 \begin_layout Plain Layout
9205 \begin_inset CommandInset label
9207 name "des:KeepEmpty"
9214 \begin_inset Flex CharStyle:Code
9217 \begin_layout Plain Layout
9228 \begin_inset Flex CharStyle:Code
9231 \begin_layout Plain Layout
9237 ] Usually LyX does not allow you to leave a paragraph empty, since it would
9238 lead to empty LaTeX output.
9239 There are some cases where this could be desirable however: in a letter
9240 template, the required fields can be provided as empty fields, so that
9241 people do not forget them; in some special classes, a layout can be used
9242 as some kind of break, which does not contain actual text.
9245 \begin_layout Description
9246 \begin_inset Flex CharStyle:Code
9249 \begin_layout Plain Layout
9255 [float=0] The vertical space between the label and the text body.
9256 Only used for labels that are above the text body (
9257 \begin_inset Flex CharStyle:Code
9260 \begin_layout Plain Layout
9267 \begin_inset Flex CharStyle:Code
9270 \begin_layout Plain Layout
9271 Centered_Top_Environment
9279 \begin_layout Description
9280 \begin_inset Flex CharStyle:Code
9283 \begin_layout Plain Layout
9290 \begin_inset Flex CharStyle:Code
9293 \begin_layout Plain Layout
9300 \begin_inset Newline newline
9303 The name of the counter for automatic numbering (see Section
9304 \begin_inset CommandInset ref
9306 reference "sub:Counters"
9311 This must be given if
9312 \begin_inset Flex CharStyle:Code
9315 \begin_layout Plain Layout
9322 \begin_inset Flex CharStyle:Code
9325 \begin_layout Plain Layout
9334 \begin_layout Description
9335 \begin_inset Flex CharStyle:Code
9338 \begin_layout Plain Layout
9344 The font used for the label.
9346 \begin_inset space ~
9350 \begin_inset CommandInset ref
9352 reference "sub:Font-description"
9359 \begin_layout Description
9360 \begin_inset Flex CharStyle:Code
9363 \begin_layout Plain Layout
9369 Text that indicates how far a label should be indented.
9372 \begin_layout Description
9373 \begin_inset Flex CharStyle:Code
9376 \begin_layout Plain Layout
9383 \begin_inset Flex CharStyle:Code
9386 \begin_layout Plain Layout
9392 ] The horizontal space between the label and the text body.
9393 Only used for labels that are not above the text body.
9396 \begin_layout Description
9397 \begin_inset Flex CharStyle:Code
9400 \begin_layout Plain Layout
9407 \begin_inset Flex CharStyle:Code
9410 \begin_layout Plain Layout
9416 ] The string used for a label with a
9417 \begin_inset Flex CharStyle:Code
9420 \begin_layout Plain Layout
9428 \begin_inset Flex CharStyle:Code
9431 \begin_layout Plain Layout
9437 is set, this string can be contain the special formatting commands described
9439 \begin_inset CommandInset ref
9441 reference "sub:Counters"
9449 \begin_layout Plain Layout
9450 For the sake of backwards compatibility, the string
9451 \begin_inset Flex CharStyle:Code
9454 \begin_layout Plain Layout
9464 will be replaced by the expanded
9465 \begin_inset Flex CharStyle:Code
9468 \begin_layout Plain Layout
9475 \begin_inset Flex CharStyle:Code
9478 \begin_layout Plain Layout
9487 This feature is now obsolete and should be replaced by the mechanisms of
9489 \begin_inset CommandInset ref
9491 reference "sub:Counters"
9503 \begin_layout Description
9504 \begin_inset Flex CharStyle:Code
9507 \begin_layout Plain Layout
9514 \begin_inset Flex CharStyle:Code
9517 \begin_layout Plain Layout
9523 ] This is used inside the appendix instead of
9524 \begin_inset Flex CharStyle:Code
9527 \begin_layout Plain Layout
9535 \begin_inset Flex CharStyle:Code
9538 \begin_layout Plain Layout
9545 \begin_inset Flex CharStyle:Code
9548 \begin_layout Plain Layout
9557 \begin_layout Description
9558 \begin_inset Flex CharStyle:Code
9561 \begin_layout Plain Layout
9567 [FIXME] (Used only with XML-type formats.)
9570 \begin_layout Description
9571 \begin_inset Flex CharStyle:Code
9574 \begin_layout Plain Layout
9581 \begin_inset Flex CharStyle:Code
9584 \begin_layout Plain Layout
9589 , Manual, Static, Top_Environment,
9590 \begin_inset Newline newline
9593 Centered_Top_Environment, Sensitive, Counter
9599 \begin_inset Newline newline
9603 \begin_inset Flex CharStyle:Code
9606 \begin_layout Plain Layout
9612 means the label is the very first word (up to the first real blank).
9616 \begin_layout Plain Layout
9617 Use protected spaces if you want more than one word as the label.
9623 \begin_inset Flex CharStyle:Code
9626 \begin_layout Plain Layout
9632 means it is defined in the layout (see
9633 \begin_inset Flex CharStyle:Code
9636 \begin_layout Plain Layout
9644 \begin_inset Flex CharStyle:Code
9647 \begin_layout Plain Layout
9654 \begin_inset Flex CharStyle:Code
9657 \begin_layout Plain Layout
9658 Centered_Top_Environment
9663 are special cases of
9664 \begin_inset Flex CharStyle:Code
9667 \begin_layout Plain Layout
9674 The label will be printed above the paragraph, but only at the top of an
9675 environment or the top of a chain of paragraphs with this layout.
9676 Usage is for example the
9677 \begin_inset Flex CharStyle:MenuItem
9680 \begin_layout Plain Layout
9687 \begin_inset Flex CharStyle:MenuItem
9690 \begin_layout Plain Layout
9697 This is also the case for
9698 \begin_inset Flex CharStyle:Code
9701 \begin_layout Plain Layout
9707 labels with latex type
9708 \begin_inset Flex CharStyle:Code
9711 \begin_layout Plain Layout
9717 , in order to make layouts for theorems work correctly.
9719 \begin_inset Flex CharStyle:Code
9722 \begin_layout Plain Layout
9728 is a special case for the caption-labels
9729 \begin_inset Quotes eld
9733 \begin_inset Quotes erd
9737 \begin_inset Quotes eld
9741 \begin_inset Quotes erd
9746 \begin_inset Flex CharStyle:Code
9749 \begin_layout Plain Layout
9755 means the (hardcoded) label string depends on the kind of float.
9757 \begin_inset Flex CharStyle:Code
9760 \begin_layout Plain Layout
9766 label type defines automatically numbered labels.
9768 \begin_inset CommandInset ref
9770 reference "sub:Counters"
9777 \begin_layout Description
9778 \begin_inset Flex CharStyle:Code
9781 \begin_layout Plain Layout
9787 The name of the corresponding LaTeX stuff.
9788 Either the environment or command name.
9791 \begin_layout Description
9792 \begin_inset Flex CharStyle:Code
9795 \begin_layout Plain Layout
9801 An optional parameter for the corresponding
9802 \begin_inset Flex CharStyle:Code
9805 \begin_layout Plain Layout
9812 This parameter cannot be changed from within LyX.
9815 \begin_layout Description
9816 \begin_inset Flex CharStyle:Code
9819 \begin_layout Plain Layout
9826 \begin_inset CommandInset label
9828 name "des:LatexType"
9833 \begin_inset Flex CharStyle:Code
9836 \begin_layout Plain Layout
9841 , Command, Environment, Item_Environment,
9847 \begin_inset Flex CharStyle:Code
9850 \begin_layout Plain Layout
9856 ] How the layout should be translated into LaTeX.
9858 \begin_inset Flex CharStyle:Code
9861 \begin_layout Plain Layout
9867 means nothing special.
9869 \begin_inset Flex CharStyle:Code
9872 \begin_layout Plain Layout
9879 \begin_inset Flex CharStyle:Code
9882 \begin_layout Plain Layout
9889 {\SpecialChar \ldots{}
9896 \begin_inset Flex CharStyle:Code
9899 \begin_layout Plain Layout
9906 \begin_inset Flex CharStyle:Code
9909 \begin_layout Plain Layout
9916 }\SpecialChar \ldots{}
9930 \begin_inset Flex CharStyle:Code
9933 \begin_layout Plain Layout
9940 \begin_inset Flex CharStyle:Code
9943 \begin_layout Plain Layout
9950 \begin_inset Flex CharStyle:Code
9953 \begin_layout Plain Layout
9961 is generated for each paragraph of this environment.
9963 \begin_inset Flex CharStyle:Code
9966 \begin_layout Plain Layout
9973 \begin_inset Flex CharStyle:Code
9976 \begin_layout Plain Layout
9983 \begin_inset Flex CharStyle:Code
9986 \begin_layout Plain Layout
9992 is passed as an argument to the environment.
9994 \begin_inset Flex CharStyle:Code
9997 \begin_layout Plain Layout
10003 can be defined in the
10004 \begin_inset Flex CharStyle:MenuItem
10007 \begin_layout Plain Layout
10012 ayout\SpecialChar \menuseparator
10024 \begin_inset Flex CharStyle:Code
10027 \begin_layout Plain Layout
10035 is perhaps a bit misleading, since these rules apply to SGML classes, too.
10036 Visit the SGML class files for specific examples.
10039 \begin_layout Standard
10040 Putting the last few things together, the LaTeX output will be either:
10043 \begin_layout LyX-Code
10046 latexname[latexparam]{\SpecialChar \ldots{}
10050 \begin_layout Standard
10054 \begin_layout LyX-Code
10057 begin{latexname}[latexparam] \SpecialChar \ldots{}
10063 \begin_layout Standard
10064 depending upon the LaTeX type.
10067 \begin_layout Description
10068 \begin_inset Flex CharStyle:Code
10071 \begin_layout Plain Layout
10078 \begin_inset Flex CharStyle:Code
10081 \begin_layout Plain Layout
10087 ] If you put layouts into environments, the leftmargins are not simply added,
10088 but added with a factor
10089 \begin_inset Formula $\frac{4}{depth+4}$
10093 Note that this parameter is also used when the margin is defined as
10094 \begin_inset Flex CharStyle:Code
10097 \begin_layout Plain Layout
10104 \begin_inset Flex CharStyle:Code
10107 \begin_layout Plain Layout
10114 Then it is added to the manual or dynamic margin.
10116 \begin_inset Newline newline
10119 The argument is passed as a string.
10121 \begin_inset Quotes eld
10125 \begin_inset Flex CharStyle:Code
10128 \begin_layout Plain Layout
10135 \begin_inset Quotes erd
10138 means that the paragraph is indented with the width of
10139 \begin_inset Quotes eld
10143 \begin_inset Flex CharStyle:Code
10146 \begin_layout Plain Layout
10153 \begin_inset Quotes erd
10156 in the normal font.
10157 You can get a negative width by prefixing the string with
10158 \begin_inset Quotes eld
10162 \begin_inset Flex CharStyle:Code
10165 \begin_layout Plain Layout
10172 \begin_inset Quotes erd
10176 This way was chosen so that the look is the same with each used screen
10181 \begin_layout Description
10182 \begin_inset Flex CharStyle:Code
10185 \begin_layout Plain Layout
10192 \begin_inset Flex CharStyle:Code
10195 \begin_layout Plain Layout
10200 , Manual, Dynamic, First_Dynamic, Right_Address_Box
10206 \begin_inset Newline newline
10209 The kind of margin that the layout has on the left side.
10211 \begin_inset Flex CharStyle:Code
10214 \begin_layout Plain Layout
10220 just means a fixed margin.
10222 \begin_inset Flex CharStyle:Code
10225 \begin_layout Plain Layout
10231 means that the left margin depends on the string entered in the
10232 \begin_inset Flex CharStyle:MenuItem
10235 \begin_layout Plain Layout
10236 Edit\SpecialChar \menuseparator
10238 \begin_inset space ~
10247 This is used to typeset nice lists without tabulators.
10249 \begin_inset Flex CharStyle:Code
10252 \begin_layout Plain Layout
10258 means that the margin depends on the size of the label.
10259 This is used for automatic enumerated headlines.
10260 It is obvious that the headline
10261 \begin_inset Quotes eld
10264 5.4.3.2.1 Very long headline
10265 \begin_inset Quotes erd
10268 must have a wider left margin (as wide as
10269 \begin_inset Quotes eld
10273 \begin_inset Quotes erd
10276 plus the space) than
10277 \begin_inset Quotes eld
10280 3.2 Very long headline
10281 \begin_inset Quotes erd
10285 \begin_inset Quotes eld
10289 \begin_inset Quotes erd
10292 are not able to do this.
10294 \begin_inset Flex CharStyle:Code
10297 \begin_layout Plain Layout
10303 is similar, but only the very first row of the paragraph is dynamic, while
10304 the others are static; this is used, for example, for descriptions.
10306 \begin_inset Flex CharStyle:Code
10309 \begin_layout Plain Layout
10315 means the margin is chosen in a way that the longest row of this paragraph
10316 fits to the right margin.
10317 This is used to typeset an address on the right edge of the page.
10320 \begin_layout Description
10321 \begin_inset Flex CharStyle:Code
10324 \begin_layout Plain Layout
10331 \begin_inset Flex CharStyle:Code
10334 \begin_layout Plain Layout
10343 \begin_inset Flex CharStyle:Code
10346 \begin_layout Plain Layout
10352 ] Whether fragile commands in this layout should be
10353 \begin_inset Flex CharStyle:Code
10356 \begin_layout Plain Layout
10369 whether this command should itself be protected.)
10372 \begin_layout Description
10373 \begin_inset Flex CharStyle:Code
10376 \begin_layout Plain Layout
10383 \begin_inset Flex CharStyle:Code
10386 \begin_layout Plain Layout
10393 \begin_inset Flex CharStyle:Code
10396 \begin_layout Plain Layout
10404 ] Whether newlines are translated into LaTeX newlines (
10405 \begin_inset Flex CharStyle:Code
10408 \begin_layout Plain Layout
10419 The translation can be switched off to allow more comfortable LaTeX editing
10423 \begin_layout Description
10424 \begin_inset Flex CharStyle:Code
10427 \begin_layout Plain Layout
10434 \begin_inset Flex CharStyle:Code
10437 \begin_layout Plain Layout
10444 \begin_inset Flex CharStyle:Code
10447 \begin_layout Plain Layout
10455 ] Whether the following Paragraph is allowed to indent its very first row.
10457 \begin_inset Flex CharStyle:Code
10460 \begin_layout Plain Layout
10466 means that it is not allowed to do so;
10467 \begin_inset Flex CharStyle:Code
10470 \begin_layout Plain Layout
10476 means it could do so if it wants to.
10479 \begin_layout Description
10480 \begin_inset Flex CharStyle:Code
10483 \begin_layout Plain Layout
10489 Name of a layout that has replaced this layout.
10490 This is used to rename a layout, while keeping backward compatibility.
10493 \begin_layout Description
10494 \begin_inset Flex CharStyle:Code
10497 \begin_layout Plain Layout
10504 \begin_inset Flex CharStyle:Code
10507 \begin_layout Plain Layout
10513 ] The number of optional arguments that can be used with this layout.
10514 This is useful for things like section headings, and only makes sense with
10518 \begin_layout Description
10519 \begin_inset Flex CharStyle:Code
10522 \begin_layout Plain Layout
10529 \begin_inset Flex CharStyle:Code
10532 \begin_layout Plain Layout
10538 ] The indent of the very first line of a paragraph.
10540 \begin_inset Flex CharStyle:Code
10543 \begin_layout Plain Layout
10549 will be fixed for a certain layout.
10550 The exception is Standard layout, since the indentation of a Standard layout
10551 paragraph can be prohibited with
10552 \begin_inset Flex CharStyle:Code
10555 \begin_layout Plain Layout
10562 Also, Standard layout paragraphs inside environments use the
10563 \begin_inset Flex CharStyle:Code
10566 \begin_layout Plain Layout
10572 of the environment, not their native one.
10573 For example, Standard paragraphs inside an enumeration are not indented.
10576 \begin_layout Description
10577 \begin_inset Flex CharStyle:Code
10580 \begin_layout Plain Layout
10587 \begin_inset Flex CharStyle:Code
10590 \begin_layout Plain Layout
10596 ] The vertical space between two paragraphs of this layout.
10599 \begin_layout Description
10600 \begin_inset Flex CharStyle:Code
10603 \begin_layout Plain Layout
10610 \begin_inset Flex CharStyle:Code
10613 \begin_layout Plain Layout
10619 ] LyX allows the user to choose either
10620 \begin_inset Quotes eld
10624 \begin_inset Quotes erd
10628 \begin_inset Quotes eld
10632 \begin_inset Quotes erd
10635 to typeset a document.
10637 \begin_inset Quotes eld
10641 \begin_inset Quotes erd
10644 is chosen, this value is completely ignored.
10646 \begin_inset Quotes eld
10650 \begin_inset Quotes erd
10653 is chosen, the parindent of a LaTeXtype
10654 \begin_inset Quotes eld
10658 \begin_inset Quotes erd
10661 layout is ignored and all paragraphs are separated by this parskip argument.
10662 The vertical space is calculated with
10663 \begin_inset Flex CharStyle:Code
10666 \begin_layout Plain Layout
10668 \begin_inset space ~
10677 \begin_inset Flex CharStyle:Code
10680 \begin_layout Plain Layout
10686 is the height of a row with the normal font.
10687 This way, the look stays the same with different screen fonts.
10690 \begin_layout Description
10691 \begin_inset Flex CharStyle:Code
10694 \begin_layout Plain Layout
10701 \begin_inset CommandInset label
10703 name "des:PathThru"
10710 \begin_inset Flex CharStyle:Code
10713 \begin_layout Plain Layout
10724 \begin_inset Flex CharStyle:Code
10727 \begin_layout Plain Layout
10733 ] Whether the contents of this paragraph should be output in raw form, meaning
10734 without special translations that LaTeX would require.
10737 \begin_layout Description
10738 \begin_inset Flex CharStyle:Code
10741 \begin_layout Plain Layout
10748 \begin_inset CommandInset label
10750 name "des:Preamble"
10754 Information to be included in the LaTeX preamble when this style is used.
10755 Used to define macros, load packages, etc., required by this particular
10758 \begin_inset Quotes eld
10762 \begin_inset Flex CharStyle:Code
10765 \begin_layout Plain Layout
10772 \begin_inset Quotes erd
10778 \begin_layout Description
10779 \begin_inset Flex CharStyle:Code
10782 \begin_layout Plain Layout
10789 \begin_inset Flex CharStyle:Code
10792 \begin_layout Plain Layout
10799 \begin_inset CommandInset label
10801 name "des:Requires"
10805 Whether the layout requires the feature
10806 \begin_inset Flex CharStyle:Code
10809 \begin_layout Plain Layout
10816 See the description of
10817 \begin_inset Flex CharStyle:Code
10820 \begin_layout Plain Layout
10827 \begin_inset CommandInset ref
10828 LatexCommand pageref
10829 reference "des:FreeSpacing"
10833 ) for information on `features'.
10837 \begin_layout Description
10838 \begin_inset Flex CharStyle:Code
10841 \begin_layout Plain Layout
10848 \begin_inset Flex CharStyle:Code
10851 \begin_layout Plain Layout
10858 \begin_inset Flex CharStyle:Code
10861 \begin_layout Plain Layout
10870 \begin_layout Description
10871 \begin_inset Flex CharStyle:Code
10874 \begin_layout Plain Layout
10881 \begin_inset Flex CharStyle:Code
10884 \begin_layout Plain Layout
10889 , onehalf, double, other
10898 ] This defines what the default spacing should be in the layout.
10900 \begin_inset Flex CharStyle:Code
10903 \begin_layout Plain Layout
10910 \begin_inset Flex CharStyle:Code
10913 \begin_layout Plain Layout
10920 \begin_inset Flex CharStyle:Code
10923 \begin_layout Plain Layout
10929 correspond respectively to a multiplier value of 1, 1.25 and 1.667.
10930 If you specify the argument
10931 \begin_inset Flex CharStyle:Code
10934 \begin_layout Plain Layout
10940 , then you should also provide a numerical argument which will be the actual
10942 Note that, contrary to other parameters,
10943 \begin_inset Flex CharStyle:Code
10946 \begin_layout Plain Layout
10952 implies the generation of specific LaTeX code, using the package
10955 \begin_inset Flex CharStyle:Code
10958 \begin_layout Plain Layout
10967 \begin_layout Description
10968 \begin_inset Flex CharStyle:Code
10971 \begin_layout Plain Layout
10977 The font used for the text body .
10979 \begin_inset CommandInset ref
10981 reference "sub:Font-description"
10988 \begin_layout Description
10989 \begin_inset Flex CharStyle:Code
10992 \begin_layout Plain Layout
11000 The level of the style in the table of contents.
11001 This is used for automatic numbering of section headings.
11004 \begin_layout Description
11005 \begin_inset Flex CharStyle:Code
11008 \begin_layout Plain Layout
11015 \begin_inset Flex CharStyle:Code
11018 \begin_layout Plain Layout
11024 ] The vertical space with which the very first of a chain of paragraphs
11025 with this layout is separated from the previous paragraph.
11026 If the previous paragraph has another layout, the separations are not simply
11027 added, but the maximum is taken.
11030 \begin_layout Subsection
11032 \begin_inset CommandInset label
11041 \begin_layout Standard
11042 Since version 1.3.0 of LyX, it is has been both possible and necessary to
11043 define the floats (
11044 \begin_inset Flex CharStyle:MenuItem
11047 \begin_layout Plain Layout
11054 \begin_inset Flex CharStyle:MenuItem
11057 \begin_layout Plain Layout
11063 , \SpecialChar \ldots{}
11064 ) in the text class itself.
11065 Standard floats are included in the file
11066 \begin_inset Flex CharStyle:Code
11069 \begin_layout Plain Layout
11075 , so you may have to do no more than add
11078 \begin_layout LyX-Code
11079 Input stdfloats.inc
11082 \begin_layout Standard
11083 to your layout file.
11084 If you want to implement a text class that proposes some other float types
11085 (like the AGU class bundled with LyX), the information below will hopefully
11089 \begin_layout Description
11090 \begin_inset Flex CharStyle:Code
11093 \begin_layout Plain Layout
11100 \begin_inset Flex CharStyle:Code
11103 \begin_layout Plain Layout
11110 \begin_inset Quotes erd
11114 \begin_inset Quotes erd
11117 ] The file name extension of an auxiliary file for the list of figures (or
11119 LaTeX writes the captions to this file.
11122 \begin_layout Description
11123 \begin_inset Flex CharStyle:Code
11126 \begin_layout Plain Layout
11133 \begin_inset Flex CharStyle:Code
11136 \begin_layout Plain Layout
11143 \begin_inset Quotes erd
11147 \begin_inset Quotes erd
11150 ] The string that will be used in the menus and also for the caption.
11153 \begin_layout Description
11154 \begin_inset Flex CharStyle:Code
11157 \begin_layout Plain Layout
11164 \begin_inset Flex CharStyle:Code
11167 \begin_layout Plain Layout
11176 \begin_inset Flex CharStyle:Code
11179 \begin_layout Plain Layout
11186 \begin_inset Flex CharStyle:Code
11189 \begin_layout Plain Layout
11195 if the float is already defined by the LaTeX document class.
11197 \begin_inset Flex CharStyle:Code
11200 \begin_layout Plain Layout
11206 , the float will be defined using the LaTeX package
11207 \begin_inset Flex CharStyle:Code
11210 \begin_layout Plain Layout
11219 \begin_layout Description
11220 \begin_inset Flex CharStyle:Code
11223 \begin_layout Plain Layout
11230 \begin_inset Flex CharStyle:Code
11233 \begin_layout Plain Layout
11240 \begin_inset Quotes erd
11244 \begin_inset Quotes erd
11247 ] The heading used for the list of floats.
11250 \begin_layout Description
11251 \begin_inset Flex CharStyle:Code
11254 \begin_layout Plain Layout
11261 \begin_inset Flex CharStyle:Code
11264 \begin_layout Plain Layout
11271 \begin_inset Quotes erd
11275 \begin_inset Quotes erd
11278 ] This (optional) argument determines whether floats of this class will
11279 be numbered within some sectional unit of the document.
11280 For example, if within is equal to
11281 \begin_inset Flex CharStyle:Code
11284 \begin_layout Plain Layout
11290 , the floats will be numbered within chapters.
11294 \begin_layout Description
11295 \begin_inset Flex CharStyle:Code
11298 \begin_layout Plain Layout
11305 \begin_inset Flex CharStyle:Code
11308 \begin_layout Plain Layout
11315 \begin_inset Quotes erd
11319 \begin_inset Quotes erd
11322 ] The default placement for the given class of floats.
11323 The string should be as in standard LaTeX:
11324 \begin_inset Flex CharStyle:Code
11327 \begin_layout Plain Layout
11334 \begin_inset Flex CharStyle:Code
11337 \begin_layout Plain Layout
11344 \begin_inset Flex CharStyle:Code
11347 \begin_layout Plain Layout
11354 \begin_inset Flex CharStyle:Code
11357 \begin_layout Plain Layout
11363 for top, bottom, page, and here, respectively.
11367 \begin_layout Plain Layout
11368 Note that the order of these letters in the string is irrelevant, like in
11374 On top of that there is a new type,
11375 \begin_inset Flex CharStyle:Code
11378 \begin_layout Plain Layout
11384 , which does not really correspond to a float, since it means: put it
11385 \begin_inset Quotes eld
11389 \begin_inset Quotes erd
11393 Note however that the
11394 \begin_inset Flex CharStyle:Code
11397 \begin_layout Plain Layout
11403 specifier is special and, because of implementation details, cannot be
11404 used in non-built in float types.
11405 If you do not understand what this means, just use
11406 \begin_inset Quotes eld
11410 \begin_inset Flex CharStyle:Code
11413 \begin_layout Plain Layout
11420 \begin_inset Quotes erd
11426 \begin_layout Description
11427 \begin_inset Flex CharStyle:Code
11430 \begin_layout Plain Layout
11437 \begin_inset Flex CharStyle:Code
11440 \begin_layout Plain Layout
11447 \begin_inset Quotes erd
11451 \begin_inset Quotes erd
11454 ] The style used when defining the float using
11455 \begin_inset Flex CharStyle:Code
11458 \begin_layout Plain Layout
11469 \begin_layout Description
11470 \begin_inset Flex CharStyle:Code
11473 \begin_layout Plain Layout
11480 \begin_inset Flex CharStyle:Code
11483 \begin_layout Plain Layout
11490 \begin_inset Quotes erd
11494 \begin_inset Quotes erd
11498 \begin_inset Quotes eld
11502 \begin_inset Quotes erd
11505 of the new class of floats, like program or algorithm.
11506 After the appropriate
11507 \begin_inset Flex CharStyle:Code
11510 \begin_layout Plain Layout
11519 \begin_inset Flex CharStyle:Code
11522 \begin_layout Plain Layout
11531 \begin_inset Flex CharStyle:Code
11534 \begin_layout Plain Layout
11545 \begin_layout Standard
11546 Note that defining a float with type
11547 \begin_inset Flex CharStyle:Code
11550 \begin_layout Plain Layout
11558 automatically defines the corresponding counter with name
11559 \begin_inset Flex CharStyle:Code
11562 \begin_layout Plain Layout
11573 \begin_layout Subsection
11574 Flex insets and InsetLayout
11575 \begin_inset CommandInset label
11577 name "sub:Flex-insets-and"
11584 \begin_layout Standard
11585 LyX has supported character styles since version 1.4.0; as of version 1.6.0,
11586 these are called Flex insets.
11590 \begin_layout Standard
11591 Flex insets come in three different kinds:
11594 \begin_layout Itemize
11596 \begin_inset Flex CharStyle:Code
11599 \begin_layout Plain Layout
11605 ): These define semantic markup corresponding to such LaTeX commands as
11607 \begin_inset Flex CharStyle:Code
11610 \begin_layout Plain Layout
11619 \begin_inset Flex CharStyle:Code
11622 \begin_layout Plain Layout
11633 \begin_layout Itemize
11635 \begin_inset Flex CharStyle:Code
11638 \begin_layout Plain Layout
11644 ): These can be used to define custom collapsible insets, similar to TeX
11645 code, footnote, and the like.
11646 An obvious example is an endnote inset, which is defined in the
11647 \begin_inset Flex CharStyle:Code
11650 \begin_layout Plain Layout
11659 \begin_layout Itemize
11661 \begin_inset Flex CharStyle:Code
11664 \begin_layout Plain Layout
11670 ): For use with DocBook classes.
11673 \begin_layout Standard
11674 Flex insets are defined using the
11675 \begin_inset Flex CharStyle:Code
11678 \begin_layout Plain Layout
11684 tag, which shall be explained in a moment.
11687 \begin_layout Standard
11689 \begin_inset Flex CharStyle:Code
11692 \begin_layout Plain Layout
11698 tag also serves another function: It can be used to customize the general
11699 layout of many different types of insets.
11701 \begin_inset Flex CharStyle:Code
11704 \begin_layout Plain Layout
11710 can be used to customize the layout parameters for footnotes, marginal
11711 notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
11712 boxes, tables, algorithms, URLs, and optional arguments, as well as to
11713 define Flex insets.
11716 \begin_layout Standard
11718 \begin_inset Flex CharStyle:Code
11721 \begin_layout Plain Layout
11727 definition must begin with a line of the form:
11730 \begin_layout LyX-Code
11734 \begin_layout Standard
11736 \begin_inset Flex CharStyle:Code
11739 \begin_layout Plain Layout
11745 indicates the inset whose layout is being defined, and here there are two
11749 \begin_layout Enumerate
11750 The layout for a pre-existing inset is being modified.
11751 In this case, can be
11752 \begin_inset Flex CharStyle:Code
11755 \begin_layout Plain Layout
11761 any one of the following:
11762 \begin_inset Flex CharStyle:Code
11765 \begin_layout Plain Layout
11772 \begin_inset Flex CharStyle:Code
11775 \begin_layout Plain Layout
11782 \begin_inset Flex CharStyle:Code
11785 \begin_layout Plain Layout
11792 \begin_inset Flex CharStyle:Code
11795 \begin_layout Plain Layout
11802 \begin_inset Flex CharStyle:Code
11805 \begin_layout Plain Layout
11812 \begin_inset Flex CharStyle:Code
11815 \begin_layout Plain Layout
11822 \begin_inset Flex CharStyle:Code
11825 \begin_layout Plain Layout
11832 \begin_inset Flex CharStyle:Code
11835 \begin_layout Plain Layout
11842 \begin_inset Flex CharStyle:Code
11845 \begin_layout Plain Layout
11852 \begin_inset Flex CharStyle:Code
11855 \begin_layout Plain Layout
11862 \begin_inset Flex CharStyle:Code
11865 \begin_layout Plain Layout
11872 \begin_inset Flex CharStyle:Code
11875 \begin_layout Plain Layout
11882 \begin_inset Flex CharStyle:Code
11885 \begin_layout Plain Layout
11892 \begin_inset Flex CharStyle:Code
11895 \begin_layout Plain Layout
11902 \begin_inset Flex CharStyle:Code
11905 \begin_layout Plain Layout
11912 \begin_inset Flex CharStyle:Code
11915 \begin_layout Plain Layout
11922 \begin_inset Flex CharStyle:Code
11925 \begin_layout Plain Layout
11932 \begin_inset Flex CharStyle:Code
11935 \begin_layout Plain Layout
11942 \begin_inset Flex CharStyle:Code
11945 \begin_layout Plain Layout
11952 \begin_inset Flex CharStyle:Code
11955 \begin_layout Plain Layout
11965 \begin_layout Enumerate
11966 The layout for a Flex inset is being defined.
11968 \begin_inset Flex CharStyle:Code
11971 \begin_layout Plain Layout
11977 can be any valid identifier not used by a pre-existing inset.
11978 Note that the definition of a flex inset must
11983 \begin_inset Flex CharStyle:Code
11986 \begin_layout Plain Layout
11995 \begin_layout Standard
11997 \begin_inset Flex CharStyle:Code
12000 \begin_layout Plain Layout
12006 definition can contain the following entries:
12009 \begin_layout Description
12010 \begin_inset Flex CharStyle:Code
12013 \begin_layout Plain Layout
12019 The color for the inset's background.
12020 The valid colors are defined in
12021 \begin_inset Flex CharStyle:Code
12024 \begin_layout Plain Layout
12033 \begin_layout Description
12034 \begin_inset Flex CharStyle:Code
12037 \begin_layout Plain Layout
12043 As with paragraph styles (see page
12044 \begin_inset CommandInset ref
12046 reference "des:CopyStyle"
12053 \begin_layout Description
12054 \begin_inset Flex CharStyle:Code
12057 \begin_layout Plain Layout
12064 \begin_inset Flex CharStyle:Code
12067 \begin_layout Plain Layout
12076 \begin_inset Flex CharStyle:Code
12079 \begin_layout Plain Layout
12085 ] Indicates whether the user may employ the Paragraph Settings dialog to
12086 customize the paragraph.
12089 \begin_layout Description
12090 \begin_inset Flex CharStyle:Code
12093 \begin_layout Plain Layout
12100 \begin_inset Flex CharStyle:Code
12103 \begin_layout Plain Layout
12110 \begin_inset Flex CharStyle:Code
12113 \begin_layout Plain Layout
12120 \begin_inset Flex CharStyle:Code
12123 \begin_layout Plain Layout
12129 , describing the rendering style used for the inset's frame and buttons.
12130 Footnotes generally use
12131 \begin_inset Flex CharStyle:Code
12134 \begin_layout Plain Layout
12140 , ERT insets generally
12141 \begin_inset Flex CharStyle:Code
12144 \begin_layout Plain Layout
12150 , and character styles
12151 \begin_inset Flex CharStyle:Code
12154 \begin_layout Plain Layout
12163 \begin_layout Description
12164 \begin_inset Flex CharStyle:Code
12167 \begin_layout Plain Layout
12173 Required at the end of the InsetLayout declarations.
12176 \begin_layout Description
12177 \begin_inset Flex CharStyle:Code
12180 \begin_layout Plain Layout
12186 The font used for both the text body
12192 \begin_inset space ~
12196 \begin_inset CommandInset ref
12198 reference "sub:Font-description"
12203 Note that defining this font automatically defines the
12204 \begin_inset Flex CharStyle:Code
12207 \begin_layout Plain Layout
12213 to the same value, so define this first and define
12214 \begin_inset Flex CharStyle:Code
12217 \begin_layout Plain Layout
12223 later if you want them to be different.
12226 \begin_layout Description
12227 \begin_inset Flex CharStyle:Code
12230 \begin_layout Plain Layout
12237 \begin_inset Quotes eld
12241 \begin_inset Quotes erd
12244 language, leading to Left-to-Right (latin) output, e.
12245 \begin_inset space \thinspace{}
12249 \begin_inset space \space{}
12252 in TeX code or URL.
12256 \begin_layout Description
12257 \begin_inset Flex CharStyle:Code
12260 \begin_layout Plain Layout
12267 \begin_inset Flex CharStyle:Code
12270 \begin_layout Plain Layout
12279 \begin_inset Flex CharStyle:Code
12282 \begin_layout Plain Layout
12288 ] Indicates whether the PlainLayout should be used or, instead, the user
12289 can change the paragraph style used in the inset.
12292 \begin_layout Description
12293 \begin_inset Flex CharStyle:Code
12296 \begin_layout Plain Layout
12302 As with paragraph styles (see page
12303 \begin_inset CommandInset ref
12304 LatexCommand pageref
12305 reference "des:FreeSpacing"
12312 \begin_layout Description
12313 \begin_inset Flex CharStyle:Code
12316 \begin_layout Plain Layout
12323 \begin_inset Flex CharStyle:Code
12326 \begin_layout Plain Layout
12335 \begin_inset Flex CharStyle:Code
12338 \begin_layout Plain Layout
12344 ] Whether to include the contents of this inset in the strings generated
12345 for the `Outline' pane.
12346 One would not, for example, want the content of a footnote in a section
12347 header to be included in the TOC displayed in the outline, but one would
12348 normally want the content of a character style displayed.
12349 Default is false: not to include.
12352 \begin_layout Description
12353 \begin_inset Flex CharStyle:Code
12356 \begin_layout Plain Layout
12362 As with paragraph styles (see page
12363 \begin_inset CommandInset ref
12364 LatexCommand pageref
12365 reference "des:KeepEmpty"
12372 \begin_layout Description
12373 \begin_inset Flex CharStyle:Code
12376 \begin_layout Plain Layout
12382 The font used for the label.
12384 \begin_inset space ~
12388 \begin_inset CommandInset ref
12390 reference "sub:Font-description"
12395 Note that this definition can never appear before
12396 \begin_inset Flex CharStyle:Code
12399 \begin_layout Plain Layout
12405 , lest it be ineffective.
12408 \begin_layout Description
12409 \begin_inset Flex CharStyle:Code
12412 \begin_layout Plain Layout
12418 What will be displayed on the button or elsewhere as the inset label.
12419 Some inset types (TeX code and Branch) modify this label on the fly.
12422 \begin_layout Description
12423 \begin_inset Flex CharStyle:Code
12426 \begin_layout Plain Layout
12432 The name of the corresponding LaTeX stuff.
12433 Either the environment or command name.
12436 \begin_layout Description
12437 \begin_inset Flex CharStyle:Code
12440 \begin_layout Plain Layout
12446 The optional parameter for the corresponding
12447 \begin_inset Flex CharStyle:Code
12450 \begin_layout Plain Layout
12456 stuff, including possible bracket pairs like
12457 \begin_inset Flex CharStyle:Code
12460 \begin_layout Plain Layout
12467 This parameter cannot be changed from within LyX.
12470 \begin_layout Description
12471 \begin_inset Flex CharStyle:Code
12474 \begin_layout Plain Layout
12480 As with paragraph styles (see page
12481 \begin_inset CommandInset ref
12482 LatexCommand pageref
12483 reference "des:LatexType"
12490 \begin_layout Description
12491 \begin_inset Flex CharStyle:Code
12494 \begin_layout Plain Layout
12501 \begin_inset Flex CharStyle:Code
12504 \begin_layout Plain Layout
12511 \begin_inset Flex CharStyle:Code
12514 \begin_layout Plain Layout
12521 \begin_inset Flex CharStyle:Code
12524 \begin_layout Plain Layout
12531 \begin_inset Flex CharStyle:Code
12534 \begin_layout Plain Layout
12540 (indicating a dummy definition ending definitions of charstyles, etc).
12541 This entry is required in and is only meaningful for Flex insets.
12542 Among other things, it determines on which menu this inset will appear.
12545 \begin_layout Description
12546 \begin_inset Flex CharStyle:Code
12549 \begin_layout Plain Layout
12556 \begin_inset Flex CharStyle:Code
12559 \begin_layout Plain Layout
12568 \begin_inset Flex CharStyle:Code
12571 \begin_layout Plain Layout
12577 ] Whether multiple paragraphs are permitted in this inset.
12578 This will also set CustomPars to the same value and ForcePlain to the opposite
12580 These can be reset to other values, if they are used
12587 \begin_layout Description
12588 \begin_inset Flex CharStyle:Code
12591 \begin_layout Plain Layout
12598 \begin_inset Flex CharStyle:Code
12601 \begin_layout Plain Layout
12610 \begin_inset Flex CharStyle:Code
12613 \begin_layout Plain Layout
12619 ] Whether fragile commands in this layout should be
12620 \begin_inset Flex CharStyle:Code
12623 \begin_layout Plain Layout
12636 whether the command should itself be protected.)
12639 \begin_layout Description
12640 \begin_inset Flex CharStyle:Code
12643 \begin_layout Plain Layout
12650 \begin_inset Flex CharStyle:Code
12653 \begin_layout Plain Layout
12662 \begin_inset Flex CharStyle:Code
12665 \begin_layout Plain Layout
12671 ] As with paragraph styles (see page
12672 \begin_inset CommandInset ref
12674 reference "des:PathThru"
12681 \begin_layout Description
12682 \begin_inset Flex CharStyle:Code
12685 \begin_layout Plain Layout
12691 As with paragraph styles (see page
12692 \begin_inset CommandInset ref
12693 LatexCommand pageref
12694 reference "des:Preamble"
12701 \begin_layout Description
12702 \begin_inset Flex CharStyle:Code
12705 \begin_layout Plain Layout
12712 \begin_inset Flex CharStyle:Code
12715 \begin_layout Plain Layout
12721 ] As with paragraph styles (see page
12722 \begin_inset CommandInset ref
12723 LatexCommand pageref
12724 reference "des:Requires"
12731 \begin_layout Subsection
12733 \begin_inset CommandInset label
12735 name "sub:Counters"
12742 \begin_layout Standard
12743 Since version 1.3.0 of LyX, it is both possible and necessary to define the
12745 \begin_inset Flex CharStyle:MenuItem
12748 \begin_layout Plain Layout
12755 \begin_inset Flex CharStyle:MenuItem
12758 \begin_layout Plain Layout
12764 , \SpecialChar \ldots{}
12765 ) in the text class itself.
12766 The standard counters are defined in the file
12767 \begin_inset Flex CharStyle:Code
12770 \begin_layout Plain Layout
12776 , so you may have to do no more than add
12779 \begin_layout LyX-Code
12780 Input stdcounters.inc
12783 \begin_layout Standard
12784 to your layout file to get them to work.
12785 But if you want to define custom counters, then you can do so.
12786 The counter declaration must begin with:
12789 \begin_layout LyX-Code
12793 \begin_layout Standard
12794 where of course `name' is replaced by the name of the counter.
12795 And it must end with
12796 \begin_inset Quotes eld
12800 \begin_inset Flex CharStyle:Code
12803 \begin_layout Plain Layout
12810 \begin_inset Quotes erd
12814 The following parameters can also be used:
12817 \begin_layout Description
12818 \begin_inset Flex CharStyle:Code
12821 \begin_layout Plain Layout
12822 LabelString [string=""]
12827 when this is defined, this string defines how the counter is displayed.
12828 Setting this value sets
12829 \begin_inset Flex CharStyle:Code
12832 \begin_layout Plain Layout
12833 LabelStringAppendix
12839 The following special constructs can be used in the string:
12843 \begin_layout Itemize
12844 \begin_inset Flex CharStyle:Code
12847 \begin_layout Plain Layout
12855 will be replaced by the expansion of the
12856 \begin_inset Flex CharStyle:Code
12859 \begin_layout Plain Layout
12866 \begin_inset Flex CharStyle:Code
12869 \begin_layout Plain Layout
12870 LabelStringAppendix
12876 \begin_inset Flex CharStyle:Code
12879 \begin_layout Plain Layout
12889 \begin_layout Itemize
12890 counter values can be expressed using LaTeX-like macros
12891 \begin_inset Flex CharStyle:Code
12894 \begin_layout Plain Layout
12911 \begin_inset Flex CharStyle:Code
12914 \begin_layout Plain Layout
12926 \begin_layout Plain Layout
12936 Actually, the situation is a bit more complicated: any
12955 other than those described below will produce arabic numerals.
12956 It would not be surprising to see this change in the future.
12962 \begin_inset Flex CharStyle:Code
12965 \begin_layout Plain Layout
12971 : 1, 2, 3,\SpecialChar \ldots{}
12973 \begin_inset Flex CharStyle:Code
12976 \begin_layout Plain Layout
12982 for lower-case letters: a, b, c, \SpecialChar \ldots{}
12984 \begin_inset Flex CharStyle:Code
12987 \begin_layout Plain Layout
12993 for upper-case letters: A, B, C, \SpecialChar \ldots{}
12995 \begin_inset Flex CharStyle:Code
12998 \begin_layout Plain Layout
13004 for lower-case roman numerals: i, ii, iii, \SpecialChar \ldots{}
13006 \begin_inset Flex CharStyle:Code
13009 \begin_layout Plain Layout
13015 for upper-case roman numerals: I, II, III\SpecialChar \ldots{}
13017 \begin_inset Flex CharStyle:Code
13020 \begin_layout Plain Layout
13026 for hebrew numerals.
13030 \begin_layout Standard
13031 If LabelString is not defined, a default value is constructed as follows:
13032 if the counter has a master counter
13033 \begin_inset Flex CharStyle:Code
13036 \begin_layout Plain Layout
13043 \begin_inset Flex CharStyle:Code
13046 \begin_layout Plain Layout
13053 \begin_inset Flex CharStyle:Code
13056 \begin_layout Plain Layout
13066 is used; otherwise the string
13067 \begin_inset Flex CharStyle:Code
13070 \begin_layout Plain Layout
13081 \begin_layout Description
13082 \begin_inset Flex CharStyle:Code
13085 \begin_layout Plain Layout
13086 LabelStringAppendix [string=""]
13092 \begin_inset Flex CharStyle:Code
13095 \begin_layout Plain Layout
13101 , but for use in the Appendix.
13104 \begin_layout Description
13105 \begin_inset Flex CharStyle:Code
13108 \begin_layout Plain Layout
13115 \begin_inset Flex CharStyle:Code
13118 \begin_layout Plain Layout
13125 \begin_inset Quotes erd
13129 \begin_inset Quotes erd
13132 ] If this is set to the name of another counter, the present counter will
13133 be reset every time the other one is increased.
13135 \begin_inset Flex CharStyle:Code
13138 \begin_layout Plain Layout
13145 \begin_inset Flex CharStyle:Code
13148 \begin_layout Plain Layout
13157 \begin_layout Subsection
13159 \begin_inset CommandInset label
13161 name "sub:Font-description"
13168 \begin_layout Standard
13169 A font description looks like this:
13172 \begin_layout LyX-Code
13182 \begin_layout LyX-Code
13186 \begin_layout LyX-Code
13190 \begin_layout Standard
13191 The following commands are available:
13194 \begin_layout Description
13195 \begin_inset Flex CharStyle:Code
13198 \begin_layout Plain Layout
13205 \begin_inset Flex CharStyle:Code
13208 \begin_layout Plain Layout
13217 \begin_inset Flex CharStyle:Code
13220 \begin_layout Plain Layout
13227 \begin_inset Flex CharStyle:Code
13230 \begin_layout Plain Layout
13237 \begin_inset Flex CharStyle:Code
13240 \begin_layout Plain Layout
13247 \begin_inset Flex CharStyle:Code
13250 \begin_layout Plain Layout
13257 \begin_inset Flex CharStyle:Code
13260 \begin_layout Plain Layout
13267 \begin_inset Flex CharStyle:Code
13270 \begin_layout Plain Layout
13277 \begin_inset Flex CharStyle:Code
13280 \begin_layout Plain Layout
13287 \begin_inset Flex CharStyle:Code
13290 \begin_layout Plain Layout
13299 \begin_layout Description
13300 \begin_inset Flex CharStyle:Code
13303 \begin_layout Plain Layout
13312 \begin_inset Flex CharStyle:Code
13315 \begin_layout Plain Layout
13326 \begin_inset Flex CharStyle:Code
13329 \begin_layout Plain Layout
13336 \begin_inset Flex CharStyle:Code
13339 \begin_layout Plain Layout
13348 \begin_layout Description
13349 \begin_inset Flex CharStyle:Code
13352 \begin_layout Plain Layout
13359 \begin_inset Flex CharStyle:Code
13362 \begin_layout Plain Layout
13368 ] Valid argument are:
13369 \begin_inset Flex CharStyle:Code
13372 \begin_layout Plain Layout
13379 \begin_inset Flex CharStyle:Code
13382 \begin_layout Plain Layout
13389 \begin_inset Flex CharStyle:Code
13392 \begin_layout Plain Layout
13399 \begin_inset Flex CharStyle:Code
13402 \begin_layout Plain Layout
13409 \begin_inset Flex CharStyle:Code
13412 \begin_layout Plain Layout
13419 \begin_inset Flex CharStyle:Code
13422 \begin_layout Plain Layout
13429 Each of these turns on or off the corresponding attribute.
13432 \begin_layout Description
13433 \begin_inset Flex CharStyle:Code
13436 \begin_layout Plain Layout
13445 \begin_inset Flex CharStyle:Code
13448 \begin_layout Plain Layout
13459 \begin_inset Flex CharStyle:Code
13462 \begin_layout Plain Layout
13471 \begin_layout Description
13472 \begin_inset Flex CharStyle:Code
13475 \begin_layout Plain Layout
13484 \begin_inset Flex CharStyle:Code
13487 \begin_layout Plain Layout
13498 \begin_inset Flex CharStyle:Code
13501 \begin_layout Plain Layout
13508 \begin_inset Flex CharStyle:Code
13511 \begin_layout Plain Layout
13518 \begin_inset Flex CharStyle:Code
13521 \begin_layout Plain Layout
13530 \begin_layout Description
13531 \begin_inset Flex CharStyle:Code
13534 \begin_layout Plain Layout
13541 \begin_inset Flex CharStyle:Code
13544 \begin_layout Plain Layout
13551 \begin_inset Flex CharStyle:Code
13554 \begin_layout Plain Layout
13561 \begin_inset Flex CharStyle:Code
13564 \begin_layout Plain Layout
13573 \begin_inset Flex CharStyle:Code
13576 \begin_layout Plain Layout
13583 \begin_inset Flex CharStyle:Code
13586 \begin_layout Plain Layout
13593 \begin_inset Flex CharStyle:Code
13596 \begin_layout Plain Layout
13603 \begin_inset Flex CharStyle:Code
13606 \begin_layout Plain Layout
13613 \begin_inset Flex CharStyle:Code
13616 \begin_layout Plain Layout
13625 \begin_layout Subsection
13626 Upgrading old layout files
13629 \begin_layout Standard
13630 The file format of layout files changes from time to time, so old layout
13631 files need to be converted.
13632 This process has been automated since LyX 1.4.0: If LyX reads an old format
13633 layout file it will call the conversion tool
13634 \begin_inset Flex CharStyle:Code
13637 \begin_layout Plain Layout
13638 LyXDir/scripts/layout2layout.py
13643 and convert it to a temporary file in current format.
13644 The original file is left untouched.
13645 If you want to convert the layout file permanently, just call the converter
13649 \begin_layout LyX-Code
13650 python $LyXDir/scripts/layout2layout.py myclass.layout myclassnew.layout
13653 \begin_layout Standard
13654 (You need to replace
13655 \begin_inset Flex CharStyle:Code
13658 \begin_layout Plain Layout
13664 with the name of your LyX system directory, unless you happen to have defined
13665 such an environment variable.) Then copy
13666 \begin_inset Flex CharStyle:Code
13669 \begin_layout Plain Layout
13676 \begin_inset Flex CharStyle:Code
13679 \begin_layout Plain Layout
13688 \begin_layout Standard
13689 The automatic conversion only handles syntax changes.
13690 It cannot handle the case where the contents of included files was changed,
13691 so these will have to be converted separately.
13694 \begin_layout Section
13696 \begin_inset CommandInset label
13698 name "sec:Creating-Templates"
13705 \begin_layout Standard
13706 Templates are created just like usual documents.
13707 The only difference is that usual documents contain all possible settings,
13708 including the font scheme and the paper size.
13709 Usually a user doesn't want a template to overwrite his defaults in these
13711 For that reason, the designer of a template should remove the corresponding
13713 \begin_inset Flex CharStyle:Code
13716 \begin_layout Plain Layout
13725 \begin_inset Flex CharStyle:Code
13728 \begin_layout Plain Layout
13736 from the template LyX file.
13737 This can be done with any simple text-editor, for example
13738 \begin_inset Flex CharStyle:Code
13741 \begin_layout Plain Layout
13748 \begin_inset Flex CharStyle:Code
13751 \begin_layout Plain Layout
13761 \begin_layout Standard
13762 Put the edited template files you create in
13763 \begin_inset Flex CharStyle:Code
13766 \begin_layout Plain Layout
13772 , copy the ones you use from the global template directory in
13773 \begin_inset Flex CharStyle:Code
13776 \begin_layout Plain Layout
13782 to the same place, and redefine the template path in the
13783 \begin_inset Flex CharStyle:MenuItem
13786 \begin_layout Plain Layout
13787 Tools\SpecialChar \menuseparator
13788 Preferences\SpecialChar \menuseparator
13797 \begin_layout Standard
13798 Note that there is a template which has a particular meaning:
13799 \begin_inset Flex CharStyle:Code
13802 \begin_layout Plain Layout
13809 This template is loaded every time you create a new document with
13810 \begin_inset Flex CharStyle:MenuItem
13813 \begin_layout Plain Layout
13814 File\SpecialChar \menuseparator
13820 in order to provide useful defaults.
13821 To create this template from inside LyX, all you have to do is to open
13822 a document with the correct settings, and use the
13823 \begin_inset Flex CharStyle:MenuItem
13826 \begin_layout Plain Layout
13827 Save as Document Defaults
13835 \begin_layout Chapter
13836 Including External Material
13839 \begin_layout Standard
13840 \begin_inset Box Shadowbox
13849 height_special "totalheight"
13852 \begin_layout Plain Layout
13853 WARNING: This portion of the documentation has not been updated for some
13855 We certainly hope that it is still accurate, but there are no guarantees.
13863 \begin_layout Standard
13864 The use of material from sources external to LyX is covered in detail in
13870 This part of the manual covers what needs to happen behind the scenes for
13871 new sorts of material to be included.
13874 \begin_layout Section
13878 \begin_layout Standard
13879 The external material feature is based on the concept of a
13884 A template is a specification of how LyX should interface with a certain
13886 As bundled, LyX comes with predefined templates for Xfig figures, various
13887 raster format images, chess diagrams, and LilyPond music notation.
13888 You can check the actual list by using the menu
13889 \begin_inset Flex CharStyle:MenuItem
13892 \begin_layout Plain Layout
13893 Insert\SpecialChar \menuseparator
13894 File\SpecialChar \menuseparator
13901 Furthermore, it is possible to roll your own template to support a specific
13903 Later we'll describe in more detail what is involved, and hopefully you
13904 will submit all the templates you create so we can include them in a later
13908 \begin_layout Standard
13909 Another basic idea of the external material feature is to distinguish between
13910 the original file that serves as a base for final material and the produced
13911 file that is included in your exported or printed document.
13912 For example, consider the case of a figure produced with
13913 \begin_inset Flex CharStyle:Code
13916 \begin_layout Plain Layout
13923 The Xfig application itself works on an original file with the
13924 \begin_inset Flex CharStyle:Code
13927 \begin_layout Plain Layout
13934 Within Xfig, you create and change your figure, and when you are done,
13936 \begin_inset Flex CharStyle:Code
13939 \begin_layout Plain Layout
13946 When you want to include the figure in your document, you invoke
13947 \begin_inset Flex CharStyle:Code
13950 \begin_layout Plain Layout
13956 in order to create a PostScript file that can readily be included in your
13959 \begin_inset Flex CharStyle:Code
13962 \begin_layout Plain Layout
13968 file is the original file, and the PostScript file is the produced file.
13971 \begin_layout Standard
13972 This distinction is important in order to allow updating of the material
13973 while you are in the process of writing the document.
13974 Furthermore, it provides us with the flexibility that is needed to support
13975 multiple export formats.
13976 For instance, in the case of a plain text file, it is not exactly an award-winn
13977 ing idea to include the figure as raw PostScript.
13978 Instead, you'd either prefer to just include a reference to the figure
13979 or try to invoke some graphics to ASCII converter to make the final result
13980 look similar to the real graphics.
13981 The external material management allows you to do this, because it is parametri
13982 zed on the different export formats that LyX supports.
13985 \begin_layout Standard
13986 Besides supporting the production of different products according to the
13987 exported format, it supports tight integration with editing and viewing
13989 In the case of an Xfig figure, you are able to invoke Xfig on the original
13990 file with a single click from within the external material dialog in LyX,
13991 and also preview the produced PostScript file with Ghostview with another
13993 No more fiddling around with the command line and/or file browsers to locate
13994 and manipulate the original or produced files.
13995 In this way, you are finally able to take full advantage of the many different
13996 applications that are relevant to use when you write your documents, and
13997 ultimately be more productive.
14000 \begin_layout Section
14001 The external template configuration file
14004 \begin_layout Standard
14005 It is relatively easy to add custom external template definitions to LyX.
14006 However, be aware that doing this in an careless manner most probably
14010 introduce an easily exploitable security hole.
14011 So before you do this, please read the discussion about security in section
14013 \begin_inset CommandInset ref
14015 reference "sec:Security-discussion"
14022 \begin_layout Standard
14023 Having said that, we encourage you to submit any interesting templates that
14028 \begin_layout Standard
14029 The external templates are defined in the
14030 \begin_inset Flex CharStyle:Code
14033 \begin_layout Plain Layout
14034 LyXDir/lib/external_templates
14040 You can place your own version in
14041 \begin_inset Flex CharStyle:Code
14044 \begin_layout Plain Layout
14045 UserDir/external_templates
14053 \begin_layout Standard
14054 A typical template looks like this:
14057 \begin_layout LyX-Code
14061 \begin_layout LyX-Code
14062 GuiName "XFig: $$AbsOrRelPathParent$$Basename"
14065 \begin_layout LyX-Code
14069 \begin_layout LyX-Code
14073 \begin_layout LyX-Code
14077 \begin_layout LyX-Code
14081 \begin_layout LyX-Code
14085 \begin_layout LyX-Code
14086 AutomaticProduction true
14089 \begin_layout LyX-Code
14093 \begin_layout LyX-Code
14097 \begin_layout LyX-Code
14101 \begin_layout LyX-Code
14102 TransformCommand Rotate RotationLatexCommand
14105 \begin_layout LyX-Code
14106 TransformCommand Resize ResizeLatexCommand
14109 \begin_layout LyX-Code
14110 Product "$$RotateFront$$ResizeFront
14113 \begin_layout LyX-Code
14118 input{$$AbsOrRelPathMaster$$Basename.pstex_t}
14121 \begin_layout LyX-Code
14122 $$ResizeBack$$RotateBack"
14125 \begin_layout LyX-Code
14129 \begin_layout LyX-Code
14130 UpdateResult "$$AbsPath$$Basename.pstex_t"
14133 \begin_layout LyX-Code
14134 Requirement "graphicx"
14137 \begin_layout LyX-Code
14138 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
14141 \begin_layout LyX-Code
14142 ReferencedFile latex "$$AbsPath$$Basename.eps"
14145 \begin_layout LyX-Code
14146 ReferencedFile dvi "$$AbsPath$$Basename.eps"
14149 \begin_layout LyX-Code
14153 \begin_layout LyX-Code
14157 \begin_layout LyX-Code
14158 TransformCommand Rotate RotationLatexCommand
14161 \begin_layout LyX-Code
14162 TransformCommand Resize ResizeLatexCommand
14165 \begin_layout LyX-Code
14166 Product "$$RotateFront$$ResizeFront
14169 \begin_layout LyX-Code
14174 input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
14177 \begin_layout LyX-Code
14178 $$ResizeBack$$RotateBack"
14181 \begin_layout LyX-Code
14182 UpdateFormat pdftex
14185 \begin_layout LyX-Code
14186 UpdateResult "$$AbsPath$$Basename.pdftex_t"
14189 \begin_layout LyX-Code
14190 Requirement "graphicx"
14193 \begin_layout LyX-Code
14194 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
14197 \begin_layout LyX-Code
14198 ReferencedFile latex "$$AbsPath$$Basename.pdf"
14201 \begin_layout LyX-Code
14205 \begin_layout LyX-Code
14209 \begin_layout LyX-Code
14210 Product "$$Contents(
14212 "$$AbsPath$$Basename.asc
14217 \begin_layout LyX-Code
14218 UpdateFormat asciixfig
14221 \begin_layout LyX-Code
14222 UpdateResult "$$AbsPath$$Basename.asc"
14225 \begin_layout LyX-Code
14229 \begin_layout LyX-Code
14233 \begin_layout LyX-Code
14234 Product "<graphic fileref=
14236 "$$AbsOrRelPathMaster$$Basename.eps
14241 \begin_layout LyX-Code
14245 \begin_layout LyX-Code
14249 \begin_layout LyX-Code
14250 UpdateResult "$$AbsPath$$Basename.eps"
14253 \begin_layout LyX-Code
14254 ReferencedFile docbook "$$AbsPath$$Basename.eps"
14257 \begin_layout LyX-Code
14258 ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
14261 \begin_layout LyX-Code
14265 \begin_layout LyX-Code
14266 Product "[XFig: $$FName]"
14269 \begin_layout LyX-Code
14273 \begin_layout LyX-Code
14277 \begin_layout Standard
14278 As you can see, the template is enclosed in
14279 \begin_inset Flex CharStyle:Code
14282 \begin_layout Plain Layout
14288 \SpecialChar \ldots{}
14290 \begin_inset Flex CharStyle:Code
14293 \begin_layout Plain Layout
14300 It contains a header specifying some general settings and, for each supported
14301 primary document file format, a section
14302 \begin_inset Flex CharStyle:Code
14305 \begin_layout Plain Layout
14311 \SpecialChar \ldots{}
14313 \begin_inset Flex CharStyle:Code
14316 \begin_layout Plain Layout
14325 \begin_layout Subsection
14326 The template header
14329 \begin_layout Description
14330 \begin_inset Flex CharStyle:Code
14333 \begin_layout Plain Layout
14334 AutomaticProduction
14335 \begin_inset space ~
14343 Whether the file represented by the template must be generated by LyX.
14344 This command must occur exactly once.
14347 \begin_layout Description
14348 \begin_inset Flex CharStyle:Code
14351 \begin_layout Plain Layout
14353 \begin_inset space ~
14361 A glob pattern that is used in the file dialog to filter out the desired
14363 If there is more than one possible file extension (e.
14364 \begin_inset space \thinspace{}
14368 \begin_inset space \space{}
14372 \begin_inset Flex CharStyle:Code
14375 \begin_layout Plain Layout
14382 \begin_inset Flex CharStyle:Code
14385 \begin_layout Plain Layout
14391 ), use something like
14392 \begin_inset Flex CharStyle:Code
14395 \begin_layout Plain Layout
14402 This command must occur exactly once.
14405 \begin_layout Description
14406 \begin_inset Flex CharStyle:Code
14409 \begin_layout Plain Layout
14411 \begin_inset space ~
14419 The text that is displayed on the button.
14420 This command must occur exactly once.
14423 \begin_layout Description
14424 \begin_inset Flex CharStyle:Code
14427 \begin_layout Plain Layout
14429 \begin_inset space ~
14433 \begin_inset space ~
14441 The help text that is used in the External dialog.
14442 Provide enough information to explain to the user just what the template
14443 can provide him with.
14444 This command must occur exactly once.
14447 \begin_layout Description
14448 \begin_inset Flex CharStyle:Code
14451 \begin_layout Plain Layout
14453 \begin_inset space ~
14461 The file format of the original file.
14462 This must be the name of a format that is known to LyX (see section
14463 \begin_inset CommandInset ref
14465 reference "sec:Formats"
14471 \begin_inset Quotes eld
14475 \begin_inset Flex CharStyle:Code
14478 \begin_layout Plain Layout
14485 \begin_inset Quotes erd
14488 if the template can handle original files of more than one format.
14489 LyX will attempt to interrogate the file itself in order to deduce its
14490 format in this case.
14491 This command must occur exactly once.
14494 \begin_layout Description
14495 \begin_inset Flex CharStyle:Code
14498 \begin_layout Plain Layout
14500 \begin_inset space ~
14508 A unique name for the template.
14509 It must not contain substitution macros (see below).
14512 \begin_layout Description
14513 \begin_inset Flex CharStyle:Code
14516 \begin_layout Plain Layout
14518 \begin_inset space ~
14521 Rotate|Resize|Clip|Extra
14526 This command specifies which transformations are supported by this template.
14527 It may occur zero or more times.
14528 This command enables the corresponding tabs in the external dialog.
14530 \begin_inset Flex CharStyle:Code
14533 \begin_layout Plain Layout
14539 command must have either a corresponding
14540 \begin_inset Flex CharStyle:Code
14543 \begin_layout Plain Layout
14550 \begin_inset Flex CharStyle:Code
14553 \begin_layout Plain Layout
14560 \begin_inset Flex CharStyle:Code
14563 \begin_layout Plain Layout
14570 Otherwise the transformation will not be supported by that format.
14573 \begin_layout Subsection
14577 \begin_layout Description
14578 \begin_inset Flex CharStyle:Code
14581 \begin_layout Plain Layout
14583 \begin_inset space ~
14586 LaTeX|PDFLaTeX|PlainText|DocBook
14591 The primary document file format that this format definition is for.
14592 Not every template has a sensible representation in all document file formats.
14593 Please define nevertheless a
14594 \begin_inset Flex CharStyle:Code
14597 \begin_layout Plain Layout
14603 section for all formats.
14604 Use a dummy text when no representation is available.
14605 Then you can at least see a reference to the external material in the exported
14609 \begin_layout Description
14610 \begin_inset Flex CharStyle:Code
14613 \begin_layout Plain Layout
14615 \begin_inset space ~
14619 \begin_inset space ~
14627 This command defines an additional macro
14628 \begin_inset Flex CharStyle:Code
14631 \begin_layout Plain Layout
14637 for substitution in
14638 \begin_inset Flex CharStyle:Code
14641 \begin_layout Plain Layout
14649 \begin_inset Flex CharStyle:Code
14652 \begin_layout Plain Layout
14658 itself may contain substitution macros.
14659 The advantage over using
14660 \begin_inset Flex CharStyle:Code
14663 \begin_layout Plain Layout
14670 \begin_inset Flex CharStyle:Code
14673 \begin_layout Plain Layout
14679 is that the substituted value of
14680 \begin_inset Flex CharStyle:Code
14683 \begin_layout Plain Layout
14689 is sanitized so that it is a valid optional argument in the document format.
14690 This command may occur zero or more times.
14693 \begin_layout Description
14694 \begin_inset Flex CharStyle:Code
14697 \begin_layout Plain Layout
14699 \begin_inset space ~
14707 The text that is inserted in the exported document.
14708 This is actually the most important command and can be quite complex.
14709 This command must occur exactly once.
14712 \begin_layout Description
14713 \begin_inset Flex CharStyle:Code
14716 \begin_layout Plain Layout
14718 \begin_inset space ~
14726 This command specifies a preamble snippet that will be included in the
14728 It has to be defined using
14729 \begin_inset Flex CharStyle:Code
14732 \begin_layout Plain Layout
14738 \SpecialChar \ldots{}
14740 \begin_inset Flex CharStyle:Code
14743 \begin_layout Plain Layout
14750 This command may occur zero or more times.
14753 \begin_layout Description
14754 \begin_inset Flex CharStyle:Code
14757 \begin_layout Plain Layout
14759 \begin_inset space ~
14763 \begin_inset space ~
14771 This command denotes files that are created by the conversion process and
14772 are needed for a particular export format.
14773 If the filename is relative, it is interpreted relative to the master document.
14774 This command may be given zero or more times.
14777 \begin_layout Description
14778 \begin_inset Flex CharStyle:Code
14781 \begin_layout Plain Layout
14783 \begin_inset space ~
14791 The name of a required LaTeX package.
14792 The package is included via
14793 \begin_inset Flex CharStyle:Code
14796 \begin_layout Plain Layout
14804 in the LaTeX preamble.
14805 This command may occur zero or more times.
14808 \begin_layout Description
14809 \begin_inset Flex CharStyle:Code
14812 \begin_layout Plain Layout
14814 \begin_inset space ~
14818 \begin_inset space ~
14821 RotationLatexCommand
14826 This command specifies that the built in LaTeX command should be used for
14828 This command may occur once or not at all.
14831 \begin_layout Description
14832 \begin_inset Flex CharStyle:Code
14835 \begin_layout Plain Layout
14837 \begin_inset space ~
14841 \begin_inset space ~
14849 This command specifies that the built in LaTeX command should be used for
14851 This command may occur once or not at all.
14854 \begin_layout Description
14855 \begin_inset Flex CharStyle:Code
14858 \begin_layout Plain Layout
14860 \begin_inset space ~
14864 \begin_inset space ~
14867 RotationLatexOption
14872 This command specifies that rotation is done via an optional argument.
14873 This command may occur once or not at all.
14876 \begin_layout Description
14877 \begin_inset Flex CharStyle:Code
14880 \begin_layout Plain Layout
14882 \begin_inset space ~
14886 \begin_inset space ~
14894 This command specifies that resizing is done via an optional argument.
14895 This command may occur once or not at all.
14898 \begin_layout Description
14899 \begin_inset Flex CharStyle:Code
14902 \begin_layout Plain Layout
14904 \begin_inset space ~
14908 \begin_inset space ~
14916 This command specifies that clipping is done via an optional argument.
14917 This command may occur once or not at all.
14920 \begin_layout Description
14921 \begin_inset Flex CharStyle:Code
14924 \begin_layout Plain Layout
14926 \begin_inset space ~
14930 \begin_inset space ~
14938 This command specifies that an extra optional argument is used.
14939 This command may occur once or not at all.
14942 \begin_layout Description
14943 \begin_inset Flex CharStyle:Code
14946 \begin_layout Plain Layout
14948 \begin_inset space ~
14956 The file format of the converted file.
14957 This must be the name of a format that is known to LyX (see the
14958 \begin_inset Flex CharStyle:MenuItem
14961 \begin_layout Plain Layout
14966 ools\SpecialChar \menuseparator
14971 references:Conversion
14977 This command must occur exactly once.
14980 \begin_layout Description
14981 \begin_inset Flex CharStyle:Code
14984 \begin_layout Plain Layout
14986 \begin_inset space ~
14994 The file name of the converted file.
14995 The file name must be absolute.
14996 This command must occur exactly once.
14999 \begin_layout Subsection
15000 Preamble definitions
15003 \begin_layout Standard
15004 The external template configuration file may contain additional preamble
15005 definitions enclosed by
15006 \begin_inset Flex CharStyle:Code
15009 \begin_layout Plain Layout
15015 \SpecialChar \ldots{}
15017 \begin_inset Flex CharStyle:Code
15020 \begin_layout Plain Layout
15027 They can be used by the templates in the
15028 \begin_inset Flex CharStyle:Code
15031 \begin_layout Plain Layout
15040 \begin_layout Section
15041 The substitution mechanism
15044 \begin_layout Standard
15045 When the external material facility invokes an external program, it is done
15046 on the basis of a command defined in the template configuration file.
15047 These commands can contain various macros that are expanded before execution.
15048 Execution always take place in the directory of the containing document.
15051 \begin_layout Standard
15052 Also, whenever external material is to be displayed, the name will be produced
15053 by the substitution mechanism, and most other commands in the template
15054 definition support substitution as well.
15057 \begin_layout Standard
15058 The available macros are the following:
15061 \begin_layout Description
15062 \begin_inset Flex CharStyle:Code
15065 \begin_layout Plain Layout
15066 $$AbsOrRelPathMaster
15071 The file path, absolute or relative to the master LyX document.
15074 \begin_layout Description
15075 \begin_inset Flex CharStyle:Code
15078 \begin_layout Plain Layout
15079 $$AbsOrRelPathParent
15084 The file path, absolute or relative to the LyX document.
15087 \begin_layout Description
15088 \begin_inset Flex CharStyle:Code
15091 \begin_layout Plain Layout
15097 The absolute file path.
15100 \begin_layout Description
15101 \begin_inset Flex CharStyle:Code
15104 \begin_layout Plain Layout
15110 The filename without path and without the extension.
15113 \begin_layout Description
15114 \begin_inset Flex CharStyle:Code
15117 \begin_layout Plain Layout
15119 \begin_inset Quotes eld
15123 \begin_inset Quotes erd
15131 This macro will expand to the contents of the file with the name
15132 \begin_inset Flex CharStyle:Code
15135 \begin_layout Plain Layout
15144 \begin_layout Description
15145 \begin_inset Flex CharStyle:Code
15148 \begin_layout Plain Layout
15154 The file extension (including the dot).
15157 \begin_layout Description
15158 \begin_inset Flex CharStyle:Code
15161 \begin_layout Plain Layout
15167 The filename of the file specified in the external material dialog.
15168 This is either an absolute name, or it is relative to the LyX document.
15171 \begin_layout Description
15172 \begin_inset Flex CharStyle:Code
15175 \begin_layout Plain Layout
15182 \begin_inset Flex CharStyle:Code
15185 \begin_layout Plain Layout
15191 (absolute name or relative to the LyX document).
15194 \begin_layout Description
15195 \begin_inset Flex CharStyle:Code
15198 \begin_layout Plain Layout
15204 The file path, relative to the master LyX document.
15207 \begin_layout Description
15208 \begin_inset Flex CharStyle:Code
15211 \begin_layout Plain Layout
15217 The file path, relative to the LyX document.
15220 \begin_layout Description
15221 \begin_inset Flex CharStyle:Code
15224 \begin_layout Plain Layout
15230 This macro will expand to the absolute path of the system directory.
15231 This is typically used to point to the various helper scripts that are
15235 \begin_layout Description
15236 \begin_inset Flex CharStyle:Code
15239 \begin_layout Plain Layout
15245 A name and full path to a temporary file which will be automatically deleted
15246 whenever the containing document is closed, or the external material insertion
15250 \begin_layout Standard
15251 All path macros contain a trailing directory separator, so you can construct
15253 \begin_inset space \thinspace{}
15257 \begin_inset space \space{}
15260 the absolute filename with
15261 \begin_inset Flex CharStyle:Code
15264 \begin_layout Plain Layout
15265 $$AbsPath$$Basename$$Extension
15273 \begin_layout Standard
15274 The macros above are substituted in all commands unless otherwise noted.
15276 \begin_inset Flex CharStyle:Code
15279 \begin_layout Plain Layout
15285 supports additionally the following substitutions if they are enabled by
15287 \begin_inset Flex CharStyle:Code
15290 \begin_layout Plain Layout
15297 \begin_inset Flex CharStyle:Code
15300 \begin_layout Plain Layout
15309 \begin_layout Description
15310 \begin_inset Flex CharStyle:Code
15313 \begin_layout Plain Layout
15319 The front part of the resize command.
15322 \begin_layout Description
15323 \begin_inset Flex CharStyle:Code
15326 \begin_layout Plain Layout
15332 The back part of the resize command.
15335 \begin_layout Description
15336 \begin_inset Flex CharStyle:Code
15339 \begin_layout Plain Layout
15345 The front part of the rotation command.
15348 \begin_layout Description
15349 \begin_inset Flex CharStyle:Code
15352 \begin_layout Plain Layout
15358 The back part of the rotation command.
15361 \begin_layout Standard
15362 The value string of the
15363 \begin_inset Flex CharStyle:Code
15366 \begin_layout Plain Layout
15372 command supports additionally the following substitutions if they are enabled
15374 \begin_inset Flex CharStyle:Code
15377 \begin_layout Plain Layout
15384 \begin_inset Flex CharStyle:Code
15387 \begin_layout Plain Layout
15396 \begin_layout Description
15397 \begin_inset Flex CharStyle:Code
15400 \begin_layout Plain Layout
15409 \begin_layout Description
15410 \begin_inset Flex CharStyle:Code
15413 \begin_layout Plain Layout
15422 \begin_layout Description
15423 \begin_inset Flex CharStyle:Code
15426 \begin_layout Plain Layout
15435 \begin_layout Description
15436 \begin_inset Flex CharStyle:Code
15439 \begin_layout Plain Layout
15445 The rotation option.
15448 \begin_layout Standard
15449 You may ask why there are so many path macros.
15450 There are mainly two reasons:
15453 \begin_layout Enumerate
15454 Relative and absolute file names should remain relative or absolute, respectivel
15456 Users may have reasons to prefer either form.
15457 Relative names are useful for portable documents that should work on different
15458 machines, for example.
15459 Absolute names may be required by some programs.
15462 \begin_layout Enumerate
15463 LaTeX treats relative file names differently than LyX and other programs
15464 in nested included files.
15465 For LyX, a relative file name is always relative to the document that contains
15467 For LaTeX, it is always relative to the master document.
15468 These two definitions are identical if you have only one document, but
15469 differ if you have a master document that includes part documents.
15470 That means that relative filenames must be transformed when presented to
15472 Fortunately LyX does this automatically for you if you choose the right
15476 \begin_layout Standard
15477 So which path macro should be used in new template definitions? The rule
15481 \begin_layout Itemize
15483 \begin_inset Flex CharStyle:Code
15486 \begin_layout Plain Layout
15492 if an absolute path is required.
15495 \begin_layout Itemize
15497 \begin_inset Flex CharStyle:Code
15500 \begin_layout Plain Layout
15501 $$AbsOrRelPathMaster
15506 if the substituted string is some kind of LaTeX input.
15509 \begin_layout Itemize
15511 \begin_inset Flex CharStyle:Code
15514 \begin_layout Plain Layout
15515 $$AbsOrRelPathParent
15520 in order to preserve the user's choice.
15523 \begin_layout Standard
15524 There are special cases where this rule does not work and e.
15525 \begin_inset space \thinspace{}
15529 \begin_inset space \space{}
15532 relative names are needed, but normally it will work just fine.
15533 One example for such a case is the command
15534 \begin_inset Flex CharStyle:Code
15537 \begin_layout Plain Layout
15538 ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
15543 in the XFig template above: We can't use the absolute name because the
15545 \begin_inset Flex CharStyle:Code
15548 \begin_layout Plain Layout
15554 files needs the relative name in order to rewrite the file content.
15557 \begin_layout Section
15558 \begin_inset CommandInset label
15560 name "sec:Security-discussion"
15564 Security discussion
15567 \begin_layout Standard
15568 The external material feature interfaces with a lot of external programs
15569 and does so automatically, so we have to consider the security implications
15571 In particular, since you have the option of including your own filenames
15572 and/or parameter strings and those are expanded into a command, it seems
15573 that it would be possible to create a malicious document which executes
15574 arbitrary commands when a user views or prints the document.
15575 This is something we definitely want to avoid.
15578 \begin_layout Standard
15579 However, since the external program commands are specified in the template
15580 configuration file only, there are no security issues if LyX is properly
15581 configured with safe templates only.
15582 This is so because the external programs are invoked with the
15583 \begin_inset Flex CharStyle:Code
15586 \begin_layout Plain Layout
15592 -system call rather than the
15593 \begin_inset Flex CharStyle:Code
15596 \begin_layout Plain Layout
15602 system-call, so it's not possible to execute arbitrary commands from the
15603 filename or parameter section via the shell.
15606 \begin_layout Standard
15607 This also implies that you are restricted in what command strings you can
15608 use in the external material templates.
15609 In particular, pipes and redirection are not readily available.
15610 This has to be so if LyX should remain safe.
15611 If you want to use some of the shell features, you should write a safe
15612 script to do this in a controlled manner, and then invoke the script from
15613 the command string.
15617 \begin_layout Standard
15618 It is possible to design a template that interacts directly with the shell,
15619 but since this would allow a malicious user to execute arbitrary commands
15620 by writing clever filenames and/or parameters, we generally recommend that
15621 you only use safe scripts that work with the
15622 \begin_inset Flex CharStyle:Code
15625 \begin_layout Plain Layout
15631 system call in a controlled manner.
15632 Of course, for use in a controlled environment, it can be tempting to just
15633 fall back to use ordinary shell scripts.
15634 If you do so, be aware that you
15638 provide an easily exploitable security hole in your system.
15639 Of course it stands to reason that such unsafe templates will never be
15640 included in the standard LyX distribution, although we do encourage people
15641 to submit new templates in the open source tradition.
15642 But LyX as shipped from the official distribution channels will never have
15646 \begin_layout Standard
15647 Including external material provides a lot of power, and you have to be
15648 careful not to introduce security hazards with this power.
15649 A subtle error in a single line in an innocent looking script can open
15650 the door to huge security problems.
15651 So if you do not fully understand the issues, we recommend that you consult
15652 a knowledgeable security professional or the LyX development team if you
15653 have any questions about whether a given template is safe or not.
15654 And do this before you use it in an uncontrolled environment.