ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \doifmodeselse?
@ 2009-04-02 16:01 Gerben Wierda
  2009-04-02 16:28 ` \doifmodeselse? Alan Stone
  2009-04-02 16:34 ` \doifmodeselse? Hans Hagen
  0 siblings, 2 replies; 4+ messages in thread
From: Gerben Wierda @ 2009-04-02 16:01 UTC (permalink / raw)
  To: ntg-context

Using --mode or --modes with texexec sets up modes which can be used  
in the files to parse different parts.

For that I use \doifmodeelse{}{}{}

But combining various modes in one \doiffmodeelse would be handy.

e.g. (pseudocode)

   if mode is workinprogress or test

or the other way around

   if mode is all or editor

So I would like something like

\doifmodeselse{all,editor)

or even better booleans

\doiffmodeselse{not test or editor}

so I do not need to build a large setup of nested \ifmodeelse

This is not in ConTeXt currently. Would it be easy to program such a  
multiple modes selector?

G
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: \doifmodeselse?
  2009-04-02 16:01 \doifmodeselse? Gerben Wierda
@ 2009-04-02 16:28 ` Alan Stone
  2009-04-02 16:42   ` \doifmodeselse? Alan Stone
  2009-04-02 16:34 ` \doifmodeselse? Hans Hagen
  1 sibling, 1 reply; 4+ messages in thread
From: Alan Stone @ 2009-04-02 16:28 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 939 bytes --]

On Thu, Apr 2, 2009 at 6:01 PM, Gerben Wierda <Gerben.Wierda@rna.nl> wrote:

> Using --mode or --modes with texexec sets up modes which can be used in the
> files to parse different parts.
>
> For that I use \doifmodeelse{}{}{}
>
> But combining various modes in one \doiffmodeelse would be handy.
>
> e.g. (pseudocode)
>
>  if mode is workinprogress or test
>
> or the other way around
>
>  if mode is all or editor
>
> So I would like something like
>
> \doifmodeselse{all,editor)


Do you mean something like this ?

\starttext
\doifmodeelse{a,b}
 {\doifmode{a}{a}
  \doifmode{b}{b}}
 {c}
\stoptext

context.cmd --modes=a modes
context.cmd --modes=a,b modes
context.cmd --modes=c modes

Alan


>
>
> or even better booleans
>
> \doiffmodeselse{not test or editor}
>
> so I do not need to build a large setup of nested \ifmodeelse
>
> This is not in ConTeXt currently. Would it be easy to program such a
> multiple modes selector?
>
> G

[-- Attachment #1.2: Type: text/html, Size: 1526 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: \doifmodeselse?
  2009-04-02 16:01 \doifmodeselse? Gerben Wierda
  2009-04-02 16:28 ` \doifmodeselse? Alan Stone
@ 2009-04-02 16:34 ` Hans Hagen
  1 sibling, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2009-04-02 16:34 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Gerben

> So I would like something like
> 
> \doifmodeselse{all,editor)

that should work already with \doifmodeelse, where the default is 'or'

there is also an 'and':

\doifallmodeselse{all,editor)

> \doiffmodeselse{not test or editor}

maybe later, in mkiv

test:

\starttext

\enablemode[a,c]

\doifmodeelse    {a}   {okay}{oeps} \par
\doifmodeelse    {b}   {oeps}{okay} \par
\doifmodeelse    {a,c} {okay}{oeps} \par
\doifallmodeselse{a,c} {okay}{oeps} \par
\doifallmodeselse{a,b} {oeps}{okay} \par

\stoptext

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: \doifmodeselse?
  2009-04-02 16:28 ` \doifmodeselse? Alan Stone
@ 2009-04-02 16:42   ` Alan Stone
  0 siblings, 0 replies; 4+ messages in thread
From: Alan Stone @ 2009-04-02 16:42 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1173 bytes --]

For your information...

http://www.pragma-ade.com/general/manuals/mmodes.pdf

Alan

On Thu, Apr 2, 2009 at 6:28 PM, Alan Stone <software.list.1es9s@gmail.com>wrote:

>  On Thu, Apr 2, 2009 at 6:01 PM, Gerben Wierda <Gerben.Wierda@rna.nl>wrote:
>
>> Using --mode or --modes with texexec sets up modes which can be used in
>> the files to parse different parts.
>>
>> For that I use \doifmodeelse{}{}{}
>>
>> But combining various modes in one \doiffmodeelse would be handy.
>>
>> e.g. (pseudocode)
>>
>>  if mode is workinprogress or test
>>
>> or the other way around
>>
>>  if mode is all or editor
>>
>> So I would like something like
>>
>> \doifmodeselse{all,editor)
>
>
> Do you mean something like this ?
>
> \starttext
> \doifmodeelse{a,b}
>  {\doifmode{a}{a}
>   \doifmode{b}{b}}
>  {c}
> \stoptext
>
> context.cmd --modes=a modes
> context.cmd --modes=a,b modes
> context.cmd --modes=c modes
>
> Alan
>
>
>>
>>
>> or even better booleans
>>
>> \doiffmodeselse{not test or editor}
>>
>> so I do not need to build a large setup of nested \ifmodeelse
>>
>> This is not in ConTeXt currently. Would it be easy to program such a
>> multiple modes selector?
>>
>> G
>>
>

[-- Attachment #1.2: Type: text/html, Size: 2165 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-04-02 16:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-02 16:01 \doifmodeselse? Gerben Wierda
2009-04-02 16:28 ` \doifmodeselse? Alan Stone
2009-04-02 16:42   ` \doifmodeselse? Alan Stone
2009-04-02 16:34 ` \doifmodeselse? 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).