ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Automating a letter module style
@ 2002-11-21  0:00 Nigel King
  2002-11-21 14:40 ` John Culleton
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Nigel King @ 2002-11-21  0:00 UTC (permalink / 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

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2002-11-29 17:12 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-21  0:00 Automating a letter module style Nigel King
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

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).