On Fri, 21 May 2004, Gunnar G wrote:

> Hello.
> I'm using the answer.sty package to write exercise and answers and I would
> like to have some kind of short cut for this in LyX.
> 
> Right now I write:
> 
> \begin{ex}
> What is the problem with Foo?
> \begin{sol}
> Bar is the solution!
> \end{sol}
> \end{ex}
> 
> And then select the text and press CTRL+L (dang, I use these shortcuts so
> much that I forget which keys I press) to make it ERT.

You need to create your own layout (or modify an existing one). In this 
layout, you should then create a new "paragraph type". I did this once for 
the "Song"-layout (look in the wiki for Songbook-layout).

Here's what the entry looks like for a "Song":

# Song style definition
Style Song
  Margin                Dynamic
  LatexType             Environment
  LatexName             song
  NeedProtect           1
  NextNoIndent          1
  LabelSep              xxx
  ParSkip               0.4
  TopSep                1.3
  BottomSep             0.7
  ParSep                0.7
  Align                 Block
  AlignPossible         Block, Left
  LabelType             Counter_Section

  # standard font definition
  Font
    Family              Sans 
    Series              Bold
    Size                Large
  EndFont
End

The field 'LatexType' instructs LyX that this will use an environment with 
the name given by the field 'LatexName'. You could try changing 'song' 
into 'ex' and see what this will give you. Then try asking specific 
questions to the list when you run into problems.

You should probably read the tutorials by Steve Litt first though:
        http://wiki.lyx.org/pmwiki.php/LyX/Tutorials

/Christian

-- 
Christian Ridderstr�m                           http://www.md.kth.se/~chr


Reply via email to