[NTG-context] Evaluating a Lua expression at the end

Kumar Appaiah a.kumar at alumni.iitm.ac.in
Mon Apr 13 13:53:28 CEST 2015


I am trying to set up a system where I can use Lua to find a total
that I can display at the end. For example, if I set a question paper,
after each question, I do a \directlua{total = total + 4}, assuming
this question has 4 points. At the top of my document, I now want to
say "Total points:" and display the value of total.

Now, naturally, using \directlua gives me 0, since total is 0 at the
beginning. But \latelua didn't seem to be what I am looking for. Could
someone please guide me in the right direction?



More information about the ntg-context mailing list