ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Jean-Philippe Rey <jean-philippe.rey@ecp.fr>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: serial letters
Date: Fri, 24 May 2019 13:49:55 +0200	[thread overview]
Message-ID: <0F91C081-2CD3-4EA0-8944-157C7F756DE7@ecp.fr> (raw)
In-Reply-To: <7525A011-3996-4BEA-8AD2-F7AED5AD3317@fiee.net>

Hello Everybody,

> Le 8 avr. 2019 à 15:26, Henning Hraban Ramm <texml@fiee.net> a écrit :
> 
> How would you approach serial letters, e.g. to all members of a club?
> (Actually I need to send out donation receipts.)
> 
> I’d like to use the letter module, since my usual letter design is using it.
> 
> I can export the addresses to CSV, JSON, Lua tables or whatever or transfer them to a SQLite db.
> Would it make more sense to read them in Lua and combine this data with a buffer, or to write a single tex file for every letter?
> I know how to do the latter, but I’d like to learn a more ConTeXt-ish way.
> Would it make sense to use the bibliographies module?


I have the same need. I tried a basic solution:

======================= Start failing example
\usemodule[letter]

\setupletter[
  signature={JPR},
  closing={Sincerely yours,}
  ]

\def\GenLetter[#1]{
  \getparameters[GL][#1]
  \startletter[
     toname={\GLto},
     toaddress={\GLadr},
     opening={\GLciv},
     ]

  Blah blah \GLciv.

  \stopletter
}

\starttext

\GenLetter[civ={M.}, to={Pierre Durand}, adr={Trifouillis-les-Oies}]

\stoptext
======================= End failing example

My idea being to generate as many letters I like by multiplying the \GenLetter line.

However, I get an error message I don’t understand. Can someone point to the thing I am doing wrong ?

Thank you.

Here is the corresponding console output:

======================= Start console output
This is LuaTeX, Version 1.09.0 (TeX Live 2019/dev) 
system commands enabled.
open source     > level 1, order 1, name '/Users/jprey/Applications/ConTeXt/2018-09-13/tex/texmf-context/tex/context/base/mkiv/cont-yes.mkiv'
system          > 
system          > ConTeXt  ver: 2018.09.13 17:41 MKIV beta  fmt: 2018.9.16  int: english/english
system          > 
system          > 'cont-new.mkiv' loaded
open source     > level 2, order 2, name '/Users/jprey/Applications/ConTeXt/2018-09-13/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'
system          > beware: some patches loaded from cont-new.mkiv
close source    > level 2, order 2, name '/Users/jprey/Applications/ConTeXt/2018-09-13/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'
system          > files > jobname 'letterTest', input './letterTest', result 'letterTest'
fonts           > latin modern fonts are not preloaded
languages       > language 'en' is active
system          > synctex functionality is enabled, expect 5-10 pct runtime overhead!
open source     > level 2, order 3, name '/Users/jprey/SCA/Concours/2019/JURY/Confirmation fonction/letterTest.tex'
modules         > 'letter' is loaded
open source     > level 3, order 4, name '/Users/jprey/Applications/ConTeXt/2018-09-13/tex/texmf-modules/tex/context/third/letter/base/s-cor-01.mkvi'
modules         > 'cor-00' is loaded
open source     > level 4, order 5, name '/Users/jprey/Applications/ConTeXt/2018-09-13/tex/texmf-modules/tex/context/third/letter/base/s-cor-00.mkvi'
resolvers       > lua > loading file '/Users/jprey/Applications/ConTeXt/2018-09-13/tex/texmf-modules/tex/context/third/letter/base/s-cor-00.lua' succeeded
close source    > level 4, order 5, name '/Users/jprey/Applications/ConTeXt/2018-09-13/tex/texmf-modules/tex/context/third/letter/base/s-cor-00.mkvi'
modules         > 'cor-06' is loaded
open source     > level 4, order 6, name '/Users/jprey/Applications/ConTeXt/2018-09-13/tex/texmf-modules/tex/context/third/letter/base/s-cor-06.mkvi'
close source    > level 4, order 6, name '/Users/jprey/Applications/ConTeXt/2018-09-13/tex/texmf-modules/tex/context/third/letter/base/s-cor-06.mkvi'
open source     > level 4, order 7, name '/Users/jprey/Applications/ConTeXt/2018-09-13/tex/texmf-modules/tex/context/third/letter/style/letter-imp-default.mkiv'
close source    > level 4, order 7, name '/Users/jprey/Applications/ConTeXt/2018-09-13/tex/texmf-modules/tex/context/third/letter/style/letter-imp-default.mkiv'
open source     > level 4, order 8, name '/Users/jprey/Applications/ConTeXt/2018-09-13/tex/texmf-modules/tex/context/third/letter/style/letter-imp-dinb.mkiv'
open source     > level 5, order 9, name '/Users/jprey/Applications/ConTeXt/2018-09-13/tex/texmf-modules/tex/context/third/letter/style/letter-imp-default.mkiv'
close source    > level 5, order 9, name '/Users/jprey/Applications/ConTeXt/2018-09-13/tex/texmf-modules/tex/context/third/letter/style/letter-imp-default.mkiv'
close source    > level 4, order 9, name '/Users/jprey/Applications/ConTeXt/2018-09-13/tex/texmf-modules/tex/context/third/letter/style/letter-imp-dinb.mkiv'
system          > module wrapping error in 'letter'
close source    > level 3, order 9, name '/Users/jprey/Applications/ConTeXt/2018-09-13/tex/texmf-modules/tex/context/third/letter/base/s-cor-01.mkvi'
fonts           > preloading latin modern fonts (second stage)
fonts           > 'fallback modern-designsize rm 12pt' is loaded

tex error       > tex error on line 23 in file /Users/jprey/SCA/Concours/2019/JURY/Confirmation fonction/letterTest.tex: ! Undefined control sequence

<inserted text> ...v!letter \edef \p_correspondence_option_option 
                                                 {\correspondenceoptionpara...
\correspondence_place ...\t_correspondence_before 
                                                 \page \setuplayout [\c!met...
\correspondence_stop ...\correspondence_place [#1]
                                                 \endgroup \stoptext 
l.23 ...{Pierre Durand}, adr={Trifouillis-les-Oies}]


13           opening={\GLciv},
14           ]
15     
16        Blah blah \GLciv.
17     
18        \stopletter
19     }
20     
21     \starttext
22     
23 >>  \GenLetter[civ={M.}, to={Pierre Durand}, adr={Trifouillis-les-Oies}]
24     
25     \stoptext
26     
======================= End console output

-- 
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
___________________________________________________________________________________

  parent reply	other threads:[~2019-05-24 11:49 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 [this message]
2019-05-24 16:05   ` Wolfgang Schuster
2019-05-24 18:19     ` jean-philippe.rey

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=0F91C081-2CD3-4EA0-8944-157C7F756DE7@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).