1 #% Do not delete the line below; configure depends on this
2 # \DeclareLaTeXClass{letter (lettre)}
3 # French Letter textclass definition file.
4 # Author : Alain Castera <castera@in2p3.fr>
5 # Modifies only some things from letter.layout
6 # to use the lettre.cls class from Denis Megevand
7 # (almost) nothing regarding fax, only letter
10 # A lot of LateX code added to avoid being bored by
11 # the imposed command order of the class letter (see comments)
14 # further more LaTeX code to make tth happy
15 # with the class.(Following a request on
16 # such kind of thing from lyx-users@lists.lyx.org)
18 # rev.3; J.-P. Chretien oct 2010
19 # general update and review for inclusion in lyx-1.6.8
21 # - english named styles (translated in fr.po)
22 # - margins set to dynamic to ensure alignment of line headings
24 # - ordering control left at the beginning (any other way ?)
29 #(pre)declarations (just to impose some order on the menus)
81 # Input general definitions
86 %% to allow reorder commands and output them when needed only
87 \newif\ifneedsendletter % we started a letter
88 \newif\ifneedsendfax % we started a fax
89 \newif\ifmonaddressused % sender address specified
90 \newif\ifmonlieuused % city
91 \newif\ifmonlocationused % sender extra info (office, etc..)
92 \newif\ifmontelephoneused % sender phone # specified
93 \newif\ifmonfaxused % sender fax # specified
94 \newif\ifmonemailused % sender email address specified
95 \newif\iflyxsigp % first of up to 3 signatures
96 \newif\iflyxsigs % second signature
97 \newif\iflyxsigt % third one
98 \newif\ifpsneeded % post-scriptum
99 \newif\ifccneeded % carbon copy to somebody
100 \newif\ifencneeded % encluded items
102 %% Sometimes you don't want a closing ("formule de politesse"),
103 %% but the package still needs it. Use a void macro instead of a newif
104 \newcommand{\Lyclose}{}
107 %% here is the real stuff : ouput the commands in the "proper" order
108 \newcommand{\findemessage}
110 \ifneedsendletter %% did we start a letter ?
111 \iflyxsigp \signature{\Lysigp} \else \name{} \fi
112 \iflyxsigs \secondsignature{\Lysigs} \fi
113 \iflyxsigt \thirdsignature{\Lysigt} \fi
118 \ifpsneeded \ps{P.S. : }{\Lyps} \psneededfalse \fi
119 \ifccneeded \cc{\Lycc} \ccneededfalse \fi
120 \ifencneeded \encl{\Lyenc} \encneededfalse \fi
122 \needsendletterfalse %% done with letter
123 \fi % if needSendLetter
124 \ifneedsendfax \end{telefax} %% nothing provided yet for telefax !
131 # My Address style used to specify sender name and coordinates
144 \newcommand{\MyAddress}[1]{ % will save the info for future use
146 \providecommand{\lyaddress}{\address{#1}}
162 AlignPossible Block, Left
166 # label font definition
173 \newcommand{\Myplace}[1]{ % will save the info for future use
175 \providecommand{\lylieu}{\relax}
176 \renewcommand{\lylieu}{\lieu{#1}}
181 #suppress City indication
191 # label font definition
199 \newcommand{\MyNoPlace}{
201 \providecommand{\lylieu}{\relax}
202 \renewcommand{\lylieu}{\nolieu{}}
219 AlignPossible Block, Left
222 # label font definition
230 #suppress date indication
240 # label font definition
250 # location (i.e. office, department ...)
263 AlignPossible Block, Left
265 # label font definition
272 \newcommand{\MyLocation}[1]{ % will save the info for future use
274 \providecommand{\lylocation}{\relax}
275 \renewcommand{\lylocation}{\location{#1}}
285 LatexName MyTelephone
293 AlignPossible Block, Left
295 # label font definition
302 \newcommand{\MyTelephone}[1]{ % will save the info for future use
303 \montelephoneusedtrue
304 \providecommand{\lytelephone}{\relax}
305 \renewcommand{\lytelephone}{\telephone{#1}}
310 #suppress telephone indication
316 LatexName MyNoTelephone
320 # label font definition
327 \newcommand{\MyNoTelephone}{
328 \montelephoneusedtrue
329 \providecommand{\lytelephone}{\relax}
330 \renewcommand{\lytelephone}{\notelephone{}}
348 AlignPossible Block, Left
351 # label font definition
358 \newcommand{\MyFax}[1]{ % will save the info for future use
360 \providecommand{\lyfax}{\relax}
361 \renewcommand{\lyfax}{\fax{#1}}
366 #suppress fax indication
376 # label font definition
383 \newcommand{\MyNoFax}{
385 \providecommand{\lyfax}{\relax}
386 \renewcommand{\lyfax}{\nofax{}}
405 AlignPossible Block, Left
407 # label font definition
414 \newcommand{\MyEmail}[1]{ % will save the info for future use
416 \providecommand{\lyemail}{\relax}
417 \renewcommand{\lyemail}{\email{#1}}
434 AlignPossible Block, Left
436 # label font definition
452 # label font definition
468 # label font definition
476 Style Send_To_Address
477 CopyStyle Send_To_Address
478 Margin Right_Address_Box
482 \newcommand{\lettre}[1] { %% organized as expected by the package
483 \findemessage %% if we already started a letter or a fax
484 \begin{letter}{#1} %% now the new one
508 #As a temporary(?) trick the last(only?) letter of the file must be processed
509 # and to allow changing sender address, location,etc.. in between 2 letters
518 LatexName findemessage
520 LabelString EndOfMessage.
522 # label font definition
531 CopyStyle EndOfMessage
532 LabelString EndOfFile.
535 # Opening style definition (Accroche)
541 # label font definition
549 # Closing style definition (FormuleDePolitesse, Salutations)
558 \newcommand{\lyxclose}[1]{\renewcommand{\Lyclose}{#1}}
562 # Signature style definition
566 LabelString Signature:
569 # label font definition
576 %% automatic assignment of signatures
577 %% there is only 1 Signature style, but multiple latex commands
578 \newcommand{\lyxsig}[1]{
579 \iflyxsigs %% the second sig. exists, so this one is the third
580 \providecommand{\Lysigt}{\relax}
581 \renewcommand{\Lysigt}{#1}
583 \else %% if lyxsigs exist
584 \iflyxsigp %% the second one
585 \providecommand{\Lysigs}{\relax}
586 \renewcommand{\Lysigs}{#1}
588 \else %% the first one
589 \providecommand{\Lysigp}{\relax}
590 \renewcommand{\Lysigp}{#1}
592 \fi %% if lyxsidp exist
593 \fi %% if lyxsigs exist
599 # encl style definition (Ci-joint)
607 # label font definition
614 \newcommand{\lyxenc}[1]{
615 \providecommand{\Lyenc}{\relax}
616 \renewcommand{\Lyenc}{#1}
628 # label font definition
635 \newcommand{\lyxcc}[1]{
636 \providecommand{\Lycc}{\relax}
637 \renewcommand{\Lycc}{#1}
653 # label font definition
660 \newcommand{\lyxps}[1]{
661 \providecommand{\Lyps}{\relax}
662 \renewcommand{\Lyps}{#1}