Jean-Marc Lasgouttes wrote: > Juergen, I'll let you be judge whether this would make sense to have > in lyx.
It does make sense, since this is the most flexible letter class I know, it is well documented and the old scrlettr class is not supported anymore. Nonetheless I'd propose to keep the old scrlettr class and provide the scrlttr2 class as an alternative (also because it is not backwards compatible). I have updated the layout file wrt your suggestions (thanks!) and some missing bits. There is only one ugly hack, but I don't know a better solution (the \begin{letter}...\end{letter} environment). Attached is the updated layout file, a template and a diff against LaTeXConfig.lyx.in (1.4cvs). > Also, you may want to update the scr* classes to latest > version of koma-script. Yes, later probably. Jürgen.
#% Do not delete the line below; configure depends on this # \DeclareLaTeXClass[scrlttr2]{letter (koma-script v.2)} # KOMA scrlettr2 textclass definition file. # Juergen Spitzmueller <[EMAIL PROTECTED]>, 2003/2/17. # Standard style definition Style Standard LatexName dummy ParSep 0.4 AlignPossible Block, Left, Right, Center End Input stdlists.inc # Modify Description Style Description LabelFont Family Sans EndFont End # Delete List NoStyle List # Labeling style definition Style Labeling Margin Manual LatexType List_Environment LatexName labeling NextNoindent 1 LabelSep xxx ParSkip 0.4 TopSep 0.7 BottomSep 0.7 ParSep 0.5 Align Block AlignPossible Block, Left LabelType Manual LabelString 00.00.0000 End Input stdlayouts.inc # Delete Caption NoStyle Caption # Letter style definition Style Address LatexType Command LatexName begin LatexParam {letter} #Ugly hack! Preamble \AtEndDocument{\end{letter}} EndPreamble KeepEmpty 1 LeftMargin xxxxxxxxxxxx::xx LabelSep xx TopSep 1.5 BottomSep 1.5 ParSep 1.5 Align Left AlignPossible Left LabelType Static LabelString "Address:" LabelFont Series Bold Shape Italic Size Small Color Blue EndFont End # NextLetter style definition # Start new letter Style NextAddress LatexType Command LatexName end{letter}\begin{letter} KeepEmpty 1 LeftMargin xxxxxxxxxxxx::xx LabelSep xx TopSep 1.5 BottomSep 1.5 ParSep 1.5 Align Left AlignPossible Left LabelType Static LabelString "Next Address:" LabelFont Series Bold Shape Italic Size Small Color Blue EndFont End # Opening style definition Style Opening LatexType Command LatexName opening KeepEmpty 0 LeftMargin xxxxxxxxxxxx::xx LabelSep xx TopSep 0.4 BottomSep 0.4 ParSep 0.4 Align Left AlignPossible Left LabelType Static LabelString "Opening:" LabelFont Series Bold Shape Italic Color Magenta EndFont End # Closing style definition Style Closing CopyStyle Opening LatexType Command LatexName closing LabelString "Closing:" End # PS style definition Style PS CopyStyle Opening LatexType Command LatexName ps LabelString "Post Scriptum:" End # CC style definition Style CC CopyStyle Opening LatexType Command LatexName cc LabelString "cc:" End # Encl style definition Style Encl CopyStyle Opening LatexName encl LabelString "encl:" End # Name style definition Style Name LatexType Command LatexName setkomavar LatexParam {fromname} KeepEmpty 1 LeftMargin xxxxxxxxxxxx::xx LabelSep xx TopSep 0.4 BottomSep 0.4 ParSep 0.4 Align Left AlignPossible Left LabelType Static LabelString "Sender Name:" LabelFont Series Bold Shape Italic Color Blue EndFont End # Signature style definition Style Signature CopyStyle Name LatexName setkomavar LatexParam {signature} LabelString "Signature:" End # Address style definition Style SenderAddress CopyStyle Name LatexName setkomavar LatexParam {fromaddress} LabelString "Sender Address:" End # Telephone style definition Style Telephone CopyStyle Name LatexName setkomavar LatexParam {fromphone} LabelString "Sender Phone:" End # Fax style definition Style Fax CopyStyle Name LatexName setkomavar LatexParam {fromfax} LabelString "Sender Fax:" End # E-Mail style definition Style E-Mail CopyStyle Name LatexName setkomavar LatexParam {fromemail} LabelString "Sender E-Mail:" End # URL style definition Style URL CopyStyle Name LatexName setkomavar LatexParam {fromurl} LabelString "Sender URL:" End # Bank style definition Style Bank CopyStyle Name LatexName setkomavar LatexParam {frombank} LabelString "Bank:" End # Logo style definition Style Logo CopyStyle Name LatexName setkomavar LatexParam {fromlogo} LabelString "Logo:" End # Place style definition Style Place CopyStyle Name LatexName setkomavar LatexParam {place} LabelString "Place:" End # Date style definition Style Date CopyStyle Name LatexName setkomavar LatexParam {date} LabelString "Date:" End # Backaddress style definition Style Backaddress CopyStyle Name LatexName setkomavar LatexParam {backaddress} LabelString "Backaddress:" End # Specialmail style definition Style Specialmail CopyStyle Name LatexName setkomavar LatexParam {specialmail} LabelString "Specialmail:" End # Location style definition Style Location CopyStyle Name LatexName setkomavar LatexParam {location} LabelString "Location:" End # Title style definition Style Title CopyStyle Name LatexName setkomavar LatexParam {title} LabelString "Title:" End # Subject style definition Style Subject CopyStyle Name LatexName setkomavar LatexParam {subject} LabelString "Subject:" End # Yourref style definition Style Yourref CopyStyle Name LatexName setkomavar LatexParam {yourref} LabelString "Your ref.:" LabelFont Family Sans Series Medium Shape Up Size Small Color None EndFont End # Yourmail style definition Style Yourmail CopyStyle Yourref LatexName setkomavar LatexParam {yourmail} LabelString "Your letter of:" End # Myref style definition Style Myref CopyStyle Yourref LatexName setkomavar LatexParam {myref} LabelString "Our ref.:" End # Customer style definition Style Customer CopyStyle Yourref LatexName setkomavar LatexParam {customer} LabelString "Customer no.:" End # Invoice style definition Style Invoice CopyStyle Yourref LatexName setkomavar LatexParam {invoice} LabelString "Invoice no.:" End
Index: lib/ChangeLog =================================================================== RCS file: /cvs/lyx/lyx-devel/lib/ChangeLog,v retrieving revision 1.379 diff -u -r1.379 ChangeLog --- lib/ChangeLog 2003/02/14 21:39:31 1.379 +++ lib/ChangeLog 2003/02/17 10:10:38 @@ -1,3 +1,9 @@ +2003-02-17 Juergen Spitzmueller <[EMAIL PROTECTED]> + + * templates/koma-letter2.lyx: + * layouts/scrlttr2.layout: new KOMA letter class + * doc/LaTeXConfig.lyx.in: document this. + 2003-02-14 Jean-Marc Lasgouttes <[EMAIL PROTECTED]> * chkconfig.ltx: information is in LaTeXConfig.lyx, not Index: lib/doc/LaTeXConfig.lyx.in =================================================================== RCS file: /cvs/lyx/lyx-devel/lib/doc/LaTeXConfig.lyx.in,v retrieving revision 1.28 diff -u -r1.28 LaTeXConfig.lyx.in --- lib/doc/LaTeXConfig.lyx.in 2003/02/13 17:49:07 1.28 +++ lib/doc/LaTeXConfig.lyx.in 2003/02/17 10:10:40 @@ -1013,6 +1013,11 @@ \layout Subsection Koma-Script +\begin_inset LatexCommand \label{sub:Koma-Script} + +\end_inset + + \layout Description Found: scrartcl: @chk_scrartcl@, @@ -1047,6 +1052,39 @@ . They have been changed to look somewhat better and be more adapted to european typesetting standards. +\layout Subsection + +Koma-Script letter +\layout Standard + +Found: scrlettr: @chk_scrlettr@, +\family sans +scr +\family default +lttr2: @chk_scrlttr2@ +\layout Description + +CTAN: +\family typewriter +macros/latex/contrib/supported/koma-script/ +\layout Description + +Notes: These letter classes are bundled with the Koma-Script classes (see + +\begin_inset LatexCommand \ref{sub:Koma-Script} + +\end_inset + +). + LyX provides layouts for both the old (now unsupported) +\family sans +scrlettr +\family default + class and the new, much more flexible +\family sans +scrlttr2 +\family default + class, which was introduced with Koma-Script version 2.9 (released 2002-06-21). \layout Subsection latex8
#LyX 1.3 created this file. For more info see http://www.lyx.org/ \lyxformat 221 \textclass scrlettr2 \begin_preamble %%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Here you can modify the layout of your letter %% Have a look at the KOMA script documentation %% for details. Most commands are commented out %% here (i.e. we use default settings) %%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Load an *.lco style file (see KOMA documentation) \LoadLetterOption{DIN}% %% THE CLASS OPTIONS %% Remove preceeding '%' to uncomment an item \KOMAoptions{% %,headsepline=true% separate the header with a line on page >1 %,footsepline=true% separate the footer with a line on page >1 %pagenumber=botcenter% position of the page number (see docu) %,parskip=false% Use indent instead of skip (more options cf. docu) ,fromalign=center% alignment of the address ,fromrule=aftername% separate the address with a line? ,fromphone=true% print sender phone number %,fromfax=true% print sender fax number ,fromemail=true% print sender e-mail address ,fromurl=true% print sender URL %,fromlogo=true% print a logo (position depends on fromalign) %,addrfield=false% print an address field? %,backaddress=false% print the back address? %,subject=afteropening,titled% alternative subject layout and position %,locfield=narrow% width of the (extra) location field %,foldmarks=false% print foldmarks? %,numericaldate=true% date layout %,refline=wide% layout of the refline } %% Customize Separators %\setkomavar{placeseparator}{ -- } \setkomavar{backaddressseparator}{ $\cdot$ } %\setkomavar{emailseparator}{ --> } %\setkomavar{enclseparator}{ > } %\setkomavar{faxseparator}{ --> } %\setkomavar{phoneseparator}{ --> } %\setkomavar{subjectseparator}{ >>> } %% Customize fonts %% Use LaTeX's standard font commands %% Modify with \setkomafont or \addtokomafont %% (see KOMA documentation) \setkomafont{backaddress}{\rmfamily} %\setkomafont{descriptionlabel}{} \setkomafont{fromaddress}{\small} \setkomafont{fromname}{\scshape} %\setkomafont{pagefoot}{} %\setkomafont{pagehead}{} %\setkomafont{pagenumber}{} %\setkomafont{subject}{} %\setkomafont{title}{} \end_preamble \language english \inputencoding auto \fontscheme palatino \graphics default \paperfontsize 11 \spacing other 1.15 \papersize Default \paperpackage a4 \use_geometry 0 \use_amsmath 0 \use_natbib 0 \use_numerical_citations 0 \paperorientation portrait \secnumdepth 3 \tocdepth 3 \paragraph_separation indent \defskip medskip \quotes_language danish \quotes_times 2 \papercolumns 1 \papersides 1 \paperpagestyle default \layout Name The LyX Developers Team \layout SenderAddress 140 Map Road \newline CVS City \layout Telephone 0011/222 \begin_inset ERT status Collapsed \layout Standard \backslash , \end_inset 333 \layout E-Mail [EMAIL PROTECTED] \layout URL www.lyx.org \layout Backaddress The LyX Developers Team \newline 140 Map Road \newline CVS City \layout Signature The LyX Team \layout Subject New KOMA letter layout \layout Place The Internet \layout Date \begin_inset ERT status Collapsed \layout Standard \backslash today \end_inset \layout Address Mr X. Ample \newline 666 Sesame Street \newline 12345 Nowhere \layout Opening Dear Mr. Ample, \layout Standard This template illustrates the use of the new scrlttr2 class (introduced with KOMA-script v. 2.9). This letter class is very flexible. Have a look at \family sans Layout\SpecialChar \menuseparator Document\SpecialChar \menuseparator Preamble \family default for the most common parameters. Please consult the KOMA Script documentation \begin_inset Foot collapsed true \layout Standard \begin_inset LatexCommand \url{http://www.ctan.org/tex-archive/macros/latex/contrib/supported/koma-script/scrguien.pdf} \end_inset \end_inset for a detailed description. \layout Closing Have fun with it, \layout PS P. \begin_inset ERT status Collapsed \layout Standard \backslash , \end_inset S.: The blue colored items have to be before the address, the magenta colored after it. \layout CC The LyX Users \the_end