On Thu, May 17, 2001 at 05:05:33PM +0200, Michael Lauer wrote:
> I want to write a layout file for the standard letter format
> we use in our institution. I'm struggleing very early here...
> I find the chapter on LyX layouts very brief - there really
> should be something tutorial like. However, within the .cls
> file I have a \begin{letter}{Prof. Dr. Hagedorn} which forms
> the address and opens the letter environment. Somewhere later
> there is the obligate \end{letter}. How do I transform this
> construct into a LyX 'Style' ? My first attempt was
> 
> Style Adresse
>         LatexType       Environment
>         LatexName       letter
> End
> 
> which gives the corresponding \begin{letter}...\end{letter}
> in the resulting LaTeX file. But how do I specify the
> recipient in LyX ? Typing text within the address layout
> gives \begin{letter} text - which does not help.

LyX currently has no support for environments with arguments. So you need a
workaround:

Style Address
  LatexType       Command
  LatexName       Address
  Preamble 
\newcommand{\Address}[1]{\begin{letter}{#1}\AtEndDocument{\end{letter}}}
  EndPreamble
End

Reply via email to