Hi Wolfgang,

Thanks for the tip: I’ll try to adapt what you suggest to the case of blocks 
and question-hint-answer, and then let you know if I succeed.
Out of curiosity, how can one access the counter associated to an enumeration 
or an item?

Also, if I understand correctly, the command
        \increment\QuestionCounter
creates first a counter named QuestionCounter, if it does not exist yet, and 
then increments its value: so one does not need anymore commands such as
        \newcounter\QuestionCounter
before incrementing it. Am I right?

Best regards: OK

On 12 janv. 2014, at 22:40, Wolfgang Schuster <schuster.wolfg...@gmail.com> 
wrote:

> […]
> When you have only questions and answers you can use the coupling key but in 
> your case something like below is necessary:
> 
> \defineenumeration[Question]
> \defineenumeration[Answer]
> 
> \define\startquestion
>  {\increment\QuestionCounter
>   \expanded{\startQuestion[reference=Question:\QuestionCounter]}}
> 
> \define\stopquestion
>  {\stopQuestion
>   \par
>   \in{Answer}[Answer:\QuestionCounter]}
> 
> \define\startanswer
>  {\expanded{\startAnswer[reference=Answer:\QuestionCounter]}}
> 
> \define\stopanswer
>  {\stopAnswer
>   \par
>   \in{Question}[Question:\QuestionCounter]}
> 
> \setupinteraction[state=start]
> 
> \starttext
> 
> \startquestion
> What is the answer to life the universe and everything?
> \stopquestion
> 
> \page
> 
> \startanswer
> 42.
> \stopanswer
> 
> \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
> ___________________________________________________________________________________

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

Reply via email to