]> git.lyx.org Git - lyx.git/blob - layouts/lettre.layout
Add documentation for notes cite engine type.
[lyx.git] / layouts / lettre.layout
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
9 #---------------
10 # rev 1; A. Castera :
11 # A lot of LateX code added to avoid being bored by
12 # the imposed command order of the class letter (see comments)
13 #---------------
14 #rev 2; A. Castera :
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)
18 #---------------
19 # rev.3; J.-P. Chretien oct 2010
20 # general update and review for inclusion in lyx-1.6.8
21 #  - remove tth stuff
22 #  - english named styles (translated in fr.po)
23 #  - margins set to dynamic to ensure alignment of line headings
24 #  - categories
25 #  - ordering control left at the beginning (any other way ?)
26 #---------------
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)
30
31 # TODO: DocBook doesn't support several letters in the same file.
32
33
34 Format 104
35
36 #(pre)declarations (just to impose some order on the menus)
37 Style Standard
38 End
39
40 Style My_Address
41 End
42 Style Location
43 End
44 Style Telephone
45 End
46 Style NoTelephone
47 End
48 Style Fax
49 End
50 Style NoFax
51 End
52 Style Email
53 End
54 Style Place
55 End
56 Style NoPlace
57 End
58 Style Date
59 End
60 Style NoDate
61 End
62 Style Send_To_Address
63 End
64 Style Subject
65 End
66 Style YourRef
67 End
68 Style MyRef
69 End 
70 Style Opening
71 End
72 Style Closing
73 End
74 Style Signature
75 End
76 Style encl
77 End
78 Style   cc
79 End
80 Style Post_Scriptum
81 End
82 Style EndOfMessage
83 End
84 Style EndOfFile
85 End
86
87
88 # Input general definitions
89 Input letter.layout
90
91 Preamble
92 %% A lot of newif 
93 %% to allow reorder commands and output them when needed only
94  \newif\ifneedsendletter        % we started a letter
95  \newif\ifneedsendfax           % we started a fax
96  \newif\ifmonaddressused        % sender address specified
97  \newif\ifmonlieuused           % city
98  \newif\ifmonlocationused       % sender extra info (office, etc..)
99  \newif\ifmontelephoneused      % sender phone # specified
100  \newif\ifmonfaxused            % sender fax # specified
101  \newif\ifmonemailused          % sender email address specified
102  \newif\iflyxsigp               % first of up to 3 signatures
103  \newif\iflyxsigs               % second signature
104  \newif\iflyxsigt               % third one
105  \newif\ifpsneeded              % post-scriptum
106  \newif\ifccneeded              % carbon copy to somebody
107  \newif\ifencneeded             % encluded items
108    
109 %% Sometimes you don't want a closing ("formule de politesse"),
110 %% but the package still needs it. Use a void macro instead of a newif
111  \newcommand{\Lyclose}{}
112 %% 
113
114 %% here is the real stuff : ouput the commands in the "proper" order
115  \newcommand{\findemessage}
116   { 
117     \ifneedsendletter %% did we start a letter ?
118       \iflyxsigp \signature{\Lysigp} \else \name{} \fi
119       \iflyxsigs \secondsignature{\Lysigs} \fi
120       \iflyxsigt \thirdsignature{\Lysigt} \fi   
121       \lyxsigpfalse
122       \lyxsigsfalse
123       \lyxsigtfalse
124       \closing{\Lyclose}
125       \ifpsneeded \ps{P.S. : }{\Lyps} \psneededfalse \fi
126       \ifccneeded \cc{\Lycc} \ccneededfalse \fi
127       \ifencneeded \encl{\Lyenc} \encneededfalse \fi
128       \end{letter}
129       \needsendletterfalse %% done with letter
130     \fi         % if needSendLetter
131       \ifneedsendfax \end{telefax} %% nothing provided yet for telefax !
132       \needsendfaxfalse 
133     \fi         % if needSendFax
134   }     %findemessage
135
136 % to get the specified pagesize 
137 % (workaround for an a4paper/lettre problem in pdf mode)
138 % removed in oct 2016, no more needed since 2.351 and created an error with LuaTeX
139 %\@ifpackageloaded{ifpdf}{}{\usepackage{ifpdf}}
140 %\ifpdf\input pdftexconfig.tex\fi
141
142 EndPreamble
143
144 # My Address style used to specify sender name and coordinates
145 Style My_Address
146   CopyStyle     My_Address
147   Category      "Postal Data"
148   Margin        Static
149   LatexType     Command
150   LatexName     MyAddress
151   ParSkip       0.4
152   BottomSep     1.5
153   ParSep        1.5
154   Align         Left
155   AlignPossible     Left
156   Preamble
157    \newcommand{\MyAddress}[1]{ % will save the info for future use
158         \monaddressusedtrue
159         \providecommand{\lyaddress}{\address{#1}}
160         }
161   EndPreamble
162   # Don't break the sequential bunch of elements going into the wrapper.
163   DocBookTag         NONE
164   DocBookWrapperTag  address
165   DocBookWrapperMergeWithPrevious  true
166   DocBookInInfo      always
167 End
168
169 # City name style
170 Style Place
171   Category              Headings
172   Margin                Dynamic
173   LatexType             Command
174   LatexName             Myplace
175   LabelSep              xx
176   TopSep                0.4
177   BottomSep             0.4
178   ParSep                0.4
179   Align                 Block
180   AlignPossible         Block, Left
181   LabelType             Static
182   LabelString           City:
183   LeftMargin            x
184   # label font definition
185   LabelFont 
186     Series              Bold
187     Shape               Italic
188     Color               textlabel3
189   EndFont
190   Preamble
191    \newcommand{\Myplace}[1]{   % will save the info for future use
192         \monlieuusedtrue
193         \providecommand{\lylieu}{\relax}
194         \renewcommand{\lylieu}{\lieu{#1}}
195         }
196   EndPreamble
197   DocBookTag         city
198   DocBookTagType     paragraph
199   DocBookWrapperTag  address
200   DocBookWrapperMergeWithPrevious  true
201   DocBookInInfo      always
202 End
203
204 #suppress City indication
205 Style NoPlace
206   Category              Headings
207   KeepEmpty             1
208   LatexType             Command
209   LatexName             MyNoPlace
210   LabelType             Static
211   Margin                Dynamic
212   LabelString           NoPlace
213   LeftMargin            x
214   # label font definition
215   LabelFont 
216     Series              Bold
217     Shape               Italic
218     Color               textlabel3
219   EndFont
220
221   Preamble
222    \newcommand{\MyNoPlace}{
223         \monlieuusedtrue
224         \providecommand{\lylieu}{\relax}
225         \renewcommand{\lylieu}{\nolieu{}}
226         }
227   EndPreamble
228   # Don't break the sequential bunch of elements going into the wrapper.
229   DocBookTag         NONE
230   DocBookWrapperTag  address
231   DocBookWrapperMergeWithPrevious  true
232   DocBookInInfo      always
233 End
234
235 # date Style
236 Style Date
237   Category              Headings
238   Margin                Dynamic
239   LatexType             Command
240   LatexName             date
241   LeftMargin            x
242   LabelSep              xx
243   TopSep                0.4
244   BottomSep             0.4
245   ParSep                0.4
246   Align                 Block
247   AlignPossible         Block, Left
248   LabelType             Static
249   LabelString           Date:
250   # label font definition
251   LabelFont 
252     Series              Bold
253     Shape               Italic
254     Color               textlabel3
255   EndFont
256   DocBookTag      date
257   DocBookTagType  paragraph
258   DocBookInInfo   always
259   DocBookNoFontInside   true
260 End
261
262 #suppress date indication
263 Style NoDate
264   Category              Headings
265   KeepEmpty             1
266   Margin                Dynamic
267   LatexType             Command
268   LatexName             nodate
269   LabelType             Static
270   LeftMargin            x
271   LabelString           NoDate
272   # label font definition
273   LabelFont 
274     Series              Bold
275     Shape               Italic
276     Color               textlabel3
277   EndFont
278   Preamble
279   EndPreamble
280   DocBookTag     NONE
281   DocBookInInfo  always
282 End
283
284 # location (i.e. office, department ...)
285 Style Location
286   Category              Headings
287   Margin                Dynamic
288   LatexType             Command
289   LatexName             MyLocation
290   LeftMargin            x
291   LabelString           Office:
292   LabelSep              xx
293   TopSep                0.4
294   BottomSep             0.4
295   ParSep                0.4
296   Align                 Block
297   AlignPossible         Block, Left
298   LabelType             Static
299   # label font definition
300   LabelFont 
301     Series              Bold
302     Shape               Italic
303     Color               textlabel3
304   EndFont
305   Preamble
306    \newcommand{\MyLocation}[1]{ % will save the info for future use
307         \monlocationusedtrue
308         \providecommand{\lylocation}{\relax}
309         \renewcommand{\lylocation}{\location{#1}}
310         }
311   EndPreamble
312   DocBookWrapperTag  address
313   DocBookWrapperMergeWithPrevious  true
314   DocBookInInfo      always
315 End
316
317 # telephone Style
318 Style Telephone
319   Category              Headings
320   Margin                Dynamic
321   LatexType             Command
322   LatexName             MyTelephone
323   LeftMargin            x
324   LabelString           Tel:
325   LabelSep              xx
326   TopSep                0.4
327   BottomSep             0.4
328   ParSep                0.4
329   Align                 Block
330   AlignPossible         Block, Left
331   LabelType             Static
332   # label font definition
333   LabelFont 
334     Series              Bold
335     Shape               Italic
336     Color               textlabel3
337   EndFont
338   Preamble
339     \newcommand{\MyTelephone}[1]{ % will save the info for future use
340         \montelephoneusedtrue
341         \providecommand{\lytelephone}{\relax}
342         \renewcommand{\lytelephone}{\telephone{#1}}
343        }
344   EndPreamble
345   DocBookWrapperTag  address
346   DocBookWrapperMergeWithPrevious  true
347   DocBookInInfo      always
348 End
349
350 #suppress telephone indication
351 Style NoTelephone
352   Category              Headings
353   KeepEmpty             1
354   Margin                Dynamic
355   LatexType             Command
356   LatexName             MyNoTelephone
357   LabelType             Static
358   LeftMargin            x
359   LabelString           NoTel
360   # label font definition
361   LabelFont 
362     Series              Bold
363     Shape               Italic
364     Color               textlabel3
365   EndFont
366   Preamble
367    \newcommand{\MyNoTelephone}{
368         \montelephoneusedtrue
369         \providecommand{\lytelephone}{\relax}
370         \renewcommand{\lytelephone}{\notelephone{}}
371         }
372   EndPreamble
373   # Don't break the sequential bunch of elements going into the wrapper.
374   DocBookTag         NONE
375   DocBookWrapperTag  address
376   DocBookWrapperMergeWithPrevious  true
377   DocBookInInfo      always
378 End
379
380 # telefax Style
381 Style Fax
382   Category              Headings
383   Margin                Dynamic
384   LatexType             Command
385   LatexName             MyFax
386   LeftMargin            x
387   LabelSep              xx
388   TopSep                0.4
389   BottomSep             0.4
390   ParSep                0.4
391   Align                 Block
392   AlignPossible         Block, Left
393   LabelType             Static
394   LabelString           Fax:
395   # label font definition
396   LabelFont 
397     Series              Bold
398     Shape               Italic
399     Color               textlabel3
400   EndFont
401   Preamble
402    \newcommand{\MyFax}[1]{ % will save the info for future use
403         \monfaxusedtrue
404         \providecommand{\lyfax}{\relax}
405         \renewcommand{\lyfax}{\fax{#1}}
406         }
407   EndPreamble
408   DocBookTag         fax
409   DocBookTagType     paragraph
410   DocBookWrapperTag  address
411   DocBookWrapperMergeWithPrevious  true
412   DocBookInInfo      always
413 End
414
415 #suppress fax indication
416 Style NoFax
417   Category              Headings
418   KeepEmpty             1
419   Margin                Dynamic
420   LatexType             Command
421   LatexName             MyNoFax
422   LabelType             Static
423   LeftMargin            x
424   LabelString           NoFax
425    # label font definition
426   LabelFont 
427     Series              Bold
428     Shape               Italic
429     Color               textlabel3
430   EndFont
431   Preamble
432    \newcommand{\MyNoFax}{
433         \monfaxusedtrue
434         \providecommand{\lyfax}{\relax}
435         \renewcommand{\lyfax}{\nofax{}}
436         }
437   EndPreamble
438   # Don't break the sequential bunch of elements going into the wrapper.
439   DocBookTag         NONE
440   DocBookWrapperTag  address
441   DocBookWrapperMergeWithPrevious  true
442   DocBookInInfo      always
443 End
444
445
446 # Email Style
447 Style Email
448   Category              Headings
449   Margin                Dynamic
450   LatexType             Command
451   LatexName             MyEmail
452   LeftMargin            x
453   LabelString           Email:
454   LabelSep              xx
455   TopSep                0.4
456   BottomSep             0.4
457   ParSep                0.4
458   Align                 Block
459   AlignPossible         Block, Left
460   LabelType             Static
461   # label font definition
462   LabelFont 
463     Series              Bold
464     Shape               Italic
465     Color               textlabel3
466   EndFont
467   Preamble
468    \newcommand{\MyEmail}[1]{ % will save the info for future use
469         \monemailusedtrue
470         \providecommand{\lyemail}{\relax}
471         \renewcommand{\lyemail}{\email{#1}}
472         }
473   EndPreamble
474   DocBookTag         email
475   DocBookTagType     paragraph
476   DocBookWrapperTag  address
477   DocBookWrapperMergeWithPrevious  true
478   DocBookInInfo      always
479 End
480
481 # Subject Style
482 Style Subject
483   Margin                Dynamic
484   LatexType             Command
485   LatexName             conc
486   LeftMargin            x
487   LabelString           Subject:
488   LabelSep              xx
489   TopSep                0.4
490   BottomSep             0.4
491   ParSep                0.4
492   Align                 Block
493   AlignPossible         Block, Left
494   LabelType             Static
495   # label font definition
496   LabelFont 
497     Series              Bold
498     Shape               Italic
499     Color               textlabel3
500   EndFont
501   DocBookTag     title
502   DocBookTagType paragraph
503   DocBookInInfo  maybe
504 End
505
506 # YourRef Style
507 Style YourRef
508   CopyStyle             Subject
509   Margin                Dynamic
510   LatexType             Command
511   LatexName             Vref
512   LeftMargin            x
513   LabelString           YourRef:
514   # label font definition
515   LabelFont 
516     Series              Bold
517     Shape               Italic
518     Color               textlabel3
519   EndFont
520   DocBookTag      productnumber
521   DocBookAttr     role='your-ref'
522   DocBookTagType  paragraph
523   DocBookInInfo   always
524 End
525
526 # MyRef Style
527 Style MyRef
528   CopyStyle             Subject
529   Margin                Dynamic
530   LatexType             Command
531   LatexName             Nref
532   LeftMargin            x
533   LabelString           MyRef:
534   # label font definition
535   LabelFont 
536     Series              Bold
537     Shape               Italic
538     Color               textlabel3
539   EndFont
540   DocBookTag      productnumber
541   DocBookAttr     role='my-ref'
542   DocBookTagType  paragraph
543   DocBookInInfo   always
544 End
545
546 Style Send_To_Address
547   CopyStyle             Send_To_Address
548   Margin                Right_Address_Box
549   LatexType             Command
550   LatexName             lettre
551   Preamble
552   \newcommand{\lettre}[1] { %% organized as expected by the package
553           \findemessage   %% if we already started a letter or a fax
554           \begin{letter}{#1} %% now the new one
555           \ifmonaddressused
556           \lyaddress{}
557           \fi
558           \ifmonlocationused
559           \lylocation{}
560           \fi
561           \ifmonlieuused
562           \lylieu{}
563           \fi
564           \ifmontelephoneused
565           \lytelephone{}
566           \fi
567           \ifmonfaxused
568           \lyfax{}
569           \fi
570           \ifmonemailused
571           \lyemail{}
572           \fi
573           \needsendlettertrue
574         }
575   EndPreamble
576   DocBookTag         NONE
577   DocBookWrapperTag  address
578   DocBookWrapperAttr role='send-to-address'
579   DocBookWrapperMergeWithPrevious  true
580   DocBookInInfo      always
581 End
582
583 #As a temporary(?) trick the last(only?) letter of the file must be processed
584 # and to allow changing sender address, location,etc.. in between 2 letters
585 Style EndOfMessage
586   Category              Closings
587   KeepEmpty             1
588   Margin                Dynamic
589   TopSep                0.8
590   BottomSep             0.8
591   ParSep                0.8
592   LatexType             Command
593   LatexName             findemessage
594   LabelType             Static
595   LabelString           EndOfMessage.
596   LeftMargin            x
597   # label font definition
598   LabelFont 
599     Series              Bold
600     Shape               Italic
601     Color               textlabel3
602   EndFont
603   DocBookTag  NONE
604 End
605
606 Style EndOfFile
607   CopyStyle             EndOfMessage
608   LabelString           EndOfFile.
609   DocBookTag  NONE
610 End
611
612 # Opening style definition (Accroche)
613 Style Opening
614   CopyStyle             Opening
615   Margin                Dynamic
616   LeftMargin            x
617   LabelString           Opening:
618   # label font definition
619   LabelFont 
620     Series              Bold
621     Shape               Italic
622     Color               textlabel3
623   EndFont
624 End
625
626 # Closing style definition (FormuleDePolitesse, Salutations)
627 Style Closing
628   CopyStyle             Closing
629   Margin                Dynamic
630   LeftMargin            x
631   LabelString           Closing:
632   LatexType             Command
633   LatexName             lyxclose
634   Preamble
635     \newcommand{\lyxclose}[1]{\renewcommand{\Lyclose}{#1}}
636   EndPreamble
637 End
638
639 # Signature style definition
640 Style Signature
641   Margin                Dynamic
642   LeftMargin            x
643   LabelString           Signature:
644   LatexType             Command
645   LatexName             lyxsig
646   # label font definition
647   LabelFont 
648     Series              Bold
649     Shape               Italic
650     Color               textlabel3
651   EndFont
652   Preamble
653       %% automatic assignment of signatures
654       %% there is only 1 Signature style, but multiple latex commands
655        \newcommand{\lyxsig}[1]{
656          \iflyxsigs %% the second sig. exists, so this one is the third
657            \providecommand{\Lysigt}{\relax}
658            \renewcommand{\Lysigt}{#1}
659            \lyxsigttrue
660           \else                 %% if lyxsigs exist
661             \iflyxsigp          %% the second one
662               \providecommand{\Lysigs}{\relax}
663               \renewcommand{\Lysigs}{#1}
664               \lyxsigstrue
665              \else              %% the first one
666                \providecommand{\Lysigp}{\relax}
667                \renewcommand{\Lysigp}{#1}
668                \lyxsigptrue
669              \fi                %% if lyxsidp exist
670           \fi                   %% if lyxsigs exist
671         }
672   EndPreamble
673 End
674
675
676 # encl style definition (Ci-joint)
677 Style encl
678   CopyStyle             encl
679   Category              Closings
680   Margin                Dynamic
681   LeftMargin            x
682   LabelString           encl:
683   LatexName             lyxenc
684   # label font definition
685   LabelFont 
686     Series              Bold
687     Shape               Italic
688     Color               textlabel3
689   EndFont
690   Preamble
691     \newcommand{\lyxenc}[1]{
692          \providecommand{\Lyenc}{\relax}
693          \renewcommand{\Lyenc}{#1} 
694          \encneededtrue
695         }
696   EndPreamble
697 End
698
699 #Carbon Copy
700 Style   cc
701   CopyStyle             encl
702   LatexName             lyxcc
703   LeftMargin            x
704   LabelString           cc:
705   # label font definition
706   LabelFont 
707     Series              Bold
708     Shape               Italic
709     Color               textlabel3
710   EndFont
711   Preamble
712     \newcommand{\lyxcc}[1]{
713          \providecommand{\Lycc}{\relax}
714          \renewcommand{\Lycc}{#1} 
715          \ccneededtrue
716         }
717   EndPreamble
718 End
719
720 #Post Scriptum
721 Style Post_Scriptum
722   Category              Closings
723   Margin                Dynamic
724   LatexType             Command
725   LatexName             lyxps
726   LabelSep              xx
727   LabelType             Static
728   LeftMargin            x
729   LabelString           P.S.:
730   # label font definition
731   LabelFont 
732     Series              Bold
733     Shape               Italic
734     Color               textlabel3
735   EndFont
736   Preamble
737     \newcommand{\lyxps}[1]{
738          \providecommand{\Lyps}{\relax}
739          \renewcommand{\Lyps}{#1} 
740          \psneededtrue
741         }
742   EndPreamble
743   DocBookTag   para
744   DocBookAttr  role='post-scriptum'
745 End