# Re: [NTG-context] letters in context mkiv

 Dear Contex’ers,This morning I have been experimenting with the solutions suggested by Thomas and Wolfgang.Thomas’ solution works, it produces two distinct letters, yet the address is probably on another layer. This means that it is not shifted to the right, at least not with the command (\setupletterlayer[address]), so that it will be visible through the envelope window.With Wolfgang’s solution the address is moved to its desired place, and the letter text is printed as well.However, inserting a text (by means of \input) is problematic (see pdf), with or without \relax.I then experimented with alternatives like \startbuffer[lettercontent] … endbuffer. The \input problem remains: it appears that the buffer takes any command (\foo) as literal text.I tried moving the setbuffer … endbuffer part to elswhere in the document. I also experimented with \input a sample text of my own on my harddisk. I tried deleting the \placeletter command - no difference.So, I feel I am close, but not yet there, one more step …Robert\usemodule[letter]\startbuffer[participants]      Hendriks    Karel    mr.    K.    Arnhem

Mr. K. Hendriks

Grotestraat 5

1234 BB Arnhem

1234bb5
Janssen    Piet    P.    mr.    Nijmegen

Mr. P. Janssen

Kortestraat 8

1234 AA Nijmegen

1234aa8
\stopbuffer\startxmlsetups xml:setups\xmlsetsetup{#1}{document|contacts|contact|prefix|initials|address|city|text|kix|p}{xml:*}\stopxmlsetups\xmlregistersetup{xml:setups}\setuplettersection[content][alternative=setups]\startsetups[letter:layer:address]    \correspondenceparameter{toname}\\    \correspondenceparameter{toaddress}\stopsetups\setuplettertext[en][date=]\setuplettertext[nl][date=]\startxmlsetups xml:contacts\xmlflush{#1}\stopxmlsetups\startxmlsetups xml:p\xmlflushtext{#1}\par\stopxmlsetups\setupletterlayer  [address]  [alternative=setups,   y=6cm,   x=12cm,   color=red,   style=\ss\tfa]\startsetups[letter:section:content]    \getbuffer[lettercontent]\stopsetups%\startbuffer[lettercontent]%content of the letter \xmltext{#1}{/city}%\input knuth \relax%\stopbuffer\startxmlsetups xml:contact    \setupletter      [toaddress={\xmlall{#1}{/address/p}\par      \xmltext{#1}{/kix}},         opening={Dear \xmltext{#1}{/prefix} \xmltext{#1}{/formalname},},         closing={Kind regards,},         subject={subject: your life in \xmltext{#1}{/city}},       signature={Herman}]\setbuffer[lettercontent]%This is the content of the letter.\input knuth \relax\endbuffer\placeletter\stopxmlsetups\setuppagenumbering [state=stop]\starttext\xmlprocessbuffer{main}{participants}{}\stoptext

brieven2mkiv3.pdf

```___________________________________________________________________________________
Wiki!```
```
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________```