]> git.lyx.org Git - lyx.git/blob - lib/layouts/lettre.layout
stdinsets.inc, InsetERT.cpp: change "ERT" to "TeX" to be consistent - the documentati...
[lyx.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 % to get the specified pagesize (workaround for a lettre problem)
130 \input pdftexconfig.tex
131
132 EndPreamble
133
134 # My Address style used to specify sender name and coordinates
135 Style My_Address
136   CopyStyle     My_Address
137   Category      Headings
138   Margin        Static
139   LatexType     Command
140   LatexName     MyAddress
141   ParSkip       0.4
142   BottomSep     1.5
143   ParSep        1.5
144   Align         Left
145   AlignPossible     Left
146   Preamble
147    \newcommand{\MyAddress}[1]{ % will save the info for future use
148         \monaddressusedtrue
149         \providecommand{\lyaddress}{\address{#1}}
150         }
151   EndPreamble
152 End
153
154 # City name style
155 Style Place
156   Category              Headings
157   Margin                Dynamic
158   LatexType             Command
159   LatexName             Myplace
160   LabelSep              xx
161   TopSep                0.4
162   BottomSep             0.4
163   ParSep                0.4
164   Align                 Block
165   AlignPossible         Block, Left
166   LabelType             Static
167   LabelString           City:
168   LeftMargin            x
169   # label font definition
170   LabelFont 
171     Series              Bold
172     Shape               Italic
173     Color               red
174   EndFont
175   Preamble
176    \newcommand{\Myplace}[1]{   % will save the info for future use
177         \monlieuusedtrue
178         \providecommand{\lylieu}{\relax}
179         \renewcommand{\lylieu}{\lieu{#1}}
180         }
181   EndPreamble
182 End
183
184 #suppress City indication
185 Style NoPlace
186   Category              Headings
187   KeepEmpty             1
188   LatexType             Command
189   LatexName             MyNoPlace
190   LabelType             Static
191   Margin                Dynamic
192   LabelString           NoPlace
193   LeftMargin            x
194   # label font definition
195   LabelFont 
196     Series              Bold
197     Shape               Italic
198     Color               red
199   EndFont
200
201   Preamble
202    \newcommand{\MyNoPlace}{
203         \monlieuusedtrue
204         \providecommand{\lylieu}{\relax}
205         \renewcommand{\lylieu}{\nolieu{}}
206         }
207   EndPreamble
208 End
209
210 # date Style
211 Style Date
212   Category              Headings
213   Margin                Dynamic
214   LatexType             Command
215   LatexName             date
216   LeftMargin            x
217   LabelSep              xx
218   TopSep                0.4
219   BottomSep             0.4
220   ParSep                0.4
221   Align                 Block
222   AlignPossible         Block, Left
223   LabelType             Static
224   LabelString           Date:
225   # label font definition
226   LabelFont 
227     Series              Bold
228     Shape               Italic
229     Color               red
230   EndFont
231 End
232
233 #suppress date indication
234 Style NoDate
235   Category              Headings
236   KeepEmpty             1
237   Margin                Dynamic
238   LatexType             Command
239   LatexName             nodate
240   LabelType             Static
241   LeftMargin            x
242   LabelString           NoDate
243   # label font definition
244   LabelFont 
245     Series              Bold
246     Shape               Italic
247     Color               red
248   EndFont
249   Preamble
250   EndPreamble
251 End
252
253 # location (i.e. office, department ...)
254 Style Location
255   Category              Headings
256   Margin                Dynamic
257   LatexType             Command
258   LatexName             MyLocation
259   LeftMargin            x
260   LabelString           Office:
261   LabelSep              xx
262   TopSep                0.4
263   BottomSep             0.4
264   ParSep                0.4
265   Align                 Block
266   AlignPossible         Block, Left
267   LabelType             Static
268   # label font definition
269   LabelFont 
270     Series              Bold
271     Shape               Italic
272     Color               red
273   EndFont
274   Preamble
275    \newcommand{\MyLocation}[1]{ % will save the info for future use
276         \monlocationusedtrue
277         \providecommand{\lylocation}{\relax}
278         \renewcommand{\lylocation}{\location{#1}}
279         }
280   EndPreamble
281 End
282
283 # telephone Style
284 Style Telephone
285   Category              Headings
286   Margin                Dynamic
287   LatexType             Command
288   LatexName             MyTelephone
289   LeftMargin            x
290   LabelString           Tel:
291   LabelSep              xx
292   TopSep                0.4
293   BottomSep             0.4
294   ParSep                0.4
295   Align                 Block
296   AlignPossible         Block, Left
297   LabelType             Static
298   # label font definition
299   LabelFont 
300     Series              Bold
301     Shape               Italic
302     Color               red
303   EndFont
304   Preamble
305     \newcommand{\MyTelephone}[1]{ % will save the info for future use
306         \montelephoneusedtrue
307         \providecommand{\lytelephone}{\relax}
308         \renewcommand{\lytelephone}{\telephone{#1}}
309        }
310   EndPreamble
311 End
312
313 #suppress telephone indication
314 Style NoTelephone
315   Category              Headings
316   KeepEmpty             1
317   Margin                Dynamic
318   LatexType             Command
319   LatexName             MyNoTelephone
320   LabelType             Static
321   LeftMargin            x
322   LabelString           NoTel
323   # label font definition
324   LabelFont 
325     Series              Bold
326     Shape               Italic
327     Color               red
328   EndFont
329   Preamble
330    \newcommand{\MyNoTelephone}{
331         \montelephoneusedtrue
332         \providecommand{\lytelephone}{\relax}
333         \renewcommand{\lytelephone}{\notelephone{}}
334         }
335   EndPreamble
336
337 End
338
339 # telefax Style
340 Style Fax
341   Category              Headings
342   Margin                Dynamic
343   LatexType             Command
344   LatexName             MyFax
345   LeftMargin            x
346   LabelSep              xx
347   TopSep                0.4
348   BottomSep             0.4
349   ParSep                0.4
350   Align                 Block
351   AlignPossible         Block, Left
352   LabelType             Static
353   LabelString           Fax:
354   # label font definition
355   LabelFont 
356     Series              Bold
357     Shape               Italic
358     Color               red
359   EndFont
360   Preamble
361    \newcommand{\MyFax}[1]{ % will save the info for future use
362         \monfaxusedtrue
363         \providecommand{\lyfax}{\relax}
364         \renewcommand{\lyfax}{\fax{#1}}
365         }
366   EndPreamble
367 End
368
369 #suppress fax indication
370 Style NoFax
371   Category              Headings
372   KeepEmpty             1
373   Margin                Dynamic
374   LatexType             Command
375   LatexName             MyNoFax
376   LabelType             Static
377   LeftMargin            x
378   LabelString           NoFax
379    # label font definition
380   LabelFont 
381     Series              Bold
382     Shape               Italic
383     Color               red
384   EndFont
385   Preamble
386    \newcommand{\MyNoFax}{
387         \monfaxusedtrue
388         \providecommand{\lyfax}{\relax}
389         \renewcommand{\lyfax}{\nofax{}}
390         }
391   EndPreamble
392 End
393
394
395 # Email Style
396 Style Email
397   Category              Headings
398   Margin                Dynamic
399   LatexType             Command
400   LatexName             MyEmail
401   LeftMargin            x
402   LabelString           Email:
403   LabelSep              xx
404   TopSep                0.4
405   BottomSep             0.4
406   ParSep                0.4
407   Align                 Block
408   AlignPossible         Block, Left
409   LabelType             Static
410   # label font definition
411   LabelFont 
412     Series              Bold
413     Shape               Italic
414     Color               red
415   EndFont
416   Preamble
417    \newcommand{\MyEmail}[1]{ % will save the info for future use
418         \monemailusedtrue
419         \providecommand{\lyemail}{\relax}
420         \renewcommand{\lyemail}{\email{#1}}
421         }
422   EndPreamble
423 End
424
425 # Subject Style
426 Style Subject
427   Margin                Dynamic
428   LatexType             Command
429   LatexName             conc
430   LeftMargin            x
431   LabelString           Subject:
432   LabelSep              xx
433   TopSep                0.4
434   BottomSep             0.4
435   ParSep                0.4
436   Align                 Block
437   AlignPossible         Block, Left
438   LabelType             Static
439   # label font definition
440   LabelFont 
441     Series              Bold
442     Shape               Italic
443     Color               red
444   EndFont
445 End
446
447 # YourRef Style
448 Style YourRef
449   CopyStyle             Subject
450   Margin                Dynamic
451   LatexType             Command
452   LatexName             Vref
453   LeftMargin            x
454   LabelString           YourRef:
455   # label font definition
456   LabelFont 
457     Series              Bold
458     Shape               Italic
459     Color               red
460   EndFont
461 End
462
463 # MyRef Style
464 Style MyRef
465   CopyStyle             Subject
466   Margin                Dynamic
467   LatexType             Command
468   LatexName             Nref
469   LeftMargin            x
470   LabelString           MyRef:
471   # label font definition
472   LabelFont 
473     Series              Bold
474     Shape               Italic
475     Color               red
476   EndFont
477 End
478
479 Style Send_To_Address
480   CopyStyle             Send_To_Address
481   Margin                Right_Address_Box
482   LatexType             Command
483   LatexName             lettre
484   Preamble
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
488           \ifmonaddressused
489           \lyaddress{}
490           \fi
491           \ifmonlocationused
492           \lylocation{}
493           \fi
494           \ifmonlieuused
495           \lylieu{}
496           \fi
497           \ifmontelephoneused
498           \lytelephone{}
499           \fi
500           \ifmonfaxused
501           \lyfax{}
502           \fi
503           \ifmonemailused
504           \lyemail{}
505           \fi
506           \needsendlettertrue
507         }
508   EndPreamble
509 End
510
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
513 Style EndOfMessage
514   Category              Closings
515   KeepEmpty             1
516   Margin                Dynamic
517   TopSep                0.8
518   BottomSep             0.8
519   ParSep                0.8
520   LatexType             Command
521   LatexName             findemessage
522   LabelType             Static
523   LabelString           EndOfMessage.
524   LeftMargin            x
525   # label font definition
526   LabelFont 
527     Series              Bold
528     Shape               Italic
529     Color               red
530   EndFont
531 End
532
533 Style EndOfFile
534   CopyStyle             EndOfMessage
535   LabelString           EndOfFile.
536 End
537
538 # Opening style definition (Accroche)
539 Style Opening
540   CopyStyle             Opening
541   Margin                Dynamic
542   LeftMargin            x
543   LabelString           Opening:
544   # label font definition
545   LabelFont 
546     Series              Bold
547     Shape               Italic
548     Color               red
549   EndFont
550 End
551
552 # Closing style definition (FormuleDePolitesse, Salutations)
553 Style Closing
554   CopyStyle             Closing
555   Margin                Dynamic
556   LeftMargin            x
557   LabelString           Closing:
558   LatexType             Command
559   LatexName             lyxclose
560   Preamble
561     \newcommand{\lyxclose}[1]{\renewcommand{\Lyclose}{#1}}
562   EndPreamble
563 End
564
565 # Signature style definition
566 Style Signature
567   Margin                Dynamic
568   LeftMargin            x
569   LabelString           Signature:
570   LatexType             Command
571   LatexName             lyxsig
572   # label font definition
573   LabelFont 
574     Series              Bold
575     Shape               Italic
576     Color               red
577   EndFont
578   Preamble
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}
585            \lyxsigttrue
586           \else                 %% if lyxsigs exist
587             \iflyxsigp          %% the second one
588               \providecommand{\Lysigs}{\relax}
589               \renewcommand{\Lysigs}{#1}
590               \lyxsigstrue
591              \else              %% the first one
592                \providecommand{\Lysigp}{\relax}
593                \renewcommand{\Lysigp}{#1}
594                \lyxsigptrue
595              \fi                %% if lyxsidp exist
596           \fi                   %% if lyxsigs exist
597         }
598   EndPreamble
599 End
600
601
602 # encl style definition (Ci-joint)
603 Style encl
604   CopyStyle             encl
605   Category              Closings
606   Margin                Dynamic
607   LeftMargin            x
608   LabelString           encl:
609   LatexName             lyxenc
610   # label font definition
611   LabelFont 
612     Series              Bold
613     Shape               Italic
614     Color               red
615   EndFont
616   Preamble
617     \newcommand{\lyxenc}[1]{
618          \providecommand{\Lyenc}{\relax}
619          \renewcommand{\Lyenc}{#1} 
620          \encneededtrue
621         }
622   EndPreamble
623 End
624
625 #Carbon Copy
626 Style   cc
627   CopyStyle             encl
628   LatexName             lyxcc
629   LeftMargin            x
630   LabelString           cc:
631   # label font definition
632   LabelFont 
633     Series              Bold
634     Shape               Italic
635     Color               red
636   EndFont
637   Preamble
638     \newcommand{\lyxcc}[1]{
639          \providecommand{\Lycc}{\relax}
640          \renewcommand{\Lycc}{#1} 
641          \ccneededtrue
642         }
643   EndPreamble
644 End
645
646 #Post Scriptum
647 Style Post_Scriptum
648   Category              Closings
649   Margin                Dynamic
650   LatexType             Command
651   LatexName             lyxps
652   LabelSep              xx
653   LabelType             Static
654   LeftMargin            x
655   LabelString           P.S.:
656   # label font definition
657   LabelFont 
658     Series              Bold
659     Shape               Italic
660     Color               red
661   EndFont
662   Preamble
663     \newcommand{\lyxps}[1]{
664          \providecommand{\Lyps}{\relax}
665          \renewcommand{\Lyps}{#1} 
666          \psneededtrue
667         }
668   EndPreamble
669 End
670
671
672