From: Nigel King <king@dircon.co.uk>
Subject: Automating a letter module style
Date: Thu, 21 Nov 2002 00:00:51 +0000 [thread overview]
Message-ID: <BA01D2B3.B2D5%king@dircon.co.uk> (raw)
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
next reply other threads:[~2002-11-21 0:00 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-21 0:00 Nigel King [this message]
2002-11-21 14:40 ` John Culleton
2002-11-21 15:23 ` Bruce D'Arcus
2002-11-22 22:31 ` Hans Hagen
2002-11-22 23:40 ` Bruce D'Arcus
2002-11-25 16:58 ` Hans Hagen
2002-11-25 17:10 ` Bruce D'Arcus
2002-11-25 17:23 ` Hans Hagen
2002-11-29 11:36 ` metafun and \input graph Hartmut Henkel
2002-11-29 12:53 ` Nigel King
2002-11-29 12:58 ` Hans Hagen
2002-11-29 16:55 ` Hartmut Henkel
2002-11-29 17:12 ` Hans Hagen
2002-11-22 23:14 ` Automating a letter module style Hans Hagen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BA01D2B3.B2D5%king@dircon.co.uk \
--to=king@dircon.co.uk \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).