Peter Ljunglöf wrote:
> I would really like to have some kind of general "environment"
> paragraph style, so I could insert uncommon environments in a
> pseudo-lyx style. E.g., if I have only one or two theorems in my
> article (and I don't want to use an existing style which includes
> theorems), I don't want to design a new layout file just for that.
This is a nice idea. I think it may be possible. What we can do is
define a very general environment that takes a single argument, which is
the name of the environment you actually want. So we'll have something like:
    \newenvironment{general}[1]{\begin{#1}}{\end{#1}}
Then create a layout that accepts one "optional" argument, which is in
fact required:
    Style General
       CopyStyle Standard
       LatexType Environment
       LatexName general
       OptionalArgs 1
       Preamble
              \newenvironment{general}[1][]{\begin{#1}}{\end{#1}}
       EndPreamble
    EndStyle
Note that I've made the argument optional, with no default, so we'll get
an error if there's no argument provided. You may want to put in a default.

If that doesn't work, one can just put the argument in ERT, in braces,
at the very beginning of the environment. That /does/ work, and is a
generally useful trick.
> A suggestion for the future would be to have layout files for latex
> packages too. Then I could write a layout file for the theorem
> package, and in the document settings just add the theorem
> layout/package, and the document class would be independent of that.
> (As it is now, if I want to be able to use package X in articles,
> reports, books and slides, I have to make layout files article_X,
> report_X, book_X and slide_X, which is cumbersome).
I filed an enhancement request about this a while ago. The developers
seemed enthusiastic, but I don't know its status. See bug 2657.

I do wish I knew C++.

Richard

-- 
==================================================================
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://bobjweil.com/heck/
==================================================================
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto

Reply via email to