1 #% Do not delete the line below; configure depends on this
2 # \DeclareLaTeXClass{French Letter (lettre)}
3 # \DeclareCategory{Letters}
4 # French Letter textclass definition file.
5 # Author : Alain Castera <castera@in2p3.fr>
6 # Modifies only some things from letter.layout
7 # to use the lettre.cls class from Denis Megevand
8 # (almost) nothing regarding fax, only letter
11 # A lot of LateX code added to avoid being bored by
12 # the imposed command order of the class letter (see comments)
15 # further more LaTeX code to make tth happy
16 # with the class.(Following a request on
17 # such kind of thing from lyx-users@lists.lyx.org)
19 # rev.3; J.-P. Chretien oct 2010
20 # general update and review for inclusion in lyx-1.6.8
22 # - english named styles (translated in fr.po)
23 # - margins set to dynamic to ensure alignment of line headings
25 # - ordering control left at the beginning (any other way ?)
30 #(pre)declarations (just to impose some order on the menus)
82 # Input general definitions
87 %% to allow reorder commands and output them when needed only
88 \newif\ifneedsendletter % we started a letter
89 \newif\ifneedsendfax % we started a fax
90 \newif\ifmonaddressused % sender address specified
91 \newif\ifmonlieuused % city
92 \newif\ifmonlocationused % sender extra info (office, etc..)
93 \newif\ifmontelephoneused % sender phone # specified
94 \newif\ifmonfaxused % sender fax # specified
95 \newif\ifmonemailused % sender email address specified
96 \newif\iflyxsigp % first of up to 3 signatures
97 \newif\iflyxsigs % second signature
98 \newif\iflyxsigt % third one
99 \newif\ifpsneeded % post-scriptum
100 \newif\ifccneeded % carbon copy to somebody
101 \newif\ifencneeded % encluded items
103 %% Sometimes you don't want a closing ("formule de politesse"),
104 %% but the package still needs it. Use a void macro instead of a newif
105 \newcommand{\Lyclose}{}
108 %% here is the real stuff : ouput the commands in the "proper" order
109 \newcommand{\findemessage}
111 \ifneedsendletter %% did we start a letter ?
112 \iflyxsigp \signature{\Lysigp} \else \name{} \fi
113 \iflyxsigs \secondsignature{\Lysigs} \fi
114 \iflyxsigt \thirdsignature{\Lysigt} \fi
119 \ifpsneeded \ps{P.S. : }{\Lyps} \psneededfalse \fi
120 \ifccneeded \cc{\Lycc} \ccneededfalse \fi
121 \ifencneeded \encl{\Lyenc} \encneededfalse \fi
123 \needsendletterfalse %% done with letter
124 \fi % if needSendLetter
125 \ifneedsendfax \end{telefax} %% nothing provided yet for telefax !
130 % to get the specified pagesize
131 % (workaround for an a4paper/lettre problem in pdf mode)
132 \@ifpackageloaded{ifpdf}{}{\usepackage{ifpdf}}
133 \ifpdf\input pdftexconfig.tex\fi
137 # My Address style used to specify sender name and coordinates
150 \newcommand{\MyAddress}[1]{ % will save the info for future use
152 \providecommand{\lyaddress}{\address{#1}}
168 AlignPossible Block, Left
172 # label font definition
179 \newcommand{\Myplace}[1]{ % will save the info for future use
181 \providecommand{\lylieu}{\relax}
182 \renewcommand{\lylieu}{\lieu{#1}}
187 #suppress City indication
197 # label font definition
205 \newcommand{\MyNoPlace}{
207 \providecommand{\lylieu}{\relax}
208 \renewcommand{\lylieu}{\nolieu{}}
225 AlignPossible Block, Left
228 # label font definition
236 #suppress date indication
246 # label font definition
256 # location (i.e. office, department ...)
269 AlignPossible Block, Left
271 # label font definition
278 \newcommand{\MyLocation}[1]{ % will save the info for future use
280 \providecommand{\lylocation}{\relax}
281 \renewcommand{\lylocation}{\location{#1}}
291 LatexName MyTelephone
299 AlignPossible Block, Left
301 # label font definition
308 \newcommand{\MyTelephone}[1]{ % will save the info for future use
309 \montelephoneusedtrue
310 \providecommand{\lytelephone}{\relax}
311 \renewcommand{\lytelephone}{\telephone{#1}}
316 #suppress telephone indication
322 LatexName MyNoTelephone
326 # label font definition
333 \newcommand{\MyNoTelephone}{
334 \montelephoneusedtrue
335 \providecommand{\lytelephone}{\relax}
336 \renewcommand{\lytelephone}{\notelephone{}}
354 AlignPossible Block, Left
357 # label font definition
364 \newcommand{\MyFax}[1]{ % will save the info for future use
366 \providecommand{\lyfax}{\relax}
367 \renewcommand{\lyfax}{\fax{#1}}
372 #suppress fax indication
382 # label font definition
389 \newcommand{\MyNoFax}{
391 \providecommand{\lyfax}{\relax}
392 \renewcommand{\lyfax}{\nofax{}}
411 AlignPossible Block, Left
413 # label font definition
420 \newcommand{\MyEmail}[1]{ % will save the info for future use
422 \providecommand{\lyemail}{\relax}
423 \renewcommand{\lyemail}{\email{#1}}
440 AlignPossible Block, Left
442 # label font definition
458 # label font definition
474 # label font definition
482 Style Send_To_Address
483 CopyStyle Send_To_Address
484 Margin Right_Address_Box
488 \newcommand{\lettre}[1] { %% organized as expected by the package
489 \findemessage %% if we already started a letter or a fax
490 \begin{letter}{#1} %% now the new one
514 #As a temporary(?) trick the last(only?) letter of the file must be processed
515 # and to allow changing sender address, location,etc.. in between 2 letters
524 LatexName findemessage
526 LabelString EndOfMessage.
528 # label font definition
537 CopyStyle EndOfMessage
538 LabelString EndOfFile.
541 # Opening style definition (Accroche)
547 # label font definition
555 # Closing style definition (FormuleDePolitesse, Salutations)
564 \newcommand{\lyxclose}[1]{\renewcommand{\Lyclose}{#1}}
568 # Signature style definition
572 LabelString Signature:
575 # label font definition
582 %% automatic assignment of signatures
583 %% there is only 1 Signature style, but multiple latex commands
584 \newcommand{\lyxsig}[1]{
585 \iflyxsigs %% the second sig. exists, so this one is the third
586 \providecommand{\Lysigt}{\relax}
587 \renewcommand{\Lysigt}{#1}
589 \else %% if lyxsigs exist
590 \iflyxsigp %% the second one
591 \providecommand{\Lysigs}{\relax}
592 \renewcommand{\Lysigs}{#1}
594 \else %% the first one
595 \providecommand{\Lysigp}{\relax}
596 \renewcommand{\Lysigp}{#1}
598 \fi %% if lyxsidp exist
599 \fi %% if lyxsigs exist
605 # encl style definition (Ci-joint)
613 # label font definition
620 \newcommand{\lyxenc}[1]{
621 \providecommand{\Lyenc}{\relax}
622 \renewcommand{\Lyenc}{#1}
634 # label font definition
641 \newcommand{\lyxcc}[1]{
642 \providecommand{\Lycc}{\relax}
643 \renewcommand{\Lycc}{#1}
659 # label font definition
666 \newcommand{\lyxps}[1]{
667 \providecommand{\Lyps}{\relax}
668 \renewcommand{\Lyps}{#1}