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 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
>>>>
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. [...
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)
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
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.
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 _
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
}
{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
= 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
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
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
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}}
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
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:
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
hm.. it still executes always the else-part of the doifelse-function
(Untested)
\def\presentheadnumber%
{\doifelse{\headnumber[section]}{0}%
^^
{\headnumber[chapter]}%
{\headnumber[section]}%
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
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
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%
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]}%
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]}%
22 matches
Mail list logo