}
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{}{}?
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
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
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
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
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
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
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
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
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
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
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
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
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
, 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
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
\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
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
, 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
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
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
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
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
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
24 matches
Mail list logo