]> git.lyx.org Git - features.git/blob - lib/layouts/lettre.layout
Update layouts to format 30.
[features.git] / lib / layouts / lettre.layout
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
8 #---------------
9 # rev 1; A. Castera :
10 # A lot of LateX code added to avoid being bored by
11 # the imposed command order of the class letter (see comments)
12 #---------------
13 #rev 2; A. Castera :
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)
17 #---------------
18 # rev.3; J.-P. Chretien oct 2010
19 # general update and review for inclusion in lyx-1.6.8
20 #  - remove tth stuff
21 #  - english named styles (translated in fr.po)
22 #  - margins set to dynamic to ensure alignment of line headings
23 #  - categories
24 #  - ordering control left at the beginning (any other way ?)
25
26
27 Format 30
28
29 #(pre)declarations (just to impose some order on the menus)
30 Style Standard
31 End
32
33 Style My_Address
34 End
35 Style Location
36 End
37 Style Telephone
38 End
39 Style NoTelephone
40 End
41 Style Fax
42 End
43 Style NoFax
44 End
45 Style Email
46 End
47 Style Place
48 End
49 Style NoPlace
50 End
51 Style Date
52 End
53 Style NoDate
54 End
55 Style Send_To_Address
56 End
57 Style Subject
58 End
59 Style YourRef
60 End
61 Style MyRef
62 End 
63 Style Opening
64 End
65 Style Closing
66 End
67 Style Signature
68 End
69 Style encl
70 End
71 Style   cc
72 End
73 Style Post_Scriptum
74 End
75 Style EndOfMessage
76 End
77 Style EndOfFile
78 End
79
80
81 # Input general definitions
82 Input letter.layout
83
84 Preamble
85 %% A lot of newif 
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
101    
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}{}
105 %% 
106
107 %% here is the real stuff : ouput the commands in the "proper" order
108  \newcommand{\findemessage}
109   { 
110     \ifneedsendletter %% did we start a letter ?
111       \iflyxsigp \signature{\Lysigp} \else \name{} \fi
112       \iflyxsigs \secondsignature{\Lysigs} \fi
113       \iflyxsigt \thirdsignature{\Lysigt} \fi   
114       \lyxsigpfalse
115       \lyxsigsfalse
116       \lyxsigtfalse
117       \closing{\Lyclose}
118       \ifpsneeded \ps{P.S. : }{\Lyps} \psneededfalse \fi
119       \ifccneeded \cc{\Lycc} \ccneededfalse \fi
120       \ifencneeded \encl{\Lyenc} \encneededfalse \fi
121       \end{letter}
122       \needsendletterfalse %% done with letter
123     \fi         % if needSendLetter
124       \ifneedsendfax \end{telefax} %% nothing provided yet for telefax !
125       \needsendfaxfalse 
126     \fi         % if needSendFax
127   }     %findemessage
128
129 EndPreamble
130
131 # My Address style used to specify sender name and coordinates
132 Style My_Address
133   CopyStyle     My_Address
134   Category      Headings
135   Margin        Static
136   LatexType     Command
137   LatexName     MyAddress
138   ParSkip       0.4
139   BottomSep     1.5
140   ParSep        1.5
141   Align         Left
142   AlignPossible     Left
143   Preamble
144    \newcommand{\MyAddress}[1]{ % will save the info for future use
145         \monaddressusedtrue
146         \providecommand{\lyaddress}{\address{#1}}
147         }
148   EndPreamble
149 End
150
151 # City name style
152 Style Place
153   Category              Headings
154   Margin                Dynamic
155   LatexType             Command
156   LatexName             Myplace
157   LabelSep              xx
158   TopSep                0.4
159   BottomSep             0.4
160   ParSep                0.4
161   Align                 Block
162   AlignPossible         Block, Left
163   LabelType             Static
164   LabelString           City:
165   LeftMargin            x
166   # label font definition
167   LabelFont 
168     Series              Bold
169     Shape               Italic
170     Color               red
171   EndFont
172   Preamble
173    \newcommand{\Myplace}[1]{   % will save the info for future use
174         \monlieuusedtrue
175         \providecommand{\lylieu}{\relax}
176         \renewcommand{\lylieu}{\lieu{#1}}
177         }
178   EndPreamble
179 End
180
181 #suppress City indication
182 Style NoPlace
183   Category              Headings
184   KeepEmpty             1
185   LatexType             Command
186   LatexName             MyNoPlace
187   LabelType             Static
188   Margin                Dynamic
189   LabelString           NoPlace
190   LeftMargin            x
191   # label font definition
192   LabelFont 
193     Series              Bold
194     Shape               Italic
195     Color               red
196   EndFont
197
198   Preamble
199    \newcommand{\MyNoPlace}{
200         \monlieuusedtrue
201         \providecommand{\lylieu}{\relax}
202         \renewcommand{\lylieu}{\nolieu{}}
203         }
204   EndPreamble
205 End
206
207 # date Style
208 Style Date
209   Category              Headings
210   Margin                Dynamic
211   LatexType             Command
212   LatexName             date
213   LeftMargin            x
214   LabelSep              xx
215   TopSep                0.4
216   BottomSep             0.4
217   ParSep                0.4
218   Align                 Block
219   AlignPossible         Block, Left
220   LabelType             Static
221   LabelString           Date:
222   # label font definition
223   LabelFont 
224     Series              Bold
225     Shape               Italic
226     Color               red
227   EndFont
228 End
229
230 #suppress date indication
231 Style NoDate
232   Category              Headings
233   KeepEmpty             1
234   Margin                Dynamic
235   LatexType             Command
236   LatexName             nodate
237   LabelType             Static
238   LeftMargin            x
239   LabelString           NoDate
240   # label font definition
241   LabelFont 
242     Series              Bold
243     Shape               Italic
244     Color               red
245   EndFont
246   Preamble
247   EndPreamble
248 End
249
250 # location (i.e. office, department ...)
251 Style Location
252   Category              Headings
253   Margin                Dynamic
254   LatexType             Command
255   LatexName             MyLocation
256   LeftMargin            x
257   LabelString           Office:
258   LabelSep              xx
259   TopSep                0.4
260   BottomSep             0.4
261   ParSep                0.4
262   Align                 Block
263   AlignPossible         Block, Left
264   LabelType             Static
265   # label font definition
266   LabelFont 
267     Series              Bold
268     Shape               Italic
269     Color               red
270   EndFont
271   Preamble
272    \newcommand{\MyLocation}[1]{ % will save the info for future use
273         \monlocationusedtrue
274         \providecommand{\lylocation}{\relax}
275         \renewcommand{\lylocation}{\location{#1}}
276         }
277   EndPreamble
278 End
279
280 # telephone Style
281 Style Telephone
282   Category              Headings
283   Margin                Dynamic
284   LatexType             Command
285   LatexName             MyTelephone
286   LeftMargin            x
287   LabelString           Tel:
288   LabelSep              xx
289   TopSep                0.4
290   BottomSep             0.4
291   ParSep                0.4
292   Align                 Block
293   AlignPossible         Block, Left
294   LabelType             Static
295   # label font definition
296   LabelFont 
297     Series              Bold
298     Shape               Italic
299     Color               red
300   EndFont
301   Preamble
302     \newcommand{\MyTelephone}[1]{ % will save the info for future use
303         \montelephoneusedtrue
304         \providecommand{\lytelephone}{\relax}
305         \renewcommand{\lytelephone}{\telephone{#1}}
306        }
307   EndPreamble
308 End
309
310 #suppress telephone indication
311 Style NoTelephone
312   Category              Headings
313   KeepEmpty             1
314   Margin                Dynamic
315   LatexType             Command
316   LatexName             MyNoTelephone
317   LabelType             Static
318   LeftMargin            x
319   LabelString           NoTel
320   # label font definition
321   LabelFont 
322     Series              Bold
323     Shape               Italic
324     Color               red
325   EndFont
326   Preamble
327    \newcommand{\MyNoTelephone}{
328         \montelephoneusedtrue
329         \providecommand{\lytelephone}{\relax}
330         \renewcommand{\lytelephone}{\notelephone{}}
331         }
332   EndPreamble
333
334 End
335
336 # telefax Style
337 Style Fax
338   Category              Headings
339   Margin                Dynamic
340   LatexType             Command
341   LatexName             MyFax
342   LeftMargin            x
343   LabelSep              xx
344   TopSep                0.4
345   BottomSep             0.4
346   ParSep                0.4
347   Align                 Block
348   AlignPossible         Block, Left
349   LabelType             Static
350   LabelString           Fax:
351   # label font definition
352   LabelFont 
353     Series              Bold
354     Shape               Italic
355     Color               red
356   EndFont
357   Preamble
358    \newcommand{\MyFax}[1]{ % will save the info for future use
359         \monfaxusedtrue
360         \providecommand{\lyfax}{\relax}
361         \renewcommand{\lyfax}{\fax{#1}}
362         }
363   EndPreamble
364 End
365
366 #suppress fax indication
367 Style NoFax
368   Category              Headings
369   KeepEmpty             1
370   Margin                Dynamic
371   LatexType             Command
372   LatexName             MyNoFax
373   LabelType             Static
374   LeftMargin            x
375   LabelString           NoFax
376    # label font definition
377   LabelFont 
378     Series              Bold
379     Shape               Italic
380     Color               red
381   EndFont
382   Preamble
383    \newcommand{\MyNoFax}{
384         \monfaxusedtrue
385         \providecommand{\lyfax}{\relax}
386         \renewcommand{\lyfax}{\nofax{}}
387         }
388   EndPreamble
389 End
390
391
392 # Email Style
393 Style Email
394   Category              Headings
395   Margin                Dynamic
396   LatexType             Command
397   LatexName             MyEmail
398   LeftMargin            x
399   LabelString           Email:
400   LabelSep              xx
401   TopSep                0.4
402   BottomSep             0.4
403   ParSep                0.4
404   Align                 Block
405   AlignPossible         Block, Left
406   LabelType             Static
407   # label font definition
408   LabelFont 
409     Series              Bold
410     Shape               Italic
411     Color               red
412   EndFont
413   Preamble
414    \newcommand{\MyEmail}[1]{ % will save the info for future use
415         \monemailusedtrue
416         \providecommand{\lyemail}{\relax}
417         \renewcommand{\lyemail}{\email{#1}}
418         }
419   EndPreamble
420 End
421
422 # Subject Style
423 Style Subject
424   Margin                Dynamic
425   LatexType             Command
426   LatexName             conc
427   LeftMargin            x
428   LabelString           Subject:
429   LabelSep              xx
430   TopSep                0.4
431   BottomSep             0.4
432   ParSep                0.4
433   Align                 Block
434   AlignPossible         Block, Left
435   LabelType             Static
436   # label font definition
437   LabelFont 
438     Series              Bold
439     Shape               Italic
440     Color               red
441   EndFont
442 End
443
444 # YourRef Style
445 Style YourRef
446   CopyStyle             Subject
447   Margin                Dynamic
448   LatexType             Command
449   LatexName             Vref
450   LeftMargin            x
451   LabelString           YourRef:
452   # label font definition
453   LabelFont 
454     Series              Bold
455     Shape               Italic
456     Color               red
457   EndFont
458 End
459
460 # MyRef Style
461 Style MyRef
462   CopyStyle             Subject
463   Margin                Dynamic
464   LatexType             Command
465   LatexName             Nref
466   LeftMargin            x
467   LabelString           MyRef:
468   # label font definition
469   LabelFont 
470     Series              Bold
471     Shape               Italic
472     Color               red
473   EndFont
474 End
475
476 Style Send_To_Address
477   CopyStyle             Send_To_Address
478   Margin                Right_Address_Box
479   LatexType             Command
480   LatexName             lettre
481   Preamble
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
485           \ifmonaddressused
486           \lyaddress{}
487           \fi
488           \ifmonlocationused
489           \lylocation{}
490           \fi
491           \ifmonlieuused
492           \lylieu{}
493           \fi
494           \ifmontelephoneused
495           \lytelephone{}
496           \fi
497           \ifmonfaxused
498           \lyfax{}
499           \fi
500           \ifmonemailused
501           \lyemail{}
502           \fi
503           \needsendlettertrue
504         }
505   EndPreamble
506 End
507
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
510 Style EndOfMessage
511   Category              Closings
512   KeepEmpty             1
513   Margin                Dynamic
514   TopSep                0.8
515   BottomSep             0.8
516   ParSep                0.8
517   LatexType             Command
518   LatexName             findemessage
519   LabelType             Static
520   LabelString           EndOfMessage.
521   LeftMargin            x
522   # label font definition
523   LabelFont 
524     Series              Bold
525     Shape               Italic
526     Color               red
527   EndFont
528 End
529
530 Style EndOfFile
531   CopyStyle             EndOfMessage
532   LabelString           EndOfFile.
533 End
534
535 # Opening style definition (Accroche)
536 Style Opening
537   CopyStyle             Opening
538   Margin                Dynamic
539   LeftMargin            x
540   LabelString           Opening:
541   # label font definition
542   LabelFont 
543     Series              Bold
544     Shape               Italic
545     Color               red
546   EndFont
547 End
548
549 # Closing style definition (FormuleDePolitesse, Salutations)
550 Style Closing
551   CopyStyle             Closing
552   Margin                Dynamic
553   LeftMargin            x
554   LabelString           Closing:
555   LatexType             Command
556   LatexName             lyxclose
557   Preamble
558     \newcommand{\lyxclose}[1]{\renewcommand{\Lyclose}{#1}}
559   EndPreamble
560 End
561
562 # Signature style definition
563 Style Signature
564   Margin                Dynamic
565   LeftMargin            x
566   LabelString           Signature:
567   LatexType             Command
568   LatexName             lyxsig
569   # label font definition
570   LabelFont 
571     Series              Bold
572     Shape               Italic
573     Color               red
574   EndFont
575   Preamble
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}
582            \lyxsigttrue
583           \else                 %% if lyxsigs exist
584             \iflyxsigp          %% the second one
585               \providecommand{\Lysigs}{\relax}
586               \renewcommand{\Lysigs}{#1}
587               \lyxsigstrue
588              \else              %% the first one
589                \providecommand{\Lysigp}{\relax}
590                \renewcommand{\Lysigp}{#1}
591                \lyxsigptrue
592              \fi                %% if lyxsidp exist
593           \fi                   %% if lyxsigs exist
594         }
595   EndPreamble
596 End
597
598
599 # encl style definition (Ci-joint)
600 Style encl
601   CopyStyle             encl
602   Category              Closings
603   Margin                Dynamic
604   LeftMargin            x
605   LabelString           encl:
606   LatexName             lyxenc
607   # label font definition
608   LabelFont 
609     Series              Bold
610     Shape               Italic
611     Color               red
612   EndFont
613   Preamble
614     \newcommand{\lyxenc}[1]{
615          \providecommand{\Lyenc}{\relax}
616          \renewcommand{\Lyenc}{#1} 
617          \encneededtrue
618         }
619   EndPreamble
620 End
621
622 #Carbon Copy
623 Style   cc
624   CopyStyle             encl
625   LatexName             lyxcc
626   LeftMargin            x
627   LabelString           cc:
628   # label font definition
629   LabelFont 
630     Series              Bold
631     Shape               Italic
632     Color               red
633   EndFont
634   Preamble
635     \newcommand{\lyxcc}[1]{
636          \providecommand{\Lycc}{\relax}
637          \renewcommand{\Lycc}{#1} 
638          \ccneededtrue
639         }
640   EndPreamble
641 End
642
643 #Post Scriptum
644 Style Post_Scriptum
645   Category              Closings
646   Margin                Dynamic
647   LatexType             Command
648   LatexName             lyxps
649   LabelSep              xx
650   LabelType             Static
651   LeftMargin            x
652   LabelString           P.S.:
653   # label font definition
654   LabelFont 
655     Series              Bold
656     Shape               Italic
657     Color               red
658   EndFont
659   Preamble
660     \newcommand{\lyxps}[1]{
661          \providecommand{\Lyps}{\relax}
662          \renewcommand{\Lyps}{#1} 
663          \psneededtrue
664         }
665   EndPreamble
666 End
667
668
669