[NTG-context] getting ConTeXt results back to Lua (for typesetting solutions at end of document)

Hans Hagen j.hagen at xs4all.nl
Fri Feb 1 09:48:08 CET 2019

On 2/1/2019 4:10 AM, Sanjoy Mahajan wrote:
> Thank you, Matthias and Wolfgang, for the examples/solutions.
> If I understand them right, there must be one solution for each exercise
> (otherwise the solution numbering gets out of sync).  Or do the
> coupling= options in Matthias's example remove that restriction?  In my
> experiments with the examples, deleting the first solution
> unsynchronized the exercise--solution numbering, no matter how I fiddled
> with the coupling keys.
> In the ideal pedagogical world, I'd write a solution for each exercise.
> But reality might intervene, so I still wonder if the solutions can
> automatically know and include the exercise number (perhaps by placing
> \startanswer..\stopanswer inside \startexercise..\stopexercise and using
> \getnumber[exercise]).  If there is a clever way, that's great.  But,
> the nature of TeX as a macro language may preclude the \getnumber code
> being evaluated just when one wants.
given that context originally was made for typesetting educational 
materials including questions, answers, explanations ... how about 
looking at the 'blocks' mechanism (there are some examples in the test 
suite under blocks)


                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl

More information about the ntg-context mailing list