* \doifinstring: strange characters on the output
@ 2021-10-31 22:53 Tomas Hala via ntg-context
2021-11-01 16:46 ` Hans Hagen via ntg-context
2021-11-01 16:48 ` Hans Hagen via ntg-context
0 siblings, 2 replies; 4+ messages in thread
From: Tomas Hala via ntg-context @ 2021-10-31 22:53 UTC (permalink / raw)
To: Mailing list ConTeXt; +Cc: Tomas Hala
Hi all,
I noticed that \doifinstring produces quite strange output if a command
follows immediately (or with any amount of spaces) after the substring
I am searching for:
-------------------------------------MWE
\starttext
\def\xxx{asdf \bf Z:\bf asdf} % strange
\def\xxx{asdf \bf Z: \bf asdf} % strange
\def\xxx{asdf \bf Z:: \bf asdf} % OK
\def\xxx{asdf \bf Z: text \bf asdf} % OK
\def\xxx{asdf \bf Z:{} \bf asdf} % OK
\doifinstring{Z:}{\xxx}{yes!}
\stoptext
----------------------------------OUTPUT
fbf@yes!
fbf@yes!
yes!
yes!
yes!
----------------------------------------
If I insert another character, text or {} between them
(with or without spaces), all is ok.
I would like to ask what is the cause of this behavior and how to
use the \doifinstring to prevent the "fbf@" on the output.
Best wishes
Tomáš
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: \doifinstring: strange characters on the output
2021-10-31 22:53 \doifinstring: strange characters on the output Tomas Hala via ntg-context
@ 2021-11-01 16:46 ` Hans Hagen via ntg-context
2021-11-01 16:48 ` Hans Hagen via ntg-context
1 sibling, 0 replies; 4+ messages in thread
From: Hans Hagen via ntg-context @ 2021-11-01 16:46 UTC (permalink / raw)
To: mailing list for ConTeXt users; +Cc: Hans Hagen
On 10/31/2021 11:53 PM, Tomas Hala via ntg-context wrote:
> Hi all,
>
> I noticed that \doifinstring produces quite strange output if a command
> follows immediately (or with any amount of spaces) after the substring
> I am searching for:
>
> -------------------------------------MWE
> \starttext
> \def\xxx{asdf \bf Z:\bf asdf} % strange
> \def\xxx{asdf \bf Z: \bf asdf} % strange
> \def\xxx{asdf \bf Z:: \bf asdf} % OK
> \def\xxx{asdf \bf Z: text \bf asdf} % OK
> \def\xxx{asdf \bf Z:{} \bf asdf} % OK
>
> \doifinstring{Z:}{\xxx}{yes!}
> \stoptext
> ----------------------------------OUTPUT
> fbf@yes!
> fbf@yes!
> yes!
> yes!
> yes!
> ----------------------------------------
>
> If I insert another character, text or {} between them
> (with or without spaces), all is ok.
>
> I would like to ask what is the cause of this behavior and how to
> use the \doifinstring to prevent the "fbf@" on the output.
partial expansion of a protected macro where one doesn't expect it
before i patch i let wolfgang check it
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: \doifinstring: strange characters on the output
2021-10-31 22:53 \doifinstring: strange characters on the output Tomas Hala via ntg-context
2021-11-01 16:46 ` Hans Hagen via ntg-context
@ 2021-11-01 16:48 ` Hans Hagen via ntg-context
2021-11-02 22:18 ` Tomas Hala via ntg-context
1 sibling, 1 reply; 4+ messages in thread
From: Hans Hagen via ntg-context @ 2021-11-01 16:48 UTC (permalink / raw)
To: mailing list for ConTeXt users; +Cc: Hans Hagen
On 10/31/2021 11:53 PM, Tomas Hala via ntg-context wrote:
> I would like to ask what is the cause of this behavior and how to
> use the \doifinstring to prevent the "fbf@" on the output.
btw, you can prevent it by using lmtx
Hans
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: \doifinstring: strange characters on the output
2021-11-01 16:48 ` Hans Hagen via ntg-context
@ 2021-11-02 22:18 ` Tomas Hala via ntg-context
0 siblings, 0 replies; 4+ messages in thread
From: Tomas Hala via ntg-context @ 2021-11-02 22:18 UTC (permalink / raw)
To: Hans Hagen; +Cc: Tomas Hala, mailing list for ConTeXt users
Hi Hans,
ok, thank you, lmtx is a good way.
Tomáš
> I would like to ask what is the cause of this behavior and how to
> use the \doifinstring to prevent the "fbf@" on the output.
partial expansion of a protected macro where one doesn't expect it
before i patch i let wolfgang check it
btw, you can prevent it by using lmtx
# Hans
#
# -----------------------------------------------------------------
# Hans Hagen | PRAGMA ADE
# Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
# tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
# -----------------------------------------------------------------
Tomáš Hála
--------------------------------------------------------------------
Mendelova univerzita, Provozně ekonomická fakulta, ústav informatiky
Zemědělská 1, CZ-613 00 Brno, tel. +420 545 13 22 28
--------------------------------------------------------------------
http://akela.mendelu.cz/~thala
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-11-02 22:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-31 22:53 \doifinstring: strange characters on the output Tomas Hala via ntg-context
2021-11-01 16:46 ` Hans Hagen via ntg-context
2021-11-01 16:48 ` Hans Hagen via ntg-context
2021-11-02 22:18 ` Tomas Hala via ntg-context
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).