Re: [NTG-context] \doifmode error with question blocks

2017-05-18 Thread Hans Hagen

On 5/18/2017 1:48 PM, Jan Willem Flamma wrote:

Dear list members

If using modes to show or hide certain part of the text.

In the MWE below the part between the startmode[test] .. stopmode works jus 
fine. When using the \doifmode construction an error is produced on the 
position of the closing curly bracket.
I prefer to use \doifmode constructions because they can be nested. The 
question block must play a role here but I don’t know why.

Am I overlooking something here?

Kind regards,
Jan Willem Flamma



\enablemode[test]

\defineblock[question]
\defineblock[answer]

\starttext

\doifmode{test}{

\input knuth

\beginquestion
\startquestion
Question
\stopquestion
\endquestion
\beginanswer
\startanswer
Answer
\stopanswer
\endanswer

}


in order to get rid of the {} the \doifmode match has to grad the 
argument which doesn't work well with commands that change the nature of 
the \ on the fly, so it's a no-go




\startmode[test]

\input knuth

\beginquestion
\startquestion
Question
\stopquestion
\endquestion
\beginanswer
\startanswer
Answer
\stopanswer
\endanswer

\stopmode

\stoptext
___
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
___




--

-
  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
___

[NTG-context] \doifmode error with question blocks

2017-05-18 Thread Jan Willem Flamma
Dear list members

If using modes to show or hide certain part of the text.

In the MWE below the part between the startmode[test] .. stopmode works jus 
fine. When using the \doifmode construction an error is produced on the 
position of the closing curly bracket.
I prefer to use \doifmode constructions because they can be nested. The 
question block must play a role here but I don’t know why.

Am I overlooking something here?

Kind regards,
Jan Willem Flamma



\enablemode[test]

\defineblock[question]
\defineblock[answer]

\starttext

\doifmode{test}{

\input knuth

\beginquestion
\startquestion
Question
\stopquestion
\endquestion
\beginanswer
\startanswer
Answer
\stopanswer
\endanswer

}


\startmode[test]

\input knuth

\beginquestion
\startquestion
Question
\stopquestion
\endquestion
\beginanswer
\startanswer
Answer
\stopanswer
\endanswer

\stopmode

\stoptext
___
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
___