Re: [NTG-context] Compare contents of macros via \doif etc. alternatives

2017-07-23 Thread Hans Hagen
On 7/23/2017 8:46 AM, Henri Menke wrote: On 07/23/2017 05:55 PM, Jaroslav Hajtmar wrote: Thanx Hans for reply. also, it depends on what you want to achieve ... maybe comparing macros is not needed at all You have right, that anytime compares are not needed, but for my very needed

Re: [NTG-context] Compare contents of macros via \doif etc. alternatives

2017-07-23 Thread Henri Menke
re any way to evaluate of contents of two macros as I am showing in >>>> my minimal example? >>>> I know, that problem is in expansion, but I dont know to resolve it. >>>> My minimal example consist of piece lua code, because I am solving my >>>>

Re: [NTG-context] Compare contents of macros via \doif etc. alternatives

2017-07-22 Thread Jaroslav Hajtmar
ines a new macro using \protected\def. To compare as equal in a \doif context, both operands have to _expand_ to the same thing (here 123). Here \mymacro is not expandable and thus only \doifelse{\mymacro}{\mymacro} will ever compare true. Furthermore, scanning for optional arguments (i.e. [...

[NTG-context] Compare contents of macros via \doif etc. alternatives

2017-07-22 Thread Jaroslav Hajtmar
Hello ConTeXist. Is there any way to evaluate of contents of two macros as I am showing in my minimal example? I know, that problem is in expansion, but I dont know to resolve it. My minimal example consist of piece lua code, because I am solving my problem in mixed codes (TeX & Lua)

Re: [NTG-context] Compare contents of macros via \doif etc. alternatives

2017-07-22 Thread Hans Hagen
consist of piece lua code, because I am solving my problem in mixed codes (TeX & Lua) Something similar has been asked before and it is not possible. The interfaces.definecommand function defines a new macro using \protected\def. To compare as equal in a \doif context, both operands

Re: [NTG-context] Compare contents of macros via \doif etc. alternatives

2017-07-21 Thread Jaroslav Hajtmar
acro using \protected\def. To compare as equal in a \doif context, both operands have to _expand_ to the same thing (here 123). Here \mymacro is not expandable and thus only \doifelse{\mymacro}{\mymacro} will ever compare true. Furthermore, scanning for optional arguments (i.e.

Re: [NTG-context] Compare contents of macros via \doif etc. alternatives

2017-07-21 Thread Henri
piece lua code, because I am solving my problem > in mixed codes (TeX > & Lua) Something similar has been asked before and it is not possible.  The  interfaces.definecommand function defines a new macro using \protected\def.  To compare as equal in a \doif context, both operands have to _

[NTG-context] Compare contents of macros via \doif etc. alternatives

2017-07-21 Thread Jaroslav Hajtmar
Hello ConTeXist. Is there any way to evaluate of contents of two macros as I am showing in my minimal example? I know, that problem is in expansion, but I dont know to resolve it. My minimal example consist of piece lua code, because I am solving my problem in mixed codes (TeX & Lua) Thanx for

[NTG-context] \doif... and Lua

2011-03-25 Thread Procházka Lukáš Ing . - Pontex s . r . o .
} {No} \stoptext --- But this gives me always No. - I'm not sure if this is a good way, and whether attempt to use \doif(...) macro is a good idea at all. Any (better) solution? Best regards, Lukas -- Ing. Lukáš Procházka [mailto:l...@pontex.cz] Pontex s. r. o. [mailto:pon...@pontex.cz

Re: [NTG-context] \doif... and Lua

2011-03-25 Thread Wolfgang Schuster
= a} \doifempty{\directlua{return test}} %\doifempty{\directlua{test}} {Yes} {No} \stoptext --- But this gives me always No. - I'm not sure if this is a good way, and whether attempt to use \doif(...) macro is a good idea at all. Any (better) solution? \starttext \ctxlua{test

Re: [NTG-context] \doif... and Lua

2011-03-25 Thread Procházka Lukáš Ing . - Pontex s . r . o .
to use \doif(...) macro is a good idea at all. Any (better) solution? \starttext \ctxlua{test = true} Test is \ctxlua{commands.testcase(test)}{True}{False}. \ctxlua{test = false} Test is \ctxlua{commands.testcase(test)}{True}{False}. \stoptext Wolfgang

[NTG-context] \doif(not)empty(else)

2009-02-08 Thread Alan Stone
Hi, Re: http://wiki.contextgarden.net/System_Macros/Branches_and_Decisions What kind of emptyness do \doifempty, \doifnotempty, \doifemptyelse test ? \def\ISay{} %\def\ISay{Boe!} \starttext \doifemptyelse{\ISay}{I say sht}{I say \ISay} \blank \doif{\ISay}{}{I say sht

Re: [NTG-context] \doif(not)empty(else)

2009-02-08 Thread Peter Münster
On Sun, 8 Feb 2009, Alan Stone wrote: Re: http://wiki.contextgarden.net/System_Macros/Branches_and_Decisions What kind of emptyness do \doifempty, \doifnotempty, \doifemptyelse test ? Hello Alan, Here a small test file: \def\Empty{} \def\Macro#1{argument is \doifemptyelse{#1}{empty}{full}}

Re: [NTG-context] \doif(not)empty(else)

2009-02-08 Thread Wolfgang Schuster
Peter Münster schrieb: On Sun, 8 Feb 2009, Alan Stone wrote: Re: http://wiki.contextgarden.net/System_Macros/Branches_and_Decisions What kind of emptyness do \doifempty, \doifnotempty, \doifemptyelse test ? Hello Alan, Here a small test file: \def\Empty{} \def\Macro#1{argument is

Re: [NTG-context] currentheadnumber / doif.. problem

2007-10-18 Thread Peter Schorsch
ok, I found the solution. In the documentation (cont-eni.pdf) at page 172 following is written: For example: \currentheadnumber : 8.3 \headnumber[chapter] : 8 \headnumber[section] : 8.3 but that is partly wrong. There should be standing (change example from 8.3 to 8.3.2): For example:

Re: [NTG-context] currentheadnumber / doif.. problem

2007-10-15 Thread Peter Schorsch
Aditya wrote: Can you create a minimum example to play with? I attached the module t-pararef.tex and the example pararef-test.tex. The ref1 is still wrong. When I replace \currentheadnumber in \paragraphMark with the before defined \presentheadnumber  context is saying that a «Missing

Re: [NTG-context] currentheadnumber / doif.. problem

2007-09-25 Thread Peter Schorsch
hm.. it still executes always the else-part of the doifelse-function (Untested) \def\presentheadnumber% {\doifelse{\headnumber[section]}{0}% ^^ {\headnumber[chapter]}% {\headnumber[section]}%

Re: [NTG-context] currentheadnumber / doif.. problem

2007-09-25 Thread Aditya Mahajan
On Tue, 25 Sep 2007, Peter Schorsch wrote: hm.. it still executes always the else-part of the doifelse-function Can you create a minimum example to play with? Aditya ___ If your question is of interest to

Re: [NTG-context] currentheadnumber / doif.. problem

2007-09-12 Thread Duncan Hothersall
Hi Peter Date: Mon, 10 Sep 2007 01:21:26 +0200 From: Peter Schorsch [EMAIL PROTECTED] Subject: [NTG-context] currentheadnumber / doif.. problem To: ntg-context@ntg.nl Hi, I tried to get the full present heading-number. If I am using currentnumber I am getting back only the last part

Re: [NTG-context] currentheadnumber / doif.. problem

2007-09-12 Thread Aditya Mahajan
On Mon, 10 Sep 2007, Peter Schorsch wrote: Hi, I tried to get the full present heading-number. If I am using currentnumber the result is only the last part of the heading-number. So I tried do implement a function like this: (Untested) \def\presentheadnumber%

[NTG-context] currentheadnumber / doif.. problem

2007-09-11 Thread Peter Schorsch
Hi, I tried to get the full present heading-number. If I am using currentnumber the result is only the last part of the heading-number. So I tried do implement a function like this: \def\presentheadnumber% {\doifelse{\headnumber[section]}{}% {\headnumber[chapter]}%

[NTG-context] currentheadnumber / doif.. problem

2007-09-10 Thread Peter Schorsch
Hi, I tried to get the full present heading-number. If I am using currentnumber I am getting back only the last part of the heading-number. So I tried do implement a function like this: \def\presentheadnumber% {\doifelse{\headnumber[section]}{}% {\headnumber[chapter]}%