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
130 % (workaround for an a4paper/lettre problem in pdf mode)
131 \@ifpackageloaded{ifpdf}{}{\usepackage{ifpdf}}
132 \ifpdf\input pdftexconfig.tex\fi
136 # My Address style used to specify sender name and coordinates
149 \newcommand{\MyAddress}[1]{ % will save the info for future use
151 \providecommand{\lyaddress}{\address{#1}}
167 AlignPossible Block, Left
171 # label font definition
178 \newcommand{\Myplace}[1]{ % will save the info for future use
180 \providecommand{\lylieu}{\relax}
181 \renewcommand{\lylieu}{\lieu{#1}}
186 #suppress City indication
196 # label font definition
204 \newcommand{\MyNoPlace}{
206 \providecommand{\lylieu}{\relax}
207 \renewcommand{\lylieu}{\nolieu{}}
224 AlignPossible Block, Left
227 # label font definition
235 #suppress date indication
245 # label font definition
255 # location (i.e. office, department ...)
268 AlignPossible Block, Left
270 # label font definition
277 \newcommand{\MyLocation}[1]{ % will save the info for future use
279 \providecommand{\lylocation}{\relax}
280 \renewcommand{\lylocation}{\location{#1}}
290 LatexName MyTelephone
298 AlignPossible Block, Left
300 # label font definition
307 \newcommand{\MyTelephone}[1]{ % will save the info for future use
308 \montelephoneusedtrue
309 \providecommand{\lytelephone}{\relax}
310 \renewcommand{\lytelephone}{\telephone{#1}}
315 #suppress telephone indication
321 LatexName MyNoTelephone
325 # label font definition
332 \newcommand{\MyNoTelephone}{
333 \montelephoneusedtrue
334 \providecommand{\lytelephone}{\relax}
335 \renewcommand{\lytelephone}{\notelephone{}}
353 AlignPossible Block, Left
356 # label font definition
363 \newcommand{\MyFax}[1]{ % will save the info for future use
365 \providecommand{\lyfax}{\relax}
366 \renewcommand{\lyfax}{\fax{#1}}
371 #suppress fax indication
381 # label font definition
388 \newcommand{\MyNoFax}{
390 \providecommand{\lyfax}{\relax}
391 \renewcommand{\lyfax}{\nofax{}}
410 AlignPossible Block, Left
412 # label font definition
419 \newcommand{\MyEmail}[1]{ % will save the info for future use
421 \providecommand{\lyemail}{\relax}
422 \renewcommand{\lyemail}{\email{#1}}
439 AlignPossible Block, Left
441 # label font definition
457 # label font definition
473 # label font definition
481 Style Send_To_Address
482 CopyStyle Send_To_Address
483 Margin Right_Address_Box
487 \newcommand{\lettre}[1] { %% organized as expected by the package
488 \findemessage %% if we already started a letter or a fax
489 \begin{letter}{#1} %% now the new one
513 #As a temporary(?) trick the last(only?) letter of the file must be processed
514 # and to allow changing sender address, location,etc.. in between 2 letters
523 LatexName findemessage
525 LabelString EndOfMessage.
527 # label font definition
536 CopyStyle EndOfMessage
537 LabelString EndOfFile.
540 # Opening style definition (Accroche)
546 # label font definition
554 # Closing style definition (FormuleDePolitesse, Salutations)
563 \newcommand{\lyxclose}[1]{\renewcommand{\Lyclose}{#1}}
567 # Signature style definition
571 LabelString Signature:
574 # label font definition
581 %% automatic assignment of signatures
582 %% there is only 1 Signature style, but multiple latex commands
583 \newcommand{\lyxsig}[1]{
584 \iflyxsigs %% the second sig. exists, so this one is the third
585 \providecommand{\Lysigt}{\relax}
586 \renewcommand{\Lysigt}{#1}
588 \else %% if lyxsigs exist
589 \iflyxsigp %% the second one
590 \providecommand{\Lysigs}{\relax}
591 \renewcommand{\Lysigs}{#1}
593 \else %% the first one
594 \providecommand{\Lysigp}{\relax}
595 \renewcommand{\Lysigp}{#1}
597 \fi %% if lyxsidp exist
598 \fi %% if lyxsigs exist
604 # encl style definition (Ci-joint)
612 # label font definition
619 \newcommand{\lyxenc}[1]{
620 \providecommand{\Lyenc}{\relax}
621 \renewcommand{\Lyenc}{#1}
633 # label font definition
640 \newcommand{\lyxcc}[1]{
641 \providecommand{\Lycc}{\relax}
642 \renewcommand{\Lycc}{#1}
658 # label font definition
665 \newcommand{\lyxps}[1]{
666 \providecommand{\Lyps}{\relax}
667 \renewcommand{\Lyps}{#1}