ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: jean-philippe.rey@ecp.fr
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: serial letters
Date: Fri, 24 May 2019 20:19:34 +0200	[thread overview]
Message-ID: <7A030C19-E5B6-4359-86C1-56859867A671@ecp.fr> (raw)
In-Reply-To: <065b375a-53a6-44ce-43c6-da8828b91ae0@gmail.com>

Thank you very much Wolfgang,

It works very well and perfectly suits my needs.

Thanks again,

> Le 24 mai 2019 à 18:05, Wolfgang Schuster <wolfgang.schuster.lists@gmail.com> a écrit :
> 
> The problem is that you put the letter-environment in a command but the environment uses the buffer mechanism to store the content which doesn't work when it is used in a command definition.
> 
> What you have to do is to move the content of the letters out of the \GenLetter command, you can use the lettercontent-environment for this. In the \GenLetter command you now use the \placeletter command to flush the content of the letter with the current values for the address etc.
> 
> %%%% begin example
> \usemodule[letter]
> 
> \setupletter
>   [signature={JPR},
>      closing={Sincerely yours,}]
> 
> \setupletter
>   [   toname=\correspondenceparameter{to},
>    toaddress=\correspondenceparameter{adr},
>      opening=\correspondenceparameter{civ}]
> 
> \startlettercontent
>   Blah blah \correspondenceparameter{civ}.
> \stoplettercontent
> 
> \def\GenLetter[#1]%
>   {\begingroup
>      \setupletter[#1]%
>      \placeletter
>    \endgroup}
> 
> \starttext
> 
> \GenLetter[civ={M.}, to={Pierre Durand}, adr={Trifouillis-les-Oies}]
> 
> \stoptext
> %%%% end example
> 
> Wolfgang


-- 
Jean-Philippe Rey
jean-philippe.rey@centralesupelec.fr
91192 Gif-sur-Yvette Cedex - France
Empreinte PGP : 807A 5B2C 69E4 D4B5 783A 428A 1B5E E83E 261B BF51

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

      reply	other threads:[~2019-05-24 18:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-08 13:26 Henning Hraban Ramm
2019-04-09 19:38 ` Wolfgang Schuster
2019-04-10  7:08   ` Henning Hraban Ramm
2019-05-06 11:15     ` Jan U. Hasecke
2019-05-07 10:08       ` Henning Hraban Ramm
2019-05-24 11:49 ` Jean-Philippe Rey
2019-05-24 16:05   ` Wolfgang Schuster
2019-05-24 18:19     ` jean-philippe.rey [this message]

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=7A030C19-E5B6-4359-86C1-56859867A671@ecp.fr \
    --to=jean-philippe.rey@ecp.fr \
    --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).