On Tue, May 22, 2001 at 12:07:45AM +0200, Michael Lauer wrote:
> Dekel wrote:
>
> > 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
>
> That did it. Very good. Thanks!
>
> Can I generalize this method for Commands with several parameters ?
> How would I map such commands to Lyx layouts ?
>
> For instance an exercise sheet for students - in the .tex file there is
> \Title{Bla bla Lecture exercise 5}{8-12-2001}{8-19-2001}
>
> Is there a reasonable possibility to get one Lay layout out of that or
> do I need three with cascaded \newcommands ?
You need to use 3 new commands:
Style title
LatexType Command
LatexName settitle
Preamble
\newcommand{\settitle}[1]{\def\thetitle{#1}}
EndPreamble
End
Style date
LatexType Command
LatexName setdate
Preamble
\newcommand{\setdate}[1]{\def\thedate{#1}}
EndPreamble
End
Style duedate
LatexType Command
LatexName makeTitle
Preamble
\newcommand{\makeTitle}[1]{\Title{\thetitle}{\thedate}{#1}}
EndPreamble
End