On 17.04.05, Trinh Pham wrote:
> Does this mean I just need to write the Latex code directly
> into the Lyx preamble? 

Unfortunately, the class used cannot be defined in the preamble, as this is
the very first command of a latex document, preceding even the preamble.

> I'm not familiar with how Lyx actually recognizes class files, and it
> does not appear that placing the .cls file into the latex library is
> enough.

Even more unfortunately, there is no way to let LyX use a class that has not
a .layout file describing this class.

Fortunately, creating such a .layout file is easy. 

The detailled answer is in Help>Customization Chapter 5. The short answer is,
place a file "class-name.layout" in the layouts/ subdirectory of your
LyX-directory (~/.lyx/ on my Debian system) and let it contain the
three lines:

#% Do not delete the line below; configure depends on this
#  \DeclareLaTeXClass[class-name]{article (Class Name)}
Input article.layout

for a article like class, or

#% Do not delete the line below; configure depends on this
#  \DeclareLaTeXClass[class-name]{report (Class Name)}
Input report.layout

for a report like class, or

#% Do not delete the line below; configure depends on this
#  \DeclareLaTeXClass[class-name]{book (Class Name)}
Input book.layout

for a book like class.

Of course this works for all other defined classes too.


If you wish, you can improve the layout file by adding/modifying
definitions for commands and environments defined in your special class.
But you can also use ERT for these specials and live with a different
presentation on screen and paper (with the layout on paper always
determined by the .cls class file).


G�nter



-- 
G.Milde web.de

Reply via email to