-#LyX 1.6.0svn created this file. For more info see http://www.lyx.org/
-\lyxformat 341
+#LyX 2.0.0svn created this file. For more info see http://www.lyx.org/
+\lyxformat 373
\begin_document
\begin_header
\textclass scrbook
\begin_preamble
% DO NOT ALTER THIS PREAMBLE!!!
%
-% This preamble is designed to ensure that the User's Guide prints
+% This preamble is designed to ensure that this document prints
% out as advertised. If you mess with this preamble,
-% parts of the User's Guide may not print out as expected. If you
+% parts of this document may not print out as expected. If you
% have problems LaTeXing this file, please contact
% the documentation team
% email: lyx-docs@lists.lyx.org
% redefine the \LyX macro for PDF bookmarks
\def\LyX{\texorpdfstring{%
L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
- {LyX }}
+ {LyX}}
% used for multi-column text
\usepackage{multicol}
\usepackage{inputenc}
\end_preamble
\options fleqn,liststotoc,bibtotoc,idxtotoc,BCOR7.5mm,titlepage,tablecaptionabove
+\use_default_options false
\begin_modules
logicalmkup
\end_modules
\end_local_layout
\language english
\inputencoding auto
+\fontencoding global
\font_roman default
\font_sans default
\font_typewriter default
\font_default_family default
+\use_xetex false
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100
\graphics default
+\default_output_format default
+\bibtex_command default
+\index_command default
\paperfontsize 12
\spacing single
\use_hyperref true
\pdf_pdfborder false
\pdf_colorlinks true
\pdf_backref false
-\pdf_pagebackref false
\pdf_pdfusetitle false
\pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true,pdfstartview=XYZ, plainpages=false, pdfpagelabels"
\papersize default
\use_geometry false
\use_amsmath 0
\use_esint 0
+\use_mhchem 1
\cite_engine basic
\use_bibtopic false
+\use_indices false
\paperorientation portrait
+\suppress_date false
\branch OutDated
\selected 0
+\filename_suffix 0
\color #f5fae7
\end_branch
+\index Index
+\shortcut idx
+\color #008000
+\end_index
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
-\defskip medskip
+\paragraph_indentation default
\quotes_language english
\papercolumns 1
\papersides 2
\paperpagestyle headings
-\tracking_changes true
+\tracking_changes false
\output_changes false
-\author "RGH"
-\author ""
\end_header
\begin_body
\end_inset
.
+ Include
+\begin_inset Quotes eld
+\end_inset
+
+[Customization]
+\begin_inset Quotes erd
+\end_inset
+
+ in the subject header, and please cc the current maintainer of this file,
+ Richard Heck <rgheck@comcast.net>.
\end_layout
\end_inset
-
+
+\begin_inset Newline newline
+\end_inset
+
+
+\begin_inset Newline newline
+\end_inset
+
+Version 2.0.x
\end_layout
\begin_layout Standard
\end_inset
+\end_layout
+
+\begin_layout Standard
+\begin_inset Note Note
+status open
+
+\begin_layout Plain Layout
+Please use change tracking when modifying this document.
+ This makes it easier for our translators to recognize things that have
+ been changed, and it helps the maintainer keep up-to-date with what's been
+ done.
+\end_layout
+
+\end_inset
+
+
\end_layout
\begin_layout Chapter
In it, we discuss issues like keyboard shortcuts, screen previewing options,
printer options, sending commands to LyX via the LyX Server, internationalizati
on, installing new LaTeX classes and LyX layouts, etc.
- We can't possibly hope to touch on everything you can change---our developers
- add new features faster than we can document them---but we will explain
- the most common customizations and hopefully point you in the right direction
+ We can't possibly hope to touch on everything you can change—our developers
+ add new features faster than we can document them—but we will explain the
+ most common customizations and hopefully point you in the right direction
for some of the more obscure ones.
\end_layout
\begin_layout Standard
\begin_inset Branch OutDated
-status collapsed
+status open
\begin_layout Standard
Information from previous versions of this document that now seems to be
status collapsed
\begin_layout Plain Layout
-
-\bar under
-H
-\bar default
-elp\SpecialChar \menuseparator
+Help\SpecialChar \menuseparator
About
\begin_inset space ~
\end_inset
-Ly
-\bar under
-X
+LyX
\end_layout
\end_inset
\end_inset
and its sub-directories contain a number of files and that can be used
- to customise LyX's behaviour.
+ to customize LyX's behavior.
You can change many of these files from within LyX itself through the
\begin_inset Flex CharStyle:MenuItem
status collapsed
\begin_layout Plain Layout
-
-\bar under
-T
-\bar default
-ools\SpecialChar \menuseparator
-
-\bar under
-P
-\bar default
-references
+Tools\SpecialChar \menuseparator
+Preferences
\end_layout
\end_inset
status collapsed
\begin_layout Plain Layout
-
-\bar under
-H
-\bar default
-elp\SpecialChar \menuseparator
-L
-\bar under
-a
-\bar default
-TeX
+Help\SpecialChar \menuseparator
+LaTeX
\begin_inset space ~
\end_inset
\end_inset
deserves special attention, as noted above.
- If there exists an internationalized version of the help-document with
-
+ The internationalized help docs are in subdirectories
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-$LANG_
+doc/xx
\end_layout
\end_inset
- prepended to the name, that will be used first.
- See Chapter
+ where
+\begin_inset Quotes eld
+\end_inset
+
+xx
+\begin_inset Quotes erd
+\end_inset
+
+ is the ISO language code.
+ See chapter
\begin_inset space ~
\end_inset
\begin_inset CommandInset ref
LatexCommand ref
-reference "chap:i18n"
+reference "cha:Internationalizing-LyX"
\end_inset
\begin_inset CommandInset ref
LatexCommand ref
-reference "sec:keymap"
+reference "sec:International-Keymap-Stuff"
\end_inset
\begin_inset CommandInset ref
LatexCommand ref
-reference "chap:textclass"
+reference "cha:Installing-New-Document"
\end_inset
\begin_inset CommandInset ref
LatexCommand ref
-reference "sec:templates"
+reference "sec:Creating-Templates"
\end_inset
status collapsed
\begin_layout Plain Layout
-
-\bar under
-H
-\bar default
-elp\SpecialChar \menuseparator
+Help\SpecialChar \menuseparator
About
\begin_inset space ~
\end_inset
\end_inset
this contains tables describing how different character encodings can be
- mapped to unicode
+ mapped to Unicode
\end_layout
\begin_layout Labeling
status collapsed
\begin_layout Plain Layout
-
-\bar under
-H
-\bar default
-elp\SpecialChar \menuseparator
+Help\SpecialChar \menuseparator
About
\begin_inset space ~
\end_inset
status collapsed
\begin_layout Plain Layout
-
-\bar under
-T
-\bar default
-ools\SpecialChar \menuseparator
-
-\bar under
-P
-\bar default
-references
+Tools\SpecialChar \menuseparator
+Preferences
\end_layout
\end_inset
status collapsed
\begin_layout Plain Layout
-
-\bar under
-T
-\bar default
-ools\SpecialChar \menuseparator
-
-\bar under
-R
-\bar default
-econfigure
+Tools\SpecialChar \menuseparator
+Reconfigure
\end_layout
\end_inset
status collapsed
\begin_layout Plain Layout
-
-\bar under
-D
-\bar default
-ocument\SpecialChar \menuseparator
-
-\bar under
-S
-\bar default
-ettings
+Document\SpecialChar \menuseparator
+Settings
\end_layout
\end_inset
status collapsed
\begin_layout Plain Layout
-
-\bar under
-H
-\bar default
-elp
+Help
\end_layout
\end_inset
\end_inset
- subirectory, however, since it contains a file written by the configuration
+ subdirectory, however, since it contains a file written by the configuration
script (also accessible through
\begin_inset Flex CharStyle:MenuItem
status collapsed
\begin_layout Plain Layout
-
-\bar under
-T
-\bar default
-ools\SpecialChar \menuseparator
-
-\bar under
-R
-\bar default
-econfigure
+Tools\SpecialChar \menuseparator
+Reconfigure
\end_layout
\end_inset
\end_layout
\begin_layout Section
-Using the dialog for the first time
-\end_layout
-
-\begin_layout Standard
-The
-\begin_inset Flex CharStyle:Code
-status collapsed
-
-\begin_layout Plain Layout
-UserDir/preferences
-\end_layout
-
-\end_inset
-
- file will contain only changes that you have made to the default behavior,
- some of which is hard-coded into LyX and some of which is contained in
- the system file
-\begin_inset Flex CharStyle:Code
-status collapsed
-
-\begin_layout Plain Layout
-LyXDir/lyxrc.defaults
-\end_layout
-
-\end_inset
-
-.
- Note that in both files lines beginning with a
-\begin_inset Quotes eld
-\end_inset
-
-#
-\begin_inset Quotes erd
-\end_inset
-
- are just comments and are not interpreted.
- However, only system administrators should edit
-\begin_inset Flex CharStyle:Code
-status collapsed
-
-\begin_layout Plain Layout
-LyXDir/lyxrc.defaults
-\end_layout
-
-\end_inset
-
-.
- Users should use the
-\begin_inset Flex CharStyle:MenuItem
-status collapsed
-
-\begin_layout Plain Layout
-Tools\SpecialChar \menuseparator
-Preferences
-\end_layout
+Formats
+\begin_inset CommandInset label
+LatexCommand label
+name "sec:Formats"
\end_inset
- dialog to create and modify their own
-\begin_inset Flex CharStyle:Code
-status collapsed
-
-\begin_layout Plain Layout
-UserDir/preferences
-\end_layout
-
-\end_inset
- file.
\end_layout
\begin_layout Standard
-We hope that the
+The first step is to define your file formats if they are not already defined.
+ To do so, open the
\begin_inset Flex CharStyle:MenuItem
status collapsed
\end_inset
- dialog will be largely self-explanatory.
- Most things in the dialog have associated `tool tips': hover your mouse
- pointer over something for more information.
- Before we highlight a few of the more important commands below, however,
- a word of warning: Applying some of your changes (e.g., screen fonts) will
- have an instant effect.
- Others (e.g.
- changing the bind file) will not.
- If nothing appears to have changed, just
-\begin_inset Flex CharStyle:MenuItem
-status collapsed
-
-\begin_layout Plain Layout
-Save
-\end_layout
-
-\end_inset
-
- the changes and restart LyX.
-\end_layout
-
-\begin_layout Section
-File Handling
-\end_layout
-
-\begin_layout Standard
-LyX has a powerful mechanism to convert to and from any file format using
- external programs.
-
-\end_layout
-
-\begin_layout Subsection
-\begin_inset CommandInset label
-LatexCommand label
-name "sub:Formats"
-
-\end_inset
-
-Formats
-\end_layout
-
-\begin_layout Standard
-The first step is to define your file formats if they are not already defined.
- To do so, open the
+ dialog.
+ Under
\begin_inset Flex CharStyle:MenuItem
status collapsed
\begin_layout Plain Layout
-Tools\SpecialChar \menuseparator
-Preferences\SpecialChar \menuseparator
File Handling\SpecialChar \menuseparator
-File Formats
+File formats
\end_layout
\end_inset
- dialog.
- Press the
+ press the
\begin_inset Flex CharStyle:MenuItem
status collapsed
\end_inset
- field contains the named used to identify the format in the GUI.
+ field contains the name used to identify the format in the GUI.
The
\begin_inset Flex CharStyle:MenuItem
status collapsed
\end_inset
- is used to identify the format interally.
+ is used to identify the format internally.
You will also need to enter a file extension.
These are all required.
The optional
\end_inset
- and
+ and an
\begin_inset Flex CharStyle:MenuItem
status collapsed
\end_inset
menu.
- The editor is for example launched when you press the
-\begin_inset Flex CharStyle:MenuItem
-status collapsed
-
-\begin_layout Plain Layout
-Edit
-\end_layout
-
-\end_inset
-
- button in the
-\begin_inset Flex CharStyle:MenuItem
-status collapsed
-
-\begin_layout Plain Layout
-Graphics
-\end_layout
-
-\end_inset
-
- or the
+ The editor is for example launched when you right-click on an image and
+ choose
\begin_inset Flex CharStyle:MenuItem
status collapsed
\begin_layout Plain Layout
-External material
+Edit externally
\end_layout
\end_inset
- dialog.
+ in the appearing context menu.
\end_layout
\begin_layout Standard
\end_inset
option tells LyX that a format is suitable for document export.
- If this is is set and if a suitable conversion route exists (see
+ If this is set and if a suitable conversion route exists (see sec.
+\begin_inset space \thinspace{}
+\end_inset
+
+
\begin_inset CommandInset ref
LatexCommand ref
-reference "sub:Converters"
+reference "sec:Converters"
\end_inset
.
\end_layout
-\begin_layout Subsection
+\begin_layout Section
Copiers
\end_layout
status collapsed
\begin_layout Plain Layout
-For example, the file may refer to other files---images, for example---using
+For example, the file may refer to other files—images, for example—using
relative file names, and these may become invalid when the file is copied
to the temporary directory.
\end_layout
\end_inset
g.
-\begin_inset space ~
+\begin_inset space \space{}
\end_inset
\end_layout
\begin_layout Standard
-The latter is to be given in a form suitable for inclusion in a LaTeX's
-
+The latter should be the filename as it would be used in a LaTeX's
\series bold
\backslash
include
\series default
- command and is relevant only when exporting files suitable for such inclusion.
+ command.
+ It is relevant only when exporting files suitable for such inclusion.
\end_layout
\begin_layout Standard
\end_inset
-Save that in your local LyX directory---say,
+Save it in your local LyX directory—say,
\begin_inset Flex CharStyle:Code
status collapsed
\end_inset
----and make it executable, if you need to do so on your platform.
+—and make it executable, if you need to do so on your platform.
Then, in the
\begin_inset Flex CharStyle:MenuItem
status collapsed
\begin_layout Plain Layout
Tools\SpecialChar \menuseparator
-Preferences:Copiers
+Preferences
+\end_layout
+
+\end_inset
+
+ dialog, select under
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+File Handling\SpecialChar \menuseparator
+File formats
\end_layout
\end_inset
- dialog, select the
+ the
\begin_inset Flex CharStyle:MenuItem
status collapsed
\end_inset
- format---or one of the other pdf formats---and enter
+ format—or one of the other pdf formats—and enter
\begin_inset Flex CharStyle:Code
status collapsed
\end_layout
-\begin_layout Subsection
+\begin_layout Section
+Converters
\begin_inset CommandInset label
LatexCommand label
-name "sub:Converters"
+name "sec:Converters"
\end_inset
-Converters
+
\end_layout
\begin_layout Standard
-You can define your own Converters to, uhh, convert files between different
- formats.
+You can define your own Converters to convert files between different formats.
This is done in the
\begin_inset Flex CharStyle:MenuItem
status collapsed
\end_inset
- and
-\begin_inset space \thinspace{}
-\end_inset
-
-
+ and
\begin_inset Flex CharStyle:MenuItem
status collapsed
\end_inset
- The base filename of the input file (i.e., without the extension)
-\end_layout
-
+ The base filename of the input file (i.
+\begin_inset space \thinspace{}
+\end_inset
+
+g., without the extension)
+\end_layout
+
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex CharStyle:Code
The path to the input file
\end_layout
+\begin_layout Labeling
+\labelwidthstring 00.00.0000
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+$$r
+\end_layout
+
+\end_inset
+
+ The path to the original input file (this is different from $$p when a
+ chain of converters is called).
+\end_layout
+
\begin_layout Standard
In the
\begin_inset Flex CharStyle:MenuItem
status collapsed
\begin_layout Plain Layout
-script <infile.out >infile.log
+script < infile.out > infile.log
\end_layout
\end_inset
\end_layout
\begin_layout Standard
-You do not have to define converters between all the formats between which
- you want to convert.
- For example, you will note that there is no `LyX to PostScript®' converter,
- but LyX will export PostScript®.
+You do not have to define converters for all formats between which you want
+ to convert.
+ For example, you will note that there is no `LyX to PostScript' converter,
+ but LyX will export PostScript.
It does so by first creating a LaTeX file (no converter needs to be defined
for this) which is then converted to DVI using the `LaTeX to DVI' converter,
- and finally converting the resulting DVI file to PostScript®.
+ and finally converting the resulting DVI file to PostScript.
LyX finds such `chains' of converters automatically, and it will always
choose the shortest possible chain.
You can, though, still define multiple conversion methods between file
\end_inset
-; via (DVI and) PostScript®, using
+; via (DVI and) PostScript, using
\begin_inset Flex CharStyle:MenuItem
status collapsed
formats', as described in section
\begin_inset CommandInset ref
LatexCommand ref
-reference "sub:Formats"
+reference "sec:Formats"
\end_inset
Internationalizing LyX
\begin_inset CommandInset label
LatexCommand label
-name "chap:i18n"
+name "cha:Internationalizing-LyX"
\end_inset
-file for that language.
When this is available, you'll have to generate a
\begin_inset Flex CharStyle:Code
-status open
+status collapsed
\begin_layout Plain Layout
mo
\end_inset
- (e.g.
-
+ (e.
+\begin_inset space \thinspace{}
+\end_inset
+
+g.
+\begin_inset space \space{}
+\end_inset
+
+
\begin_inset Flex CharStyle:Code
status collapsed
\end_layout
\begin_layout Subsubsection
-Ambigous messages
+Ambiguous messages
\end_layout
\begin_layout Standard
\end_inset
- does not handle such ambigous translations.
+ does not handle such ambiguous translations.
Therefore you have to add some context information to the message: Instead
of
\begin_inset Flex CharStyle:Code
\end_inset
- Now the two occurences of
+ Now the two occurrences of
\begin_inset Flex CharStyle:Code
status collapsed
status collapsed
\begin_layout Plain Layout
-
-\bar under
-H
-\bar default
-elp
+Help
\end_layout
\end_inset
status collapsed
\begin_layout Plain Layout
-LyXDir/doc/xx_DocName.lyx
+LyXDir/doc/xx/DocName.lyx
\end_layout
\end_inset
do right away:
\end_layout
-\begin_layout Itemize
-Read
-\begin_inset Flex CharStyle:Code
-status collapsed
-
-\begin_layout Plain Layout
-DocStyle.lyx
-\end_layout
-
-\end_inset
-
-, the guide to writing LyX documentation.
- Pay special attention to the translator's section.
-\end_layout
-
\begin_layout Itemize
Check out the documentation translation web page at
\begin_inset CommandInset href
LatexCommand href
-name "http://www.devel.lyx.org"
-target "http://www.devel.lyx.org"
+name "http://www.lyx.org/Translation"
+target "http://www.lyx.org/Translation"
\end_inset
status collapsed
\begin_layout Plain Layout
-
-\bar under
-H
-\bar default
-elp\SpecialChar \menuseparator
-
-\bar under
-I
-\bar default
-ntroduction
+Help\SpecialChar \menuseparator
+Introduction
\end_layout
\end_inset
status collapsed
\begin_layout Plain Layout
-UserDir/doc/
+UserDir/doc/xx/
\end_layout
\end_inset
\end_layout
\begin_layout Section
+International Keymap Stuff
\begin_inset CommandInset label
LatexCommand label
-name "sec:keymap"
+name "sec:International-Keymap-Stuff"
\end_inset
-International Keymap Stuff
+
\end_layout
\begin_layout Standard
In doing the revisions on this document in March 2008, I did not look over
this stuff, as I do not understand it.
It would be good if someone else could do so.
+ (RH)
\end_layout
\end_inset
\emph default
\family roman
-followed by the other, unallowed key, as output.
+followed by the other, not allowed key, as output.
\family default
Note that a
\shape up
\emph on
result
-\family default
-\shape default
\emph default
-
-\family roman
-\shape up
is produced.
If such a declaration does not exist in
\family default
\family roman
\emph on
-accent char
+accent char
\emph default
, you get
\family default
\family roman
\emph on
accent_key char
-\family default
\emph default
-
-\family roman
where
\family default
\family roman
\emph on
accent_key
-\family default
\emph default
-
-\family roman
is the first arg
\family default
ument of the
\end_inset
- to set up the special
+ to set up the special
\begin_inset Flex CharStyle:Code
status collapsed
status collapsed
\begin_layout Plain Layout
-
-\bar under
-E
-\bar default
-dit\SpecialChar \menuseparator
-
-\bar under
-P
-\bar default
-references
+Edit\SpecialChar \menuseparator
+Preferences
\end_layout
\end_inset
\end_layout
\begin_layout Chapter
-Installing New Document Classes, Layouts, and Templates
+Installing New Document Classes, Layouts, and Templates
\begin_inset CommandInset label
LatexCommand label
-name "chap:textclass"
+name "cha:Installing-New-Document"
\end_inset
In this chapter, we describe the procedures for creating and installing
new LyX layout and template files, as well as offer a refresher on correctly
installing new LaTeX document classes.
- Some definitions: a document class is a LaTeX file (usually ending in
+
+\end_layout
+
+\begin_layout Standard
+First, let us a say a few words about how one ought to think about the relation
+ between LyX and LaTeX.
+ The thing to understand is that, in a certain sense, LyX doesn't know anything
+ about LaTeX.
+ Indeed, from LyX's point of view, LaTeX is just one of several
+\begin_inset Quotes eld
+\end_inset
+
+backend formats
+\begin_inset Quotes erd
+\end_inset
+
+ in which it is capable of producing output.
+ Other such formats are DocBook, plaintext, and XHTML.
+ LaTeX is, of course, a particularly important format, but very little of
+ the information LyX has about LaTeX is actually contained in the program
+ itself.
+\begin_inset Foot
+status collapsed
+
+\begin_layout Plain Layout
+Some commands are sufficiently complex that they are
+\begin_inset Quotes eld
+\end_inset
+
+hardcoded
+\begin_inset Quotes erd
+\end_inset
+
+ into LyX.
+ But the developers generally regard this as a Bad Thing.
+\end_layout
+
+\end_inset
+
+ Rather, that information, even for the standard classes like
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+article.cls
+\end_layout
+
+\end_inset
+
+, is contained in layout files.
+\end_layout
+
+\begin_layout Standard
+You can think of the layout file for a given document class as a translation
+ manual between LyX constructs---paragraphs with their corresponding styles,
+ certain sorts of insets, etc---and the corresponding LaTeX constructs.
+ Almost everything LyX knows about
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+article.cls
+\end_layout
+
+\end_inset
+
+, for example, is contained in the file
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+article.layout
+\end_layout
+
+\end_inset
+
+.
+ For this reason, anyone intending to write layout files should plan to
+ study the existing files.
+ A good place to start is with
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+stdsections.inc
+\end_layout
+
+\end_inset
+
+, which just gets `included' in
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+article.layout
+\end_layout
+
+\end_inset
+
+,
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+book.layout
+\end_layout
+
+\end_inset
+
+, and many of the other layout files for document classes.
+ This file is where sections and the like are defined:
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+stdsections.inc
+\end_layout
+
+\end_inset
+
+ tells LyX how paragraphs that are marked with the Section, Subsection,
+ etc, styles can be translated into corresponding LaTeX commands.
+ The
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+article.layout
+\end_layout
+
+\end_inset
+
+ file basically just includes several of these
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+std*.inc
+\end_layout
+
+\end_inset
+
+ files.
+\end_layout
+
+\begin_layout Standard
+Defining the LyX--LaTeX correspondence is not, however, the only thing layout
+ files do.
+ Their other job is to define how the LyX constructs themselves will appear
+ on-screen.
+ The fact that layout files have these two jobs is often a source of confusion,
+ because they are completely separate.
+ Telling LyX how to translate a certain paragraph style into LaTeX does
+ not tell LyX how to display it; conversely, telling LyX how to display
+ a certain paragraph style does not tell LyX how to translate it into LaTeX,
+ let alone tell LaTeX how to display it.
+ So, in general, when you define a new LyX construct, you must always do
+ two quite separate things: (i)
+\begin_inset space ~
+\end_inset
+
+tell LyX how to translate it into LaTeX, and (ii)
+\begin_inset space ~
+\end_inset
+
+tell LyX how to display it.
+\end_layout
+
+\begin_layout Standard
+Much the same is true, of course, as regards LyX's other backend formats,
+ though XHTML is in some ways different, because in that case LyX
+\emph on
+is
+\emph default
+ able, to some extent, anyway, to use information about how it should display
+ a paragraph on the screen to output information (in the form of CSS) about
+ how the paragrpah should be displayed in a browser.
+ Even in this case, however, the distinction between what LyX does internally
+ and how things are rendered externally remains in force, and the two can
+ be controlled separately.
+\end_layout
+
+\begin_layout Standard
+Some definitions: a document class is a LaTeX file (usually ending in
\begin_inset Flex CharStyle:Code
status collapsed
can be used somewhat interchangeably, but it is better to refer to the
file as the layout, and the thing living in LyX's memory as the text class.
A template file is simply a LyX document that contains a set of predefined
- entries for a given document class---entries that are generally required
+ entries for a given document class—entries that are generally required
for that class.
Templates are especially useful for things like journal manuscripts that
are to be submitted electronically.
\begin_layout Standard
Some installations may not include a LaTeX package that you would like to
use within LyX.
- For example, you might need FoilTeX, a package for preparing slides or
- viewgraphs for overhead projectors.
+ For example, you might need FoilTeX, a package for preparing slides for
+ overhead projectors.
Modern LaTeX distributions like TeXLive (2008 or newer) or MiKTeX provide
- a user interface for that.
- For example on MiKTeX you start its program
+ a user interface for installing such packages.
+ For example, with MiKTeX, you start the program
\begin_inset Quotes eld
\end_inset
\end_inset
to get a list of available packages.
- To install one, right click on it or use the installing toolbar button.
- When the package you want to install is not in the list, but you have it
- in form of a
-\begin_inset Flex CharStyle:Code
-status collapsed
-
-\begin_layout Plain Layout
-.cls
-\end_layout
-
-\end_inset
-
- or
-\begin_inset Flex CharStyle:Code
-status collapsed
-
-\begin_layout Plain Layout
-.sty
-\end_layout
-
-\end_inset
-
--file, then copy these files to a subfolder of your LaTeX distribution,
- for example to the folder
-\family sans
-~
-\backslash
-tex
-\backslash
-latex
-\family default
-.
- Then update the file name database of your LaTeX-distribution.
- For example on MiKTeX this is done by pressing the button
-\family sans
-Refresh
-\begin_inset space ~
-\end_inset
-
-FNDB
-\family default
- that you find in MiKTeX's
-\begin_inset Quotes eld
-\end_inset
-
-Settings
-\begin_inset Quotes erd
-\end_inset
-
- program.
- In both cases you need afterwards to reconfigure LyX using the menu
-\begin_inset Flex CharStyle:MenuItem
-status collapsed
-
-\begin_layout Plain Layout
-Tools\SpecialChar \menuseparator
-Reconfigure
-\end_layout
-
-\end_inset
-
- and then to restart LyX.
+ To install one, right click on it or use the toolbar button to install
+ it.
+
\end_layout
\begin_layout Standard
-If your LaTeX distribution doesn't provide a user interface, then you can
- follow these steps by using a UNIX/Linux console.
+If your LaTeX distribution doesn't provide such a user interface, or if
+ the file is not available through the package browser, then you can follow
+ these steps.
\end_layout
\begin_layout Enumerate
\end_layout
\begin_layout Enumerate
-You can install this package in several different places.
+You can install the package in several different places.
If you want it to be available for all users on your system, then you should
install it in your `local' TeX tree; if you want (or need) it to be available
just for you, then you can install it in your own `user' TeX tree.
Where these should be created, if they do not already exist, depends upon
the details of your system.
- To find out, look in the file
+ To find out where they are, look in the file
\begin_inset Flex CharStyle:Code
status collapsed
\end_inset
- The location of the `local' TeX tree is defined by
+ The location of the `local' TeX tree is defined by the
\begin_inset Flex CharStyle:Code
status collapsed
\end_inset
-; this is usually somewhere like
+ variable; this is usually somewhere like
\begin_inset Flex CharStyle:Code
status collapsed
\end_inset
- variables; e.g.
-\begin_inset Newline newline
+ variables; e.
+\begin_inset space \thinspace{}
+\end_inset
+
+g.
+\begin_inset Newline newline
\end_inset
\end_layout
\begin_layout Enumerate
-Create your local
-\begin_inset Foot
+Your local and user trees must have the same sort of directory structure
+ as your main existing
+\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-We'll assume henceforth that you're defining `local' TeX tree.
- If you're defining a user tree, just adjust as necessary.
+texmf
\end_layout
\end_inset
- TeX tree.
- You must follow the directory structure of your existing
+ directory, which will be found at
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-texmf
+TEXMFMAIN
\end_layout
\end_inset
- directory, which will be found at
+ (commonly,
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-TEXMFMAIN
+/usr/share/texmf/
\end_layout
\end_inset
-.
- For example, latex packages should go under
+.) For example, latex packages should go under
\begin_inset Flex CharStyle:Code
status collapsed
$TEXMFLOCAL/tex/latex/
\end_layout
+\end_inset
+
+ or
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+$TEXMFHOME/tex/latex/
+\end_layout
+
\end_inset
.
\end_layout
\begin_layout Enumerate
-Install the package.
- For example, you would unpack the FoilTeX tarball and copy it to
+Once your tree is properly set up, you can install the package into an appropria
+te location.
+ For example, you might install the FoilTeX files into
\begin_inset Flex CharStyle:Code
status collapsed
\end_layout
\begin_layout Enumerate
-Run:
+Finally, you must update the database TeX uses to find files.
+ On MiKTeX, this is done by pressing the button
+\family sans
+Refresh
+\begin_inset space ~
+\end_inset
+
+FNDB
+\family default
+ that you find in MiKTeX's
+\begin_inset Quotes eld
+\end_inset
+
+Settings
+\begin_inset Quotes erd
+\end_inset
+
+ program.
+
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-texhash
+$TEXMFLOCAL/tex/latex/
\end_layout
\end_inset
.
- This should create
+ Under TeXLive and the like, you should run
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-$TEXMFLOCAL/ls-R
+texhash
\end_layout
\end_inset
- amongst others.
+ from a terminal, with root permissions if necessary.
+
\end_layout
\begin_layout Standard
Your package is now installed and available to LaTeX.
- To make it available to LyX, you need to create a Layout file, if one is
- not already available.
- (See the next section.) Once you have a layout file, you need only reconfigure
- (
-\begin_inset Flex CharStyle:MenuItem
+ You can verify this from a terminal by typing `
+\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-Tools\SpecialChar \menuseparator
-Reconfigure
+kpsewhich yourfile.ext
\end_layout
\end_inset
-) and then restart LyX.
- You should then see your new package---for example
+'.
+ To make LyX aware of it, however, you will need to reconfigure (
\begin_inset Flex CharStyle:MenuItem
status collapsed
\begin_layout Plain Layout
-slides (FoilTeX)
+Tools\SpecialChar \menuseparator
+Reconfigure
\end_layout
\end_inset
----under
+) and then restart LyX.
+ If the new package was a document class, such as FoilTeX again, you will
+ now see it—
\begin_inset Flex CharStyle:MenuItem
status collapsed
\begin_layout Plain Layout
-Document\SpecialChar \menuseparator
-Settings
+slides (FoilTeX)
\end_layout
\end_inset
- in the
+—available under
\begin_inset Flex CharStyle:MenuItem
status collapsed
\begin_layout Plain Layout
+Document\SpecialChar \menuseparator
+Settings\SpecialChar \menuseparator
Document Class
\end_layout
\end_inset
- drop box.
+.
\end_layout
+\begin_layout Standard
+Unless, of course, no layout file is available for your new document class.
+ That is the topic of the next section.
+\end_layout
+
\begin_layout Section
Layouts
\end_layout
\end_inset
- text class format as an example.
+ text class as an example.
The
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-.layout
+*.layout
\end_layout
\end_inset
files describe what paragraph and character styles are available for a
- given document class and how LyX should display them.
- We try to provide a thorough description of the process here; however,
- there are so many different types of documents supported by LaTeX classes
- that we can't hope to cover every different possibility or problem you
- might encounter.
- (The LyX users' list is frequented by people with lots of experience with
- layout design who are willing to share what they've learned.)
+ given document class, how LyX should display them, and how they should
+ be translated into LaTeX, DocBook, or whatever output format is being used.
+
+\end_layout
+
+\begin_layout Standard
+We shall try to provide a thorough description of the process of writing
+ layout files here.
+ However, there are so many different types of documents supported by LaTeX,
+ DocBook, and so forth, that we can't hope to cover every different possibility
+ or problem you might encounter.
+ The LyX users' list is frequented by people with lots of experience with
+ layout design who are willing to share what they've learned, so please
+ feel free to ask questions there.
\end_layout
\begin_layout Standard
As you prepare to write a new layout, it is extremely helpful to look at
- the example layouts distributed with LyX.
- If you use a nice LaTeX document class that might be of interest for others,
- too, and have a nice corresponding LyX layout, feel free to contribute
- the stuff to us, so we may put it into the distribution.
- There is also a
+ the layouts distributed with LyX.
+ If you use a nice LaTeX document class that might also be of interest for
+ others and so write a corresponding LyX layout, you should consider posting
+ your layout to the
\begin_inset CommandInset href
LatexCommand href
name "section on the LyX wiki"
\end_inset
- for this kind of material.
+ or even to the LyX developers' list, so that it might be included in LyX
+ itself.
+\begin_inset Foot
+status collapsed
+
+\begin_layout Plain Layout
+Note that LyX is licensed under the General Public License, so any material
+ that is contribued to LyX must be similarly licensed.
+\end_layout
+
+\end_inset
+
+
\end_layout
\begin_layout Standard
-All the tags described in this chapter are case-insensitive; this means
- that
+All the tags described here are case-insensitive; this means that
\begin_inset Flex CharStyle:Code
status collapsed
\end_inset
.
- If the argument has a datatype like
+ If the argument has a data type like
\begin_inset Quotes eld
\end_inset
\begin_layout Subsection
Layout modules
+\begin_inset CommandInset label
+LatexCommand label
+name "sub:Layout-modules"
+
+\end_inset
+
+
\end_layout
\begin_layout Standard
-Similar to layout files, and new with LyX 1.6, are layout
+We have spoken to this point about `layout files'.
+ But there are different sorts of files that contain layout information.
+ Layout files, strictly so called, have the
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+.layout
+\end_layout
+
+\end_inset
+
+ extension and provide LyX with information about document classes.
+ As of LyX 1.6, however, layout informtion can also be contained in layout
+
\emph on
modules
\emph default
-.
+, which have the
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+.module
+\end_layout
+
+\end_inset
+
+ extension.
Modules are to LaTeX packages much as layouts are to LaTeX classes, and
- some modules---such as the Endnotes module---provide support for just such
- a package.
- In a sense, layout modules are similar to included files---files like
+ some modules—such as the endnotes module—specifcally provide support for
+ one such package.
+ In a sense, layout modules are similar to included
+\begin_inset Foot
+status collapsed
+
+\begin_layout Plain Layout
+These can have any extension, but by convention have the
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+.inc
+\end_layout
+
+\end_inset
+
+ extension.
+\end_layout
+
+\end_inset
+
+ files—files like
\begin_inset Flex CharStyle:Code
status collapsed
\end_inset
----in that modules are not specific to a given document layout but may be
- used with many different layouts.
- The difference is that using a layout module does not require editing the
- layout file.
- Rather, modules are selected in the
+—in that modules are not specific to a given document class but may be used
+ with many different classes.
+ The difference is that using an included file with
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+article.cls
+\end_layout
+
+\end_inset
+
+, say, requires editing that file.
+ Modules, by contrast, are selected in the
\begin_inset Flex CharStyle:MenuItem
status collapsed
\begin_layout Standard
Building modules is the easiest way to get started with layout editing,
- since it can be as simple as adding a single new paragraph or flex inset.
+ since it can be as simple as adding a single new paragraph style or flex
+ inset.
But modules may, in principle, contain anything a layout file can contain.
\end_layout
\end_layout
\begin_layout Standard
-The argument in square brackets is optional: It declares any LaTeX packages
- on which the module depends.
- The mandatory argument, in curly brackets, is the name of the module, as
+The mandatory argument, in curly brackets, is the name of the module, as
it should appear in
\begin_inset Flex CharStyle:MenuItem
status collapsed
\end_inset
.
-
+ The argument in square brackets is optional: It declares any LaTeX packages
+ on which the module depends.
+ Please note that only packages about which LyX knows should be listed in
+ the square brackets.
+\begin_inset Foot
+status collapsed
+
+\begin_layout Plain Layout
+The list of such packages is documented only in the source code.
+\end_layout
+
+\end_inset
+
+ LyX will not check for arbitrary packages.
+ It is also possible to use the form
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+from->to
+\end_layout
+
+\end_inset
+
+, which declares that the module can only be used when there exists a conversion
+ chain between the formats `
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+from
+\end_layout
+
+\end_inset
+
+' and `
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+to
+\end_layout
+
+\end_inset
+
+'.
\end_layout
\begin_layout Standard
\begin_layout LyX-Code
#You will need to add
\backslash
-theendnotes in ERT where you
+theendnotes in TeX code where you
\end_layout
\begin_layout LyX-Code
\emph on
filenames
\emph default
- without the .module extension.
+ without the
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+.module
+\end_layout
+
+\end_inset
+
+ extension.
So
\begin_inset Flex CharStyle:Code
status collapsed
In fact,
\emph on
it is strongly recommended that you not attempt to edit modules while simultaneo
-usly working on documents
+usly working on actual documents
\emph default
.
Though of course the developers strive to keep LyX stable in such situations,
\end_layout
\begin_layout Standard
-If your new document class is provided as a style file that is used in conjuncti
-on with an existing, supported document class---for the sake of the example,
- we'll assume that the style file is called
+The easier case is the one in which your new document class is provided
+ as a style file that is to be used in conjunction with an already supported
+ document class.
+ Gor the sake of the example, we'll assume that the style file is called
+
\begin_inset Flex CharStyle:MenuItem
status collapsed
\end_inset
-, which is a standard class---start by copying the existing class's layout
- file into your local directory:
+, which is a standard class.
+
+\end_layout
+
+\begin_layout Standard
+Start by copying the existing class's layout file into your local directory:
\end_layout
\begin_layout LyX-Code
status collapsed
\begin_layout Plain Layout
-
-\bar under
-T
-\bar default
-ools\SpecialChar \menuseparator
-
-\bar under
-R
-\bar default
-econfigure
+Tools\SpecialChar \menuseparator
+Reconfigure
\end_layout
\end_inset
status collapsed
\begin_layout Plain Layout
-
-\bar under
-D
-\bar default
-ocument\SpecialChar \menuseparator
-
-\bar under
-S
-\bar default
-ettings
+Document\SpecialChar \menuseparator
+Settings
\end_layout
\end_inset
dialog.
It is likely that some of the sectioning commands and such in your new
- class will work differently from how they worked in the base class---
+ class will work differently from how they worked in the base class—
\begin_inset Flex CharStyle:Code
status collapsed
\end_inset
- in this example---so you can fiddle around with the settings for the different
+ in this example—so you can fiddle around with the settings for the different
sections if you wish.
-\end_layout
-
-\begin_layout Subsection
-Layout for a
-\begin_inset Flex CharStyle:MenuItem
-status collapsed
-
-\begin_layout Plain Layout
-cls
-\end_layout
+ Your new package may also provide commands or environments not present
+ in the base class.
+ In this case, you will want to add these to the layout file.
+ See
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "sec:TextClass"
\end_inset
- file
+ for information on how to do so.
\end_layout
\begin_layout Standard
-There are two possibilities here.
- One is that the class file is itself based upon an existing document class.
- For example, many thesis classes are based upon
+If
\begin_inset Flex CharStyle:MenuItem
status collapsed
\begin_layout Plain Layout
-book.cls
+myclass.sty
\end_layout
\end_inset
-.
- To see whether yours is, look for a line like
+ can be used with several different document classes, and even if it cannot,
+ you might find it easiest just to user a module that you can load with
+ the base class.
+ The simplest possible such module would be:
\end_layout
\begin_layout LyX-Code
-
+#
\backslash
-LoadClass{book}
+DeclareLyXModule{My Class}
\end_layout
-\begin_layout Standard
-in the file.
- If so, then you may proceed largely as in the previous section, though
- the DeclareLaTeXClass line will be different.
- If your new class is thesis, and it is based upon book, then the line should
- read:
-\begin_inset Foot
-status collapsed
-
-\begin_layout Plain Layout
-And it will be easiest if you save the file to
-\begin_inset Flex CharStyle:Code
-status collapsed
+\begin_layout LyX-Code
+#DescriptionBegin
+\end_layout
-\begin_layout Plain Layout
-thesis.layout
+\begin_layout LyX-Code
+#Support for myclass.sty.
\end_layout
+\begin_layout LyX-Code
+#DescriptionEnd
+\begin_inset Newline newline
\end_inset
-: LyX assumes that the document class has the same name as the layout file.
-
+
\end_layout
+\begin_layout LyX-Code
+Format 11
+\begin_inset Newline newline
\end_inset
\end_layout
\begin_layout LyX-Code
+Preamble
+\begin_inset Newline newline
+\end_inset
+
\backslash
-DeclareLaTeXClass[thesis,book]{thesis}
+usepackage{myclass}
+\begin_inset Newline newline
+\end_inset
+
+EndPreamble
\end_layout
\begin_layout Standard
-If, on the other hand, the new class is not based upon an existing class,
- you will probably have to
+A more complex module might modify the behavior of some existing constructs
+ or define some new ones.
+ Again, see
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "sec:TextClass"
+
+\end_inset
+
+ for discussion.
+\end_layout
+
+\begin_layout Subsection
+Layout for a
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+cls
+\end_layout
+
+\end_inset
+
+ file
+\end_layout
+
+\begin_layout Standard
+There are two possibilities here.
+ One is that the class file is itself based upon an existing document class.
+ For example, many thesis classes are based upon
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+book.cls
+\end_layout
+
+\end_inset
+
+.
+ To see whether yours is, look for a line like
+\end_layout
+
+\begin_layout LyX-Code
+
+\backslash
+LoadClass{book}
+\end_layout
+
+\begin_layout Standard
+in the file.
+ If so, then you may proceed largely as in the previous section, though
+ the
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+DeclareLaTeXClass
+\end_layout
+
+\end_inset
+
+ line will be different.
+ If your new class is
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+thesis
+\end_layout
+
+\end_inset
+
+, and it is based upon
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+book
+\end_layout
+
+\end_inset
+
+, then the line should read:
+\begin_inset Foot
+status collapsed
+
+\begin_layout Plain Layout
+And it will be easiest if you save the file to
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+thesis.layout
+\end_layout
+
+\end_inset
+
+: LyX assumes that the document class has the same name as the layout file.
+
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout LyX-Code
+
+\backslash
+DeclareLaTeXClass[thesis,book]{thesis}
+\end_layout
+
+\begin_layout Standard
+If, on the other hand, the new class is not based upon an existing class,
+ you will probably have to
\begin_inset Quotes eld
\end_inset
\end_layout
\begin_layout Section
+\begin_inset CommandInset label
+LatexCommand label
+name "sec:TextClass"
+
+\end_inset
+
Declaring a new text class
\end_layout
and enjoy one or two of your favorite adult beverages; more if you are
getting particularly stuck.
It's really not that hard, except that the multitude of options can become
- overwhelming if you try to do to much in one sitting.
+ overwhelming if you try to do too much in one sitting.
Go have another adult beverage, just for good measure.
\end_layout
\end_layout
\begin_layout Standard
-Lines in a layout file which begin with a
+Lines in a layout file which begin with
\begin_inset Flex CharStyle:Code
status collapsed
\end_inset
are comments.
- There is one exception to this rule: all layouts should begin with lines
- like:
+ There is one exception to this rule.
+ All
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+*.layout
+\end_layout
+
+\end_inset
+
+ files should begin with a line like:
\end_layout
\begin_layout LyX-Code
status collapsed
\begin_layout Plain Layout
-
-\bar under
-D
-\bar default
-ocument\SpecialChar \menuseparator
-
-\bar under
-S
-\bar default
-ettings
+Document\SpecialChar \menuseparator
+Settings
\end_layout
\end_inset
\end_layout
\begin_layout Standard
-This indicates that your text class uses the foo.sty package.
+This indicates that your text class uses the
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+foo.sty
+\end_layout
+
+\end_inset
+
+ package.
Finally, it is also possible to declare classes for DocBook code.
- Typical declarations will look like
+ Typical declarations will look like:
\end_layout
\begin_layout LyX-Code
\begin_layout Standard
The class need only be specified if the name of the LaTeX class file and
- the name of the layout file are different; if the name of the classfile
+ the name of the layout file are different; if the name of the class file
is not specified, then LyX will simply assume that it is the same as the
name of the layout file.
\end_layout
status collapsed
\begin_layout Plain Layout
-
-\bar under
-T
-\bar default
-ools\SpecialChar \menuseparator
-
-\bar under
-R
-\bar default
-econfigure
+Tools\SpecialChar \menuseparator
+Reconfigure
\end_layout
\end_inset
-, exit LyX and restart it.
+, exit LyX and restart.
Then your new text class should be available along with the others.
\end_layout
\begin_layout Standard
-In versions of LyX prior to 1.6, you had to restart LyX to see any changes
- you made to your layout files.
- As a result, editing layout files could be very time consuming.
+Once the layout file is installed, you can edit it and see your changes
+ without having to reconfigure or to restart LyX.
+ In versions of LyX prior to 1.6, this was not true.
+ As a result, editing layout files was very time consuming.
Beginning with 1.6, however, you can force a reload of the layout currently
in use by using the LyX function
\begin_inset Flex CharStyle:MenuItem
\end_inset
.
- There is no default binding for this function---though, of course, you
- can bind it to a key yourself.
- If you want to use this function, then, you should simply enter it in the
- mini-buffer.
+ There is no default binding for this function—though, of course, you can
+ bind it to a key yourself.
+ But you use this function simply by entering it in the mini-buffer.
+\end_layout
+
+\begin_layout Standard
+
\emph on
Warning
\emph default
\emph on
strongly
\emph default
- recommended that you not attempt to edit your layout while simultaneously
- working on a document that you care about.
+ recommended that you not attempt to edit layout information while simultaneousl
+y working on a document that you care about.
Use a test document.
Syntax errors and the like in your layout file could cause peculiar behavior.
In particular, such errors could cause LyX to regard the current layout
as invalid and to attempt to switch to some other layout.
The LyX team strives to keep LyX stable in such situations, but safe is
better than sorry.
+\begin_inset Foot
+status collapsed
+
+\begin_layout Plain Layout
+And while we're giving advice, make regular backups.
+ And be nice to your mother.
+\end_layout
+
+\end_inset
+
+
\end_layout
\begin_layout Subsection
\end_layout
\begin_layout Standard
-The first non-comment line must contain the file format number:
+The first non-comment line of any layout file, included file, or module
+
+\emph on
+must
+\emph default
+ contain the file format number:
\end_layout
\begin_layout Description
\end_inset
-] This tag was introduced with LyX 1.4.0 (layout files of LyX 1.3.x and earlier
- don't have an explicit file format).
- The file format that is documented here is format 8.
+] The format of the layout file.
+\end_layout
+
+\begin_layout Standard
+This tag was introduced with LyX 1.4.0.
+ Layout files from LyX 1.3.x and earlier don't have an explicit file format
+ and are considered to be of format 1.
+ The format for the present version of LyX is format
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+19
+\end_layout
+
+\end_inset
+
+.
+ But LyX is capable of reading earlier formats, too, just as it is capable
+ of reading files produced by earlier versions of LyX.
\end_layout
\begin_layout Subsection
\begin_inset CommandInset ref
LatexCommand ref
-reference "sec:classoptions"
+reference "sub:ClassOptions"
\end_inset
\end_inset
-] Whether the class should default to having one or two columns.
+] Whether the class should
+\emph on
+default
+\emph default
+ to having one or two columns.
Can be changed in the
\begin_inset Flex CharStyle:MenuItem
status collapsed
\begin_layout Plain Layout
-
-\bar under
-D
-\bar default
-ocument\SpecialChar \menuseparator
-
-\bar under
-S
-\bar default
-ettings
+Document\SpecialChar \menuseparator
+Settings
\end_layout
\end_inset
\end_inset
- This sequence defines a new counter.
- See Section
-\begin_inset space ~
-\end_inset
-
+ [
+\begin_inset Flex CharStyle:Code
+status collapsed
-\begin_inset CommandInset ref
-LatexCommand ref
-reference "sec:counter"
+\begin_layout Plain Layout
+string
+\end_layout
\end_inset
- for details.
+] This sequence defines the properties for a counter.
+ If the counter does not yet exist, it is created; if it does exist, it
+ is modified.
Must end with
\begin_inset Quotes eld
\end_inset
\end_inset
.
+\begin_inset Newline newline
+\end_inset
+
+See Section
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "sub:Counters"
+
+\end_inset
+
+ for details on counters.
\end_layout
\begin_layout Description
\begin_inset CommandInset ref
LatexCommand ref
-reference "sec:fonts"
+reference "sub:Font-description"
\end_inset
status collapsed
\begin_layout Plain Layout
-DefaultStyle
+DefaultModule
\end_layout
\end_inset
status collapsed
\begin_layout Plain Layout
-string
+string]
\end_layout
\end_inset
-] This is the style that will be assigned to new paragraphs, usually
-\begin_inset Flex CharStyle:MenuItem
+ Specifies a module to be included by default with this document class.
+ The module should be specified by filename without the
+\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-Standard
+.module
\end_layout
\end_inset
-.
- This will default to the first defined style if not given, but you are
- highly encouraged to use this directive.
+ extension.
+ The user can still remove the module, but it will be active at the outset.
+ (This applies only when new files are created, or when this class is chosen
+ for an existing document.)
\end_layout
\begin_layout Description
status collapsed
\begin_layout Plain Layout
-Float
+DefaultStyle
\end_layout
\end_inset
- Defines a new float.
- See Section
-\begin_inset space ~
-\end_inset
-
-
-\begin_inset CommandInset ref
-LatexCommand ref
-reference "sec:floats"
-
-\end_inset
-
- for details.
- Must end with
-\begin_inset Quotes eld
-\end_inset
-
-
+ [
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-End
+string
\end_layout
\end_inset
+] This is the style that will be assigned to new paragraphs, usually
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+Standard
+\end_layout
-\begin_inset Quotes erd
\end_inset
.
+ This will default to the first defined style if not given, but you are
+ encouraged to use this directive.
\end_layout
\begin_layout Description
status collapsed
\begin_layout Plain Layout
-Input
+ExcludesModule
\end_layout
\end_inset
- As its name implies, this command allows you to include another layout
- definition file within yours to avoid duplicating commands.
- Common examples are the standard layout files, for example,
+ [
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-stdclass.inc
+string
\end_layout
\end_inset
-, which contains most of the basic layouts.
+] This tag indicates that the module in question—which should be specified
+ by filename without the
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+.module
+\end_layout
+
+\end_inset
+
+ extension—cannot be used with this document class.
+ This might be used in a journal-specific layout file to prevent, say, the
+ use of the
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+theorems-sec
+\end_layout
+
+\end_inset
+
+ module that numbers theorems by section.
+ This tag may
+\emph on
+not
+\emph default
+ be used in a module.
+ Modules have their own way of excluding other modules (see
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "sub:Layout-modules"
+
+\end_inset
+
+).
\end_layout
\begin_layout Description
status collapsed
\begin_layout Plain Layout
-InsetLayout
+Float
\end_layout
\end_inset
- This section (re-)defines the layout of an inset.
- It can be applied to an existing inset of to a new, user-defined inset,
- e.g., a new character style.
+ Defines a new float.
See Section
\begin_inset space ~
\end_inset
\begin_inset CommandInset ref
LatexCommand ref
-reference "sec:charstyle"
+reference "sub:Floats"
\end_inset
- for more information.
+ for details.
Must end with
\begin_inset Quotes eld
\end_inset
status collapsed
\begin_layout Plain Layout
-LeftMargin
+IfCounter
\end_layout
\end_inset
-
-\change_deleted 0 1223264406
-[[FIXME]]
-\change_inserted 0 1223264424
-A string that indicates the width of the left margin on the screen, for
- example,
-\begin_inset Quotes eld
-\end_inset
-
-MMMMM
-\begin_inset Quotes erd
-\end_inset
-
-.
-\change_unchanged
-
-\end_layout
-
-\begin_layout Description
+ [
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-NoFloat
+string
\end_layout
\end_inset
- This command deletes an existing float.
- This is particularly useful when you want to suppress a float that has
- be defined in an input file.
-\end_layout
+] Modifies the properties of the given counter.
+ If the counter does not exist, the section is ignored.
+ Must end with
+\begin_inset Quotes eld
+\end_inset
+
-\begin_layout Description
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-NoStyle
+End
\end_layout
\end_inset
- This command deletes an existing style.
- This is particularly useful when you want to suppress a style that has
- be defined in an input file.
-\end_layout
-\begin_layout Description
-\begin_inset Flex CharStyle:Code
-status collapsed
+\begin_inset Quotes erd
+\end_inset
-\begin_layout Plain Layout
-OutputType
-\end_layout
+.
+\begin_inset Newline newline
+\end_inset
+See Section
+\begin_inset space ~
\end_inset
-
-\change_deleted 0 1223264478
-[[FIXME]]
-\change_inserted 0 1223264538
-A string indicating what sort of output documents using this class will
- produce.
- At present, the options are: `docbook', `latex', `linuxdoc', and `literate'.
-\change_unchanged
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "sub:Counters"
+
+\end_inset
+
+ for details on counters.
\end_layout
\begin_layout Description
status collapsed
\begin_layout Plain Layout
-
-\series medium
-PageStyle
+IfStyle
\end_layout
\end_inset
[
-\emph on
-
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-
-\emph on
-plain
+string
\end_layout
\end_inset
-
-\emph default
-,
-\begin_inset Flex CharStyle:Code
-status collapsed
-
-\begin_layout Plain Layout
-empty
-\end_layout
-
+] Modifies the properties of the given paragraph style.
+ If the style does not exist, the section is ignored.
+ Must end with
+\begin_inset Quotes eld
\end_inset
-,
+
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-headings
+End
\end_layout
\end_inset
-] The class default pagestyle.
- Can be changed in the
-\begin_inset Flex CharStyle:MenuItem
-status collapsed
-
-\begin_layout Plain Layout
-
-\bar under
-D
-\bar default
-ocument\SpecialChar \menuseparator
-
-\bar under
-S
-\bar default
-ettings
-\end_layout
+\begin_inset Quotes erd
\end_inset
- dialog.
+.
\end_layout
\begin_layout Description
status collapsed
\begin_layout Plain Layout
-Preamble
+Input
\end_layout
\end_inset
- Sets the preamble for the LaTeX document.
- Note that this will completely override any prior
+ As its name implies, this command allows you to include another layout
+ definition file within yours to avoid duplicating commands.
+ Common examples are the standard layout files, for example,
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-Premable
+stdclass.inc
\end_layout
\end_inset
- or
+, which contains most of the basic layouts.
+\end_layout
+
+\begin_layout Description
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-AddToPreamble
+InsetLayout
\end_layout
\end_inset
- declarations.
+ This section (re-)defines the layout of an inset.
+ It can be applied to an existing inset or to a new, user-defined inset,
+ e.g., a new character style.
Must end with
\begin_inset Quotes eld
\end_inset
status collapsed
\begin_layout Plain Layout
-EndPreamble
+End
\end_layout
\end_inset
\end_inset
.
+\begin_inset Newline newline
+\end_inset
+
+See Section
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "sub:Flex-insets-and"
+
+\end_inset
+
+ for more information.
+
\end_layout
\begin_layout Description
status collapsed
\begin_layout Plain Layout
-Provides
+LeftMargin
\end_layout
\end_inset
\end_inset
-] [
-\begin_inset Flex CharStyle:Code
-status collapsed
+] A string that indicates the width of the left margin on the screen, for
+ example,
+\begin_inset Quotes eld
+\end_inset
-\begin_layout Plain Layout
+MMMMM
+\begin_inset Quotes erd
+\end_inset
-\emph on
-0
-\end_layout
+.
+ (Note that this is not a `length', like
+\begin_inset Quotes eld
+\end_inset
+2ex
+\begin_inset Quotes erd
\end_inset
-,
+.)
+\end_layout
+
+\begin_layout Description
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-1
+NoFloat
\end_layout
\end_inset
-] Whether the class already provides the feature
+ This command deletes an existing float.
+ This is particularly useful when you want to suppress a float that has
+ been defined in an input file.
+\end_layout
+
+\begin_layout Description
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-string
+NoStyle
\end_layout
\end_inset
-.
- A feature is in general the name of a package (
+ This command deletes an existing style.
+ This is particularly useful when you want to suppress a style that has
+ be defined in an input file.
+\end_layout
+
+\begin_layout Description
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-amsmath
+OutputFormat
\end_layout
\end_inset
-,
+ A string indicating the file format (as defined in the Preferences dialog)
+ produced by this class.
+ It is mainly useful when
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-makeidx
+OutputType
\end_layout
\end_inset
-, \SpecialChar \ldots{}
-) or a macro (
+ is `literate' and one wants to define a new type of literate document.
+ This string is reset to `docbook', `latex', or `literate' when the correspondin
+g
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-url
+OutputType
\end_layout
\end_inset
-,
+ parameter is encountered.
+\end_layout
+
+\begin_layout Description
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-boldsymbol
+OutputType
\end_layout
\end_inset
-,\SpecialChar \ldots{}
-); the complete list of supported features is unfortunately not documented
- outside the LyX source code---but see
+ A string indicating what sort of output documents using this class will
+ produce.
+ At present, the options are: `docbook', `latex', and `literate'.
+\end_layout
+
+\begin_layout Description
\begin_inset Flex CharStyle:Code
-status collapsed
+status open
\begin_layout Plain Layout
-LaTeXFeatures.cpp
+PageStyle
\end_layout
\end_inset
- if you're interested.
-
-\begin_inset Flex CharStyle:MenuItem
+ [
+\emph on
+
+\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-\bar under
-H
-\bar default
-elp\SpecialChar \menuseparator
-
-\bar under
-L
-\bar default
-aTeX Configuration
+\emph on
+plain
\end_layout
\end_inset
- also gives an overview of the supported packages.
-\end_layout
-\begin_layout Description
+\emph default
+,
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-Requires
+empty
\end_layout
\end_inset
- [
+,
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-string
+headings
\end_layout
\end_inset
-] Whether the class requires the feature
-\begin_inset Flex CharStyle:Code
+] The default pagestyle.
+ Can be changed in the
+\begin_inset Flex CharStyle:MenuItem
status collapsed
\begin_layout Plain Layout
- string
+Document\SpecialChar \menuseparator
+Settings
\end_layout
\end_inset
-.
- Multiple features must be separated by commas.
- Note that you can only request supported features.
+ dialog.
\end_layout
\begin_layout Description
\begin_inset Flex CharStyle:Code
-status collapsed
+status open
\begin_layout Plain Layout
-RightMargin
+Preamble
\end_layout
\end_inset
-
-\change_deleted 0 1223264443
-[[FIXME]]
-\change_inserted 0 1223264447
-A string that indicates the width of the right margin on the screen, for
- example,
-\begin_inset Quotes eld
-\end_inset
+ Sets the preamble for the LaTeX document.
+ Note that this will completely override any prior
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+Preamble
+\end_layout
-MMMMM
-\begin_inset Quotes erd
\end_inset
-.
-\change_unchanged
+ or
+\begin_inset Flex CharStyle:Code
+status collapsed
+\begin_layout Plain Layout
+AddToPreamble
\end_layout
-\begin_layout Description
+\end_inset
+
+ declarations.
+ (Use
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-SecNumDepth
+AddToPreamble
\end_layout
\end_inset
-
-\change_deleted 0 1223264553
-[[FIXME]]
-\change_inserted 0 1223264811
-Sets which divisions get numbered.
- Corresponds to the
+ if you just want to add material to the preamble.) Must end with
+\begin_inset Quotes eld
+\end_inset
+
+
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-
-\change_inserted 0 1223264626
-secnumdepth
-\change_unchanged
-
+EndPreamble
\end_layout
\end_inset
- counter in LaTeX.
-\change_unchanged
+\begin_inset Quotes erd
+\end_inset
+
+.
\end_layout
\begin_layout Description
status collapsed
\begin_layout Plain Layout
-Sides
+Provides
\end_layout
\end_inset
[
-\emph on
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+string
+\end_layout
+\end_inset
+
+] [
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
\emph on
-1
+0
\end_layout
\end_inset
-
-\emph default
,
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-2
+1
\end_layout
\end_inset
-] Whether the class-default should be printing on one or both sides of the
- paper.
- Can be changed in the
-\begin_inset Flex CharStyle:MenuItem
+] Whether the class already provides the feature
+\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-
-\bar under
-D
-\bar default
-ocument\SpecialChar \menuseparator
-
-\bar under
-S
-\bar default
-ettings
+string
\end_layout
\end_inset
- dialog.
-\end_layout
-
-\begin_layout Description
+.
+ A feature is in general the name of a package (
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-Style
+amsmath
\end_layout
\end_inset
- This sequence defines a new paragraph style.
- If the style already exists, it will redefine some of its parameters instead.
- See Section
-\begin_inset space ~
-\end_inset
-
-
-\begin_inset CommandInset ref
-LatexCommand ref
-reference "sec:style"
+,
+\begin_inset Flex CharStyle:Code
+status collapsed
-\end_inset
+\begin_layout Plain Layout
+makeidx
+\end_layout
- for details.
- Must end with
-\begin_inset Quotes eld
\end_inset
-
+, \SpecialChar \ldots{}
+) or a macro (
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-End
+url
\end_layout
\end_inset
-
-\begin_inset Quotes erd
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Description
+,
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-TitleLatexName
+boldsymbol
\end_layout
\end_inset
- [
+,\SpecialChar \ldots{}
+); the complete list of supported features is unfortunately not documented
+ outside the LyX source code—but see
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-string="maketitle"
+LaTeXFeatures.cpp
\end_layout
\end_inset
-] The name of the command or environment to be used with
-\begin_inset Flex CharStyle:Code
+ if you're interested.
+
+\begin_inset Flex CharStyle:MenuItem
status collapsed
\begin_layout Plain Layout
-TitleLatexType
+Help\SpecialChar \menuseparator
+LaTeX Configuration
\end_layout
\end_inset
-.
+ also gives an overview of the supported packages.
\end_layout
\begin_layout Description
status collapsed
\begin_layout Plain Layout
-TitleLatexType
+ProvidesModule
\end_layout
\end_inset
status collapsed
\begin_layout Plain Layout
-
-\emph on
-CommandAfter
+string
\end_layout
\end_inset
-,
+] Indicates that this layout provides the functionality of the module mentioned,
+ which should be specified by the filename without the
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-Environment
+.module
\end_layout
\end_inset
-] Indicates what kind of markup is used to define the title of a document.
-
+ extension.
+ This will typically be used if the layout includes the module directly,
+ rather than using the
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-CommandAfter
+DefaultModule
\end_layout
\end_inset
- means that the macro with name
+ tag to indicate that it ought to be used.
+ It could also be used in a module that provided an alternate implementation
+ of the same functionality.
+\end_layout
+
+\begin_layout Description
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-TitleLatexName
+Requires
\end_layout
\end_inset
- will be inserted after the last layout which has
-\begin_inset Quotes eld
-\end_inset
-
-
+ [
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-InTitle 1
+string
\end_layout
\end_inset
-
-\begin_inset Quotes erd
-\end_inset
-
-.
-
+] Whether the class requires the feature
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-Environment
+string
\end_layout
\end_inset
- corresponds to the case where the block of paragraphs which have
-\begin_inset Quotes eld
-\end_inset
-
-
+.
+ Multiple features must be separated by commas.
+ Note that you can only request supported features.
+ (Again, see
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-InTitle 1
+LaTeXFeatures.cpp
\end_layout
\end_inset
+ for a list of these.)
+\end_layout
-\begin_inset Quotes erd
-\end_inset
-
- should be enclosed into the
+\begin_layout Description
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-TitleLatexName
+RightMargin
\end_layout
\end_inset
- environment.
+ A string that indicates the width of the right margin on the screen, for
+ example,
+\begin_inset Quotes eld
+\end_inset
+
+MMMMM
+\begin_inset Quotes erd
+\end_inset
+
+.
\end_layout
\begin_layout Description
\begin_inset Flex CharStyle:Code
-status open
+status collapsed
\begin_layout Plain Layout
-TocDepth
+SecNumDepth
\end_layout
\end_inset
-
-\change_deleted 0 1223264639
-[[FIXME]]
-\change_inserted 0 1223264836
-Sets which divisions are included in the table of contents.
+ Sets which divisions get numbered.
Corresponds to the
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-
-\change_inserted 0 1223264831
-tocdepth
-\change_unchanged
-
+secnumdepth
\end_layout
\end_inset
counter in LaTeX.
-\change_unchanged
-
\end_layout
\begin_layout Description
status collapsed
\begin_layout Plain Layout
-UseModule
+Sides
\end_layout
\end_inset
[
+\emph on
+
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-string]
+
+\emph on
+1
\end_layout
\end_inset
- Specifies a module to be included by default with this document class.
- The user can still remove the module, but it will be active at the outset.
- (This applies only when new files are created, or when this class is chosen
- for an existing document.)
-\end_layout
-\begin_layout Subsection
+\emph default
+,
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-ClassOptions
-\end_layout
-
-\end_inset
-
- section
+2
\end_layout
-\begin_layout Standard
-\begin_inset CommandInset label
-LatexCommand label
-name "sec:classoptions"
-
\end_inset
-The
-\begin_inset Flex CharStyle:Code
+] Whether the class-default should be printing on one or both sides of the
+ paper.
+ Can be changed in the
+\begin_inset Flex CharStyle:MenuItem
status collapsed
\begin_layout Plain Layout
-ClassOptions
+Document\SpecialChar \menuseparator
+Settings
\end_layout
\end_inset
- section can contain the following entries:
+ dialog.
\end_layout
\begin_layout Description
status collapsed
\begin_layout Plain Layout
-FontSize
+Style
\end_layout
\end_inset
- [
+ This sequence defines a paragraph style.
+ If the style does not yet exist, it is created; if it does exist, its parameter
+s are modified.
+ Must end with
+\begin_inset Quotes eld
+\end_inset
+
+
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+End
+\end_layout
+
+\end_inset
+
+
+\begin_inset Quotes erd
+\end_inset
+
+.
+\begin_inset Newline newline
+\end_inset
+
+See Section
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "sub:Paragraph-Styles"
+
+\end_inset
+
+ for details on paragraph styles.
+\end_layout
+
+\begin_layout Description
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+TitleLatexName
+\end_layout
+
+\end_inset
+
+ [
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+string="maketitle"
+\end_layout
+
+\end_inset
+
+] The name of the command or environment to be used with
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+TitleLatexType
+\end_layout
+
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Description
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+TitleLatexType
+\end_layout
+
+\end_inset
+
+ [
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\emph on
+CommandAfter
+\end_layout
+
+\end_inset
+
+,
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+Environment
+\end_layout
+
+\end_inset
+
+] Indicates what kind of markup is used to define the title of a document.
+
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+CommandAfter
+\end_layout
+
+\end_inset
+
+ means that the macro with name
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+TitleLatexName
+\end_layout
+
+\end_inset
+
+ will be inserted after the last layout which has
+\begin_inset Quotes eld
+\end_inset
+
+
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+InTitle 1
+\end_layout
+
+\end_inset
+
+
+\begin_inset Quotes erd
+\end_inset
+
+.
+
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+Environment
+\end_layout
+
+\end_inset
+
+ corresponds to the case where the block of paragraphs which have
+\begin_inset Quotes eld
+\end_inset
+
+
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+InTitle 1
+\end_layout
+
+\end_inset
+
+
+\begin_inset Quotes erd
+\end_inset
+
+ should be enclosed into the
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+TitleLatexName
+\end_layout
+
+\end_inset
+
+ environment.
+\end_layout
+
+\begin_layout Description
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+TocDepth
+\end_layout
+
+\end_inset
+
+ Sets which divisions are included in the table of contents.
+ Corresponds to the
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+tocdepth
+\end_layout
+
+\end_inset
+
+ counter in LaTeX.
+\end_layout
+
+\begin_layout Subsection
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+ClassOptions
+\end_layout
+
+\end_inset
+
+ section
+\begin_inset CommandInset label
+LatexCommand label
+name "sub:ClassOptions"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+The
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+ClassOptions
+\end_layout
+
+\end_inset
+
+ section can contain the following entries:
+\end_layout
+
+\begin_layout Description
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+FontSize
+\end_layout
+
+\end_inset
+
+ [
\begin_inset Flex CharStyle:Code
status collapsed
\end_inset
-
-\change_deleted 0 1223264991
-[[FIXME]]
-\change_inserted 0 1223265053
-Used to set the DTD line with XML-based output classes.
- E.g.: PUBLIC
+ Used to set the DTD line with XML-based output classes.
+ E.
+\begin_inset space \thinspace{}
+\end_inset
+
+g.: PUBLIC
\begin_inset Quotes eld
\end_inset
\end_inset
.
-\change_unchanged
-
\end_layout
\begin_layout Description
\begin_layout Subsection
Paragraph Styles
-\end_layout
-
-\begin_layout Standard
\begin_inset CommandInset label
LatexCommand label
-name "sec:style"
+name "sub:Paragraph-Styles"
\end_inset
+
+\end_layout
+
+\begin_layout Standard
A paragraph style description looks like this:
\begin_inset Foot
status collapsed
status collapsed
\begin_layout Plain Layout
-BottomSep
+BabelPreamble
\end_layout
\end_inset
- [
+ Language dependent information to be included in the LaTeX preamble when
+ this style is used.
+ Note that this will completely override any prior
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+BabelPreamble
+\end_layout
+
+\end_inset
+
+ declarations.
+ Must end with
+\begin_inset Quotes eld
+\end_inset
+
+
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+EndBabelPreamble
+\end_layout
+
+\end_inset
+
+
+\begin_inset Quotes erd
+\end_inset
+
+.
+ The contents of this tag will occur once in the LaTeX preamble for each
+ language used by the document.
+ Each time, the following substitutions are made:
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+$$lang
+\end_layout
+
+\end_inset
+
+ is replaced by the language name (as used by the babel package).
+\end_layout
+
+\begin_layout Itemize
+The
+\begin_inset Quotes eld
+\end_inset
+
+Function
+\begin_inset Quotes erd
+\end_inset
+
+
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+_()
+\end_layout
+
+\end_inset
+
+ replaces its argument by the translation of the argument to the current
+ language.
+\end_layout
+
+\begin_layout Standard
+This preamble snippet will only be used if the document contains more than
+ one language and the babel package is used.
+\end_layout
+
+\end_deeper
+\begin_layout Description
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+BottomSep
+\end_layout
+
+\end_inset
+
+ [
\begin_inset Flex CharStyle:Code
status collapsed
\end_inset
-
-\change_deleted 0 1223265419
-[[FIXME]]
-\change_inserted 0 1223265432
-Depth of XML command.
+ Depth of XML command.
Used only with XML-type formats.
-\change_unchanged
-
\end_layout
\begin_layout Description
status collapsed
\begin_layout Plain Layout
-
-\bar under
-E
-\bar default
-dit\SpecialChar \menuseparator
-
-\bar under
-P
-\bar default
-aragraph
+Edit\SpecialChar \menuseparator
+Paragraph
\begin_inset space ~
\end_inset
\begin_inset CommandInset ref
LatexCommand ref
-reference "sec:fonts"
+reference "sub:Font-description"
\end_inset
\end_inset
- [[FIXME]]
-\change_inserted 0 1223265565
- (Used only with XML-type formats.)
-\change_unchanged
+ [[FIXME]] (Used only with XML-type formats.)
+\end_layout
+
+\begin_layout Description
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+InPreamble
+\end_layout
+
+\end_inset
+
+
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+[1, 0]
+\end_layout
+
+\end_inset
+ If 1, marks the layout as to be included in the document preamble rather
+ than in the document body.
+ This is useful for document classes that want such information as the title
+ and author to appear in the preamble.
\end_layout
\begin_layout Description
\end_inset
- [[FIXME]]
-\change_inserted 0 1223265576
- (Used only with XML-type formats.)
-\change_unchanged
-
+ [[FIXME]] (Used only with XML-type formats.)
\end_layout
\begin_layout Description
\begin_inset Newline newline
\end_inset
-The name of the counter for automatic numbering (see Section
-\begin_inset CommandInset ref
-LatexCommand ref
-reference "sec:counter"
-
+The name of the counter for automatic numbering.
+
+\begin_inset Newline newline
\end_inset
- for details).
- This must be given if
+This
+\emph on
+must
+\emph default
+ be given if
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-Labeltype
+LabelType
\end_layout
\end_inset
\end_inset
.
+ In that case, the counter will be stepped each time the layout appears.
+
+\begin_inset Newline newline
+\end_inset
+
+This
+\emph on
+may
+\emph default
+ also be given if
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+LabelType
+\end_layout
+
+\end_inset
+
+ is
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+Enumerate
+\end_layout
+
+\end_inset
+
+, though this case is a bit complicated.
+ Suppose you declare
+\begin_inset Quotes eld
+\end_inset
+
+
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+LabelCounter myenum
+\end_layout
+
+\end_inset
+
+
+\begin_inset Quotes erd
+\end_inset
+
+.
+ Then the actual counters used are
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+myenumi
+\end_layout
+
+\end_inset
+
+,
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+myenumii
+\end_layout
+
+\end_inset
+
+,
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+myenumiii
+\end_layout
+
+\end_inset
+
+, and
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+myenumiv
+\end_layout
+
+\end_inset
+
+, much as in LaTeX.
+ These counters must all be declared separately.
+\begin_inset Newline newline
+\end_inset
+
+See Section
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "sub:Counters"
+
+\end_inset
+
+ for details on counters.
\end_layout
\begin_layout Description
\begin_inset CommandInset ref
LatexCommand ref
-reference "sec:fonts"
+reference "sub:Font-description"
\end_inset
.
-\change_inserted 0 1223265124
-
\end_layout
\begin_layout Description
-
-\change_inserted 0 1223265614
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-
-\change_inserted 0 1223265133
LabelIndent
-\change_unchanged
-
\end_layout
\end_inset
Text that indicates how far a label should be indented.
-\change_unchanged
-
\end_layout
\begin_layout Description
in Section
\begin_inset CommandInset ref
LatexCommand ref
-reference "sec:counter"
+reference "sub:Counters"
\end_inset
Section
\begin_inset CommandInset ref
LatexCommand ref
-reference "sec:counter"
+reference "sub:Counters"
\end_inset
\end_inset
too.
-\change_inserted 0 1223265160
-
\end_layout
\begin_layout Description
-
-\change_inserted 0 1223265640
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-
-\change_inserted 0 1223265166
LabelTag
-\change_unchanged
-
\end_layout
\end_inset
[FIXME] (Used only with XML-type formats.)
-\change_unchanged
-
\end_layout
\begin_layout Description
status collapsed
\begin_layout Plain Layout
-Labeltype
+LabelType
\end_layout
\end_inset
\emph on
No_Label
\emph default
-, Manual, Static, Top_Environment,
-\begin_inset Newline newline
-\end_inset
-
-Centered_Top_Environment, Sensitive, Counter
+, Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
+ Enumerate, Itemize, Bibliography
\end_layout
\end_inset
]
-\begin_inset Newline newline
-\end_inset
-
+\end_layout
+\begin_deeper
+\begin_layout Itemize
\begin_inset Flex CharStyle:Code
status collapsed
\end_inset
means the label is the very first word (up to the first real blank).
-\begin_inset Foot
-status collapsed
-
-\begin_layout Plain Layout
-Use protected spaces if you want more than one word as the label.
-\end_layout
-
+ Use protected spaces (like
+\begin_inset space ~
\end_inset
+that one) if you want more than one word as the label.
+\end_layout
+
+\begin_layout Itemize
\begin_inset Flex CharStyle:Code
status collapsed
\end_inset
- means it is defined in the layout (see
+ means the label is simply whatever
\begin_inset Flex CharStyle:Code
status collapsed
\end_inset
-).
-
+ declares it to be.
+ Note that this really is `static'.
+\end_layout
+
+\begin_layout Itemize
\begin_inset Flex CharStyle:Code
status collapsed
.
The label will be printed above the paragraph, but only at the top of an
environment or the top of a chain of paragraphs with this layout.
- Usage is for example the
+ This might be used with the
\begin_inset Flex CharStyle:MenuItem
status collapsed
\end_inset
- layout or the
-\begin_inset Flex CharStyle:MenuItem
-status collapsed
-
-\begin_layout Plain Layout
-Bibliography
+ layout, for example.
\end_layout
-\end_inset
-
- layout.
- This is also the case for
+\begin_layout Itemize
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-Manual
+Sensitive
\end_layout
\end_inset
- labels with latex type
-\begin_inset Flex CharStyle:Code
-status collapsed
+ is a special case for the caption-labels
+\begin_inset Quotes eld
+\end_inset
-\begin_layout Plain Layout
-Environment
-\end_layout
+Figure
+\begin_inset Quotes erd
+\end_inset
+ and
+\begin_inset Quotes eld
\end_inset
-, in order to make layouts for theorems work correctly.
+Table
+\begin_inset Quotes erd
+\end_inset
+
+.
\begin_inset Flex CharStyle:Code
status collapsed
\end_inset
- is a special case for the caption-labels
-\begin_inset Quotes eld
+ means the (hardcoded) label string depends on the kind of float: It is
+ hardcoded to be `FloatType N', where N is the value of the counter associated
+ with the float.
+\end_layout
+
+\begin_layout Itemize
+The
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+Counter
+\end_layout
+
\end_inset
-Figure
-\begin_inset Quotes erd
+ label type defines automatically numbered labels.
+ The
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+LabelString
+\end_layout
+
\end_inset
- and
+ will be expanded to resolve any counter references it contains: For example,
+ it might be
\begin_inset Quotes eld
\end_inset
-Table
+
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+Section
+\backslash
+thechapter.
+\backslash
+thesection
+\end_layout
+
+\end_inset
+
+
\begin_inset Quotes erd
\end_inset
.
-
+ See Section
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "sub:Counters"
+
+\end_inset
+
+ for more information on counters.
+\end_layout
+
+\begin_layout Itemize
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-Sensitive
+Enumerate
\end_layout
\end_inset
- means the (hardcoded) label string depends on the kind of float.
- The
+ produces the usual sort of enumeration labels.
+ At present, it is hardcoded to use Arabic numerals, lowercase letters,
+ small Roman numerals, and uppercase letters for the four possible depths.
+\end_layout
+
+\begin_layout Itemize
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-Counter
+Itemize
\end_layout
\end_inset
- label type defines automatically numbered labels.
- See Section
-\begin_inset CommandInset ref
-LatexCommand ref
-reference "sec:counter"
+ produces various bullets at the different levels.
+ It is also hardcoded.
+\end_layout
+
+\begin_layout Itemize
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+Bibliography
+\end_layout
+
+\end_inset
+
+ is used internally by LyX and should be used only with
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+LatexType BibEnvironment
+\end_layout
\end_inset
.
\end_layout
+\end_deeper
\begin_layout Description
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+LangPreamble
+\end_layout
+
+\end_inset
-\change_deleted 0 1223265792
+ Like
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-LatexFooter
+BabelPreamble
\end_layout
\end_inset
- [[FIXME]]
+, but this preamble snippet occurs independently from the babel package,
+ and only for the document language.
+ Must end with
+\begin_inset Quotes eld
+\end_inset
+
+
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+EndLangPreamble
\end_layout
-\begin_layout Description
+\end_inset
+
+
+\begin_inset Quotes erd
+\end_inset
+
+.
+\end_layout
-\change_deleted 0 1223265792
+\begin_deeper
+\begin_layout Standard
+If the style defines text that appears in the typeset document, it may use
+
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-LatexHeader
+LangPreamble
\end_layout
\end_inset
- [[FIXME]]
+ and
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+BabelPreamble
\end_layout
-\begin_layout Description
+\end_inset
+
+ to support non-english and even multilanguage documents correctly.
+ The following excerpt (from the
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-LatexName
+theorems-ams.inc
\end_layout
\end_inset
- The name of the corresponding LaTeX stuff.
- Either the environment or command name.
+ file) shows how this works:
\end_layout
-\begin_layout Description
+\begin_layout LyX-Code
+Preamble
+\end_layout
+
+\begin_layout LyX-Code
+
+\backslash
+theoremstyle{remark}
+\end_layout
-\change_deleted 0 1223265962
+\begin_layout LyX-Code
+
+\backslash
+newtheorem{claim}[thm]{
+\backslash
+protect
+\backslash
+claimname}
+\end_layout
+
+\begin_layout LyX-Code
+EndPreamble
+\end_layout
+
+\begin_layout LyX-Code
+LangPreamble
+\end_layout
+
+\begin_layout LyX-Code
+
+\backslash
+providecommand{
+\backslash
+claimname}{_(Claim)}
+\end_layout
+
+\begin_layout LyX-Code
+
+\end_layout
+
+\begin_layout LyX-Code
+EndLangPreamble
+\end_layout
+
+\begin_layout LyX-Code
+BabelPreamble
+\end_layout
+
+\begin_layout LyX-Code
+
+\backslash
+addto
+\backslash
+captions$$lang{
+\backslash
+renewcommand{
+\backslash
+claimname}{_(Claim)}}
+\end_layout
+
+\begin_layout LyX-Code
+EndBabelPreamble
+\end_layout
+
+\begin_layout Standard
+The key to correct translation of the user visible text is the definition
+ of the command
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\backslash
+claimname
+\end_layout
+
+\end_inset
+
+ in the language preamble.
+ This command holds the name of the theorem that will appear in the output.
+ The
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+BabelPreamble
+\end_layout
+
+\end_inset
+
+ then uses the commands offered by the babel package to redefine
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\backslash
+claimname
+\end_layout
+
+\end_inset
+
+ for each used language in multilanguage documents.
+\end_layout
+
+\end_deeper
+\begin_layout Description
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-LatexParagraph
+LatexName
\end_layout
\end_inset
- [[FIXME]]
+ The name of the corresponding LaTeX stuff.
+ Either the environment or command name.
\end_layout
\begin_layout Description
status collapsed
\begin_layout Plain Layout
-List_Environment
+List_Environment, Bib_Environment
\end_layout
\end_inset
] How the layout should be translated into LaTeX.
-
+\begin_inset Foot
+status collapsed
+
+\begin_layout Plain Layout
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+LatexType
+\end_layout
+
+\end_inset
+
+ is perhaps a bit misleading, since these rules apply to SGML classes, too.
+ Visit the SGML class files for specific examples.
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_deeper
+\begin_layout Itemize
\begin_inset Flex CharStyle:Code
status collapsed
means nothing special.
+\end_layout
+
+\begin_layout Itemize
\begin_inset Flex CharStyle:Code
status collapsed
\end_inset
- and
+.
+\end_layout
+
+\begin_layout Itemize
\begin_inset Flex CharStyle:Code
status collapsed
.
+\end_layout
+
+\begin_layout Itemize
\begin_inset Flex CharStyle:Code
status collapsed
\end_inset
-, except that a
+, except that an
\begin_inset Flex CharStyle:Code
status collapsed
is generated for each paragraph of this environment.
+\end_layout
+
+\begin_layout Itemize
\begin_inset Flex CharStyle:Code
status collapsed
dialog.
-\begin_inset Flex CharStyle:Code
-status collapsed
-
-\begin_layout Plain Layout
+\end_layout
-\emph on
-LatexType
+\begin_layout Standard
+Putting the last few things together, the LaTeX output will be either:
\end_layout
-\end_inset
-
- is perhaps a bit misleading, since these rules apply to SGML classes, too.
- Visit the SGML class files for specific examples.
-\end_layout
-
-\begin_layout Standard
-Putting the last few things together, the LaTeX output will be either:
-\end_layout
-
-\begin_layout LyX-Code
+\begin_layout LyX-Code
\backslash
latexname[latexparam]{\SpecialChar \ldots{}
\end_layout
\begin_layout Standard
-depending upon the LaTex type.
+depending upon the LaTeX type.
\end_layout
+\end_deeper
\begin_layout Description
\begin_inset Flex CharStyle:Code
status collapsed
status collapsed
\begin_layout Plain Layout
-
-\bar under
-E
-\bar default
-dit\SpecialChar \menuseparator
-
-\bar under
-P
-\bar default
-aragraph
+Edit\SpecialChar \menuseparator
+Paragraph
\begin_inset space ~
\end_inset
\end_inset
-
-\change_deleted 0 1223265997
-[[FIXME]]
-\change_inserted 0 1223266000
-Name of a layout that has replaced this layout.
+ Name of a layout that has replaced this layout.
This is used to rename a layout, while keeping backward compatibility.
-\change_unchanged
-
\end_layout
\begin_layout Description
\end_inset
-\change_inserted 0 1223264275
-
\begin_inset CommandInset label
LatexCommand label
name "des:PathThru"
\end_inset
-
-\change_unchanged
[
\emph on
\end_inset
-Information to be included in the LaTeX preamable when this style is used.
+Information to be included in the LaTeX preamble when this style is used.
Used to define macros, load packages, etc., required by this particular
style.
Must end with
See section
\begin_inset CommandInset ref
LatexCommand ref
-reference "sec:fonts"
+reference "sub:Font-description"
\end_inset
\end_layout
\begin_layout Description
-
-\change_deleted 0 1223265258
-Need
-\change_unchanged
-
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Subsection
Floats
-\end_layout
-
-\begin_layout Standard
\begin_inset CommandInset label
LatexCommand label
-name "sec:floats"
+name "sub:Floats"
\end_inset
+
+\end_layout
+
+\begin_layout Standard
Since version 1.3.0 of LyX, it is has been both possible and necessary to
define the floats (
\begin_inset Flex CharStyle:MenuItem
\end_inset
] The string that will be used in the menus and also for the caption.
+ This is translated to the current language if babel is used.
\end_layout
\begin_layout Description
\end_inset
] The heading used for the list of floats.
+ This is translated to the document language.
\end_layout
\begin_layout Description
\end_inset
specifier is special and, because of implementation details, cannot be
- used in non-builtin float types.
+ used in non-built in float types.
If you do not understand what this means, just use
\begin_inset Quotes eld
\end_inset
\end_layout
\begin_layout Subsection
-Inset layouts and Flex insets
-\end_layout
-
-\begin_layout Standard
+Flex insets and InsetLayout
\begin_inset CommandInset label
LatexCommand label
-name "sec:charstyle"
+name "sub:Flex-insets-and"
\end_inset
-LyX has supported character styles since version 1.4.0; since version 1.6.0
- these are called Flex insets.
-
+
\end_layout
\begin_layout Standard
-Furthermore, it is possible to define the general layout of many different
- types of insets.
- Currently, InsetLayout can be used to customize the layout parameters
- for footnotes, marginal notes, note insets, ERT insets, branches, listings,
- indexes, boxes, tables, algorithms, URLs, and optional arguments, as well
- as Flex insets.
+LyX has supported character styles since version 1.4.0; as of version 1.6.0,
+ these are called Flex insets.
\end_layout
\end_inset
-): These can be used to define custom collapsable insets, similar to ERT,
- footnote, and the like.
+): These can be used to define custom collapsible insets, similar to TeX
+ code, footnote, and the like.
+ An obvious example is an endnote inset, which is defined in the
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+endnote
+\end_layout
+
+\end_inset
+
+ module.
\end_layout
\begin_layout Itemize
): For use with DocBook classes.
\end_layout
+\begin_layout Standard
+Flex insets are defined using the
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+InsetLayout
+\end_layout
+
+\end_inset
+
+ tag, which shall be explained in a moment.
+\end_layout
+
+\begin_layout Standard
+The
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+InsetLayout
+\end_layout
+
+\end_inset
+
+ tag also serves another function: It can be used to customize the general
+ layout of many different types of insets.
+ Currently,
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+InsetLayout
+\end_layout
+
+\end_inset
+
+ can be used to customize the layout parameters for footnotes, marginal
+ notes, note insets, TeX code (ERT) insets, branches, listings, indexes,
+ boxes, tables, algorithms, URLs, and optional arguments, as well as to
+ define Flex insets.
+\end_layout
+
\begin_layout Standard
The
\begin_inset Flex CharStyle:Code
\end_inset
- definition starting line is of the form
+ definition must begin with a line of the form:
\end_layout
\begin_layout LyX-Code
-InsetLayout <Type> <Name>
+InsetLayout <Type>
\end_layout
\begin_layout Standard
-where
+Here
\begin_inset Flex CharStyle:Code
status collapsed
\end_inset
- can be
+ indicates the inset whose layout is being defined, and here there are two
+ cases.
+\end_layout
+
+\begin_layout Enumerate
+The layout for a pre-existing inset is being modified.
+ In this case, can be
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+<Type>
+\end_layout
+
+\end_inset
+
+ any one of the following:
\begin_inset Flex CharStyle:Code
status collapsed
status collapsed
\begin_layout Plain Layout
-ERT
+Box:shaded
\end_layout
\end_inset
status collapsed
\begin_layout Plain Layout
-Figure
+ERT
\end_layout
\end_inset
status collapsed
\begin_layout Plain Layout
-Foot
+Figure
\end_layout
\end_inset
status collapsed
\begin_layout Plain Layout
-Index
+Foot
\end_layout
\end_inset
status collapsed
\begin_layout Plain Layout
-Listings
+Index
\end_layout
\end_inset
status collapsed
\begin_layout Plain Layout
-Marginal
+Info
\end_layout
\end_inset
status collapsed
\begin_layout Plain Layout
-Note:Comment
+Info:menu
\end_layout
\end_inset
status collapsed
\begin_layout Plain Layout
-Note:Note
+Info:shortcut
\end_layout
\end_inset
status collapsed
\begin_layout Plain Layout
-Note:GreyedOut
+Info:shortcuts
\end_layout
\end_inset
status collapsed
\begin_layout Plain Layout
-OptArg
+Listings
\end_layout
\end_inset
status collapsed
\begin_layout Plain Layout
-Table
+Marginal
\end_layout
\end_inset
status collapsed
\begin_layout Plain Layout
-URL
+Note:Comment
\end_layout
\end_inset
-, or
+,
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-Flex
+Note:Note
\end_layout
\end_inset
-.
- If
+,
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-<Type>
+Note:GreyedOut
\end_layout
\end_inset
- is
+,
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-Flex
+OptArg
\end_layout
\end_inset
-, then
+,
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-<Name>
+Table
\end_layout
\end_inset
- should have the form
+, or
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-SubType:StyleName
+URL
\end_layout
\end_inset
-, where
+.
+\end_layout
+
+\begin_layout Enumerate
+The layout for a Flex inset is being defined.
+ In this case,
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-SubType
+<Type>
\end_layout
\end_inset
- is either
+ can be any valid identifier not used by a pre-existing inset.
+ Note that the definition of a flex inset must
+\emph on
+ als
+\emph default
+o include a
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-CharStyle
+LyXType
\end_layout
\end_inset
-,
+ entry.
+\end_layout
+
+\begin_layout Standard
+The
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-Custom
+InsetLayout
\end_layout
\end_inset
-, or
+ definition can contain the following entries:
+\end_layout
+
+\begin_layout Description
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-Element
+BgColor
\end_layout
\end_inset
-, and
+ The color for the inset's background.
+ The valid colors are defined in
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-StyleName
+src/ColorCode.h
\end_layout
\end_inset
- is any valid identifier.
-
+.
\end_layout
-\begin_layout Standard
-The following
+\begin_layout Description
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-InsetLayout
+ContentAsLabel
\end_layout
\end_inset
- section can contain the following entries:
-\end_layout
-
-\begin_layout Description
+ [
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-BgColor
+
+\emph on
+0
\end_layout
\end_inset
- The color for the inset's background.
- These valid colors are defined in
+,
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-src/ColorCode.h
+1
\end_layout
\end_inset
-.
+] Whether to use the content of the inset as the label, when the inset is
+ closed.
+ Default is false.
\end_layout
\begin_layout Description
\end_inset
).
-\change_inserted 0 1223263809
-
\end_layout
\begin_layout Description
-
-\change_inserted 0 1223263872
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-
-\change_inserted 0 1223263814
CustomPars
\end_layout
\begin_layout Plain Layout
-\change_inserted 0 1223263839
-
\emph on
0
\end_layout
status collapsed
\begin_layout Plain Layout
-
-\change_inserted 0 1223263839
1
\end_layout
] Indicates whether the user may employ the Paragraph Settings dialog to
customize the paragraph.
-\change_unchanged
-
\end_layout
\begin_layout Description
\end_inset
-; ERT insets generally use
+, ERT insets generally
\begin_inset Flex CharStyle:Code
status collapsed
\end_inset
-; and character styles use
+, and character styles
\begin_inset Flex CharStyle:Code
status collapsed
\end_inset
.
-\change_inserted 0 1223264047
-
\end_layout
\begin_layout Description
-
-\change_inserted 0 1223264091
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-
-\change_inserted 0 1223264053
End
-\change_unchanged
-
\end_layout
\end_inset
Required at the end of the InsetLayout declarations.
-\change_unchanged
-
\end_layout
\begin_layout Description
\begin_inset CommandInset ref
LatexCommand ref
-reference "sec:fonts"
+reference "sub:Font-description"
\end_inset
\begin_layout Description
\begin_inset Flex CharStyle:Code
-status open
+status collapsed
\begin_layout Plain Layout
ForceLTR
\end_inset
- [[FIXME]]
-\change_inserted 0 1223263904
+ Force the
+\begin_inset Quotes eld
+\end_inset
+
+latex
+\begin_inset Quotes erd
+\end_inset
+
+ language, leading to Left-to-Right (latin) output, e.
+\begin_inset space \thinspace{}
+\end_inset
+
+g.
+\begin_inset space \space{}
+\end_inset
+in TeX code or URL.
+ A kludge.
\end_layout
\begin_layout Description
-
-\change_inserted 0 1223263954
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-
-\change_inserted 0 1223263911
ForcePlain
-\change_unchanged
-
\end_layout
\end_inset
\begin_layout Plain Layout
-\change_inserted 0 1223263915
-
\emph on
0
\end_layout
status collapsed
\begin_layout Plain Layout
-
-\change_inserted 0 1223263915
1
\end_layout
] Indicates whether the PlainLayout should be used or, instead, the user
can change the paragraph style used in the inset.
-\change_unchanged
-
+ Default is false.
\end_layout
\begin_layout Description
\end_inset
).
+ Default is false.
\end_layout
\begin_layout Description
status collapsed
\begin_layout Plain Layout
-KeepEmpty
+InToc
\end_layout
\end_inset
- As with paragraph styles (see page
-\begin_inset CommandInset ref
-LatexCommand pageref
-reference "des:KeepEmpty"
+ [
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\emph on
+0
+\end_layout
\end_inset
-).
+,
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+1
\end_layout
-\begin_layout Description
+\end_inset
-\change_deleted 0 1223264111
+] Whether to include the contents of this inset in the strings generated
+ for the `Outline' pane.
+ One would not, for example, want the content of a footnote in a section
+ header to be included in the TOC displayed in the outline, but one would
+ normally want the content of a character style displayed.
+ Default is false: not to include.
+\end_layout
+
+\begin_layout Description
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-LabelString
+KeepEmpty
\end_layout
\end_inset
- What will be displayed on the button or elsewhere as the inset label.
- Some inset types (ERT and Branch) modify this label on the fly.
+ As with paragraph styles (see page
+\begin_inset CommandInset ref
+LatexCommand pageref
+reference "des:KeepEmpty"
+
+\end_inset
+
+).
+ Default is false.
\end_layout
\begin_layout Description
\begin_inset CommandInset ref
LatexCommand ref
-reference "sec:fonts"
+reference "sub:Font-description"
\end_inset
\end_layout
\begin_layout Description
-
-\change_inserted 0 1223264113
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-
-\change_inserted 0 1223264113
LabelString
\end_layout
\end_inset
What will be displayed on the button or elsewhere as the inset label.
- Some inset types (ERT and Branch) modify this label on the fly.
+ Some inset types (TeX code and Branch) modify this label on the fly.
\end_layout
\begin_layout Description
\end_inset
-,
+, or
\begin_inset Flex CharStyle:Code
status collapsed
\end_inset
- (indicating a dummy definition ending definitions of charstyles etc.).
- This entry is only meaningful for Flex (user definable) insets.
-\change_inserted 0 1223264124
-
+ (indicating a dummy definition ending definitions of charstyles, etc).
+ This entry is required in and is only meaningful for Flex insets.
+ Among other things, it determines on which menu this inset will appear.
\end_layout
\begin_layout Description
-
-\change_inserted 0 1223264224
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-
-\change_inserted 0 1223264131
MultiPar
-\change_unchanged
-
\end_layout
\end_inset
\begin_layout Plain Layout
-\change_inserted 0 1223264137
-
\emph on
0
\end_layout
status collapsed
\begin_layout Plain Layout
-
-\change_inserted 0 1223264137
1
\end_layout
\end_inset
] Whether multiple paragraphs are permitted in this inset.
- This will also set CustomPars to the same value and ForcePlain to the opposite
- value.
- These can be reset to other values, if they are used
-\emph on
-after
-\emph default
- MultiPar.
-\change_unchanged
+ This will also set
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+CustomPars
+\end_layout
+
+\end_inset
+
+ to the same value and
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+ForcePlain
+\end_layout
+
+\end_inset
+
+ to the opposite value.
+ These can be reset to other values, if they are used
+\emph on
+after
+\emph default
+
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+MultiPar
+\end_layout
+
+\end_inset
+.
+ Default is true.
\end_layout
\begin_layout Description
\emph on
not
\emph default
- whether this command should itself be protected.)
-\change_inserted 0 1223264245
-
+ whether the command should itself be protected.) Default is false.
\end_layout
\begin_layout Description
-
-\change_inserted 0 1223264288
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-
-\change_inserted 0 1223264250
PassThru
-\change_unchanged
-
\end_layout
\end_inset
\begin_layout Plain Layout
-\change_inserted 0 1223264254
-
\emph on
0
\end_layout
status collapsed
\begin_layout Plain Layout
-
-\change_inserted 0 1223264254
1
\end_layout
] As with paragraph styles (see page
\begin_inset CommandInset ref
-LatexCommand ref
+LatexCommand pageref
reference "des:PathThru"
\end_inset
).
-\change_unchanged
-
+ Default is false.
\end_layout
\begin_layout Description
\begin_layout Subsection
Counters
-\end_layout
-
-\begin_layout Standard
\begin_inset CommandInset label
LatexCommand label
-name "sec:counter"
+name "sub:Counters"
\end_inset
+
+\end_layout
+
+\begin_layout Standard
Since version 1.3.0 of LyX, it is both possible and necessary to define the
counters (
\begin_inset Flex CharStyle:MenuItem
\begin_layout Standard
to your layout file to get them to work.
- But if you want to define custom counters, then you can do so, using the
- following parameters:
+ But if you want to define custom counters, then you can do so.
+ The counter declaration must begin with:
+\end_layout
+
+\begin_layout LyX-Code
+Counter CounterName
+\end_layout
+
+\begin_layout Standard
+where of course `
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+CounterName
+\end_layout
+
+\end_inset
+
+' is replaced by the name of the counter.
+ And it must end with
+\begin_inset Quotes eld
+\end_inset
+
+
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+End
+\end_layout
+
+\end_inset
+
+
+\begin_inset Quotes erd
+\end_inset
+
+.
+ The following parameters can also be used:
\end_layout
\begin_layout Description
\emph off
\bar no
\noun off
- other than those descibed below will produce arabic numerals.
+ other than those described below will produce arabic numerals.
It would not be surprising to see this change in the future.
\end_layout
\end_inset
-.
-\end_layout
-
-\begin_layout Description
-\begin_inset Flex CharStyle:Code
-status collapsed
-
-\begin_layout Plain Layout
-Name
-\end_layout
-
-\end_inset
-
- [
-\begin_inset Flex CharStyle:Code
-status collapsed
-
-\begin_layout Plain Layout
-string
-\end_layout
-
-\end_inset
-
-=
-\begin_inset Quotes erd
-\end_inset
-
-
-\begin_inset Quotes erd
-\end_inset
-
-] The name of the counter.
+, but for use in the Appendix.
\end_layout
\begin_layout Description
\end_inset
] If this is set to the name of another counter, the present counter will
- be reset everytime the other one is increased.
+ be reset every time the other one is increased.
For example,
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Subsection
Font description
-\end_layout
-
-\begin_layout Standard
\begin_inset CommandInset label
LatexCommand label
-name "sec:fonts"
+name "sub:Font-description"
\end_inset
+
+\end_layout
+
+\begin_layout Standard
A font description looks like this:
\end_layout
\end_inset
-] Valid argument sare:
+] Valid arguments are:
\begin_inset Flex CharStyle:Code
status collapsed
.
Each of these turns on or off the corresponding attribute.
+ For example,
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+emph
+\end_layout
+
+\end_inset
+
+ turns on emphasis, and
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+no_emph
+\end_layout
+
+\end_inset
+
+ turns it off.
+
+\begin_inset Newline newline
+\end_inset
+
+If the latter seems puzzling, remember that the font settings for the present
+ context are generally inherited from the surrounding context.
+ So
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+no_emph
+\end_layout
+
+\end_inset
+
+ would turn off the emphasis that was anyway in effect, say, in a theorem
+ environment.
\end_layout
\begin_layout Description
Creating Templates
\begin_inset CommandInset label
LatexCommand label
-name "sec:templates"
+name "sec:Creating-Templates"
\end_inset
status collapsed
\begin_layout Plain Layout
-
-\bar under
-T
-\family sans
-\bar default
-ools
-\family default
-\SpecialChar \menuseparator
-
-\bar under
-P
-\bar default
-references\SpecialChar \menuseparator
+Tools\SpecialChar \menuseparator
+Preferences\SpecialChar \menuseparator
Paths
\end_layout
\end_inset
.
- This template is loaded everytime you create a new document with
-\begin_inset Flex CharStyle:MenuItem
-status collapsed
-
-\begin_layout Plain Layout
-
-\bar under
-F
-\bar default
-ile
-\end_layout
-
-\end_inset
-
-\SpecialChar \menuseparator
-
+ This template is loaded every time you create a new document with
\begin_inset Flex CharStyle:MenuItem
status collapsed
\begin_layout Plain Layout
-
-\bar under
-N
-\bar default
-ew
+File\SpecialChar \menuseparator
+New
\end_layout
\end_inset
status collapsed
\begin_layout Plain Layout
-Sa
-\bar under
-v
-\bar default
-e as Document Defaults
+Save as Document Defaults
\end_layout
\end_inset
Including External Material
\end_layout
+\begin_layout Standard
+\begin_inset Box Shadowbox
+position "t"
+hor_pos "c"
+has_inner_box 1
+inner_pos "t"
+use_parbox 0
+width "100col%"
+special "none"
+height "1in"
+height_special "totalheight"
+status open
+
+\begin_layout Plain Layout
+WARNING: This portion of the documentation has not been updated for some
+ time.
+ We certainly hope that it is still accurate, but there are no guarantees.
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
\begin_layout Standard
The use of material from sources external to LyX is covered in detail in
the
\end_inset
extension.
- Within XFig, you create and change your figure, and when you are done,
+ Within Xfig, you create and change your figure, and when you are done,
you save the
\begin_inset Flex CharStyle:Code
status collapsed
Furthermore, it provides us with the flexibility that is needed to support
multiple export formats.
For instance, in the case of a plain text file, it is not exactly an award-winn
-ing idea to include the figure as raw PostScript®.
+ing idea to include the figure as raw PostScript.
Instead, you'd either prefer to just include a reference to the figure
- or try to invoke some graphics to Ascii converter to make the final result
+ or try to invoke some graphics to ASCII converter to make the final result
look similar to the real graphics.
- The external material management allows you to do this, because it is parameter
-ized on the different export formats that LyX supports.
+ The external material management allows you to do this, because it is parametri
+zed on the different export formats that LyX supports.
\end_layout
\begin_layout Standard
Besides supporting the production of different products according to the
exported format, it supports tight integration with editing and viewing
applications.
- In the case of an XFig figure, you are able to invoke Xfig on the original
+ In the case of an Xfig figure, you are able to invoke Xfig on the original
file with a single click from within the external material dialog in LyX,
- and also preview the produced PostScript file with ghostview with another
+ and also preview the produced PostScript file with Ghostview with another
click.
No more fiddling around with the command line and/or file browsers to locate
and manipulate the original or produced files.
A glob pattern that is used in the file dialog to filter out the desired
files.
- If there is more than one possible file extension (e.g.
-\begin_inset space ~
+ If there is more than one possible file extension (e.
+\begin_inset space \thinspace{}
+\end_inset
+
+g.
+\begin_inset space \space{}
\end_inset
tgif has
This must be the name of a format that is known to LyX (see section
\begin_inset CommandInset ref
LatexCommand ref
-reference "sub:Formats"
+reference "sec:Formats"
\end_inset
\begin_layout Standard
All path macros contain a trailing directory separator, so you can construct
- e.g.
- the absolute filename with
+ e.
+\begin_inset space \thinspace{}
+\end_inset
+
+g.
+\begin_inset space \space{}
+\end_inset
+
+the absolute filename with
\begin_inset Flex CharStyle:Code
status collapsed
\end_layout
\begin_layout Standard
-There are special cases where this rule does not work and e.g.
-\begin_inset space ~
+There are special cases where this rule does not work and e.
+\begin_inset space \thinspace{}
+\end_inset
+
+g.
+\begin_inset space \space{}
\end_inset
relative names are needed, but normally it will work just fine.
\end_layout
\begin_layout Section
+Security discussion
\begin_inset CommandInset label
LatexCommand label
name "sec:Security-discussion"
\end_inset
-Security discussion
-\end_layout
-
-\begin_layout Standard
-\begin_inset Note Note
-status collapsed
-\begin_layout Plain Layout
-This section is outdated
\end_layout
-\end_inset
-
+\begin_layout Standard
The external material feature interfaces with a lot of external programs
and does so automatically, so we have to consider the security implications
of this.
and/or parameter strings and those are expanded into a command, it seems
that it would be possible to create a malicious document which executes
arbitrary commands when a user views or prints the document.
- This is something we definately want to avoid.
+ This is something we definitely want to avoid.
\end_layout
\begin_layout Standard
If you want to use some of the shell features, you should write a safe
script to do this in a controlled manner, and then invoke the script from
the command string.
- In the
-\begin_inset Flex CharStyle:Code
-status collapsed
-
-\begin_layout Plain Layout
-lib/scripts
-\end_layout
-
-\end_inset
-
- directory of the LyX installation, you can find a safe wrapper script
-\begin_inset Flex CharStyle:Code
-status collapsed
-
-\begin_layout Plain Layout
-general_command_wrapper.py
-\end_layout
-
-\end_inset
-
- that supports redirection of input and output.
- That can serve as an example for how to write safe template scripts.
- For a more advanced example that uses
-\begin_inset Flex CharStyle:Code
-status collapsed
-
-\begin_layout Plain Layout
-fork
-\end_layout
-
-\end_inset
-
- and friends, take a look at the
-\begin_inset Flex CharStyle:Code
-status collapsed
-
-\begin_layout Plain Layout
-pic2ascii.py
-\end_layout
-
-\end_inset
-
- converter script.
+
\end_layout
\begin_layout Standard
A subtle error in a single line in an innocent looking script can open
the door to huge security problems.
So if you do not fully understand the issues, we recommend that you consult
- a knowledgable security professional or the LyX development team if you
+ a knowledgeable security professional or the LyX development team if you
have any questions about whether a given template is safe or not.
And do this before you use it in an uncontrolled environment.
\end_layout
-\begin_layout Chapter
-The LyX Server
-\end_layout
-
-\begin_layout Section
-Introduction
-\end_layout
-
-\begin_layout Standard
-The LyX server is a method implemented in LyX that will enable other programs
- to talk to LyX, invoke LyX commands, and retrieve information about the
- LyX internal state.
- This is only intended for advanced users, but they should find it useful.
- Please note that, at present,
-\emph on
-the server does not work on Windows
-\emph default
-.
-\begin_inset Foot
-status collapsed
-
-\begin_layout Plain Layout
-There is no principled reason it cannot do so.
- But none of the developers on Windows® have yet implemented this functionality
- there.
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Section
-Starting the LyX Server
-\end_layout
-
-\begin_layout Standard
-The LyX server works through the use of a pair of named pipes.
- These are usually located in
-\begin_inset Flex CharStyle:Code
-status collapsed
-
-\begin_layout Plain Layout
-UserDir
-\end_layout
-
-\end_inset
-
- and have the names
-\begin_inset Quotes eld
-\end_inset
-
-
-\begin_inset Flex CharStyle:Code
-status collapsed
-
-\begin_layout Plain Layout
-.lyxpipe.in
-\end_layout
-
-\end_inset
-
-
-\begin_inset Quotes erd
-\end_inset
-
- and
-\begin_inset Quotes eld
-\end_inset
-
-
-\begin_inset Flex CharStyle:Code
-status collapsed
-
-\begin_layout Plain Layout
-.lyxpipe.out
-\end_layout
-
-\end_inset
-
-
-\begin_inset Quotes erd
-\end_inset
-
-.
- External programs write into
-\begin_inset Flex CharStyle:Code
-status collapsed
-
-\begin_layout Plain Layout
-.lyxpipe.in
-\end_layout
-
-\end_inset
-
- and read back data from
-\begin_inset Flex CharStyle:Code
-status collapsed
-
-\begin_layout Plain Layout
-.lyxpipe.out
-\end_layout
-
-\end_inset
-
-.
- The stem of the pipe names can be defined in the
-\begin_inset Flex CharStyle:MenuItem
-status collapsed
-
-\begin_layout Plain Layout
-
-\bar under
-T
-\bar default
-ools\SpecialChar \menuseparator
-
-\bar under
-P
-\bar default
-references
-\end_layout
-
-\end_inset
-
- dialog, for example
-\begin_inset Flex CharStyle:Code
-status collapsed
-
-\begin_layout Plain Layout
-"/home/myhome/.lyxpipe"
-\end_layout
-
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Standard
-LyX will add the '
-\begin_inset Flex CharStyle:Code
-status collapsed
-
-\begin_layout Plain Layout
-.in
-\end_layout
-
-\end_inset
-
-' and '
-\begin_inset Flex CharStyle:Code
-status collapsed
-
-\begin_layout Plain Layout
-.out
-\end_layout
-
-\end_inset
-
-' to create the pipes.
- The above setting also has the effect of activating the LyX server.
- If one of the pipes already exists, LyX will assume that another LyX process
- is already running and will not start the server.
- To have several LyX processes with servers at the same time, you have to
- change the configuration between the start of the programs.
-\end_layout
-
-\begin_layout Standard
-If you are developing a client program, you might find it useful to enable
- debugging information from the LyX server.
- Do this by starting LyX as lyx -dbg lyxserver.
-\end_layout
-
-\begin_layout Standard
-Warning: if LyX crashes, it may not manage to remove the pipes; in this
- case you must remove them manually.
- If LyX starts and the pipes exist already, it will not start any server.
-\end_layout
-
-\begin_layout Standard
-Other than this, there are a few points to consider:
-\end_layout
-
-\begin_layout Itemize
-Both server and clients must run on UNIX or OS/2 machines.
- Communications between LyX on UNIX and clients on OS/2 or vice versa is
- not possible right now.
-\end_layout
-
-\begin_layout Itemize
-On OS/2, only one client can connect to LyXServer at a time.
-\end_layout
-
-\begin_layout Itemize
-On OS/2, clients must open inpipe with
-\begin_inset Flex CharStyle:Code
-status collapsed
-
-\begin_layout Plain Layout
-O_WRONLY
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-mode.
-\end_layout
-
-\begin_layout Standard
-You can find a complete example client written in C in the source distribution
- as
-\begin_inset Flex CharStyle:Code
-status collapsed
-
-\begin_layout Plain Layout
-development/lyxserver/server_monitor.c
-\end_layout
-
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Section
-Normal communication
-\end_layout
-
-\begin_layout Standard
-To issue a LyX call, the client writes a line of ASCII text into the input
- pipe.
- This line has the following format:
-\end_layout
-
-\begin_layout Quote
-LYXCMD:
-\emph on
-clientname
-\emph default
-:
-\emph on
-function
-\emph default
-:
-\emph on
-argument
-\end_layout
-
-\begin_layout Description
-
-\emph on
-clientname
-\emph default
- is a name that the client can choose arbitrarily.
- Its only use is that LyX will echo it if it sends an answer---so a client
- can dispatch results from different requesters.
-\end_layout
-
-\begin_layout Description
-
-\emph on
-function
-\emph default
- is the function you want LyX to perform.
- It is the same as the commands you'd use in the minibuffer.
-\end_layout
-
-\begin_layout Description
-
-\emph on
-argument
-\emph default
- is an optional argument which is meaningful only to some functions (for
- instance
-\begin_inset Quotes eld
-\end_inset
-
-self-insert
-\begin_inset Quotes erd
-\end_inset
-
- which will insert the argument as text at the cursor position.)
-\end_layout
-
-\begin_layout Standard
-The answer from LyX will arrive in the output pipe and be of the form
-\end_layout
-
-\begin_layout Quote
-INFO:
-\emph on
-clientname
-\emph default
-:
-\emph on
-function
-\emph default
-:
-\emph on
-data
-\end_layout
-
-\begin_layout Standard
-where
-\emph on
-clientname
-\emph default
- and
-\emph on
-function
-\emph default
- are just echoed from the command request, while
-\emph on
-data
-\emph default
- is more or less useful information filled according to how the command
- execution worked out.
- Some commands will return information about the internal state of LyX,
- such as
-\begin_inset Quotes eld
-\end_inset
-
-font-state
-\begin_inset Quotes erd
-\end_inset
-
-, while other will return an empty data-response.
- This means that the command execution went fine.
-\end_layout
-
-\begin_layout Standard
-In case of errors, the response from LyX will have this form
-\end_layout
-
-\begin_layout Quote
-ERROR:
-\emph on
-clientname
-\emph default
-:
-\emph on
-function
-\emph default
-:
-\emph on
-error message
-\end_layout
-
-\begin_layout Standard
-where the
-\emph on
-error message
-\emph default
- should contain an explanation of why the command failed.
-\end_layout
-
-\begin_layout Standard
-Examples:
-\end_layout
-
-\begin_layout LyX-Code
-echo "LYXCMD:test:beginning-of-buffer:" >~/.lyxpipe.in
-\end_layout
-
-\begin_layout LyX-Code
-echo "LYXCMD:test:get-xy:" >~/.lyxpipe.in
-\begin_inset Newline newline
-\end_inset
-
-read a <~/.lyxpipe.out
-\begin_inset Newline newline
-\end_inset
-
-echo $a
-\end_layout
-
-\begin_layout Section
-Notification
-\end_layout
-
-\begin_layout Standard
-LyX can notify clients of events going on asynchronously.
- Currently it will only do this if the user binds a key sequence with the
- function
-\begin_inset Quotes eld
-\end_inset
-
-notify
-\begin_inset Quotes erd
-\end_inset
-
-.
- The format of the string LyX sends is as follows:
-\end_layout
-
-\begin_layout Quote
-\begin_inset Flex CharStyle:Code
-status collapsed
-
-\begin_layout Plain Layout
-NOTIFY:
-\end_layout
-
-\end_inset
-
-
-\emph on
-key-sequence
-\end_layout
-
-\begin_layout Standard
-where
-\emph on
-key-sequence
-\emph default
- is the printed representation of the key sequence that was actually typed
- by the user.
-\end_layout
-
-\begin_layout Standard
-This mechanism can be used to extend LyX's command set and implement macros:
- bind some key sequence to
-\begin_inset Quotes eld
-\end_inset
-
-notify
-\begin_inset Quotes erd
-\end_inset
-
-, start a client that listens on the out pipe, dispatches the command according
- to the sequence and starts a function that may use LyX calls and LyX requests
- to issue a command or a series of commands to LyX.
-\end_layout
-
-\begin_layout Section
-The simple LyX Server Protocol
-\end_layout
-
-\begin_layout Standard
-LyX implements a simple protocol that can be used for session management.
- All messages are of the form
-\end_layout
-
-\begin_layout Quote
-LYXSRV:
-\emph on
-clientname
-\emph default
-:
-\emph on
-protocol message
-\end_layout
-
-\begin_layout Standard
-where
-\emph on
-protocol message
-\emph default
- can be
-\begin_inset Quotes eld
-\end_inset
-
-hello
-\begin_inset Quotes erd
-\end_inset
-
- or
-\begin_inset Quotes eld
-\end_inset
-
-bye
-\begin_inset Quotes erd
-\end_inset
-
-.
- If
-\begin_inset Quotes eld
-\end_inset
-
-hello
-\begin_inset Quotes erd
-\end_inset
-
- is received from a client, LyX will report back to inform the client that
- it's listening to it's messages, while
-\begin_inset Quotes eld
-\end_inset
-
-bye
-\begin_inset Quotes erd
-\end_inset
-
- sent from LyX will inform clients that LyX is closing.
-\end_layout
-
\end_body
\end_document