[NTG-context] Lua equivalent of \getvariable{}{}

2020-10-11 Thread Pablo Rodriguez
} c: \cldcontext{c}\\ \doifelse{\cldcontext{c:match("\letterpercent d+")}} {123}{yes}{no}\\ d: \cldcontext{d}\\ \doifelse{\cldcontext{d:match("\letterpercent d+")}} {123}{yes}{no} \stoptext Which is the Lua equivalent of \getvariable{}{}?

Re: [NTG-context] Expansion help needed, getvariable and TABLE

2018-01-31 Thread Hans Hagen
On 1/31/2018 4:40 PM, Rik Kabel wrote: On 2018-01-31 09:54, Wolfgang Schuster wrote: Rik Kabel schrieb: \starttexdefinition doTableRowExpB #SET     \define\A{\getvariable{#SET}{a}}     \define\B{\getvariable{#SET}{b}}     \define\C{\getvariable{#SET}{c}}     \bTR   \expanded{\bTC\A\eTC

Re: [NTG-context] Expansion help needed, getvariable and TABLE

2018-01-31 Thread Rik Kabel
On 2018-01-31 09:54, Wolfgang Schuster wrote: Rik Kabel schrieb: \starttexdefinition doTableRowExpB #SET     \define\A{\getvariable{#SET}{a}}     \define\B{\getvariable{#SET}{b}}     \define\C{\getvariable{#SET}{c}}     \bTR   \expanded{\bTC\A\eTC}   \expanded{\bTC\B\eTC

Re: [NTG-context] Expansion help needed, getvariable and TABLE

2018-01-31 Thread Wolfgang Schuster
Rik Kabel schrieb: \starttexdefinition doTableRowExpB #SET \define\A{\getvariable{#SET}{a}} \define\B{\getvariable{#SET}{b}} \define\C{\getvariable{#SET}{c}} \bTR \expanded{\bTC\A\eTC} \expanded{\bTC\B\eTC} \expanded{\bTC\C\eTC} \eTR \stoptexdefinition You

Re: [NTG-context] Expansion help needed, getvariable and TABLE

2018-01-31 Thread Rik Kabel
ly via \getvariable, everything works as expected in simple text and in TABLEs. When I \define a macro to the \getvariable, that works in simple text, but only the value of the last iteration appears in the TABLE. The macro definition is saved and when it is used, that is the value that it has. So, how

Re: [NTG-context] Expansion help needed, getvariable and TABLE

2018-01-30 Thread Wolfgang Schuster
Rik Kabel <mailto:cont...@rik.users.panix.com> 31. Januar 2018 um 03:10 Listers, I have a problem, and a question on ConTeXt programming efficiency. In the example below, I have a set of variables. When these are reference directly via \getvariable, everything works as expected in

Re: [NTG-context] Expansion help needed, getvariable and TABLE

2018-01-30 Thread Rik Kabel
On 2018-01-30 21:10, Rik Kabel wrote: Listers, I have a problem, and a question on ConTeXt programming efficiency. In the example below, I have a set of variables. When these are reference directly via \getvariable, everything works as expected in simple text and in TABLEs. When I \define

[NTG-context] Expansion help needed, getvariable and TABLE

2018-01-30 Thread Rik Kabel
Listers, I have a problem, and a question on ConTeXt programming efficiency. In the example below, I have a set of variables. When these are reference directly via \getvariable, everything works as expected in simple text and in TABLEs. When I \define a macro to the \getvariable, that works

Re: [NTG-context] \write \getvariable and expansion

