* \doifmode and friends
@ 2011-10-04 18:19 Meer, H. van der
2011-10-04 18:32 ` Wolfgang Schuster
2011-10-04 18:37 ` Aditya Mahajan
0 siblings, 2 replies; 7+ messages in thread
From: Meer, H. van der @ 2011-10-04 18:19 UTC (permalink / raw)
To: NTG ConTeXt
I find that "abc \doifmode{mode}{text} more text" can introduce extra whitespace. I conclude therefore that there is no \ignorespaces at work here. As a consequence the \doifmode does not completely disappear if mode is not satisfied.
Is this intentional or should this behaviour be changed?
Hans van der Meer
___________________________________________________________________________________
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://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: \doifmode and friends
2011-10-04 18:19 \doifmode and friends Meer, H. van der
@ 2011-10-04 18:32 ` Wolfgang Schuster
2011-10-04 18:37 ` Aditya Mahajan
1 sibling, 0 replies; 7+ messages in thread
From: Wolfgang Schuster @ 2011-10-04 18:32 UTC (permalink / raw)
To: mailing list for ConTeXt users
Am 04.10.2011 um 20:19 schrieb Meer, H. van der:
> I find that "abc \doifmode{mode}{text} more text" can introduce extra whitespace. I conclude therefore that there is no \ignorespaces at work here. As a consequence the \doifmode does not completely disappear if mode is not satisfied.
> Is this intentional or should this behaviour be changed?
You can use the annotation module, it supports this function.
\usemodule[annotation]
\defineannotation[test][alternative=text]
\starttext
Can you see this \test{hidden} text?
\setupannotation[test][alternative=none]
Can you see this \test{hidden} text?
\stoptext
Wolfgang
___________________________________________________________________________________
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://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: \doifmode and friends
2011-10-04 18:19 \doifmode and friends Meer, H. van der
2011-10-04 18:32 ` Wolfgang Schuster
@ 2011-10-04 18:37 ` Aditya Mahajan
2011-10-04 18:44 ` Wolfgang Schuster
1 sibling, 1 reply; 7+ messages in thread
From: Aditya Mahajan @ 2011-10-04 18:37 UTC (permalink / raw)
To: mailing list for ConTeXt users
On Tue, 4 Oct 2011, Meer, H. van der wrote:
> I find that "abc \doifmode{mode}{text} more text" can introduce extra whitespace. I conclude therefore that there is no \ignorespaces at work here. As a consequence the \doifmode does not completely disappear if mode is not satisfied.
> Is this intentional or should this behaviour be changed?
Can you provide a minimal example. I don't get any extra spaces
\enablemode[test]
\starttext
A\doifmode{test}{B}C
A\doifmode{notest}{B}C
\stoptext
Aditya
___________________________________________________________________________________
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://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: \doifmode and friends
2011-10-04 18:37 ` Aditya Mahajan
@ 2011-10-04 18:44 ` Wolfgang Schuster
2011-10-04 21:17 ` Meer, H. van der
0 siblings, 1 reply; 7+ messages in thread
From: Wolfgang Schuster @ 2011-10-04 18:44 UTC (permalink / raw)
To: mailing list for ConTeXt users
Am 04.10.2011 um 20:37 schrieb Aditya Mahajan:
> On Tue, 4 Oct 2011, Meer, H. van der wrote:
>
>> I find that "abc \doifmode{mode}{text} more text" can introduce extra whitespace. I conclude therefore that there is no \ignorespaces at work here. As a consequence the \doifmode does not completely disappear if mode is not satisfied.
>> Is this intentional or should this behaviour be changed?
>
> Can you provide a minimal example. I don't get any extra spaces
>
> \enablemode[test]
> \starttext
> A\doifmode{test}{B}C
>
> A\doifmode{notest}{B}C
> \stoptext
There is a unwanted space in the second paragraph.
\enablemode[test]
\starttext
A \doifmode{test}{B} C
A \doifmode{notest}{B} C
\stoptext
Wolfgang
___________________________________________________________________________________
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://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: \doifmode and friends
2011-10-04 18:44 ` Wolfgang Schuster
@ 2011-10-04 21:17 ` Meer, H. van der
2011-10-04 21:42 ` Wolfgang Schuster
2011-10-04 22:19 ` Hans Hagen
0 siblings, 2 replies; 7+ messages in thread
From: Meer, H. van der @ 2011-10-04 21:17 UTC (permalink / raw)
To: mailing list for ConTeXt users
On 4 okt. 2011, at 20:44, Wolfgang Schuster wrote:
>
> Am 04.10.2011 um 20:37 schrieb Aditya Mahajan:
>
>> On Tue, 4 Oct 2011, Meer, H. van der wrote:
>>
>>> I find that "abc \doifmode{mode}{text} more text" can introduce extra whitespace. I conclude therefore that there is no \ignorespaces at work here. As a consequence the \doifmode does not completely disappear if mode is not satisfied.
>>> Is this intentional or should this behaviour be changed?
>>
>> Can you provide a minimal example. I don't get any extra spaces
>>
>> \enablemode[test]
>> \starttext
>> A\doifmode{test}{B}C
>>
>> A\doifmode{notest}{B}C
>> \stoptext
>
>
> There is a unwanted space in the second paragraph.
I dare voicing a different opinion. Allthough there indeed is both a space before the \doifmode as well as after it, I am aware of that but that is besides my point. I expected the \doifmode to vanish completely when the condition is not met. As is the case, even if the condition is not met it has a measurable effect because of the extra space being typeset.
To be more explicit, my expectations were: A \doifmode{condition-not-met}{B} C resulting in: AC
whereas it becomes: A C.
>
> \enablemode[test]
>
> \starttext
>
> A \doifmode{test}{B} C
>
> A \doifmode{notest}{B} C
>
> \stoptext
>
> Wolfgang
> ___________________________________________________________________________________
Hans van der Meer
___________________________________________________________________________________
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://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: \doifmode and friends
2011-10-04 21:17 ` Meer, H. van der
@ 2011-10-04 21:42 ` Wolfgang Schuster
2011-10-04 22:19 ` Hans Hagen
1 sibling, 0 replies; 7+ messages in thread
From: Wolfgang Schuster @ 2011-10-04 21:42 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 1585 bytes --]
Am 04.10.2011 um 23:17 schrieb Meer, H. van der:
>
> On 4 okt. 2011, at 20:44, Wolfgang Schuster wrote:
>
>>
>> Am 04.10.2011 um 20:37 schrieb Aditya Mahajan:
>>
>>> On Tue, 4 Oct 2011, Meer, H. van der wrote:
>>>
>>>> I find that "abc \doifmode{mode}{text} more text" can introduce extra whitespace. I conclude therefore that there is no \ignorespaces at work here. As a consequence the \doifmode does not completely disappear if mode is not satisfied.
>>>> Is this intentional or should this behaviour be changed?
>>>
>>> Can you provide a minimal example. I don't get any extra spaces
>>>
>>> \enablemode[test]
>>> \starttext
>>> A\doifmode{test}{B}C
>>>
>>> A\doifmode{notest}{B}C
>>> \stoptext
>>
>> There is a unwanted space in the second paragraph.
>
> I dare voicing a different opinion. Allthough there indeed is both a space before the \doifmode as well as after it, I am aware of that but that is besides my point. I expected the \doifmode to vanish completely when the condition is not met. As is the case, even if the condition is not met it has a measurable effect because of the extra space being typeset.
> To be more explicit, my expectations were: A \doifmode{condition-not-met}{B} C resulting in: AC
> whereas it becomes: A C.
I guess modes aren’t meant for this but again i can only offer my annotation module.
\usemodule[annotation]
\defineannotation[test][alternative=text]
\starttext
A \test{B} C
\setupannotation[test][alternative=none,next=\ignorespaces]
A \test{B} C
\stoptext
Wolfgang
[-- Attachment #1.2: Type: text/html, Size: 3274 bytes --]
[-- Attachment #2: Type: text/plain, Size: 485 bytes --]
___________________________________________________________________________________
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://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: \doifmode and friends
2011-10-04 21:17 ` Meer, H. van der
2011-10-04 21:42 ` Wolfgang Schuster
@ 2011-10-04 22:19 ` Hans Hagen
1 sibling, 0 replies; 7+ messages in thread
From: Hans Hagen @ 2011-10-04 22:19 UTC (permalink / raw)
To: mailing list for ConTeXt users
On 4-10-2011 23:17, Meer, H. van der wrote:
> I dare voicing a different opinion. Allthough there indeed is both a space before the \doifmode as well as after it, I am aware of that but that is besides my point. I expected the \doifmode to vanish completely when the condition is not met. As is the case, even if the condition is not met it has a measurable effect because of the extra space being typeset.
> To be more explicit, my expectations were: A \doifmode{condition-not-met}{B} C resulting in: AC
> whereas it becomes: A C.
spaces are always meaningful
A \doifmode{condition-not-met}{B} C
actually what you ask for is:
A<space>\doifmode{condition-not-met}{B}<space>C
so when the condition is not met you get
A<space><space>C
i can see no reason for ignoring spaces after a doifmode by default
Hans
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
| 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://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-10-04 22:19 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-04 18:19 \doifmode and friends Meer, H. van der
2011-10-04 18:32 ` Wolfgang Schuster
2011-10-04 18:37 ` Aditya Mahajan
2011-10-04 18:44 ` Wolfgang Schuster
2011-10-04 21:17 ` Meer, H. van der
2011-10-04 21:42 ` Wolfgang Schuster
2011-10-04 22:19 ` Hans Hagen
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).