If I modify a core lua file how do I remake the format file? Is this something that is done from mtxrun.exe? I would certainly prefer to use a hook rather than modifying a core file, but how do I identify the hooks that are available? Is there a list of hooks that are available, or a standard way that hooks are called from the context code so that I can look for an appropriate hook? Where do I place my hook scripts? Is there a guide that is available that might get me started? What I trying to do is map equation references to the equation number generated by context. So for example, if I have an equation: \placeformula \startformula \NC F = m a \NC \NR[eq:newtonslaw] \stopformula I need a way to log the fact that 'eq:newton' became something like equation (2.3). I hoped there was a tracker that printed this out (maybe there is, but I haven't found it). So I thought maybe I could find where equation numbers are defined by context and add a tracker. The code in 'strc-ref.mkvi' and 'strc-ref.lua' looked promising. Incidentally, is this where equation numbers are created, or should I be looking in another file? Is there a lua function that gets called consistently around the time equation numbers are defined where the equation reference (i.e. eq:newtonslaw) and the associated equation number are both available and could be logged? I tried adding a new tracker in strc-ref.lua to see if I could narrow down where the labels are created, but my tracker did not seem to work. Therefore, I identified a tracker that was working and tried to modify the output slightly only to find that this did not work either. It is not clear to me at present how context loads the lua files. I hoped that it loaded these directly, so that changes would take effect immediately. -Lance Larsen ------------------------------ On 6/7/2013 1:20 AM, Lance Larsen wrote:
I have a version of context standalone installed, and I am trying to add some functionality I need to strc-ref.lua. As a simple test to see if modifying the file was working, I enabled the ?structures.referencing.identifying? tracker and verified that I was getting messages from this tracker in the log. I then modified the log statement in strc-ref.lua and processed the document again. The changes I made to the lua file did not seem to be active. I verified that there is only one log statement that matches the output I am seeing. Why would my lua code change not be active? Is the lua code cached somehow? (I am running this from windows if that matters).
The code I modified is under the path:
context\tex\texmf-context\tex\context\base\ strc-ref.lua
if you patch files that way you need to remake the format file I don't know what you patch, but changing something in a core file is no guarantee for the future. It's not a problem to add functionality (lots of hooks for that) but best do that in a local module that gets loaded at runtime then. Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | 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://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ____________________________________________________________________________ _______ End of ntg-context Digest, Vol 108, Issue 19 ********************************************