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

Sanjoy Mahajan sanjoy at olin.edu
Fri Feb 1 17:08:56 CET 2019


On 2019-02-01 09:48, Hans Hagen <j.hagen at xs4all.nl> wrote:

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

They are very helpful; thank you.  Those and Mikail's example are also
inspiring me to provide a hint and a solution for each problem, not just
a solution.

By the way, in the test suite (from the PRAGMA site), blocks-001.tex
crashes the 2019.01.28 beta here on my Debian amd64 system, with the
following error on the terminal (no log file is even produced):

 $ mycontext blocks-001.tex
 /home/sanjoy/context/2019.01.28-beta/tex/texmf-linux-64/bin/context
 /home/sanjoy/context/2019.01.28-beta/tex/texmf-linux-64/bin/luatex
 ...ta/tex/texmf-context/scripts/context/lua/mtx-context.lua:427: attempt to call a nil value (global 'restart')

(The two file paths that are printed first are for my own debugging,
 to ensure that the run is using the context and luatex binaries from
 the minimals installation.)

The culprit seems to be the "% engine=luatex" first line.  At least,
deleting it fixes the problem.  Meanwhile, blocks-003.tex doesn't have
it, and it runs fine.

About the test-suite wiki page...actually, I'll start a new thread for
that topic as it's not directly related to problems/solutions/blocks.

-Sanjoy


More information about the ntg-context mailing list