Re: [NTG-context] How to test the emptyness of a variable?

2013-11-10 Thread Géry Ogam
Thank you very much Aditya, now it works. As you said, the trick was to use \doiftextelse{}{}{} function as test of emptyness function, and \labeltext{chapter} instead of \currentstructurelabel as variable for the test because the latter was never found empty, even when it was. Thus the right cod

Re: [NTG-context] How to test the emptyness of a variable?

2013-11-09 Thread Aditya Mahajan
On Thu, 7 Nov 2013, Géry Ogam wrote: I'm sure there is also a "cleaner" TeX way, but I'm not experienced enough for that. I think you misunderstood my issue: your Lua way does the same thing than my TeX way: it displays: ONE Cool 2 Cat 3 Mouse but that is NOT what I want. What I want is: 1

Re: [NTG-context] How to test the emptyness of a variable?

2013-11-07 Thread Procházka Lukáš Ing . - Pontex s . r . o .
Hello, Lua way: \setuplabeltext[chapter=] \define[1]\MyCommand{\ctxcommand{doifelse(1==\currentsectioncountervalue)}{ONE}{#1}} \setuphead[chapter][deepnumbercommand=\MyCommand] \starttext \chapter{Cool} \chapter{Cat} \chapter{Mouse} \stoptext I'm sure there is also a "cleaner

Re: [NTG-context] How to test the emptyness of a variable?

2013-11-05 Thread Hans Hagen
On 11/5/2013 12:42 AM, Géry Ogam wrote: Hello, How to test if the current structure label is empty? The following example does not work because I don’t know how to expand the variable \currentstructurelabel.. E.g.: \define \MyCommand{\doifempty{\currentstructurelabel}{Do something}} you can