On 08/06/2010 04:24 PM, Anders Host-Madsen wrote:
Sorry, I think I was not quite clear about what I would like to do.
I'm using the IEEETran class. I would like to define a new
type of theorem (a "property") that looks the same was as
theorems look in the IEEETran class.

Same solution, really. Theorems and all other such environments are defined in the layout file, in your case, IEEEtran.layout file. In fact, IEEEtran.layout just inputs the theorems.inc file, so it's using standard theorem definitions. The easiest way to create a new one is to write a module, basing your new style on one of the ones from theorems.inc.

The top of the module is always straightforward:

#\DeclareLyXModule{Extra Theorems}
#DescriptionBegin
#Defines some extra theorem environments.
#DescriptionEnd
#Requires: theorems
#Excludes: theorems-ams | theorems-starred

# Author: Anders Host-Madsen

# Current LyX 1.6.x format
Format 11

So the lemma definition looks like this:

Style Lemma
        CopyStyle             Theorem
        DependsOn             Theorem
        LatexName             lem
        LabelString           "Lemma \thetheorem."
        Preamble
                \theoremstyle{plain}
                \newtheorem{lem}[thm]{\protect\lemmaname}
        EndPreamble
        LangPreamble
                \providecommand{\lemmaname}{_(Lemma)}
        EndLangPreamble
        BabelPreamble
                \addto\captions$$lang{\renewcommand{\lemmaname}{_(Lemma)}}
        EndBabelPreamble
End

You can change that as you wish, e.g.:

Style Conjecture
    CopyStyle Theorem
    DependsOn Theorem
    LatexName conj
    # no separate counter for these, as is the style....
    LabelString "Conjecture \thetheorem"
    Preamble
        # the LaTeX definition
        \theoremstyle{plain}
        \newtheorem{conj}[thm]{Conjecture}
    EndPreamble
End

The more complex LangPreamble stuff is used for translations, but these only really make sense for LyX-provided modules, since the translations come from LyX itself.

FYI, the AMS classes use a theorem environment that makes some additional definitions potentially available through the Theorems (AMS-Extended) module. You might be able to adapt some of that, too.

rh

Reply via email to