diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/third/letter/interface')
3 files changed, 943 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/context/third/letter/interface/default.nli b/Master/texmf-dist/tex/context/third/letter/interface/default.nli new file mode 100644 index 00000000000..f11f1700564 --- /dev/null +++ b/Master/texmf-dist/tex/context/third/letter/interface/default.nli @@ -0,0 +1,634 @@ +%D \module
+%D [ file=default,
+%D version=2008.07.08,
+%D title=\CONTEXT\ Letter Interface,
+%D subtitle=Default Interface,
+%D author=Wolfgang Schuster,
+%D date=\currentdate,
+%D copyright=Public Domain]
+
+%M \loadsetups[letter.xml]
+
+%D \subject{Constants and Variables}
+
+\unprotect
+
+%D I define a few additional constants and variables, I will move them
+%D to the base some time.
+
+\startconstants all
+
+ opening: opening
+ content: content
+ closing: closing
+ signature: signature
+ dispatch: dispatch
+ appendices: appendices
+ fromaddress: fromaddress
+ frombank: frombank
+ frommail: frommail
+ fromfax: fromfax
+ fromlogo: fromlogo
+ fromname: fromname
+ fromphone: fromphone
+ fromurl: fromurl
+ toname: toname
+ toaddress: toaddress
+ enclosure: enclosure
+ copy: copy
+ postscript: postscript
+ attention: attention
+ distribution: distribution
+ salutation: salutation
+ addressee: addressee
+\stopconstants
+
+\startvariables all
+
+ e: e
+ data: data
+ sender: sender
+ dispatch: dispatch
+ enclosure: enclosure
+ copy: copy
+ nobreak: nobreak
+ memo: memo
+ addressee: addressee
+\stopvariables
+
+%D We have at the moment only the values from the core module, I use the settings
+%D from the dinb file as default settings, you could replace them in your own
+%D document but I won't use another letterstyle for this interface.
+%D
+%D The labels are stored in a common file, you could use them in your own interface
+%D but you have to live with my names.
+
+\useletterstyle [dinb] % layout
+\useletterextension[label] % labels
+
+%D \subject{Reference line}
+%D
+%D Dimen value to save the height of the reference line.
+
+\newdimen\letter!height!reference
+
+%D We come now to the new macros defined in this file, they are meant to place the
+%D information about date, phone number and more information. You could select on of
+%D the alternatives with \type{\setupletter[alternative=...]}.
+%D
+%D I define here only what I need myself but you're free to define your own
+%D alternatives but try to avoid to use the same names as I do. You could also send
+%D me your alternatives and I will include them.
+%D
+%D This is the first alternative a, it use the values from the style file without any
+%D change, this is the normal layout for a DIN letter.
+
+\long\def\doformatreferencelista#1%
+ {\def\\{\egroup\hbox\bgroup}%
+ \setupinterlinespace\hbox\bgroup#1\egroup\par}
+
+\long\def\formatreferencelista#1%
+ {\bgroup
+ \convertargument#1\to\ascii
+ \vbox
+ {\vbox{\doattributes{\????ld\ascii}\c!titlestyle\c!titlecolor
+ {\doformatreferencelista{\labeltext{\v!letter:\ascii}}}}
+ \vtop{\doattributes{\????ld\ascii}\c!textstyle\c!textcolor
+ {\doformatreferencelista{\lettervalue\ascii}}}}%
+ \egroup
+ \hfill}
+
+\setvalue{\v!letter:\v!reference:\v!a}%
+ {\setbox\scratchbox\hbox\!!to\hsize
+ {\getcommacommandsize[\@@@@ldlist]% \@@@@ldreference?
+ \ifnum\commalistsize<\plustwo\hfill\fi
+ \processcommacommand[\@@@@ldlist]\formatreferencelista\unskip}%
+ \global\letter!height!reference\dimexpr\ht\scratchbox+\dp\scratchbox\relax
+ \box\scratchbox}
+
+\startsetups[letter:reference:\v!a]
+
+\setupletterstyle
+ [\v!reference]
+ [\c!hoffset=\backspace,
+ \c!voffset=\dimexpr\letterstylevalue\v!address\c!voffset+\letterstylevalue\v!address\c!height+\plusthree\c!mm\relax,
+ \c!width=\textwidth]
+
+\setupletterstyle
+ [\v!firstpage]
+ [\c!topspace=\dimexpr\letterstylevalue\v!reference\c!voffset+\letter!height!reference+\plustwo\lineheight\relax]
+
+\stopsetups
+
+%D This is the alternative b, you could use it if you want to place the information
+%D in a infoblock not just a simple line, it is also better suited if you want to
+%D place more infomration.
+
+\long\def\formatreferencelistb#1%
+ {\bgroup
+ \doifelse{#1}\v!line
+ {\blank[\v!line]}
+ {\hbox
+ {\doattributes{\????ld#1}\c!titlestyle\c!titlecolor
+ {\labeltext{\v!letter:#1}\lettervalue{#1\c!separator}}%
+ \doattributes{\????ld#1}\c!textstyle\c!textcolor
+ {\lettervalue{#1}}}}%
+ \egroup}
+
+\setvalue{\v!letter:\v!reference:\v!b}%
+ {\vtop % why not \vbox?
+ {\processcommacommand[\@@@@ldlist]\formatreferencelistb}}
+
+\startsetups[letter:reference:\v!b]
+
+\setupletterstyle
+ [\v!reference]
+ [\v!layer]
+ [\c!hoffset=125.7mm,
+ \c!voffset=\letterstylevalue\v!address\c!voffset]
+
+\setupletterstyle
+ [\v!reference]
+ [\v!frame]
+ [\c!width=\dimexpr\paperwidth-\letterstylevalue{\v!reference\v!layer}\c!hoffset-\cutspace\relax,
+ \c!height=\v!fit]
+
+\stopsetups
+
+%D The third alternative c could used, if you want to place just a single line
+%D with text and nothing more, like your place and the date. You need only the
+%D following two lines in your document.
+%D
+%D \starttyping
+%D \setupletter[alternative=c,list=reference]
+%D \setupletter[reference=\rightaligned{Place, \currentdate}]
+%D \stoptyping
+
+\long\def\formatreferencelistc#1%
+ {\bgroup
+ \convertargument#1\to\ascii
+ \doattributes{\????ld\ascii}\c!textstyle\c!textcolor
+ {\lettervalue\ascii}%
+ \egroup}
+
+\setvalue{\v!letter:\v!reference:\v!c}%
+ {\hbox\!!to\hsize
+ {\processcommacommand[\@@@@ldlist]\formatreferencelistc}}
+
+\startsetups[letter:reference:\v!c]
+
+\setups[letter:reference:\v!a]
+
+\stopsetups
+
+%D Alternative d, text is placed in a block like alternative bit the text
+%D is put in a table.
+
+\long\def\doformatreferencelistd#1%
+ {\doifelse{#1}\v!line
+ {\NC\NC\NC\NR} % ugly but working
+ {\NC \doattributes{\????ld#1}\c!titlestyle\c!titlecolor
+ {\labeltext{\v!letter:#1}\lettervalue{#1\c!separator}}%
+ \NC\doattributes{\????ld#1}\c!textstyle\c!textcolor{\lettervalue{#1}}
+ \NC\NR}}
+
+\def\formatreferencelistd#1%
+ {\appendtoks\doformatreferencelistd{#1}\to\scratchtoks}
+
+\setvalue{\v!letter:\v!reference:\v!d}%
+ {\vtop % why not \vbox?
+ {\scratchtoks\emptytoks
+ \processcommacommand[\@@@@ldlist]\formatreferencelistd
+ \setuptabulate[\c!before=,\c!after=]%
+ \starttabulate[|l|l|]
+ \the\scratchtoks
+ \stoptabulate}}
+
+\startsetups[letter:reference:\v!d]
+
+\setupletterstyle
+ [\v!reference]
+ [\v!layer]
+ [\c!hoffset=125.7mm,
+ \c!voffset=\letterstylevalue\v!address\c!voffset]
+
+\setupletterstyle
+ [\v!reference]
+ [\v!frame]
+ [\c!width=\dimexpr\paperwidth-\letterstylevalue{\v!reference\v!layer}\c!hoffset-\cutspace\relax,
+ \c!height=\v!fit]
+
+\stopsetups
+
+%D Alternative e, nearly the same as a but you could control the width of the
+%D fields with the width key for \tex{setupletter}.
+
+\long\def\doformatreferenceliste#1%
+ {\def\\{\egroup\hbox\bgroup}%
+ \setupinterlinespace\hbox\bgroup#1\egroup\par}
+
+\long\def\formatreferenceliste#1%
+ {\bgroup
+ \convertargument#1\to\ascii
+ \doifelselettervalue{\ascii\c!width}
+ {\hbox\!!to\lettervalue{\ascii\c!width}}
+ {\hbox}%
+ {\vbox
+ {\vbox{\doattributes{\????ld\ascii}\c!titlestyle\c!titlecolor
+ {\doformatreferenceliste{\labeltext{\v!letter:\ascii}}}}
+ \vtop{\doattributes{\????ld\ascii}\c!textstyle\c!textcolor
+ {\doformatreferenceliste{\lettervalue\ascii}}}}}%
+ \egroup}
+
+\setvalue{\v!letter:\v!reference:\v!e}%
+ {\hbox\!!to\hsize
+ {\processcommacommand[\@@@@ldlist]\formatreferenceliste\hss}}
+
+\startsetups[letter:reference:\v!e]
+
+\setups[letter:reference:\v!a]
+
+\stopsetups
+
+%D The alternative \mono{none} could be used to disable the reference.
+%D
+%D The advantage is to change only the list alternative to nothing, another
+%D method to get this result to use alternative c and remove all values from
+%D the reference but the none key is better.
+
+\resetvalue{\v!letter:\v!reference:\v!none}
+
+\startsetups[letter:reference:\v!none]
+
+ % Use the topspace value from the style
+
+\stopsetups
+
+%D \subject{Setup commands}
+%D
+%D \macros
+%D {setupletter,setlettervalue}
+%D
+%D The values for the letter field is set eitheir either with \tex{setupletter}
+%D or with \tex{setlettervalue}, the first commands allows you to input the data
+%D in a key-val list while the second is only able to accept a single value.
+%D
+%D The first definition for \tex{setupletter} was defined in \filename{t-letter.tex}
+%D and used till \date[d=20,m=4,y=2008] but I decided to replace it by a simpler
+%D method to avoid a few lines of code in my letter and the letter versions from
+%D \date[d=21,m=4,y=2008] will use the new user interface. The old definition from
+%D \filename{t-letter.tex} is now oveloaded in will eventually disappear.
+%D
+%D The second command to set \tex{setlettervalue} was developed as a alternative
+%D method to set values for the letter, I implemnted the command at the same time
+%D as I changed the user interface.
+%D
+%D Untill the old definition for \tex{setupletter} remains in \filename{t-letter.tex}
+%D I have to redefine also \tex{lettervalue}, \tex{doiflettervalue} and
+%D \tex{doifelselettervalue} because the old and new definitions differe in the
+%D number of arguments but the new definition will move to the core file as soon
+%D as I replace \tex{setupletter} in the core.
+
+%D \starttyping
+%D \def\setupletter
+%D {\dodoubleempty\dosetupletter}
+%D
+%D \def\dosetupletter[#1][#2]%
+%D {\ifsecondargument
+%D \dodosetupletter[#1][#2]%
+%D \else
+%D \dodosetupletter[#1][]%
+%D \fi}
+%D
+%D \def\dodosetupletter[#1][#2]%
+%D {\doifelsenothing{#2}
+%D {\getparameters[\????ld][#1]}
+%D {\def\dododosetupletter##1%
+%D {\getparameters[\????ld##1][#2]}%
+%D \processcommalist[#1]\dododosetupletter}}
+%D
+%D \def\lettervalue#1%
+%D {\csname\????ld#1\endcsname}
+%D
+%D \def\doiflettervalue#1%
+%D {\doiftextelse{\lettervalue{#1}}
+%D \firstofoneargument
+%D \gobbleoneargument}
+%D
+%D \def\doifelselettervalue#1%
+%D {\doiftextelse{\lettervalue{#1}}
+%D \firstoftwoarguments
+%D \secondoftwoarguments}
+%D
+%D \definecomplexorsimple\setlettervalue
+%D
+%D \def\complexsetlettervalue[#1]#2%
+%D {\setvalue{\????ld#1}{#2}}
+%D
+%D \def\simplesetlettervalue#1#2%
+%D {\setvalue{\????ld#1}{#2}}
+%D \stoptyping
+
+%D \subject{Letter environment}
+%D
+%D \macros
+%D {startletter}
+%D
+%D The main macro in this file, it is used to write the letter content.
+%D It is also possible to set the address and a few other values like
+%D the opening and closing with the optional argument, the values are
+%D local in this case and not global like the values you could set with
+%D \tex{setupletter}.
+%D
+%D \showsetup{startletter}
+
+\def\startletter
+ {\bgroup\dodoubleempty\dostartletter}
+
+\def\dostartletter[#1][#2]%
+ {\ifsecondargument
+ \setupletter[#1]%
+ \doifundefinedelse{\????ld\????ld#2}
+ {\setvalue{\????ld\c!toaddress}{#2}}
+ {\setvalue{\????ld\c!toaddress}{\getvalue{\????ld\????ld#2}}}%
+ \else\iffirstargument
+ \doifassignmentelse{#1}
+ {\setupletter[#1]}
+ {\doifundefinedelse{\????ld\????ld#1}
+ {\setvalue{\????ld\c!toaddress}{#1}}
+ {\setvalue{\????ld\c!toaddress}{\getvalue{\????ld\????ld#1}}}}%
+ \fi\fi
+ \def\stopletter
+ {\setups[letter:place]\egroup
+ \setupsubpagenumber[\c!state=\@@@@lsoptionstate]}%
+ \dostartbuffer[lettercontent][startletter][stopletter]}
+
+%D Patched version of the \tex{flushbufferline} macro for \MKII,
+%D the changes are definition as long and removing of \tex{string}
+%D in the argument of the last write block.
+
+\long\def\flushbufferline#1%
+ {\iftmpblockstarted
+ \ifsegmentatebuffer
+ \ifemptybufferline
+ \immediate\write\tmpblocks{\string\stopbufferparagraph }%
+ \immediate\write\tmpblocks{\string\startbufferparagraph}%
+ \else
+ \immediate\write\tmpblocks{#1}%
+ \fi
+ \else
+ \immediate\write\tmpblocks{#1}%
+ \fi
+ \else
+ \doifsomething{#1}
+ {\tmpblockstartedtrue
+ \immediate\write\tmpblocks{#1}}%
+ \fi}
+
+%D \macros
+%D {startlettercontent}
+%D
+%D The letter content is saved in the value content, although I could
+%D place it in the corresponding I prefer this solution because you could
+%D now use it in your own macros and redefine the content setups to your
+%D own wishes.
+
+\setupletter
+ [\c!content={\getbuffer[lettercontent]}]
+
+\def\startlettercontent
+ {\dostartbuffer[lettercontent][startlettercontent][stoplettercontent]}
+
+%D After the definition of all macros I could now put the content
+%D in the corresponding setups, this is only important if you want
+%D to define your own layout for header, address etc.
+
+\startsetups[letter:head]
+\let\\\endgraf
+\lettervalue\c!fromname
+\doiflettervalue\c!fromname\endgraf
+\lettervalue\c!fromaddress
+\stopsetups
+
+%D \subject{Addressee field}
+%D
+%D The address field is separated into two different fields.
+%D The upper field is meant for dispatch information, the official height
+%D in germany is 3 lines but this would lead to different heights dependent
+%D of the font size and the fonts own height. The lower field contains the
+%D name and address of the receiver and has a height of 6 lines in germany.
+%D This value will lead to the same problem as the upper field, because the
+%D whole address field has a fixed height and both field should fit into
+%D this space. I solved this problem by assinging the upper field 1/3 of the
+%D address height and the lower field 2/3 of the address height.
+%D
+%D If you hace problem to put all information in the limited space you could
+%D try to reduce the font size or reduce the interlinespace in the field.
+
+\presetlocalframed[\????ls\v!dispatch]
+\presetlocalframed[\????ls\v!addressee]
+
+\startsetups[letter:address]
+\let\\\endgraf
+\offinterlineskip\vskip-\lineheight
+\doif\@@@@lsoptiondispatch \v!yes{\setups[letter:place:dispatch]}
+\doif\@@@@lsoptionaddressee\v!yes{\setups[letter:place:addressee]}
+\stopsetups
+
+\startsetups[letter:place:dispatch]
+
+ \localframed
+ [\????ls\v!dispatch]
+ {\doadaptleftskip {\letterstylevalue\v!addressee\c!leftmargin}%
+ \doadaptrightskip{\letterstylevalue\v!addressee\c!rightmargin}%
+ \doattributes{\????ls\v!addressee}\c!style\c!color{\setups[letter:address:dispatch]}}
+
+\stopsetups
+
+\startsetups[letter:place:addressee]
+
+ \localframed
+ [\????ls\v!addressee]
+ {\doadaptleftskip {\letterstylevalue\v!addressee\c!leftmargin}%
+ \doadaptrightskip{\letterstylevalue\v!addressee\c!rightmargin}%
+ \doattributes{\????ls\v!addressee}\c!style\c!color{\setups[letter:address:content]}}
+
+\stopsetups
+
+\startsetups[letter:address:dispatch]
+\lettervalue\c!dispatch
+\stopsetups
+
+\startsetups[letter:address:content]
+\lettervalue\c!toname
+\doiflettervalue\c!toname\endgraf
+\lettervalue\c!toaddress
+\stopsetups
+
+%D The following setups shouldn't be changed ar you will loose information
+%D in the output.
+%D
+%D The reference line is choosen with the alternative key or if you set
+%D a not defined alternative the definition a is choosen.
+
+\startsetups[letter:reference]
+\executeifdefined{\v!letter:\v!reference:\@@@@ldalternative}{\getvalue{\v!letter:\v!reference:\v!a}}
+\stopsetups
+
+\startsetups[letter:title]
+\doifelselettervalue\c!title
+ {\lettervalue\c!title}
+ {\doiflettervalue\c!attention
+ {\labeltext{\v!letter:\c!attention}\lettervalue\c!attention}}
+\stopsetups
+
+\startsetups[letter:subject]
+\labeltext{\v!letter:\c!subject}\lettervalue\c!subject
+\stopsetups
+
+\startsetups[letter:opening]
+\doifelselettervalue\c!opening
+ {\lettervalue\c!opening}
+ {\doiflettervalue\c!salutation
+ {\lettervalue\c!salutation}}
+\stopsetups
+
+\startsetups[letter:content]
+\lettervalue\c!content
+\stopsetups
+
+%D \subject{Closing and appendices}
+%D
+%D It is possible to attach a signature to the closing command, before the signature
+%D a skip is inserted but only if the the signature key has a value. The height of the
+%D closing environment itself has a height of 4 lines to provide a free space for your
+%D own handwritten signature and to have a little bit space between the closing text
+%D and the appendices.
+
+\setvalue{\v!letter:\v!closing:\v!a}%
+ {\lettervalue\c!closing
+ \doiflettervalue\c!signature{\letterstylevalue\v!closing\c!inbetween}%
+ \lettervalue\c!signature}
+
+\startsetups[letter:closing]
+\let\\\crlf
+\executeifdefined{\v!letter:\v!closing:\@@@@lsclosingalternative}{\getvalue{\v!letter:\v!closing:\v!a}}
+\stopsetups
+
+\startsetups[letter:appendices]
+\let\\\crlf
+\doflushletterdescription
+\stopsetups
+
+\dodefineletterdescription[\v!enclosure]
+
+\startsetups[letter:enclosure]
+\processaction
+ [\lettervalue\c!enclosure]
+ [ \v!empty=>\vrule\!!height\zeropoint\!!height\zeropoint\!!width\hsize\relax\ifvmode\nowhitespace\fi,
+ \s!unknown=>\lettervalue\c!enclosure]
+\stopsetups
+
+\dodefineletterdescription[\v!copy]
+
+\startsetups[letter:copy]
+\processaction
+ [\lettervalue\c!copy]
+ [ \v!empty=>\vrule\!!height\zeropoint\!!height\zeropoint\!!width\hsize\relax\ifvmode\nowhitespace\fi,
+ \s!unknown=>\lettervalue\c!copy]
+\stopsetups
+
+\dodefineletterdescription[\v!postscript]
+
+\startsetups[letter:postscript]
+\processaction
+ [\lettervalue\c!postscript]
+ [ \v!empty=>\vrule\!!height\zeropoint\!!height\zeropoint\!!width\hsize\relax\ifvmode\nowhitespace\fi,
+ \s!unknown=>\lettervalue\c!postscript]
+\stopsetups
+
+\setvalue{\v!letter:\v!backaddress:\v!yes}%
+ {\lettervalue\c!fromname
+ \doiflettervalue\c!fromaddress\\
+ \lettervalue\c!fromaddress}
+
+\setvalue{\v!letter:\v!backaddress:\v!auto}%
+ {\lettervalue\c!fromname
+ \doiflettervalue\c!fromaddress\\
+ \lettervalue\c!fromaddress}
+
+\resetvalue{\v!letter:\v!backaddress:\v!no}
+
+\setvalue{\v!letter:\v!backaddress:\s!unknown}%
+ {\doifelselettervalue\c!backaddress
+ {\lettervalue\c!backaddress}
+ {\lettervalue\c!fromname
+ \doiflettervalue\c!fromaddress\\
+ \lettervalue\c!fromaddress}}
+
+\startsetups[letter:backaddress]
+\def\\{\lettervalue{\c!backaddress\c!separator}}
+\executeifdefined{\v!letter:\v!backaddress:\@@@@ldbackaddress}{\getvalue{\v!letter:\v!backaddress:\s!unknown}}
+\stopsetups
+
+%D To prevent a pagebreak between the last line of the text and
+%D the siganture a nonbreakable vertical space is necessary.
+%D The vertical space is inserted in the style file with the normal
+%D before and after commands where we control the distance between
+%D the elements.
+
+\defineblankmethod [\v!nobreak] {\penalty\plustenthousand}
+
+%D \subject{Additional settings}
+%D
+%D I set alternative a as default value for alternative, the only content
+%D is the date with a label. f you dont want a label choose alternative c
+%D or change the label.
+
+\startsetups[letter:optimize]
+
+ \setbox\scratchbox\hbox % trial typesetting to get the heigth of the reference line
+ {\executeifdefined{\v!letter:\v!reference:\@@@@ldalternative}{\getvalue{\v!letter:\v!reference:\v!a}}}
+
+ \setups[letter:reference:\@@@@ldalternative]
+
+\stopsetups
+
+\setupletter
+ [\c!alternative=\v!a,
+ \c!backaddress=\v!yes,
+ \c!list=\v!date,
+ \c!date=\currentdate,
+ \c!width=\zeropoint,
+ \c!backaddress\c!separator=\textcomma\space]
+
+\setupletterstyle
+ [\v!option]
+ [\c!dispatch=\v!yes,
+ \c!addressee=\v!yes]
+
+\setupletterstyle
+ [\v!dispatch,\v!addressee]
+ [\c!align=\v!right,
+ \c!width=\hsize,
+ \c!leftmargin=\zeropoint,
+ \c!rightmargin=\zeropoint,
+ \c!offset=\zeropoint,
+ \c!frame=\v!off]
+
+\setupletterstyle
+ [\v!dispatch]
+ [\c!location=\v!bottom,
+ \c!height=\dimexpr(\vsize/9)*3\relax]
+
+\setupletterstyle
+ [\v!addressee]
+ [\c!location=\v!top,
+ \c!height=\dimexpr(\vsize/9)*6\relax]
+
+\setupletterstyle
+ [\v!closing]
+ [\c!after={\blank[\v!line]},
+ \c!inbetween={\blank[\v!nobreak,2*\v!line]}]
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/third/letter/interface/knuth.nli b/Master/texmf-dist/tex/context/third/letter/interface/knuth.nli new file mode 100644 index 00000000000..1ecddf56683 --- /dev/null +++ b/Master/texmf-dist/tex/context/third/letter/interface/knuth.nli @@ -0,0 +1,57 @@ +%D \module
+%D [ file=knuth,
+%D version=2008.04.17,
+%D title=\CONTEXT\ Letter Interface,
+%D subtitle=Lettformat Interface, % Donald Knuth's own letter format
+%D author=Wolfgang Schuster,
+%D date=\currentdate,
+%D copyright=Public Domain]
+
+\unprotect
+
+\useletterstyle[knuth]
+
+\def\address
+ {\startbuffer[address][address][body]}
+
+\def\body
+ {\startbuffer[body][body][closing]}
+
+\def\closing
+ {\def\endletter{\setups[letter:place]}%
+ \startbuffer[closing][closing][endletter]}
+
+\def\annotations
+ {\blank[line]\leftskip=0pt}
+
+\def\ps
+ {\let\par\space
+ \blank[medium]\leftskip=0pt}
+
+\startsetups[letter:reference]
+
+\stopsetups
+
+\startsetups[letter:opening]
+
+ \obeylines
+ \getbuffer[address]
+
+\stopsetups
+
+\startsetups[letter:content]
+
+ \getbuffer[body]
+
+\stopsetups
+
+\startsetups[letter:closing]
+
+ \leftskip=4in
+ \obeylines
+ \def\par{\normalpar\vskip1cm\let\par\normalpar}
+ \getbuffer[closing]
+
+\stopsetups
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/third/letter/interface/pragma.nli b/Master/texmf-dist/tex/context/third/letter/interface/pragma.nli new file mode 100644 index 00000000000..5bb287af0a5 --- /dev/null +++ b/Master/texmf-dist/tex/context/third/letter/interface/pragma.nli @@ -0,0 +1,252 @@ +%D \module +%D [ file=pragma, +%D version=2008.02.17, +%D title=\CONTEXT\ Letter Extension, +%D subtitle=Pragma Style, +%D author=Wolfgang Schuster, +%D date=\currentdate, +%D copyright=Public Domain] + +\unprotect + +\useletterstyle [pragma] % prefined layout +\useletterextension[pragma] % example text + +\setvariables + [letter:head] + [graphic=] + +\setupletterstyle + [\v!option] + [\c!backgroundimage=\getvariable{letter:head}{graphic}] + +\setvariables + [letter:style] + [opening=formal, + closing=informal] + +\setvariables + [letter:data] + [address=, + subject=, + date=, + concerns=, + residence=, + reference=, + opening=, + initials=, + prefix=, + suffix=, + informalname=, + formalname=, + content={\getbuffer[texletter]}, + author=, + greeting=, + appendices=] + +\startsetups[letter:address] + \def\\{\endgraf}\getvariable{letter:data}{address} +\stopsetups + +\def\SomeTableEntry#1% + {\doifsomething{\getvariable{letter:data}{#1}} + {\doiftext{\labeltext{letter:table:#1}} + {\NC\labeltext{letter:table:#1}\EQ\getvariable{letter:data}{#1}\NC\NR}}} + +\startsetups[letter:reference:table] + + \setuptabulate[\c!before=,\c!after=] \blank[synchronize] + + \starttabulate[|l|p|] + \SomeTableEntry {concerns} + \SomeTableEntry {date} + \SomeTableEntry {subject} + \SomeTableEntry {reference} + \stoptabulate + +\stopsetups + +\setvariables + [letter:address] + [line=3, + hoffset=0pt, + width=25em, + noflines=10] + +\setvariables + [letter:reference] + [line=1, + noflines-min=2, + noflines-max=5, + noflines=\getvariable{letter:reference}{noflines-max}] + +\startsetups[letter:before] + + % I overload the predefined value for the address layer + + \setupletterstyle + [\v!address] + [\v!layer] + [\c!line=\getvariable{letter:address}{line}, + \c!hoffset=\dimexpr\backspace-\linewidth-\getvariable{letter:address}{hoffset}\relax, + \c!height=\getvariable{letter:address}{noflines}\lineheight] + + \setupletterstyle + [\v!address] + [\v!frame] + [\c!width=\getvariable{letter:address}{width}] + + \page + + \setupletterstyle + [\v!reference] + [\c!line=\getvariable{letter:reference}{line}, + \c!height=\getvariable{letter:reference}{noflines}\lineheight] + + \doifelsenothing{\getvariable{letter:data}{concerns} + \getvariable{letter:data}{subject}} + {\setupletterstyle[\v!reference][\c!height=\getvariable{letter:reference}{noflines-min}\lineheight]} + {\setupletterstyle[\v!reference][\c!height=\getvariable{letter:reference}{noflines-max}\lineheight]} + +\stopsetups + +\setupletterstyle + [\v!option] + [\c!before={\setups[letter:before]}] + +\startsetups[letter:reference] + + \doifsomething{\getvariable{letter:data}{concerns} + \getvariable{letter:data}{subject}} + {\setups[letter:reference:table]\blank} + + \doifsomething{\getvariable{letter:data}{residence}} + {\noindent + \hbox\!!to\hsize + {\hss + \getvariable{letter:data}{residence},\space + \getvariable{letter:data}{date}}} + +\stopsetups + +\startsetups[letter:opening:unknown] + \labeltext{letter:opening:unknown} +\stopsetups + +\startsetups[letter:opening:informal] + + \doifelsenothing{\getvariable{letter:data}{informalname}} + {\labeltext{letter:opening:unknown}} + {\labeltext{letter:opening:informal}\space + \getvariable{letter:data}{informalname}}, + +\stopsetups + +\startsetups[letter:opening:formal] + + \doifelsenothing{\getvariable{letter:data}{formalname}} + {\labeltext{letter:opening:unknown}} + {\labeltext{letter:opening:formal}\space + \doifsomething{\getvariable{letter:data}{prefix}} + {\getvariable{letter:data}{prefix}\space} + \getvariable{letter:data}{formalname}}, + +\stopsetups + +\startsetups[letter:opening] + \setups[letter:opening:\getvariable{letter:style}{opening}] +\stopsetups + +\def\startlettercontent + {\startbuffer[texletter][startlettercontent][stoplettercontent]} + +\startsetups[letter:content] + \getvariable{letter:data}{content} +\stopsetups + +\startsetups[letter:closing:informal] + + \blank + + \doifelsenothing{\getvariable{letter:data}{greeting}} + {\noindent\labeltext{letter:greeting:informal}} + {\noindent\getvariable{letter:data}{greeting}}, + + \blank + + \noindent\getvariable{letter:data}{author} + +\stopsetups + +\startsetups[letter:closing:formal] + + \blank + + \doifelsenothing{\getvariable{letter:data}{greeting}} + {\noindent\labeltext{letter:greeting:formal}} + {\noindent\getvariable{letter:data}{greeting}}, + + \blank + + \noindent\getvariable{letter:data}{author} + +\stopsetups + +\startsetups[letter:closing] + \setups[letter:closing:\getvariable{letter:style}{closing}] +\stopsetups + +\startsetups[letter:appendices] + \getvariable{letter:data}{appendices} +\stopsetups + +%D Labels + +\setuplabeltext + [nl] + [letter:appendices=bijlage(n) : , + letter:subject=het onderwerp, + letter:opening:formal=Geachte, + letter:opening:informal=Beste, + letter:opening:unknown=LS, + letter:name:unknown=lezer, + letter:greeting:informal=Een vriendelijke groet, + letter:greeting:formal=Hoogachtend] + +\setuplabeltext + [en] + [letter:appendices=appendices : , + letter:subject=the topic, + letter:opening:formal=Dear, + letter:opening:informal=Dear, + letter:opening:unknown=LS, + letter:name:unknown=reader, + letter:greeting:informal=Regards, + letter:greeting:formal=Sincerely yours] + +\setuplabeltext + [de] + [letter:appendices=Anlagen : , + letter:subject=das Kennzeichen, + letter:opening:formal=Sehr Geehrte, + letter:opening:informal=Hallo, + letter:opening:unknown=LS, + letter:name:unknown=Leser, + letter:greeting:informal=Mit freundlichen Gr\uumlaut\ssharp en, + letter:greeting:formal=Hochachtungsvoll] + +\setuplabeltext + [nl] + [letter:table:concerns=betreft, + letter:table:date=datum, + letter:table:subject=kenmerk, + letter:table:reference=referentie] + +\setuplabeltext + [en] + [letter:table:concerns=concerns, + letter:table:date=date, + letter:table:subject=subject, + letter:table:reference=reference] + +\protect \endinput |