+\begin_layout Standard
+If you
+\family roman
+hit
+\family default
+
+\family roman
+\emph on
+char
+\family default
+\emph default
+
+\family roman
+and then another key not in
+\family default
+
+\family roman
+\emph on
+allowed
+\emph default
+, you will get a
+\family default
+
+\family roman
+\emph on
+char
+\family default
+\emph default
+
+\family roman
+followed by the other, not allowed key, as output.
+
+\family default
+ Note that a
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+
+\shape up
+Backspace
+\end_layout
+
+\end_inset
+
+ cancels a dead key, so if
+\family roman
+you hit
+\family default
+
+\family roman
+\emph on
+char
+\family default
+\emph default
+
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+
+\shape up
+\emph on
+Backspace
+\end_layout
+
+\end_inset
+
+, the cursor will not go one position backwards but will instead cancel
+ the effect t
+\family roman
+hat
+\family default
+
+\family roman
+\shape up
+\emph on
+char
+\family default
+\shape default
+\emph default
+
+\family roman
+\shape up
+might have had on the next keystroke.
+
+\end_layout
+
+\begin_layout Standard
+The following example specifies that the character ' is to be an acute accent,
+ allowed on the characters a, e, i, o, u, A, E, I, O, and U:
+\end_layout
+
+\begin_layout LyX-Code
+
+\backslash
+kmod ' acute aeiouAEIOU
+\end_layout
+
+\begin_layout Labeling
+\labelwidthstring 00.00.0000
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+ksmod
+\end_layout
+
+\end_inset
+
+ Specify an exception to the accent character
+\end_layout
+
+\begin_layout LyX-Code
+
+\backslash
+kxmod
+\family roman
+\emph on
+accent char result
+\end_layout
+
+\begin_layout Standard
+This defines an exce
+\family roman
+ption for
+\family default
+
+\family roman
+\emph on
+accent
+\family default
+\emph default
+
+\family roman
+on
+\family default
+
+\family roman
+\emph on
+char
+\emph default
+.
+ T
+\shape up
+he
+\family default
+\shape default
+
+\family roman
+\shape up
+\emph on
+accent
+\family default
+\shape default
+\emph default
+
+\family roman
+\shape up
+must
+\family default
+\shape default
+
+\shape up
+have been assigned a keystroke with a previous
+\shape default
+
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\shape up
+
+\backslash
+kmo
+\shape default
+d
+\end_layout
+
+\end_inset
+
+ declar
+\family roman
+ation and
+\family default
+
+\family roman
+\emph on
+char
+\family default
+\emph default
+
+\family roman
+must not belong in the
+\family default
+
+\family roman
+\emph on
+allowed
+\family default
+\emph default
+
+\family roman
+set of
+\family default
+
+\family roman
+\emph on
+accent
+\emph default
+.
+ When
+\family default
+
+\family roman
+\shape up
+you enter the
+\family default
+\shape default
+
+\family roman
+\shape up
+\emph on
+accent char
+\family default
+\shape default
+\emph default
+
+\family roman
+\shape up
+sequence,
+\family default
+\shape default
+
+\family roman
+\shape up
+\emph on
+result
+\emph default
+ is produced.
+ If such a declaration does not exist in
+\family default
+\shape default
+
+\shape up
+the
+\shape default
+
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\shape up
+.kmap
+\end_layout
+
+\end_inset
+
+ file and yo
+\family roman
+u enter
+\family default
+
+\family roman
+\emph on
+accent char
+\emph default
+, you get
+\family default
+
+\family roman
+\emph on
+accent_key char
+\emph default
+ where
+\family default
+
+\family roman
+\emph on
+accent_key
+\emph default
+ is the first arg
+\family default
+ument of the
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\shape up
+
+\backslash
+kmod
+\end_layout
+
+\end_inset
+
+ declaration.
+
+\end_layout
+
+\begin_layout Standard
+The following command produces causes äi to be produced when you enter acute-i
+ ('i):
+\end_layout
+
+\begin_layout LyX-Code
+
+\backslash
+kxmod acute i "
+\backslash
+
+\backslash
+'{
+\backslash
+
+\backslash
+i}"
+\end_layout
+
+\begin_layout Labeling
+\labelwidthstring 00.00.0000
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+kcomb
+\end_layout
+
+\end_inset
+
+ Combine two accent characters
+\end_layout
+
+\begin_layout LyX-Code
+
+\backslash
+kcomb
+\family roman
+\emph on
+accent1 accent2 allowed
+\end_layout
+
+\begin_layout Standard
+This one is getting pretty esoteric.
+ It allows you to combine the effect
+\family roman
+of
+\family default
+
+\family roman
+\emph on
+accent1
+\family default
+\emph default
+
+\family roman
+and
+\family default
+
+\family roman
+\emph on
+accent2
+\family default
+\emph default
+
+\family roman
+(in that order!) on
+\family default
+
+\family roman
+\emph on
+allowed
+\family default
+\emph default
+
+\family roman
+chars.
+ The keystrokes for
+\family default
+
+\family roman
+\emph on
+accent1
+\family default
+\emph default
+
+\family roman
+and
+\family default
+
+\family roman
+\emph on
+accent2
+\family default
+\emph default
+
+\family roman
+must have be
+\family default
+en set with a
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\shape up
+
+\backslash
+kmod
+\end_layout
+
+\end_inset
+
+ command at
+\family roman
+a
+\family default
+
+\family roman
+\emph on
+previous
+\family default
+\emph default
+
+\family roman
+point in the
+\family default
+ file.
+
+\end_layout
+
+\begin_layout Standard
+Consider this example from the
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\shape up
+greek.kmap
+\end_layout
+
+\end_inset
+
+ file:
+\end_layout
+
+\begin_layout LyX-Code
+
+\backslash
+kmod ; acute aeioyvhAEIOYVH
+\backslash
+kmod : umlaut iyIY
+\backslash
+kcomb acute umlaut iyIY
+\end_layout
+
+\begin_layout Standard
+This allows you to press
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+
+\shape up
+;:i
+\end_layout
+
+\end_inset
+
+ and get the effect of
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\shape up
+
+\backslash
+'{
+\backslash
+"{i}}
+\end_layout
+
+\end_inset
+
+.
+
+\family roman
+\shape up
+A backspace
+\family default
+\shape default
+ in this case cancels the last dead key, so if you press
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+
+\shape up
+;: Backspace i
+\end_layout
+
+\end_inset
+
+ you get
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\shape up
+
+\backslash
+'{i}
+\end_layout
+
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Subsection
+The .cdef File
+\end_layout
+
+\begin_layout Standard
+After the
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\shape up
+.kmap
+\end_layout
+
+\end_inset
+
+ mapping is performed, a
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\shape up
+.cde
+\shape default
+f
+\end_layout
+
+\end_inset
+
+ file maps the strings that the symbols generate to characters in the current
+ font.
+ The LyX distribution currently includes at least the
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\shape up
+iso8859-1.cdef
+\end_layout
+
+\end_inset
+
+ and
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\shape up
+iso8859-2.cdef
+\end_layout
+
+\end_inset
+
+ files.
+\end_layout
+
+\begin_layout Standard
+In general the
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\shape up
+.cdef
+\end_layout
+
+\end_inset
+
+ file is a sequence of declarations of the form
+\end_layout
+
+\begin_layout LyX-Code
+
+\family roman
+\emph on
+char_index_in_set
+\family default
+\emph default
+
+\family roman
+\emph on
+ string
+\end_layout
+
+\begin_layout Standard
+For example, in order to map
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+
+\shape up
+
+\backslash
+'{e}
+\end_layout
+
+\end_inset
+
+ to the corresponding character in the iso-8859-1 set (233), the following
+ declaration is used
+\end_layout
+
+\begin_layout LyX-Code
+233 "
+\backslash
+
+\backslash
+'{e}"
+\end_layout
+
+\begin_layout Standard
+with
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\backslash
+
+\end_layout
+
+\end_inset
+
+ and
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+"
+\end_layout
+
+\end_inset
+
+ being escap
+\family roman
+ed in
+\family default
+
+\family roman
+\emph on
+string
+\emph default
+.
+ Note that
+\family default
+ the same character can apply to more than one string.
+ In the
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+i
+\shape up
+so-8859-7.cdef
+\end_layout
+
+\end_inset
+
+ file you have
+\end_layout
+
+\begin_layout LyX-Code
+192 "
+\backslash
+
+\backslash
+'{
+\backslash
+
+\backslash
+
+\backslash
+"{i}}"
+\begin_inset Newline newline
+\end_inset
+
+192 "
+\backslash
+
+\backslash
+
+\backslash
+"{
+\backslash
+
+\backslash
+'{i}}"
+\end_layout
+
+\begin_layout Standard
+If LyX cannot find a mapping for the string produced by the keystroke or
+ a deadkey sequence, it will check if it looks like an accented char and
+ try to draw an accent over the character on screen.
+\end_layout
+
+\begin_layout Subsection
+Dead Keys
+\end_layout
+
+\begin_layout Standard
+There is a second way to add support for international characters through
+ so-called dead-keys.
+ A dead-key works in combination with a letter to produce an accented character.
+ Here, we'll explain how to create a really simple dead-key to illustrate
+ how they work.
+\end_layout
+
+\begin_layout Standard
+Suppose you happen to need the circumflex character,
+\begin_inset Quotes eld
+\end_inset
+
+ ̂
+\begin_inset Quotes erd
+\end_inset
+
+.
+ You could bind the
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+^
+\end_layout
+
+\end_inset
+
+-key [a.k.a.
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+Shift-6
+\end_layout
+
+\end_inset
+
+] to the LyX command
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+accent-circumflex
+\end_layout
+
+\end_inset
+
+ in your
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+lyxrc
+\end_layout
+
+\end_inset
+
+ file.
+ Now, whenever you type the
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+^
+\end_layout
+
+\end_inset
+
+-key followed by a letter, that letter will have a circumflex accent on
+ it.
+ For example, the sequence
+\begin_inset Quotes eld
+\end_inset
+
+
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+^e
+\end_layout
+
+\end_inset
+
+
+\begin_inset Quotes erd
+\end_inset
+
+ produces the letter:
+\begin_inset Quotes eld
+\end_inset
+
+ê
+\begin_inset Quotes erd
+\end_inset
+
+.
+ If you tried to type
+\begin_inset Quotes eld
+\end_inset
+
+
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+^t
+\end_layout
+
+\end_inset
+
+
+\begin_inset Quotes erd
+\end_inset
+
+, however, LyX will complain with a beep, since a
+\begin_inset Quotes eld
+\end_inset
+
+
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+t
+\end_layout
+
+\end_inset
+
+
+\begin_inset Quotes erd
+\end_inset
+
+ never takes a circumflex accent.
+ Hitting
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+Space
+\end_layout
+
+\end_inset
+
+ after a dead-key produces the bare-accent.
+ Please note this last point! If you bind a key to a dead-key, you'll need
+ to rebind the character on that key to yet another key.
+ Binding the
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+,-key
+\end_layout
+
+\end_inset
+
+ to a cedilla is a bad idea, since you'll only get cedillas instead of commas.
+\end_layout
+
+\begin_layout Standard
+One common way to bind dead-keys is to use
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+Meta-
+\end_layout
+
+\end_inset
+
+,
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+Ctrl-
+\end_layout
+
+\end_inset
+
+, and
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+Shift-
+\end_layout
+
+\end_inset
+
+ in combination with an accent, like
+\begin_inset Quotes eld
+\end_inset
+
+
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+~
+\end_layout
+
+\end_inset
+
+
+\begin_inset Quotes erd
+\end_inset
+
+ or
+\begin_inset Quotes eld
+\end_inset
+
+
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+,
+\end_layout
+
+\end_inset
+
+
+\begin_inset Quotes erd
+\end_inset
+
+ or
+\begin_inset Quotes eld
+\end_inset
+
+
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+^
+\end_layout
+
+\end_inset
+
+
+\begin_inset Quotes erd
+\end_inset
+
+.
+ Another way involves using
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+xmodmap
+\end_layout
+
+\end_inset
+
+ and
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+xkeycaps
+\end_layout
+
+\end_inset
+
+ to set up the special
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+Mode_Switch
+\end_layout
+
+\end_inset
+
+ key.
+ The
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+Mode_Switch
+\end_layout
+
+\end_inset
+
+ acts in some ways just like
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+Shift
+\end_layout
+
+\end_inset
+
+ and permits you to bind keys to accented characters.
+ You can also turn keys into dead-keys by binding them to something like
+
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+usldead_cedilla
+\end_layout
+
+\end_inset
+
+ and then binding this symbolic key to the corresponding LyX command.
+\begin_inset Foot
+status collapsed
+
+\begin_layout Plain Layout
+Note from
+\noun on
+John Weiss
+\noun default
+: This is exactly what I do in my
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+~/.lyx/lyxrc
+\end_layout
+
+\end_inset
+
+ and my
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+~/.xmodmap
+\end_layout
+
+\end_inset
+
+ files.
+ I have my
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+Scroll
+\begin_inset space ~
+\end_inset
+
+Lock
+\end_layout
+
+\end_inset
+
+ key set up as
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+Mode_Shift
+\end_layout
+
+\end_inset
+
+ and a bunch of these
+\begin_inset Quotes eld
+\end_inset
+
+
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+usldead_*
+\end_layout
+
+\end_inset
+
+
+\begin_inset Quotes erd
+\end_inset
+
+ symbolic keys bound such things as
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+Scroll
+\begin_inset space ~
+\end_inset
+
+Lock-^
+\end_layout
+
+\end_inset
+
+ and
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+Scroll
+\begin_inset space ~
+\end_inset
+
+Lock-~
+\end_layout
+
+\end_inset
+
+.
+ This is how I produce my accented characters.
+\end_layout
+
+\end_inset
+
+ You can make just about anything into the
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+Mode_Switch
+\end_layout
+
+\end_inset
+
+ key: One of the
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+Ctrl-
+\end_layout
+
+\end_inset
+
+ keys, a spare function key, etc.
+ As for the LyX commands that produce accents, check the entry for
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+accent-acute
+\end_layout
+
+\end_inset
+
+ in the
+\emph on
+Reference Manual
+\emph default
+.
+ You'll find the complete list there.
+\end_layout
+
+\begin_layout Subsection
+Saving your Language Configuration
+\end_layout
+
+\begin_layout Standard
+You can edit your preferences so that your desired language environment
+ is automatically configured when LyX starts up, via the
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+Edit\SpecialChar \menuseparator
+Preferences
+\end_layout
+
+\end_inset
+
+ dialog.
+\end_layout
+
+\begin_layout Chapter
+Installing New Document Classes, Layouts, and Templates
+\begin_inset CommandInset label
+LatexCommand label
+name "cha:Installing-New-Document"
+
+\end_inset
+
+
+\begin_inset OptArg
+status collapsed
+
+\begin_layout Plain Layout
+Installing New Document Classes
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+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.
+
+\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.
+ Similarly, LyX itself does not know much about DocBook or XHTML.
+\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, DocBook, or
+ XHTML 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
+
+ and in various other files it includes.
+ 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 is 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, DocBook, and XHTML
+ commands and tags.
+ 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 the only thing layout files
+ do, though.
+ 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, to use information about how it should display a
+ paragraph on the screen to output information (in the form of CSS) about
+ how the paragraph 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.
+ See
+\begin_inset CommandInset ref
+LatexCommand prettyref
+reference "sec:Tags-for-XHTML"
+
+\end_inset
+
+ for the details.
+\end_layout
+
+\begin_layout Section
+Installing new LaTeX files
+\end_layout
+
+\begin_layout Standard
+Some installations may not include a LaTeX package or class file that you
+ would like to use within LyX.
+ 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 installing such packages.
+ For example, with MiKTeX, you start the program
+\begin_inset Quotes eld
+\end_inset
+
+Browse Packages
+\begin_inset Quotes erd
+\end_inset
+
+ to get a list of available packages.
+ 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 such a `package manager', or
+ if the file is not available from your distribution, then you can follow
+ these steps to install it manually.
+\end_layout
+
+\begin_layout Enumerate
+Get the package from
+\begin_inset CommandInset href
+LatexCommand href
+name "CTAN"
+target "http://www.ctan.org/"
+
+\end_inset
+
+ or wherever.
+\end_layout
+
+\begin_layout Enumerate
+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 trees should be created, if they do not already exist, depends
+ upon the details of your system.
+ To find out where they are, look in the file
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+texmf.cnf
+\end_layout
+
+\end_inset
+
+.
+\begin_inset Foot
+status collapsed
+
+\begin_layout Plain Layout
+This usually lives in the directory
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+$TEXMF/web2c
+\end_layout
+
+\end_inset
+
+, though you can run
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+kpsewhich texmf.cnf
+\end_layout
+
+\end_inset
+
+ to locate it.
+\end_layout
+
+\end_inset
+
+ The location of the `local' TeX tree is defined by the
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+TEXMFLOCAL
+\end_layout
+
+\end_inset
+
+ variable; this is usually somewhere like
+\begin_inset Flex URL
+status collapsed
+
+\begin_layout Plain Layout
+
+/usr/local/share/texmf/
+\end_layout
+
+\end_inset
+
+.
+ The location of the `user' TeX tree is defined by
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+TEXMFHOME
+\end_layout
+
+\end_inset
+
+ and is commonly
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+$HOME/texmf/
+\end_layout
+
+\end_inset
+
+.
+ (If these variables are not predefined, you can define them.) You'll probably
+ need root permissions to create or modify the `local' tree, but your `user'
+ tree shouldn't have such limitations.
+\end_layout
+
+\begin_layout Enumerate
+Make sure
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+TEXMF
+\end_layout
+
+\end_inset
+
+ includes the
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+TEXMFLOCAL
+\end_layout
+
+\end_inset
+
+ and
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+TEXMFHOME
+\end_layout
+
+\end_inset
+
+ variables; e.
+\begin_inset space \thinspace{}
+\end_inset
+
+g.
+\begin_inset Newline newline
+\end_inset
+
+
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN}
+\end_layout
+
+\end_inset
+
+
+\begin_inset Newline newline
+\end_inset
+
+It probably does.
+\end_layout
+
+\begin_layout Enumerate
+Your local and user trees
+\emph on
+must
+\emph default
+ have the same sort of directory structure as your main existing
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+texmf
+\end_layout
+
+\end_inset
+
+ directory, which will be found at
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+TEXMFMAIN
+\end_layout
+
+\end_inset
+
+ (commonly,
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+/usr/share/texmf/
+\end_layout
+
+\end_inset
+
+.) For example, latex packages should go under
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+$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
+
+.
+ If you do not put them here, they probably will not work.
+\end_layout
+
+\begin_layout Enumerate
+Once your tree is properly set up, you can install the package into an appropria
+te location.
+ If you are lucky, your package will have been provided as a so-called `TDS'
+ (TeX Directory Structure) zip file.
+ To install it, you want to unzip it from the top of your tree.
+ So, for example, you can copy the file
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+newpkg.zip
+\end_layout
+
+\end_inset
+
+ to
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+/home/yourname/texmf/
+\end_layout
+
+\end_inset
+
+ and then, from inside that directory, just run:
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+unzip newpkg.zip
+\end_layout
+
+\end_inset
+
+.
+ This will extract the needed files and copy them where they need to be.
+\begin_inset Newline newline
+\end_inset
+
+If you do not have a TDS file, then you have to do this manually.
+ For example, you might install the FoilTeX files into
+\begin_inset Flex URL
+status collapsed
+
+\begin_layout Plain Layout
+
+$TEXMFLOCAL/tex/latex/contrib/foiltex
+\end_layout
+
+\end_inset
+
+.
+ Why there? The CTAN download directories are themselves organized much
+ like a TeX tree, and it isn't a bad idea to follow its structure when you
+ install your own files.
+ FoilTeX, as it happens, is found at
+\begin_inset Flex URL
+status collapsed
+
+\begin_layout Plain Layout
+
+http://ctan.org/texarchive/macros/latex/contrib/foiltex/
+\end_layout
+
+\end_inset
+
+.
+
+\end_layout
+
+\begin_layout Enumerate
+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
+$TEXMFLOCAL/tex/latex/
+\end_layout
+
+\end_inset
+
+.
+ Under TeXLive and the like, you should run
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+texhash
+\end_layout
+
+\end_inset
+
+ from a terminal, with root permissions if necessary.
+
+\end_layout
+
+\begin_layout Standard
+Your package is now installed and available to LaTeX.
+ You can verify this from a terminal by typing `
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+kpsewhich yourfile.ext
+\end_layout
+
+\end_inset
+
+'.
+ To make LyX aware of it, however, you will need to reconfigure (
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+Tools\SpecialChar \menuseparator
+Reconfigure
+\end_layout
+
+\end_inset
+
+) and then restart LyX.
+ If the new package was a document class, such as FoilTeX again, you will
+ now see it 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
+
+, in this case as
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+slides (FoilTeX)
+\end_layout
+
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Standard
+What if there isn't a layout file is available for your new document class?
+ Then, unfortunately, LyX will know nothing about it until you create a
+ layout file yourself (or get someone else to do it).
+ That is the topic of the next section.
+\end_layout
+
+\begin_layout Section
+Types of layout files
+\end_layout
+
+\begin_layout Standard
+This section describes the various sorts of LyX files that contain layout
+ information.
+ These files describe various paragraph and character styles, determining
+ how LyX should display them and how they should be translated into LaTeX,
+ DocBook, XHTML, 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 even
+ by just LaTeX 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 layouts distributed with LyX.
+ If you write a LyX layout for a LaTeX document class that might also be
+ used by others, or write a module that might be useful to others, then
+ you should consider posting your layout to the
+\begin_inset CommandInset href
+LatexCommand href
+name "layout section on the LyX wiki"
+target "http://wiki.lyx.org/Layouts/Layouts"
+
+\end_inset
+
+ 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 Subsection
+Layout modules
+\begin_inset CommandInset label
+LatexCommand label
+name "sub:Layout-modules"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+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 information 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
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+endnotes
+\end_layout