+ 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
+
+\end_inset
+
+ module—specifcally provide support for one 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
+
+\begin_layout Plain Layout
+stdsections.inc
+\end_layout
+
+\end_inset
+
+—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
+
+ requires editing that file.
+ Modules, by contrast, are selected in the
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+Document\SpecialChar \menuseparator
+Settings
+\end_layout
+
+\end_inset
+
+ dialog.
+\end_layout
+
+\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 style or flex
+ inset.
+ But modules may, in principle, contain anything a layout file can contain.
+\end_layout
+
+\begin_layout Standard
+After creating a new module and copying it to the
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+layout/
+\end_layout
+
+\end_inset
+
+ folder, you will need to reconfigure and then restart LyX for the module
+ to appear in the menu.
+ However, changes you make to the module will be seen immediately, if you
+ open
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+Document\SpecialChar \menuseparator
+Settings
+\end_layout
+
+\end_inset
+
+, highlight something, and then hit
+\begin_inset Quotes eld
+\end_inset
+
+OK
+\begin_inset Quotes erd
+\end_inset
+
+.
+
+\emph on
+It is strongly recommended that you save your work before doing this
+\emph default
+.
+ In fact,
+\emph on
+it is strongly recommended that you not attempt to edit modules while simultaneo
+usly working on actual documents
+\emph default
+.
+ Though of course the developers strive to keep LyX stable in such situations,
+ syntax errors and the like in your module file could cause strange behavior.
+\end_layout
+
+\begin_layout Subsection
+Layout for
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+.sty
+\end_layout
+
+\end_inset
+
+ files
+\end_layout
+
+\begin_layout Standard
+There are two situations you are likely to encounter when wanting to support
+ a new LaTeX document class, involving LaTeX2e class (
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+.cls
+\end_layout
+
+\end_inset
+
+) and style (
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+.sty
+\end_layout
+
+\end_inset
+
+) files.
+ Supporting a style file is usually fairly easy.
+ Supporting a new class file is a bit harder.
+ We'll discuss the former in this section and the latter in the next.
+ Similar remarks apply, of course, if you want to support a new DocBook
+ DTD.
+\end_layout
+
+\begin_layout Standard
+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.
+ For the sake of the example, we'll assume that the style file is called
+
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+myclass.sty
+\end_layout
+
+\end_inset
+
+ and that it is meant to be used with
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+report.cls
+\end_layout
+
+\end_inset
+
+, which is a standard class.
+
+\end_layout
+
+\begin_layout Standard
+Start by copying the existing class's layout file into your local directory:
+\begin_inset Foot
+status collapsed
+
+\begin_layout Plain Layout
+Of course, which directory is your local directory will vary by platform,
+ and LyX allows you to specify your local directory on startup, too, using
+ the
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+-userdir
+\end_layout
+
+\end_inset
+
+ option.
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout LyX-Code
+cp report.layout ~/.lyx/layouts/myclass.layout
+\end_layout
+
+\begin_layout Standard
+Then edit
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+myclass.layout
+\end_layout
+
+\end_inset
+
+ and change the line:
+\end_layout
+
+\begin_layout LyX-Code
+
+\backslash
+DeclareLaTeXClass{report}
+\end_layout
+
+\begin_layout Standard
+to read
+\end_layout
+
+\begin_layout LyX-Code
+
+\backslash
+DeclareLaTeXClass[report, myclass.sty]{report (myclass)}
+\end_layout
+
+\begin_layout Standard
+Then add:
+\end_layout
+
+\begin_layout LyX-Code
+Preamble
+\begin_inset Newline newline
+\end_inset
+
+
+\backslash
+usepackage{myclass}
+\begin_inset Newline newline
+\end_inset
+
+EndPreamble
+\end_layout
+
+\begin_layout Standard
+near the top of the file.
+\end_layout
+
+\begin_layout Standard
+Start LyX and select
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+Tools\SpecialChar \menuseparator
+Reconfigure
+\end_layout
+
+\end_inset
+
+.
+ Then restart LyX and try creating a new document.
+ You should see "
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+report (myclass)
+\end_layout
+
+\end_inset
+
+" as a document class option in the
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+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—
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+report
+\end_layout
+
+\end_inset
+
+ in this example—so you can fiddle around with the settings for the different
+ sections if you wish.
+ The layout information for sections is contained in
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+stdsections.inc
+\end_layout
+
+\end_inset
+
+, but you do not need to copy and change this file.
+ Instead, you can simply add your changes to your layout file, after the
+ line
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+Input stdclass.inc
+\end_layout
+
+\end_inset
+
+, which itself includes
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+stdsections.inc
+\end_layout
+
+\end_inset
+
+.
+ For example, you might add these lines:
+\end_layout
+
+\begin_layout LyX-Code
+Style Chapter
+\end_layout
+
+\begin_layout LyX-Code
+ Font
+\end_layout
+
+\begin_layout LyX-Code
+ Family Sans
+\end_layout
+
+\begin_layout LyX-Code
+ EndFont
+\end_layout
+
+\begin_layout LyX-Code
+End
+\end_layout
+
+\begin_layout Standard
+to change the font for chapter headings to sans-serif.
+ This will override (or, in this case, add to) the existing declaration
+ for the Chapter style.
+
+\end_layout
+
+\begin_layout Standard
+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
+
+ for information on how to do so.
+\end_layout
+
+\begin_layout Standard
+If
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+myclass.sty
+\end_layout
+
+\end_inset
+
+ can be used with several different document classes, and even if it cannot,
+ you might find it easiest just to write a module that you can load with
+ the base class.
+ The simplest possible such module would be:
+\end_layout
+
+\begin_layout LyX-Code
+#
+\backslash
+DeclareLyXModule{My Package}
+\end_layout
+
+\begin_layout LyX-Code
+#DescriptionBegin
+\end_layout
+
+\begin_layout LyX-Code
+#Support for mypkg.sty.
+\end_layout
+
+\begin_layout LyX-Code
+#DescriptionEnd
+\begin_inset Newline newline
+\end_inset
+
+
+\end_layout
+
+\begin_layout LyX-Code
+Format 20
+\begin_inset Newline newline
+\end_inset
+
+
+\end_layout
+
+\begin_layout LyX-Code
+Preamble
+\begin_inset Newline newline
+\end_inset
+
+
+\backslash
+usepackage{mypkg}
+\begin_inset Newline newline
+\end_inset
+
+EndPreamble
+\end_layout
+
+\begin_layout Standard
+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
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+.cls
+\end_layout
+
+\end_inset
+
+ files
+\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
+
+roll your own
+\begin_inset Quotes erd
+\end_inset
+
+ layout.
+ We strongly suggest copying an existing layout file which uses a similar
+ LaTeX class and then modifying it, if you can do so.
+ At least use an existing file as a starting point so you can find out what
+ items you need to worry about.
+ Again, the specifics are covered below.
+\end_layout
+
+\begin_layout Subsection
+Creating templates
+\begin_inset CommandInset label
+LatexCommand label
+name "sub:Creating-Templates"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Once you have written a layout file for a new document class, you might
+ want to consider writing a
+\emph on
+template
+\emph default
+ for it, too.
+ A template acts as a kind of tutorial for your layout, showing how it might
+ be used, though containing dummy content.
+ You can of course look at the various templates included with LyX for ideas.
+\end_layout
+
+\begin_layout Standard
+Templates are created just like usual documents: using LyX.
+ The only difference is that usual documents contain all possible settings,
+ including the font scheme and the paper size.
+ Usually a user doesn't want a template to overwrite his preferred settings
+ for such parameters.
+ For that reason, the designer of a template should remove the corresponding
+ commands like
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\backslash
+font_roman
+\end_layout
+
+\end_inset
+
+ or
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\backslash
+papersize
+\end_layout
+
+\end_inset
+
+ from the template LyX file.
+ This can be done with any simple text-editor, for example
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+vi
+\end_layout
+
+\end_inset
+
+ or
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+notepad
+\end_layout
+
+\end_inset
+
+.
+
+\end_layout
+
+\begin_layout Standard
+Put the edited template files you create in
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+UserDir/templates/
+\end_layout
+
+\end_inset
+
+, copy the ones you use from the global template directory in
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+LyXDir/templates/
+\end_layout
+
+\end_inset
+
+ to the same place, and redefine the template path in the
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+Tools\SpecialChar \menuseparator
+Preferences\SpecialChar \menuseparator
+Paths
+\end_layout
+
+\end_inset
+
+ dialog.
+\end_layout
+
+\begin_layout Standard
+Note, by the way, that there is a template which has a particular meaning:
+
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+defaults.lyx
+\end_layout
+
+\end_inset
+
+.
+ This template is loaded every time you create a new document with
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+File\SpecialChar \menuseparator
+New
+\end_layout
+
+\end_inset
+
+ in order to provide useful defaults.
+ To create this template from inside LyX, all you have to do is to open
+ a document with the correct settings, and use the
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+Save as Document Defaults
+\end_layout
+
+\end_inset
+
+ button.
+\end_layout
+
+\begin_layout Subsection
+Upgrading old layout files
+\end_layout
+
+\begin_layout Standard
+The format of layout files changes with each LyX release, so old layout
+ files need to be converted to the new format.
+ This process has been automated since LyX 1.4: If LyX reads a layout file
+ in an older format, it automatically calls the script
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+layout2layout.py
+\end_layout
+
+\end_inset
+
+ to convert it to a temporary file in current format.
+ The original file is left untouched.
+ If you use the layout file often, then, you may want to convert it permanently,
+ so that LyX does not have to do so itself every time.
+ To do this, you can call the converter manually:
+\end_layout
+
+\begin_layout LyX-Code
+mv myclass.layout myclass.old
+\end_layout
+
+\begin_layout LyX-Code
+python LyXDir/scripts/layout2layout.py myclass.old myclass.layout
+\end_layout
+
+\begin_layout Standard
+You need to replace
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+LyXDir
+\end_layout
+
+\end_inset
+
+ with the name of your LyX system directory, of course.
+\end_layout
+
+\begin_layout Standard
+Note that manual conversion does not affect included files, so these will
+ have to be converted separately.
+\end_layout
+
+\begin_layout Section
+\begin_inset CommandInset label
+LatexCommand label
+name "sec:TextClass"
+
+\end_inset
+
+The layout file format
+\end_layout
+
+\begin_layout Standard
+When it's finally time to get your hands dirty and create or edit your own
+ layout file, the following sections describe what you're up against.
+ Our advice is to go slowly, save and test often, listen to soothing music,
+ 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 too much in one sitting.
+ Go have another adult beverage, just for good measure.
+\end_layout
+
+\begin_layout Standard
+Note that all the tags used in layout files are case-insensitive.
+ This means that
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+Style
+\end_layout
+
+\end_inset
+
+,
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+style
+\end_layout
+
+\end_inset
+
+ and
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+StYlE
+\end_layout
+
+\end_inset
+
+ are really the same tag.
+ The possible values are printed in brackets after the feature's name.
+ The default value if a feature isn't specified inside a text class-description
+ is typeset
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\emph on
+emphasized
+\end_layout
+
+\end_inset
+
+.
+ If the argument has a data type like
+\begin_inset Quotes eld
+\end_inset
+
+string
+\begin_inset Quotes erd
+\end_inset
+
+ or
+\begin_inset Quotes eld
+\end_inset
+
+float
+\begin_inset Quotes erd
+\end_inset
+
+, the default is shown like this:
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+float=
+\emph on
+default
+\end_layout
+
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Subsection
+The Document Class Declaration
+\end_layout
+
+\begin_layout Standard
+Lines in a layout file which begin with
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+#
+\end_layout
+
+\end_inset
+
+ are comments.
+ 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
+
+\size small
+#% Do not delete the line below; configure depends on this
+\end_layout
+
+\begin_layout LyX-Code
+
+\size small
+#
+\backslash
+DeclareLaTeXClass{article}
+\end_layout
+
+\begin_layout Standard
+The second line is used when you (re)configure LyX.
+ The layout file is read by the LaTeX script
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+chkconfig.ltx
+\end_layout
+
+\end_inset
+
+, in a special mode where
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+#
+\end_layout
+
+\end_inset
+
+ is ignored.
+ The first line is just a LaTeX comment, and the second one contains the
+ declaration of the text class.
+ If these lines appear in a file named
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+article.layout
+\end_layout
+
+\end_inset
+
+, then they define a text class of name
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+article
+\end_layout
+
+\end_inset
+
+ (the name of the layout file) which uses the LaTeX document class
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+article.cls
+\end_layout
+
+\end_inset
+
+ (the default is to use the same name as the layout).
+ The string
+\begin_inset Quotes eld
+\end_inset
+
+article
+\begin_inset Quotes erd
+\end_inset
+
+ that appears above is used as a description of the text class in the
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+Document\SpecialChar \menuseparator
+Settings
+\end_layout
+
+\end_inset
+
+ dialog.
+\end_layout
+
+\begin_layout Standard
+Let's assume that you wrote your own text class that uses the
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+article.cls
+\end_layout
+
+\end_inset
+
+ document class, but where you changed the appearance of the section headings.
+ If you put it in a file
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+myarticle.layout
+\end_layout
+
+\end_inset
+
+, the header of this file should be:
+\end_layout
+
+\begin_layout LyX-Code
+
+\size small
+#% Do not delete the line below; configure depends on this
+\end_layout
+
+\begin_layout LyX-Code
+
+\size small
+#
+\backslash
+DeclareLaTeXClass[article]{article (with my own headings)}
+\end_layout
+
+\begin_layout Standard
+This declares a text class
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+myarticle
+\end_layout
+
+\end_inset
+
+, associated with the LaTeX document class
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+article.cls
+\end_layout
+
+\end_inset
+
+ and described as
+\begin_inset Quotes eld
+\end_inset
+
+article (with my own headings)
+\begin_inset Quotes erd
+\end_inset
+
+.
+ If your text class depends on several packages, you can declare it as:
+\end_layout
+
+\begin_layout LyX-Code
+
+\size small
+#% Do not delete the line below; configure depends on this
+\end_layout
+
+\begin_layout LyX-Code
+
+\size small
+#
+\backslash
+DeclareLaTeXClass[article,foo.sty]{article (with my own headings)}
+\end_layout
+
+\begin_layout Standard
+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:
+\end_layout
+
+\begin_layout LyX-Code
+
+\size small
+#% Do not delete the line below; configure depends on this
+\end_layout
+
+\begin_layout LyX-Code
+
+\size small
+#
+\backslash
+DeclareDocBookClass[article]{SGML (DocBook article)}
+\end_layout
+
+\begin_layout Standard
+Note that these declarations can also be given an optional parameter declaring
+ the name of the document class (but not a list).
+\end_layout
+
+\begin_layout Standard
+So, to be as explicit as possible, the form of the layout declaration is:
+\end_layout
+
+\begin_layout LyX-Code
+
+\size small
+#
+\backslash
+DeclareLaTeXClass[class,package.sty]{layout description}
+\end_layout
+
+\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 class file
+ is not specified, then LyX will simply assume that it is the same as the
+ name of the layout file.
+\end_layout
+
+\begin_layout Standard
+When the text class has been modified to your taste, all you have to do
+ is to copy it either to
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+LyXDir/layouts/
+\end_layout
+
+\end_inset
+
+ or to
+\begin_inset Flex CharStyle:Code
+status collapsed
+
+\begin_layout Plain Layout
+UserDir/layouts
+\end_layout
+
+\end_inset
+
+, run
+\begin_inset Flex CharStyle:MenuItem
+status collapsed
+
+\begin_layout Plain Layout
+Tools\SpecialChar \menuseparator
+Reconfigure
+\end_layout
+
+\end_inset
+
+, exit LyX and restart.
+ Then your new text class should be available along with the others.
+\end_layout
+
+\begin_layout Standard
+Once the layout file is installed, you can edit it and see your changes
+ without having to reconfigure or to restart LyX.