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

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

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

2013-11-07 Thread Géry Ogam
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 Cool 2 Cat 3 Mouse So I need to check if

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

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

2013-11-05 Thread Géry Ogam
you can try \doifnothing\currentstructurelabel{Do something} It does not work in my case (even if the currenstructurelabel is empty it acts as if it not empty). In fact I asked that to get the following behaviour: — When there is a chapter label (\setuplabeltext[chapter=CHAPTER~]) I want

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

2013-11-05 Thread Géry Ogam
Any idea for achieving this behaviour? - When there is a chapter label (\setuplabeltext[chapter=CHAPTER~]), display : CHAPTER ONE Cool CHAPTER 2 Cat CHAPTER 3 Mouse etc. - When there is no chapter label (\setuplabeltext[chapter=]), display: 1 Cool 2 Cat 3 Mouse etc. My try achieves the first

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

2013-11-04 Thread Géry Ogam
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}} Best regards.