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 !
129 % to get the specified pagesize (workaround for a lettre problem)
130 \input pdftexconfig.tex
134 # My Address style used to specify sender name and coordinates
147 \newcommand{\MyAddress}[1]{ % will save the info for future use
149 \providecommand{\lyaddress}{\address{#1}}
165 AlignPossible Block, Left
169 # label font definition
176 \newcommand{\Myplace}[1]{ % will save the info for future use
178 \providecommand{\lylieu}{\relax}
179 \renewcommand{\lylieu}{\lieu{#1}}
184 #suppress City indication
194 # label font definition
202 \newcommand{\MyNoPlace}{
204 \providecommand{\lylieu}{\relax}
205 \renewcommand{\lylieu}{\nolieu{}}
222 AlignPossible Block, Left
225 # label font definition
233 #suppress date indication
243 # label font definition
253 # location (i.e. office, department ...)
266 AlignPossible Block, Left
268 # label font definition
275 \newcommand{\MyLocation}[1]{ % will save the info for future use
277 \providecommand{\lylocation}{\relax}
278 \renewcommand{\lylocation}{\location{#1}}
288 LatexName MyTelephone
296 AlignPossible Block, Left
298 # label font definition
305 \newcommand{\MyTelephone}[1]{ % will save the info for future use
306 \montelephoneusedtrue
307 \providecommand{\lytelephone}{\relax}
308 \renewcommand{\lytelephone}{\telephone{#1}}
313 #suppress telephone indication
319 LatexName MyNoTelephone
323 # label font definition
330 \newcommand{\MyNoTelephone}{
331 \montelephoneusedtrue
332 \providecommand{\lytelephone}{\relax}
333 \renewcommand{\lytelephone}{\notelephone{}}
351 AlignPossible Block, Left
354 # label font definition
361 \newcommand{\MyFax}[1]{ % will save the info for future use
363 \providecommand{\lyfax}{\relax}
364 \renewcommand{\lyfax}{\fax{#1}}
369 #suppress fax indication
379 # label font definition
386 \newcommand{\MyNoFax}{
388 \providecommand{\lyfax}{\relax}
389 \renewcommand{\lyfax}{\nofax{}}
408 AlignPossible Block, Left
410 # label font definition
417 \newcommand{\MyEmail}[1]{ % will save the info for future use
419 \providecommand{\lyemail}{\relax}
420 \renewcommand{\lyemail}{\email{#1}}
437 AlignPossible Block, Left
439 # label font definition
455 # label font definition
471 # label font definition
479 Style Send_To_Address
480 CopyStyle Send_To_Address
481 Margin Right_Address_Box
485 \newcommand{\lettre}[1] { %% organized as expected by the package
486 \findemessage %% if we already started a letter or a fax
487 \begin{letter}{#1} %% now the new one
511 #As a temporary(?) trick the last(only?) letter of the file must be processed
512 # and to allow changing sender address, location,etc.. in between 2 letters
521 LatexName findemessage
523 LabelString EndOfMessage.
525 # label font definition
534 CopyStyle EndOfMessage
535 LabelString EndOfFile.
538 # Opening style definition (Accroche)
544 # label font definition
552 # Closing style definition (FormuleDePolitesse, Salutations)
561 \newcommand{\lyxclose}[1]{\renewcommand{\Lyclose}{#1}}
565 # Signature style definition
569 LabelString Signature:
572 # label font definition
579 %% automatic assignment of signatures
580 %% there is only 1 Signature style, but multiple latex commands
581 \newcommand{\lyxsig}[1]{
582 \iflyxsigs %% the second sig. exists, so this one is the third
583 \providecommand{\Lysigt}{\relax}
584 \renewcommand{\Lysigt}{#1}
586 \else %% if lyxsigs exist
587 \iflyxsigp %% the second one
588 \providecommand{\Lysigs}{\relax}
589 \renewcommand{\Lysigs}{#1}
591 \else %% the first one
592 \providecommand{\Lysigp}{\relax}
593 \renewcommand{\Lysigp}{#1}
595 \fi %% if lyxsidp exist
596 \fi %% if lyxsigs exist
602 # encl style definition (Ci-joint)
610 # label font definition
617 \newcommand{\lyxenc}[1]{
618 \providecommand{\Lyenc}{\relax}
619 \renewcommand{\Lyenc}{#1}
631 # label font definition
638 \newcommand{\lyxcc}[1]{
639 \providecommand{\Lycc}{\relax}
640 \renewcommand{\Lycc}{#1}
656 # label font definition
663 \newcommand{\lyxps}[1]{
664 \providecommand{\Lyps}{\relax}
665 \renewcommand{\Lyps}{#1}