Hello, I have used successfully for years the attached layout and template. Is it possible to add it to branch and trunk ?If yes, do I need to retranslate the styles in English to trigger cleanly the po files translations ?
Regards -- Jean-Pierre
#% 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 Denis Megevand
# (almost) nothing regarding fax, only letter
#---------------
# rev 1; A. Castera :
# A lot of LateX code added to avoid being bored by
# the imposed command order of the class letter (see comments
#---------------
#rev 2; A. Castera :
# further more LaTeX code to make tth happy
# with the class.(Following a request on
# such kind of thing from [email protected])
Format 4
#(pre)declarations (just to impose some order on the menus)
Style Standard
End
Style MonAdresse
End
Style Localisation
End
Style Telephone
End
Style NoTelephon
End
Style Fax
End
Style NoFax
End
Style Email
End
Style Lieu
End
Style NoLieu
End
Style Date
End
Style NoDate
End
Style Destinataire
End
Style Objet
End
Style VRef
End
Style NRef
End
Style Accroche
End
# Input general definitions
Input letter.layout
#and now some more ordering
Style FormuleDePolitesse
End
Style Signature
End
Style cc
End
Style Post_Scriptum
End
Style incl
End
# here we go !
Preamble
%% A lot of newif
%% to allow reorder commands and output them when needed only
\newif\ifneedsendletter % we started a letter
\newif\ifneedsendfax % we started a fax
\newif\ifmonaddressused % sender address specified
\newif\ifmonlieuused % city
\newif\ifmonlocationused % sender extra info (office, etc..)
\newif\ifmontelephoneused % sender phone # specified
\newif\ifmonfaxused % sender fax # specified
\newif\ifmonemailused % sender email address specified
\newif\iflyxsigp % first of up to 3 signatures
\newif\iflyxsigs % second signature
\newif\iflyxsigt % third one
\newif\ifpsneeded % post-scriptum
\newif\ifccneeded % carbon copy to somebody
\newif\ifencneeded % encluded items
%% To help tex->html
\newif\iftth
\newif\iftthdate
%% should be changed to something like
%% \begin{htmlonly} \end{htmlonly} to make it available to latex2html
%% I had a lot of troubles getting multiple signatures (each one being
%% eventually complex,i.e. multiline) properly aligned on html. So I
%% used boxes in a tabular as a workaround
\iftth
\newsavebox{\sigp} % to save the first signature
\newsavebox{\sigs} % the second
\newsavebox{\sigt} % the third
\newsavebox{\tthdate} % a bad trick to manage dates
\fi
%% Sometimes you don't want a closing ("formule de politesse"),
%% but the package still needs it. Use a void macro instead of a newif
\newcommand{\Lyclose}{}
%%
%% here is the real stuff : ouput the commands in the "proper" order
\newcommand{\findemessage}
{
\ifneedsendletter %% did we start a letter ?
\iftth
\closing{\Lyclose}
\fi % iftth
\iflyxsigp \signature{\Lysigp} \else \name{} \fi
\iflyxsigs \secondsignature{\Lysigs} \fi
\iflyxsigt \thirdsignature{\Lysigt} \fi
\iftth %% Ugly, I know
\iflyxsigp
\begin{tabular}{ p{5cm} p{5cm} p{5cm} p{5cm} }
\parbox{50mm}{{\hfill}} &
\parbox{50mm}{\sigp} &
\parbox{50mm}{\sigs} &
\parbox{50mm}{\sigt} \\
\end{tabular}
\bigskip{}
\fi % if lyxsigp
\fi %% iftth
\lyxsigpfalse
\lyxsigsfalse
\lyxsigtfalse
\iftth
\else %% (latex, not tth)
\closing{\Lyclose}
\fi % iftth
\ifpsneeded \ps{P.S. : }{\Lyps} \psneededfalse \fi
\ifccneeded \cc{\Lycc} \ccneededfalse \fi
\ifencneeded \encl{\Lyenc} \encneededfalse \fi
\end{letter}
\needsendletterfalse %% done with letter
\fi % if needSendLetter
\ifneedsendfax \end{telefax} %% nothing provided yet for telefax !
\needsendfaxfalse
\fi % if needSendFax
} %findemessage
EndPreamble
# My Address style used to specify sender name and coordinates
Style MonAdresse
Margin Static
LatexType Command
LatexName Monaddress
ParSkip 0.4
BottomSep 1.5
ParSep 1.5
Align Left
AlignPossible Left
Preamble
\newcommand{\Monaddress}[1]{ % will save the info for future use
\monaddressusedtrue
\providecommand{\lyaddress}{\relax}
\renewcommand{\lyaddress}{\address{#1}}
}
\iftth %% tex->html converters do not know this package
\newcommand{\address}[1]{\mbox{#1}\par}
\fi
EndPreamble
End
# City name style
Style Lieu
Margin Static
LatexType Command
LatexName Monlieu
LeftMargin Ville::xx
LabelSep xx
TopSep 0.4
BottomSep 0.4
ParSep 0.4
Align Block
AlignPossible Block, Left
LabelType Static
LabelString Ville:
# label font definition
LabelFont
Series Bold
Shape Italic
Color red
EndFont
Preamble
\newcommand{\Monlieu}[1]{ % will save the info for future use
\monlieuusedtrue
\providecommand{\lylieu}{\relax}
\renewcommand{\lylieu}{\lieu{#1}}
}
\iftth %% tex->html converters do not know this package
\newcommand{\lieu}[1]{
\iftthdate {\raggedleft #1,\tthdate}
\else {\raggedleft #1,\today}
\fi
}
\fi
EndPreamble
End
#suppress City indication
Style NoLieu
KeepEmpty 1
LatexType Command
LatexName Monnolieu
LabelType Static
LeftMargin NoLieuxx
LabelString NoLieu
# label font definition
LabelFont
Series Bold
Shape Italic
Color red
EndFont
Preamble
\newcommand{\Monnolieu}{
\monlieuusedtrue
\providecommand{\lylieu}{\relax}
\renewcommand{\lylieu}{\nolieu{}}
}
\iftth %% tex->html converters do not know this package
\newcommand{\nolieu}[1][nowhere]{
\iftthdate {\raggedleft \tthdate}
\else {\raggedleft \today}
\fi
}
\fi
EndPreamble
End
# date Style
Style Date
Margin Static
LatexType Command
LatexName date
LeftMargin Date::xx
LabelSep xx
TopSep 0.4
BottomSep 0.4
ParSep 0.4
Align Block
AlignPossible Block, Left
LabelType Static
LabelString Date:
# label font definition
LabelFont
Series Bold
Shape Italic
Color red
EndFont
Preamble
\iftth %% tex->html converters do not know this package
\renewcommand{\date}[1]{
\sbox{\tthdate}{#1}
\tthdatetrue
}
\fi
EndPreamble
End
#suppress date indication
Style NoDate
KeepEmpty 1
LatexType Command
LatexName nodate
LabelType Static
LeftMargin NoDatexx
LabelString NoDate
# label font definition
LabelFont
Series Bold
Shape Italic
Color red
EndFont
Preamble
\iftth %% tex->html converters do not know this package
\newcommand{\nodate}{
\sbox{\tthdate}{ }
\tthdatetrue
}
\fi
EndPreamble
End
# location (i.e. office, department ...)
Style Localisation
Margin Static
LatexType Command
LatexName Monlocation
LeftMargin Bureau::xx
LabelSep xx
TopSep 0.4
BottomSep 0.4
ParSep 0.4
Align Block
AlignPossible Block, Left
LabelType Static
LabelString Bureau:
# label font definition
LabelFont
Series Bold
Shape Italic
Color red
EndFont
Preamble
\newcommand{\Monlocation}[1]{ % will save the info for future use
\monlocationusedtrue
\providecommand{\lylocation}{\relax}
\renewcommand{\lylocation}{\location{#1}}
}
\iftth %% tex->html converters do not know this package
\newcommand{\location}[1]{ #1}
\fi
EndPreamble
End
# telephone Style
Style Telephone
Margin Static
LatexType Command
LatexName Montelephone
LeftMargin Tel::xx
LabelSep xx
TopSep 0.4
BottomSep 0.4
ParSep 0.4
Align Block
AlignPossible Block, Left
LabelType Static
LabelString Tel:
# label font definition
LabelFont
Series Bold
Shape Italic
Color red
EndFont
Preamble
\newcommand{\Montelephone}[1]{ % will save the info for future use
\montelephoneusedtrue
\providecommand{\lytelephone}{\relax}
\renewcommand{\lytelephone}{\telephone{#1}}
}
\iftth %% tex->html converters do not know this package
\newcommand{\telephone}[1]{Tel : #1\par}
\fi
EndPreamble
End
#suppress telephone indication
Style NoTelephon
KeepEmpty 1
LatexType Command
LatexName Monnotelephone
LabelType Static
LeftMargin NoTelxx
LabelString NoTel
# label font definition
LabelFont
Series Bold
Shape Italic
Color red
EndFont
Preamble
\newcommand{\Monnotelephone}{
\montelephoneusedtrue
\providecommand{\lytelephone}{\relax}
\renewcommand{\lytelephone}{\notelephone{}}
}
\iftth %% tex->html converters do not know this package
\newcommand{\notelephone}[1][tele]{}
\fi
EndPreamble
End
# telefax Style
Style Fax
Margin Static
LatexType Command
LatexName Monfax
LeftMargin Fax::xx
LabelSep xx
TopSep 0.4
BottomSep 0.4
ParSep 0.4
Align Block
AlignPossible Block, Left
LabelType Static
LabelString Fax:
# label font definition
LabelFont
Series Bold
Shape Italic
Color red
EndFont
Preamble
\newcommand{\Monfax}[1]{ % will save the info for future use
\monfaxusedtrue
\providecommand{\lyfax}{\relax}
\renewcommand{\lyfax}{\fax{#1}}
}
\iftth %% tex->html converters do not know this package
\newcommand{\fax}[1]{Fax : #1\par}
\fi
EndPreamble
End
#suppress fax indication
Style NoFax
KeepEmpty 1
LatexType Command
LatexName Monnofax
LabelType Static
LeftMargin NoFaxxx
LabelString NoFax
# label font definition
LabelFont
Series Bold
Shape Italic
Color red
EndFont
Preamble
\newcommand{\Monnofax}{
\monfaxusedtrue
\providecommand{\lyfax}{\relax}
\renewcommand{\lyfax}{\nofax{}}
}
\iftth %% tex->html converters do not know this package
\newcommand{\nofax}[1][fax]{}
\fi
EndPreamble
End
# Email Style
Style Email
Margin Static
LatexType Command
LatexName Monemail
LeftMargin Email::xx
LabelSep xx
TopSep 0.4
BottomSep 0.4
ParSep 0.4
Align Block
AlignPossible Block, Left
LabelType Static
LabelString Email:
# label font definition
LabelFont
Series Bold
Shape Italic
Color red
EndFont
Preamble
\newcommand{\Monemail}[1]{ % will save the info for future use
\monemailusedtrue
\providecommand{\lyemail}{\relax}
\renewcommand{\lyemail}{\email{#1}}
}
\iftth %% tex->html converters do not know this package
\newcommand{\email}[1]{email : #1\par}
\fi
EndPreamble
End
# Objet Style
Style Objet
CopyStyle Email
LatexType Command
LatexName conc
LeftMargin Objet::xx
LabelString Objet:
Preamble
\iftth %% tex->html converters do not know this package
\newcommand{\conc}[1]{
Objet : #1 \par
}
\fi
EndPreamble
End
# VRef Style
Style VRef
CopyStyle Email
LatexType Command
LatexName Vref
LeftMargin V/Ref::xx
LabelString V/Ref:
Preamble
\iftth %% tex->html converters do not know this package
\newcommand{\Vref}[1]{
V/Ref : #1 \par
}
\fi
EndPreamble
End
# NRef Style
Style NRef
CopyStyle Email
LatexType Command
LatexName Nref
LeftMargin N/Ref::xx
LabelString N/Ref:
Preamble
\iftth %% tex->html converters do not know this package
\newcommand{\Nref}[1]{
N/Ref : #1 \par
}
\fi
EndPreamble
End
Style Destinataire
Margin Right_Address_Box
LatexType Command
LatexName lettre
Preamble
\iftth %% tex->html converters do not know this package
\newcommand{\toaddress}[1]
{ \newsavebox{\dest}
\sbox{\dest}{\centering #1}
{\raggedleft{\dest}\par}
}
\newenvironment{letter}[1]{}{}
\fi %% if tth
\newcommand{\lettre}[1] { %% organized as expected by the package
\findemessage %% if we already started a letter or a fax
\begin{letter}{#1} %% now the new one
\ifmonaddressused
\lyaddress{}
\fi
\ifmonlocationused
\lylocation{}
\fi
\ifmonlieuused
\lylieu{}
\fi
\ifmontelephoneused
\lytelephone{}
\fi
\ifmonfaxused
\lyfax{}
\fi
\ifmonemailused
\lyemail{}
\fi
\needsendlettertrue
\iftth %% tth does not know letter, so let it output the address
\toaddress{#1}
\fi
}
EndPreamble
End
#As a temporary(?) trick the last(only?) letter of the file must be processed
# and to allow changing sender address, location,etc.. in between 2 letters
Style FinDeMessage
KeepEmpty 1
LatexType Command
LatexName findemessage
LabelType Static
LabelString Fin_du_message.
LeftMargin Fin_du_message.
# label font definition
LabelFont
Series Bold
Shape Italic
Color red
EndFont
End
Style FinDeFicher
CopyStyle FinDeMessage
End
# Opening style definition
Style Accroche
CopyStyle Opening
LeftMargin Accroche::xx
LabelString Accroche:
Preamble
\iftth %% tex->html converters do not know this package
\newcommand{\opening}[1]{{\qquad #1}}
\fi
EndPreamble
End
# Signature style definition
Style Signature
LeftMargin Signature::xx
LabelString Signature:
LatexType Command
LatexName lyxsig
# label font definition
LabelFont
Series Bold
Shape Italic
Color red
EndFont
Preamble
%% automatic assignment of signatures
%% there is only 1 Signature style, but multiple latex commands
\newcommand{\lyxsig}[1]{
\iflyxsigs %% the second sig. exists, so this one is the third
\providecommand{\Lysigt}{\relax}
\renewcommand{\Lysigt}{#1}
\lyxsigttrue
\else %% if lyxsigs exist
\iflyxsigp %% the second one
\providecommand{\Lysigs}{\relax}
\renewcommand{\Lysigs}{#1}
\lyxsigstrue
\else %% the first one
\providecommand{\Lysigp}{\relax}
\renewcommand{\Lysigp}{#1}
\lyxsigptrue
\fi %% if lyxsidp exist
\fi %% if lyxsigs exist
}
\iftth %% just save to dedicated box
\newcommand{\signature}[1]
{
\sbox{\sigp}{{#1}}
}
\newcommand{\secondsignature}[1]
{
\sbox{\sigs}{{#1}}
}
\newcommand{\thirdsignature}[1]
{
\sbox{\sigt}{{#1}}
}
\fi
EndPreamble
End
# Closing style definition
Style FormuleDePolitesse
CopyStyle Closing
LeftMargin Salutations::xx
LabelString Salutations:
LatexType Command
LatexName lyxclose
Preamble
\newcommand{\lyxclose}[1]{\renewcommand{\Lyclose}{#1}}
\iftth %% tex->html converters do not know this package
\newcommand{\closing}[1]{#1\par}
\fi
EndPreamble
End
# encl style definition
Style incl
CopyStyle encl
LeftMargin Ci-joint::xx
LabelString Ci-joint:
LatexName lyxenc
# label font definition
LabelFont
Series Bold
Shape Italic
Color red
EndFont
Preamble
\newcommand{\lyxenc}[1]{
\providecommand{\Lyenc}{\relax}
\renewcommand{\Lyenc}{#1}
\encneededtrue
}
\iftth %% tex->html converters do not know this package
\newcommand{\encl}[1]{p.j. : #1 \par}
\fi
EndPreamble
End
#Carbon Copy
Style cc
LatexType Command
LatexName lyxcc
# label font definition
LabelFont
Series Bold
Shape Italic
Color red
EndFont
Preamble
\newcommand{\lyxcc}[1]{
\providecommand{\Lycc}{\relax}
\renewcommand{\Lycc}{#1}
\ccneededtrue
}
\iftth %% tex->html converters do not know this package
\newcommand{\cc}[1]{cc : #1 \par}
\fi
EndPreamble
End
#Post Scriptum
Style Post_Scriptum
Margin Static
LatexType Command
LatexName lyxps
LabelSep xx
LabelType Static
LeftMargin P.S.::xx
LabelString P.S.:
# label font definition
LabelFont
Series Bold
Shape Italic
Color red
EndFont
Preamble
\newcommand{\lyxps}[1]{
\providecommand{\Lyps}{\relax}
\renewcommand{\Lyps}{#1}
\psneededtrue
}
\iftth %% tex->html converters do not know this package
\newcommand{\ps}[2]{#1 #2 \par}
\fi
EndPreamble
End
# now suppress unwanted styles
NoStyle My_Address
NoStyle Send_To_Address
NoStyle Opening
NoStyle Closing
NoStyle encl
NoStyle Location
#NoStyle Address
#NoStyle Right_Address
modelettre.lyx
Description: application/lyx
