Atlas wrote:
Hello,
First, I really like LyX! (-: However, I am unable to get LyX to compile an
example TEX file supplied by a conference. Note: This file does compile from
the command-line, but I vastly prefer LyX. Help would be very, very much
appreciated! (-: Background: * CLS file ==> www.stacs-conf.org/for_authors/stacs.cls (note: stacs.cls is based on amsart.cls)
* I did get LyX [Windows XP] to recognize and use the stacs style (via
copy-paste+texhash+reconfiguring lyx).
* Conference-supplied TEX file (note: this file does not import correctly
nor compile in LyX 1.5.6 nor 1.6.0): http://www.stacs-conf.org/for_authors/stacs-smp.tex
   http://www.stacs-conf.org/for_authors/stacs-smp.pdf   (PDF of what the
output should look like) * In stacs-smp.tex, it states: %% due to the dependence on amsart.cls, \begin{document} has to occur %% BEFORE the title and author information: \begin{document} \title[Using stacs.cls]{How to use stacs.cls} \author[lab1]{A. Uthor}{Alice Uthor} %% the abstract has to PRECEDE the command \maketitle: %% be sure not to issue the \maketitle command twice! \begin{abstract} STUB. \end{abstract} \maketitle % Start paper here. \section*{Introduction} QUESTION ======== - Due to the dependencies, how would I get stacs-smp.tex to import and compile correctly in LyX?
You need a layout file for stacs.cls. See the Customization manual for the details. You can start by copying amsart.cls to stacs.cls and changing the first two lines to:
#% Do not delete the line below; configure depends on this
# \DeclareLaTeXClass{article (stacs)}
If there are special environments in stacs.cls that you want to use, for example, then you'll need to add them to the new layout file.

- The problem is that LyX hides most of the details in its preamble and also
apparently inserts a redefinition of the theorem environment.
LyX adds this:
\theoremstyle{plain}
\newtheorem{thm}{Theorem}
which is required by its theorem layout. It looks as if stacs.cls is already doing this, so LaTeX complains. (The basic amsart.cls does not do this.) So you need to stop LyX from issuing this code. Fortunately, all of this is user-controllable. In 1.6, the theorem layout is in theorems-ams.inc, which is included by the theorems-ams.module, which is included by default by amsart.layout. So you'd want to copy theorems-ams.inc to something like theorems-stacs.inc; make the necessary change there; copy theorems-ams.module to theorems-stacs.module; make the change there; and then change stacs.layout so it does this:
UseModule theorems-stacs.module
instead of using theorems-ams.module. (Note that this is a default include: the user can override it in Document>Settings.)

If there are theorem environments other than the ones theorems-ams.inc defines, then you will need to add those to theorems-stacs.inc, as well. Otherwise, LyX won't know about them.

The good thing is that you only have to do this once. Then you can post it on the wiki, or maybe your layout can even be included with LyX itself.

Richard

Reply via email to