On Wed, 16 Feb 2000, Wolfgang Riedel wrote:

> Hi,
> 
> I tried to create my own lyx templates for special kind of letters. For
> the first example it works very well, I'd only to modify an existing
> letter template. But in the second case, I need a little bit another
> syntax for the created latex file.
> In detail: there is an local latex documentclass ubrief.cls. This works
> with following input:
>       ...
>       \begin{document}
>       \begin{brief}{adress}
>       ...
>       \end{brief}
>       \end{document}
> My question is now, how can I describe in the lyx template (and layout),
> that my latex environment "brief" needs an additional parameter?
> Has anybody an example for such a definition?
> 
> Thank you for any help!
> Wolfgang
> 

I had the same kind of problems while creating a layout for "lettre.cls"
class from ???? (sorry, don't know anymore).
I never sent this layout because I never got time enough to clean it (but
I use it, actually, it works). The principle are :
        - do not declare your environements as latex environments but as
new latex commands.
        - add a EndOfFile/EndOfBlock command to close the environment when
needed.

I use the same kind of trick to get rid of imposed order of
environment/commands you can find in classes like ... lettre.cls, etc.

Example ( simplified, out of context, from my lettre.layout file;
interpret with care!). Some comments added by hand just for this mail. The
actual commands are much more complicated because of closing, signature
and so on, I hope that I didn't forgot crucial details
 ----------------------
#% Do not delete the line below; configure depends on this
#  \DeclareLaTeXClass{lettre (Francais)}
# French Letter textclass definition file.
# Author : Alain Castera <[EMAIL PROTECTED]>
# Modifies only some things from letter.layout
# to use the lettre.cls class from ????

# Input general definitions
Input letter.layout

# (Re)define some stuff
Preamble
%% to indicate that we started a lettre environment
 \newif\ifneedsendletter
%% used to close "lettre" environment when needed
 \newcommand{\findemessage}
    {
      \ifneedsendletter
      \end{letter}
      \needsendletterfalse
      \fi
    }
EndPreamble

%% in lettre, the argument of environment lettre is the address
Style Destinataire
  Margin        Right_Address_Box
  LatexType     Command
  LatexName     lettre
  Preamble
  \newcommand{\lettre}[1]
    { \findemessage  %% you can have multiple "lettres" inthe same file
      \begin{letter}{#1}
      \needsendlettertrue
    }
  EndPreamble
End

#As a temporary(?) trick
Style FinDeFichier
  KeepEmpty     1
  LatexType     Command
  LatexName     findemessage
  LabelType     Static
  LabelString       Fin_du_fichier.
  LeftMargin        Fin_du_fichier.
  # label font definition
  LabelFont
    Series      Bold
    Shape       Italic
    Latex       Latex
  EndFont
End

---------------------------

Hope this helps
        Alain
 *******************************************************************
 *        Alain Castera                                            *
 * LPNHE - Tour 33 RdC           | e-mail : [EMAIL PROTECTED]*
 * 4 Place Jussieu               | Telephone :     (+33) 144274187 *
 * 75252 Paris Cedex 05          | Fax :           (+33) 144274638 *
 * France                        |                                 *
 *******************************************************************

Reply via email to