Me again... I'd like to define an address layer in my environment: --- start env -- \definelayer[senderlayer] [x=0mm, y=0mm, width=\paperwidth, height=\paperheight] \def\Sender#1#2#3{\setvalue{SenderKey#1}{#2}\setvalue{SenderVal#1}{#3}} \def\GetSenderLine#1{\bTR\bTD\doiftextelse{\getvalue{SenderKey#1}}% {\getvalue{SenderKey#1}:}{}\eTD\bTD\getvalue{SenderVal#1}\eTD\eTR} \setlayerframed[senderlayer] [%corner={right}, location={left,bottom}, x=\dimexpr(\getvalue{LogoHOffset}-\bleed), %\getvalue{LogoHOffset}, y=\getvalue{LogoHeight}] % \dimexpr(\getvalue{LogoHeight}+\topspace) [height=46mm, width=\dimexpr(\getvalue{SenderKeyWidth}+\getvalue {SenderValueWidth}), frame=off, offset=none, align={left,top}]{% \setupTABLE[frame=off] \setupTABLE[x][1][width=\getvalue{SenderKeyWidth}, align=left, style= {\keystyle\strut}] \setupTABLE[x][2][width=\getvalue{SenderValueWidth}, align=right, style={\valstyle\strut}] \bTABLE \dostepwiserecurse{1}{9}{1}{% count from 1 to 9, step 1 \expanded{\GetSenderLine{\recurselevel}} } \eTABLE } \def\EnableSender{\setupbackgrounds[rightpage][page] [background={\currentvalue, senderlayer}]} --- stop env --- and use that later in a product/component: --- start text --- \Sender{1}{Name}{Hraban} \Sender{2}{Web}{www.fiee.net} \EnableSender --- stop text --- Of course it doesn't work, because the Sender values aren't set via typesetting the address in the environment, and \currentvalue in \EnableSender hasn't the right value either. Holger solves this in his letter style (wiki) via setups. Is that the best approach? How else could I postpone the senderlayer processing? (I guess it would work with some expansion magic, but I'd like to stay at ConTeXt's surface as much as possible.) Grüßlis vom Hraban! --- http://www.fiee.net/texnique/ http://contextgarden.net http://www.cacert.org (I'm an assurer)
Henning Hraban Ramm wrote:
How else could I postpone the senderlayer processing?
by making it a setup (best use variables instead of #1's etc) and process that setup later on
(I guess it would work with some expansion magic, but I'd like to stay at ConTeXt's surface as much as possible.)
see m-letter and m-corresp for how we do things at pragma Hans
Am 2006-01-15 um 19:06 schrieb Hans Hagen:
How else could I postpone the senderlayer processing? by making it a setup (best use variables instead of #1's etc) and process that setup later on
I'm getting used to setups - looking at Holger's code I thought they were complicated, but it's only his code... I don't understand how and where I should use \variables instead of #parameters?
(I guess it would work with some expansion magic, but I'd like to stay at ConTeXt's surface as much as possible.) see m-letter and m-corresp for how we do things at pragma
I'd love to, but they aren't in the distribution. Grüßlis vom Hraban! --- http://www.fiee.net/texnique/ http://contextgarden.net http://www.cacert.org (I'm an assurer)
participants (2)
-
Hans Hagen
-
Henning Hraban Ramm