2006-11-19 Thread Taco Hoekwater
Aditya Mahajan wrote: Hi, Can someone explain what should be the correct order of expansion here. I want to enter the date entered as a variable to a file. \setvariables [test] [date={d=11,m=11,y=2006}] \starttext The date entered was \expanded{\date[\getvariable{test

Re: [NTG-context] \write \getvariable and expansion

2006-11-19 Thread Aditya Mahajan
was \expanded{\date[\getvariable{test}{date}]}. \immediate\openout \scratchwrite test-001 \immediate\write \scratchwrite {The date entered was} % None of these work. The best you can get is: \immediate\write\scratchwrite{\noexpand\date[\getvariable{test}{date}]} (The variable is expanded

[NTG-context] \write \getvariable and expansion

2006-11-17 Thread Aditya Mahajan
Hi, Can someone explain what should be the correct order of expansion here. I want to enter the date entered as a variable to a file. \setvariables [test] [date={d=11,m=11,y=2006}] \starttext The date entered was \expanded{\date[\getvariable{test}{date}]}. \immediate\openout

Re: [NTG-context] getvariable

2005-10-07 Thread Peter Rolf
out, if the variable is set correctly in your \setupcrop macro? Just add \writestatus{[CROP]}{crop mark is: \getvariable{Crop}{mark}}% For debugging, I've narrowed the module down to 8 lines: \def\setupcrop{\setvariables[Crop]} Is that all \setupcrop does? :) It's a bit hard for me

Re: [NTG-context] getvariable

2005-10-06 Thread Hans Hagen
Thomas A. Schmitz wrote: I thought I had understood at least some aspects of macros, but it turns out I'm as lost as always. Here's my problem: I'm writing a module which will have a \setupcommand. The value is given in a [key=pair] list, so I thought I could use \getvariable. What I have

Re: [NTG-context] getvariable

2005-10-06 Thread Thomas A. Schmitz
page-lay.tex): \doifelse{\getvariable{Crop}{mark}{camera} {== make page background camera-crops} {\doifelse{\getvariable{Crop}{mark}{cross} {== make page background cross-crops} {do nothing} My problem right now is that the assignment by the user given in the \setup-command

Re: [NTG-context] getvariable

2005-10-06 Thread Peter Rolf
, is a call (at the end of \setupcrop) to a separate routine (based on your \doifelse construct), which sets up the background. Or have i missed something? :) Peter My idea was to have nested \doifelse statements in the module itself (I got this idea from page-lay.tex): \doifelse{\getvariable

Re: [NTG-context] getvariable

2005-10-06 Thread Thomas A. Schmitz
the background. Or have i missed something? :) Actually, this part of the code works. I have defined overlays/layers and a variable PageBackground and in my doifelse want this \let\PageBackground\empty \def\CameraMarks{Camera} \def\CrossMarks{Cross} \doifelse{\getvariable{Crop}{mark}{camera

Re: [NTG-context] getvariable

2005-10-06 Thread Peter Rolf
\CrossMarks{Cross} \doifelse{\getvariable{Crop}{mark}{camera} {\let\PageBackground\CameraMarks} {\doifelse{\getvariable{Crop}{mark}{cross} {\let\PageBackground\CrossMarks} {\relax} For debugging purposes, I just have this \doifelse{\GetMark}{camera} {mark defined

Re: [NTG-context] getvariable

2005-10-06 Thread Thomas A. Schmitz
Yes, I'm usually prone to making this kind of mistakes. But if I put exactly the same \doifelse in my TeX file (instead of in the module), the correct value is returned. I also thought there was no trickery involved, but it looks like the key is assigned its value only after the module has

Re: [NTG-context] getvariable

2005-10-06 Thread Peter Rolf
, or it's interpretation? Can you find out, if the variable is set correctly in your \setupcrop macro? Just add \writestatus{[CROP]}{crop mark is: \getvariable{Crop}{mark}}% right after the \setvariables command and have an eye on the logging. And if this works (I can't imagine why not), try

Re: [NTG-context] getvariable

2005-10-06 Thread Thomas A. Schmitz
correctly in your \setupcrop macro? Just add \writestatus{[CROP]}{crop mark is: \getvariable{Crop}{mark}}% For debugging, I've narrowed the module down to 8 lines: \def\setupcrop{\setvariables[Crop]} \setvariables[Crop][mark=cross,info=yes] \processaction[\getvariable{Crop}{mark}][ camera

Re: [NTG-context] getvariable

2005-10-06 Thread Hans Hagen
Peter Rolf wrote: Hi Thomas. Thomas A. Schmitz wrote: Sorry, I was trying to be general instead of specific and was unclear. Here's what I want: \usemodule[MyCrop] \setupcrop[mark=camera,info=yes] % or \setupcrop[mark=cross,info=no] or any combination This should work. The only

Re: [NTG-context] getvariable

2005-10-06 Thread Hans Hagen
of setting the variable, or it's interpretation? Can you find out, if the variable is set correctly in your \setupcrop macro? Just add \writestatus{[CROP]}{crop mark is: \getvariable{Crop}{mark}}% right after the \setvariables command and have an eye on the logging. And if this works (I can't

Re: [NTG-context] getvariable

2005-10-06 Thread Hans Hagen
itself (I got this idea from page-lay.tex): \doifelse{\getvariable{Crop}{mark}{camera} {== make page background camera-crops} {\doifelse{\getvariable{Crop}{mark}{cross} {== make page background cross-crops} {do nothing} My problem right now is that the assignment by the user given

[NTG-context] getvariable

2005-10-05 Thread Thomas A. Schmitz
I thought I had understood at least some aspects of macros, but it turns out I'm as lost as always. Here's my problem: I'm writing a module which will have a \setupcommand. The value is given in a [key=pair] list, so I thought I could use \getvariable. What I have is \def\setupcommand