-#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 348
\begin_document
\begin_header
\textclass scrbook
% 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
\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
\output_changes false
\author ""
\author ""
-\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
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
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.
+ a word of warning: Applying some of your changes (e.
+\begin_inset space \thinspace{}
+\end_inset
+
+g.
+\begin_inset space \space{}
+\end_inset
+
+screen fonts) will have an instant effect.
+ Others (e.
+\begin_inset space \thinspace{}
+\end_inset
+
+g.
+\begin_inset space \space{}
+\end_inset
+
+changing the bind file) will not.
If nothing appears to have changed, just
\begin_inset Flex CharStyle:MenuItem
status collapsed
\begin_layout Plain Layout
Tools\SpecialChar \menuseparator
-Preferences\SpecialChar \menuseparator
-File Handling\SpecialChar \menuseparator
-File Formats
+Preferences
\end_layout
\end_inset
dialog.
- Press the
+ Under
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+File Handling\SpecialChar \menuseparator
+File formats
+\end_layout
+
+\end_inset
+
+ press 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
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 that 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 the
+ dialog, select under
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+File Handling\SpecialChar \menuseparator
+File formats
+\end_layout
+
+\end_inset
+
+ 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 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)
+ The base filename of the input file (i.
+\begin_inset space \thinspace{}
+\end_inset
+
+g., without the extension)
\end_layout
\begin_layout Labeling
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 chain
+ of converters is called).
+\end_layout
+
\begin_layout Standard
In the
\begin_inset Flex CharStyle:MenuItem
\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®.
+ 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
\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
status collapsed
\begin_layout Plain Layout
-
-\bar under
-H
-\bar default
-elp\SpecialChar \menuseparator
+Help\SpecialChar \menuseparator
\bar under
I
status collapsed
\begin_layout Plain Layout
-UserDir/doc/
+UserDir/doc/xx/
\end_layout
\end_inset
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
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
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.
\end_inset
- variables; e.g.
+ variables; e.
+\begin_inset space \thinspace{}
+\end_inset
+
+g.
\begin_inset Newline newline
\end_inset
\end_inset
) and then restart LyX.
- You should then see your new package---for example
+ You should then see your new package—for example
\begin_inset Flex CharStyle:MenuItem
status collapsed
\end_inset
----under
+—under
\begin_inset Flex CharStyle:MenuItem
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
\end_layout
\begin_layout Subsection
+\begin_inset CommandInset label
+LatexCommand label
+name "sub:Layout-modules"
+
+\end_inset
+
Layout modules
\end_layout
\emph default
.
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
+ 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
+ In a sense, layout modules are similar to included 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
+—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.
\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
\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,
+on with an existing, supported document class—for 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
+, which is a standard class—start by copying the existing class's layout
file into your local directory:
\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
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
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
\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
\end_inset
.
- There is no default binding for this function---though, of course, you
- can bind it to a key yourself.
+ 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.
] 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 file format that is documented here is format 12.
\end_layout
\begin_layout Subsection
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
-DefaultStyle
+DefaultModule
\end_layout
\end_inset
status collapsed
\begin_layout Plain Layout
-string
+string]
+\end_layout
+
+\end_inset
+
+ Specifies a module to be included by default with this document class,
+ 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.
+ 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
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+DefaultStyle
+\end_layout
+
+\end_inset
+
+ [
+\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
+ExcludesModule
+\end_layout
+
+\end_inset
+
+ [
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+string
+\end_layout
+
+\end_inset
+
+] 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
+\begin_inset Flex CharStyle:Code
+status collapsed
+
\begin_layout Plain Layout
Float
\end_layout
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.
+ e.
+\begin_inset space \thinspace{}
+\end_inset
+
+g.
+\begin_inset space \space{}
+\end_inset
+
+a new character style.
See Section
\begin_inset space ~
\end_inset
A string indicating what sort of output documents using this class will
produce.
- At present, the options are: `docbook', `latex', `linuxdoc', and `literate'.
+ At present, the options are: `docbook', `latex', and `literate'.
\end_layout
\begin_layout Description
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
-Premable
+Preamble
\end_layout
\end_inset
,\SpecialChar \ldots{}
); the complete list of supported features is unfortunately not documented
- outside the LyX source code---but see
+ outside the LyX source code—but see
\begin_inset Flex CharStyle:Code
status collapsed
status collapsed
\begin_layout Plain Layout
+Help\SpecialChar \menuseparator
+LaTeX Configuration
+\end_layout
+
+\end_inset
+
+ also gives an overview of the supported packages.
+\end_layout
+
+\begin_layout Description
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+ProvidesModule
+\end_layout
-\bar under
-H
-\bar default
-elp\SpecialChar \menuseparator
+\end_inset
-\bar under
-L
-\bar default
-aTeX Configuration
+ [
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+string
\end_layout
\end_inset
- also gives an overview of the supported packages.
+] 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
+.module
+\end_layout
+
+\end_inset
+
+ 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
+DefaultModule
+\end_layout
+
+\end_inset
+
+ tag to indicate that it ought to be used.
+ It could be used in a module that provided an alternate implementation
+ of the same functionality.
\end_layout
\begin_layout Description
\end_inset
-] Whether the class requires the feature
+] Whether the class requires the feature
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
- string
+string
\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
\begin_layout Description
\begin_inset Flex CharStyle:Code
-status open
+status collapsed
\begin_layout Plain Layout
TocDepth
counter in LaTeX.
\end_layout
-\begin_layout Description
-\begin_inset Flex CharStyle:Code
-status collapsed
-
-\begin_layout Plain Layout
-UseModule
-\end_layout
-
-\end_inset
-
- [
-\begin_inset Flex CharStyle:Code
-status collapsed
-
-\begin_layout Plain Layout
-string]
-\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
\begin_inset Flex CharStyle:Code
status collapsed
\end_inset
Used to set the DTD line with XML-based output classes.
- E.g.: PUBLIC
+ E.
+\begin_inset space \thinspace{}
+\end_inset
+
+g.: PUBLIC
\begin_inset Quotes eld
\end_inset
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
status collapsed
\begin_layout Plain Layout
-InnerTag
+I18NPreamble
\end_layout
\end_inset
- [[FIXME]] (Used only with XML-type formats.)
-\end_layout
-
-\begin_layout Description
+ 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
-InTitle
+I18NPreamble
\end_layout
\end_inset
-
-\begin_inset Flex CharStyle:Code
-status collapsed
-
-\begin_layout Plain Layout
-[1, 0]
-\end_layout
-
+ declarations.
+ Must end with
+\begin_inset Quotes eld
\end_inset
- If 1, marks the layout as being part of a title block (see also the
+
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-TitleLatexType
+EndI18NPreamble
\end_layout
\end_inset
- and
-\begin_inset Flex CharStyle:Code
-status collapsed
-
-\begin_layout Plain Layout
-TitleLatexName
-\end_layout
+\begin_inset Quotes erd
\end_inset
- global entries).
+.
+ 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_layout Description
+\begin_deeper
+\begin_layout Itemize
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-ItemSep
+$$lang
\end_layout
\end_inset
- [
-\begin_inset Flex CharStyle:Code
-status collapsed
-
-\begin_layout Plain Layout
-float=0
+ is replaced by the language name (as used by the babel package).
\end_layout
+\begin_layout Itemize
+The
+\begin_inset Quotes eld
\end_inset
-] This provides extra space between paragraphs that have the same layout.
- If you put other layouts into an environment, each is separated with the
- environment's
+Function
+\begin_inset Quotes erd
+\end_inset
+
+
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-Parsep
+_()
\end_layout
\end_inset
-.
- But the whole items of the environment are additionally separated with
- this
+ replaces its argument by the translation of the argument to the current
+ language.
+\end_layout
+
+\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
-Itemsep
+I18NPreamble
\end_layout
\end_inset
-.
- Note that this is a
-\emph on
- multiplier.
-\end_layout
-
-\begin_layout Description
+ 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
-ItemTag
+theorems-ams.inc
\end_layout
\end_inset
- [[FIXME]] (Used only with XML-type formats.)
+ file) shows how this works:
+\end_layout
+
+\begin_layout LyX-Code
+Preamble
+\end_layout
+
+\begin_layout LyX-Code
+
+\backslash
+providecommand{
+\backslash
+claimname}{Claim}
+\end_layout
+
+\begin_layout LyX-Code
+
+\backslash
+theoremstyle{remark}
+\end_layout
+
+\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
+I18nPreamble
+\end_layout
+
+\begin_layout LyX-Code
+
+\backslash
+AtBeginDocument{
+\backslash
+ifx
+\backslash
+LdfInit
+\backslash
+undefined
+\backslash
+relax
+\backslash
+else%
+\end_layout
+
+\begin_layout LyX-Code
+
+\backslash
+addto
+\backslash
+captions$$lang{
+\backslash
+renewcommand{
+\backslash
+claimname}{_(Claim)}}%
+\end_layout
+
+\begin_layout LyX-Code
+
+\backslash
+fi}
+\end_layout
+
+\begin_layout LyX-Code
+EndI18nPreamble
+\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 standard 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
+I18NPreamble
+\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.
+ The
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\backslash
+ifx
+\backslash
+LdfInit
+\end_layout
+
+\end_inset
+
+ test ensures that no LaTeX error occurs in documents that do not use babel.
+ Since LyX loads babel after the style-specific preamble, the whole command
+ is deferred to the actual start of the document with
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\backslash
+AtBeginDocument
+\end_layout
+
+\end_inset
+
+.
+\end_layout
+
+\end_deeper
+\begin_layout Description
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+InnerTag
+\end_layout
+
+\end_inset
+
+ [[FIXME]] (Used only with XML-type formats.)
+\end_layout
+
+\begin_layout Description
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+InTitle
+\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 being part of a title block (see also the
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+TitleLatexType
+\end_layout
+
+\end_inset
+
+ and
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+TitleLatexName
+\end_layout
+
+\end_inset
+
+ global entries).
+\end_layout
+
+\begin_layout Description
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+ItemSep
+\end_layout
+
+\end_inset
+
+ [
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+float=0
+\end_layout
+
+\end_inset
+
+] This provides extra space between paragraphs that have the same layout.
+ If you put other layouts into an environment, each is separated with the
+ environment's
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+Parsep
+\end_layout
+
+\end_inset
+
+.
+ But the whole items of the environment are additionally separated with
+ this
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+Itemsep
+\end_layout
+
+\end_inset
+
+.
+ Note that this is a
+\emph on
+ multiplier.
+\end_layout
+
+\begin_layout Description
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+ItemTag
+\end_layout
+
+\end_inset
+
+ [[FIXME]] (Used only with XML-type formats.)
\end_layout
\begin_layout Description
\end_layout
\begin_layout Standard
-depending upon the LaTex type.
+depending upon the LaTeX type.
\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
\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
\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
+Flex insets and InsetLayout
\end_layout
\begin_layout Standard
\end_inset
-LyX has supported character styles since version 1.4.0; since version 1.6.0
+LyX has supported character styles since version 1.4.0; as of 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.
-
-\end_layout
-
\begin_layout Standard
Flex insets come in three different kinds:
\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
\end_layout
\begin_layout Standard
-The
+Flex insets are defined using the
\begin_inset Flex CharStyle:Code
status collapsed
\end_inset
- definition starting line is of the form
-\end_layout
-
-\begin_layout LyX-Code
-InsetLayout <Type> <Name>
+ tag, which shall be explained in a moment.
\end_layout
\begin_layout Standard
-where
+The
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-<Type>
+InsetLayout
\end_layout
\end_inset
- can be
+ 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
-Algorithm
+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
status collapsed
\begin_layout Plain Layout
-Branch
+InsetLayout
\end_layout
\end_inset
-,
+ definition must begin with a line of the form:
+\end_layout
+
+\begin_layout LyX-Code
+InsetLayout <Type>
+\end_layout
+
+\begin_layout Standard
+Here
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-Box
+<Type>
\end_layout
\end_inset
-,
+ 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
-ERT
+<Type>
\end_layout
\end_inset
-,
+ any one of the following:
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-Figure
+Algorithm
\end_layout
\end_inset
status collapsed
\begin_layout Plain Layout
-Foot
+Branch
\end_layout
\end_inset
status collapsed
\begin_layout Plain Layout
-Index
+Box
\end_layout
\end_inset
status collapsed
\begin_layout Plain Layout
-Listings
+Box:shaded
\end_layout
\end_inset
status collapsed
\begin_layout Plain Layout
-Marginal
+ERT
\end_layout
\end_inset
status collapsed
\begin_layout Plain Layout
-Note:Comment
+Figure
\end_layout
\end_inset
status collapsed
\begin_layout Plain Layout
-Note:Note
+Foot
\end_layout
\end_inset
status collapsed
\begin_layout Plain Layout
-Note:GreyedOut
+Index
\end_layout
\end_inset
status collapsed
\begin_layout Plain Layout
-OptArg
+Info
\end_layout
\end_inset
status collapsed
\begin_layout Plain Layout
-Table
+Info:menu
\end_layout
\end_inset
status collapsed
\begin_layout Plain Layout
-URL
+Info:shortcut
\end_layout
\end_inset
-, or
+,
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-Flex
+Info:shortcuts
\end_layout
\end_inset
-.
- If
+,
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-<Type>
+Listings
\end_layout
\end_inset
- is
+,
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-Flex
+Marginal
\end_layout
\end_inset
-, then
+,
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-<Name>
+Note:Comment
\end_layout
\end_inset
- should have the form
+,
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-SubType:StyleName
+Note:Note
\end_layout
\end_inset
-, where
+,
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-SubType
+Note:GreyedOut
\end_layout
\end_inset
- is either
+,
\begin_inset Flex CharStyle:Code
status collapsed
\begin_layout Plain Layout
-CharStyle
+OptArg
\end_layout
\end_inset
status collapsed
\begin_layout Plain Layout
-Custom
+Table
\end_layout
\end_inset
status collapsed
\begin_layout Plain Layout
-Element
+URL
\end_layout
\end_inset
-, and
+.
+
+\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
-StyleName
+<Type>
\end_layout
\end_inset
- is any valid identifier.
-
+ 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
+LyXType
+\end_layout
+
+\end_inset
+
+ entry.
\end_layout
\begin_layout Standard
-The following
+The
\begin_inset Flex CharStyle:Code
status collapsed
\end_inset
- section can contain the following entries:
+ definition can contain the following entries:
\end_layout
\begin_layout Description
\end_inset
The color for the inset's background.
- These valid colors are defined in
+ The valid colors are defined in
\begin_inset Flex CharStyle:Code
status collapsed
\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
\begin_layout Description
\begin_inset Flex CharStyle:Code
-status open
+status collapsed
\begin_layout Plain Layout
ForceLTR
\end_inset
- [[FIXME]]
+ 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
\begin_inset Flex CharStyle:Code
status collapsed
+\begin_layout Plain Layout
+InToc
+\end_layout
+
+\end_inset
+
+ [
+\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
+
+\end_inset
+
+] 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
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.
+ 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.
+ (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
\emph on
not
\emph default
- whether this command should itself be protected.)
+ whether the command should itself be protected.)
\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
] 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
\end_inset
-] Valid argument sare:
+] Valid argument are:
\begin_inset Flex CharStyle:Code
status collapsed
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
\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
\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.
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
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' allows 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.
- It is by writing to the LyX server, for example, that bibliography managers,
- such as JabRef, are able to
-\begin_inset Quotes eld
-\end_inset
-
-push
-\begin_inset Quotes erd
-\end_inset
-
- citations to LyX.
-\end_layout
-
-\begin_layout Standard
-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 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
-
-.
- You
-\emph on
-must
-\emph default
- configure this manually in order for the server to start.
-\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.
- If one of the pipes already exists, LyX will assume that another LyX process
- is already running and will not start the server.
- This means that if LyX crashes, or if for some other reason, a
-\begin_inset Quotes eld
-\end_inset
-
-stale
-\begin_inset Quotes erd
-\end_inset
-
- pipe is left in existence when LyX closes, then LyX will not start the
- server.
- (This is bug 641.) You will need to delete the pipes manually and then restart
- LyX.
-\end_layout
-
-\begin_layout Standard
-To have several LyX processes with servers at the same time, you have to
- use different configurations, perhaps by using separate user directories,
- each with its own
-\begin_inset Flex CharStyle:Code
-status collapsed
-
-\begin_layout Plain Layout
-preferences
-\end_layout
-
-\end_inset
-
- file, for each process.
-\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
-\begin_inset Flex CharStyle:Code
-status collapsed
-
-\begin_layout Plain Layout
-lyx -dbg lyxserver
-\end_layout
-
-\end_inset
-
-.
-\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 the input pipe with
-\begin_inset Flex CharStyle:Code
-status collapsed
-
-\begin_layout Plain Layout
-O_WRONLY
-\end_layout
-
-\end_inset
-
- 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
-clientname 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
-function 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
-argument is an optional argument which is meaningful only to some functions
- (for instance, the
-\begin_inset Quotes eld
-\end_inset
-
-self-insert
-\begin_inset Quotes erd
-\end_inset
-
- LFUN 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, such as
-\begin_inset Quotes eld
-\end_inset
-
-font-state
-\begin_inset Quotes erd
-\end_inset
-
-, will return information about the internal state of LyX, 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
-
-.
- Then start a client that listens on the output 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