Daniel Lohmann wrote:
Hi,

I got further ahead. I could solve 2) by using the ntheorem package instead of amsthm. 1) is partly solved: Adding a "OptionalArgs 1" line to my style definition enabled the "Insert->Short Title" command in LyX. However, the optional argument is not written out to LaTeX.
Yes, that's buggy.
Is there any way to pass an optional argument (in square brackets) from LyX to the \begin{xxx} of the internally used LaTeX environment?
Use ERT at the very beginning, and put the optarg in square brackets. I think that works. If not, then no idea. ;-)

rh

Thanks

Daniel

Daniel Lohmann schrieb:
Hi,

In my thesis I have to define a couple of terms and I thought about using the amsthm package which offers the \newtheorem and \newtheoremstyle commands to generate environments for theorem-like structures.

So I added to my layout file a new style $Definition to my layout file:

Counter
  Name defn
End
Style $Definition
  Margin          First_Dynamic
  LatexType       Environment
  LatexName       defn
  LabelSep        xx
  NextNoIndent          1
  ParIndent       MMM
  ParSkip         0.8
  ItemSep         0.2
  TopSep          0.5
  BottomSep       0.5
  ParSep          0.3
  Align           Block
  AlignPossible   block, left, center, right
  LabelType       Counter
  LabelCounter    defn
  LabelString     "Definition @[EMAIL PROTECTED]:"
  LeftMargin      MM
  RightMargin     MM
  LabelFont
    Family        Sans
    Shape         Up
    Series        Bold
    Size          Small
  EndFont
  Preamble
    \usepackage{amsthm}
\newtheoremstyle{mydefinition}{\topsep}{\topsep}{}{}{\sffamily\bfseries}{:}{1em}{}
    \theoremstyle{mydefinition}
    \newtheorem{defn}{Definition}[chapter]
  EndPreamble
End

All this works fine so far. However, so far I have not been able to solve two issues, a LyX-related (1.4.5) and a more LaTeX-related:

1) How can I pass the optional title parameter from LyX to the "defn" environment? The "Insert->Short Title" command I usually use for this purpose is always disabled (greyed) when I am editing a definition. Is there a specific flag I can give in the layout definition to enable it?

2) How can I indent the whole thing? The \newtheoremstyle command offers a parameter for first line indentation, but I would like to indent the whole thing by, lets say, 2em. Any idea how to achieve that with theorems?

Thanks a lot!

Daniel


--
==================================================================
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/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