I have been using a letter format and gradually improving the macro format
and style each time I use it. It makes a lot of use of backgrounds to set
elements on the page. I would like to improve some other elements.
The target structure of a letter source would be as follows.
\usemodule[lett-01]
\setupletter
[address=...\\...\\..,
signature=Nigel King,
thedate=\currentdate,
......]
\starttext
\opening
Further to your ...... %main letter content
\closing[Yours ...,]
\encl[...]
\cc[...]
\ps[...]
\stoptext
A lot of this works quite well using the following typical "macros" in
u-lett-01.tex typical parts of which are shown below
----------
\unprotect
\def\setupletter{%
\dosingleargument\dosetupletter}
\def\dosetupletter[#1]{%
\getparameters[letter@][#1]}
Some other \defs....
\def\opening{
\definelayer
[letter@layer@toaddress]
\setlayer
[letter@layer@toaddress]
[x=\backspace,y=50mm]
{\framed
[height=37.6mm,
width=89mm,
frame=on,
align={right,lohi},
strut=no,
offset=overlay]
{\getvalue{letter@toaddress}}}
\setupbackgrounds
[page]
[background={letter@layer@toaddress}]
}% end of opening
\protect
-----------
The main problems that I have follow;
1. \usemodule[lett-01] has to be \input u-lett-01 because the definitions
are not recognized properly otherwise. "no macros found", I have not found
any documentation on macros. I had a look at m-chart.tex but it was too long
and complicated to get the simple idea from. Is there another
2. I cannot find a way of defining elements which are effectively in the
running text like \openingline=Dear ..., in the setupletter because
\getvalue{letter@opening} seems not to pick up the value. A similar problem
occurs with closing which has a number of formatting constraints which
deosn't want to be seen in the letter source. The only way I have been able
to achieve the objective has been to use the following type of construct.
In the source letter
\signature[Nigel King]
In the module
\def\signature[#1]{\def\fromsig{#1}}
\def\closing[#1]{\par\framed[width=\textwidth,frame=off]{\rbox{
\blank[2*big] #1 \blank[6*big] \fromsig\par}}}
Any help would be much appreciated.
--
Nigel