From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/9888 Path: main.gmane.org!not-for-mail From: Nigel King Newsgroups: gmane.comp.tex.context Subject: Automating a letter module style Date: Thu, 21 Nov 2002 00:00:51 +0000 Sender: ntg-context-admin@ntg.nl Message-ID: Reply-To: ntg-context@ntg.nl NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1037870804 16688 80.91.224.249 (21 Nov 2002 09:26:44 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 21 Nov 2002 09:26:44 +0000 (UTC) Return-path: Original-Received: from ref.vet.uu.nl ([131.211.172.13] helo=ref.ntg.nl) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18Enbf-0004L2-00 for ; Thu, 21 Nov 2002 10:26:43 +0100 Original-Received: from ref.ntg.nl (localhost.localdomain [127.0.0.1]) by ref.ntg.nl (Postfix) with ESMTP id 36DEC10AF2; Thu, 21 Nov 2002 10:28:38 +0100 (MET) Original-Received: from mailhost1.dircon.co.uk (mailhost1.dircon.co.uk [194.112.32.65]) by ref.ntg.nl (Postfix) with ESMTP id 942E310AF1 for ; Thu, 21 Nov 2002 10:27:49 +0100 (MET) Original-Received: from [1.1.3.76] (pipinghot.gw.dircon.net [195.157.154.158]) by mailhost1.dircon.co.uk (Postfix) with ESMTP id 8D09D576F4 for ; Thu, 21 Nov 2002 09:27:47 +0000 (GMT) User-Agent: Microsoft-Entourage/10.1.1.2418 Original-To: Errors-To: ntg-context-admin@ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.0.13 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.comp.tex.context:9888 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:9888 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