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 ?)
27 # rev.4; J.-P. Chretien oct 2016
28 # update and review for inclusion in lyx-2.2.3
29 # - remove the workaround for page format (not needed after v2.351)
34 #(pre)declarations (just to impose some order on the menus)
86 # Input general definitions
91 %% to allow reorder commands and output them when needed only
92 \newif\ifneedsendletter % we started a letter
93 \newif\ifneedsendfax % we started a fax
94 \newif\ifmonaddressused % sender address specified
95 \newif\ifmonlieuused % city
96 \newif\ifmonlocationused % sender extra info (office, etc..)
97 \newif\ifmontelephoneused % sender phone # specified
98 \newif\ifmonfaxused % sender fax # specified
99 \newif\ifmonemailused % sender email address specified
100 \newif\iflyxsigp % first of up to 3 signatures
101 \newif\iflyxsigs % second signature
102 \newif\iflyxsigt % third one
103 \newif\ifpsneeded % post-scriptum
104 \newif\ifccneeded % carbon copy to somebody
105 \newif\ifencneeded % encluded items
107 %% Sometimes you don't want a closing ("formule de politesse"),
108 %% but the package still needs it. Use a void macro instead of a newif
109 \newcommand{\Lyclose}{}
112 %% here is the real stuff : ouput the commands in the "proper" order
113 \newcommand{\findemessage}
115 \ifneedsendletter %% did we start a letter ?
116 \iflyxsigp \signature{\Lysigp} \else \name{} \fi
117 \iflyxsigs \secondsignature{\Lysigs} \fi
118 \iflyxsigt \thirdsignature{\Lysigt} \fi
123 \ifpsneeded \ps{P.S. : }{\Lyps} \psneededfalse \fi
124 \ifccneeded \cc{\Lycc} \ccneededfalse \fi
125 \ifencneeded \encl{\Lyenc} \encneededfalse \fi
127 \needsendletterfalse %% done with letter
128 \fi % if needSendLetter
129 \ifneedsendfax \end{telefax} %% nothing provided yet for telefax !
134 % to get the specified pagesize
135 % (workaround for an a4paper/lettre problem in pdf mode)
136 % removed in oct 2016, no more needed since 2.351 and created an error with LuaTeX
137 %\@ifpackageloaded{ifpdf}{}{\usepackage{ifpdf}}
138 %\ifpdf\input pdftexconfig.tex\fi
142 # My Address style used to specify sender name and coordinates
145 Category "Postal Data"
155 \newcommand{\MyAddress}[1]{ % will save the info for future use
157 \providecommand{\lyaddress}{\address{#1}}
173 AlignPossible Block, Left
177 # label font definition
184 \newcommand{\Myplace}[1]{ % will save the info for future use
186 \providecommand{\lylieu}{\relax}
187 \renewcommand{\lylieu}{\lieu{#1}}
192 #suppress City indication
202 # label font definition
210 \newcommand{\MyNoPlace}{
212 \providecommand{\lylieu}{\relax}
213 \renewcommand{\lylieu}{\nolieu{}}
230 AlignPossible Block, Left
233 # label font definition
241 #suppress date indication
251 # label font definition
261 # location (i.e. office, department ...)
274 AlignPossible Block, Left
276 # label font definition
283 \newcommand{\MyLocation}[1]{ % will save the info for future use
285 \providecommand{\lylocation}{\relax}
286 \renewcommand{\lylocation}{\location{#1}}
296 LatexName MyTelephone
304 AlignPossible Block, Left
306 # label font definition
313 \newcommand{\MyTelephone}[1]{ % will save the info for future use
314 \montelephoneusedtrue
315 \providecommand{\lytelephone}{\relax}
316 \renewcommand{\lytelephone}{\telephone{#1}}
321 #suppress telephone indication
327 LatexName MyNoTelephone
331 # label font definition
338 \newcommand{\MyNoTelephone}{
339 \montelephoneusedtrue
340 \providecommand{\lytelephone}{\relax}
341 \renewcommand{\lytelephone}{\notelephone{}}
359 AlignPossible Block, Left
362 # label font definition
369 \newcommand{\MyFax}[1]{ % will save the info for future use
371 \providecommand{\lyfax}{\relax}
372 \renewcommand{\lyfax}{\fax{#1}}
377 #suppress fax indication
387 # label font definition
394 \newcommand{\MyNoFax}{
396 \providecommand{\lyfax}{\relax}
397 \renewcommand{\lyfax}{\nofax{}}
416 AlignPossible Block, Left
418 # label font definition
425 \newcommand{\MyEmail}[1]{ % will save the info for future use
427 \providecommand{\lyemail}{\relax}
428 \renewcommand{\lyemail}{\email{#1}}
445 AlignPossible Block, Left
447 # label font definition
463 # label font definition
479 # label font definition
487 Style Send_To_Address
488 CopyStyle Send_To_Address
489 Margin Right_Address_Box
493 \newcommand{\lettre}[1] { %% organized as expected by the package
494 \findemessage %% if we already started a letter or a fax
495 \begin{letter}{#1} %% now the new one
519 #As a temporary(?) trick the last(only?) letter of the file must be processed
520 # and to allow changing sender address, location,etc.. in between 2 letters
529 LatexName findemessage
531 LabelString EndOfMessage.
533 # label font definition
542 CopyStyle EndOfMessage
543 LabelString EndOfFile.
546 # Opening style definition (Accroche)
552 # label font definition
560 # Closing style definition (FormuleDePolitesse, Salutations)
569 \newcommand{\lyxclose}[1]{\renewcommand{\Lyclose}{#1}}
573 # Signature style definition
577 LabelString Signature:
580 # label font definition
587 %% automatic assignment of signatures
588 %% there is only 1 Signature style, but multiple latex commands
589 \newcommand{\lyxsig}[1]{
590 \iflyxsigs %% the second sig. exists, so this one is the third
591 \providecommand{\Lysigt}{\relax}
592 \renewcommand{\Lysigt}{#1}
594 \else %% if lyxsigs exist
595 \iflyxsigp %% the second one
596 \providecommand{\Lysigs}{\relax}
597 \renewcommand{\Lysigs}{#1}
599 \else %% the first one
600 \providecommand{\Lysigp}{\relax}
601 \renewcommand{\Lysigp}{#1}
603 \fi %% if lyxsidp exist
604 \fi %% if lyxsigs exist
610 # encl style definition (Ci-joint)
618 # label font definition
625 \newcommand{\lyxenc}[1]{
626 \providecommand{\Lyenc}{\relax}
627 \renewcommand{\Lyenc}{#1}
639 # label font definition
646 \newcommand{\lyxcc}[1]{
647 \providecommand{\Lycc}{\relax}
648 \renewcommand{\Lycc}{#1}
664 # label font definition
671 \newcommand{\lyxps}[1]{
672 \providecommand{\Lyps}{\relax}
673 \renewcommand{\Lyps}{#1}