From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/82823 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: How to hack the lua files Date: Fri, 07 Jun 2013 15:48:37 +0200 Message-ID: <51B1E4B5.1070403@wxs.nl> References: <51b1dc7a.caef440a.3a4a.ffffea86@mx.google.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1370612958 4560 80.91.229.3 (7 Jun 2013 13:49:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 7 Jun 2013 13:49:18 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Fri Jun 07 15:49:19 2013 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ukx2c-0008C3-Sp for gctc-ntg-context-518@m.gmane.org; Fri, 07 Jun 2013 15:49:18 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 97F3B101F6; Fri, 7 Jun 2013 15:49:18 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id HnLj7pz+4gcF; Fri, 7 Jun 2013 15:49:16 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id C48C1101EA; Fri, 7 Jun 2013 15:49:16 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id AC774101EA for ; Fri, 7 Jun 2013 15:49:15 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id sJIKRKRcpy3l for ; Fri, 7 Jun 2013 15:49:14 +0200 (CEST) Original-Received: from filter2-utr.mf.surf.net (filter2-utr.mf.surf.net [195.169.124.153]) by balder.ntg.nl (Postfix) with ESMTP id 68B48101E9 for ; Fri, 7 Jun 2013 15:49:04 +0200 (CEST) Original-Received: from smtp.ziggozakelijk.nl (D57D1DA2.static.ziggozakelijk.nl [213.125.29.162]) by filter2-utr.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r57Dn38l012409 for ; Fri, 7 Jun 2013 15:49:03 +0200 X-Default-Received-SPF: pass (skip=loggedin (res=PASS)) x-ip-name=10.100.1.103; Original-Received: from [10.100.1.103] (unverified [10.100.1.103]) by pragma-net.nl (SurgeMail 6.3c2) with ESMTP id 6814-1713362 for ; Fri, 07 Jun 2013 15:49:03 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 In-Reply-To: <51b1dc7a.caef440a.3a4a.ffffea86@mx.google.com> X-Authenticated-User: hagen@controller-9 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=213.125.29.162; country=NL; region=15; city=Zwolle; latitude=52.5058; longitude=6.0858; http://maps.google.com/maps?q=52.5058,6.0858&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 04JJpN3sX - a076e7beab80 - 20130607 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 195.169.124.153 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:82823 Archived-At: On 6/7/2013 3:13 PM, Lance Larsen wrote: > Hans, > > Your reply below was very helpful. I looked at the context command line > options and saw 'make'. After running this, the code changes took effect. > Thankyou. > > I could still use help in identifying where equation numbers are defined in > the code so that I can add a tracker. Do you have a suggestion of which > function (or at least lua file) I should look in for this? > > I am also curious how hooks are defined, so that I can identify them in the > code and see if there is one that would meek my purpose - also where the > hook scripts are placed so that context can find them. > > Thanks again for the reply which got me over the first hurdle. It's not that trivial as numbers are not stored like 2.1.2 and so, but as abstractions with optional rendering directives so that they can be generated on demand, depending on circumstances. For instance a formula number can be formatted differently in a list, reference, formula or wherever needed. So, in principle, there can be \in{formula}[a] references rendered in one place as 1.2.1 with the 1 being green and slanted and another place as 2.1 with the 1 being red and bold. So .. if a tracing feature like yours is needed for some reason, it has to be hooked into several places but in a consistent way (quite doable but takes time and no one needed it). The reason is that there is not one list of references but for efficiency reasons references are picked up from several 'tables'. For instance, currently, formula references come from structure lists (which also indicates that there can be lists of formulas). The following demonstrates this. \setupbodyfont[pagella] \starttext \placeformula[a] \startformula a \stopformula see \in{formula}[a] \placeformula[b] \startformula b \stopformula see \in{formula}[b] \startformula c \stopformula \startluacode local list = structures.lists.collected for i, l in ipairs(list) do -- if l.metadata.name == "formula" then logs.report("references",string.formatters["%s: %.t"]( l.references.reference, l.numberdata.numbers )) -- end end \stopluacode \stoptext ----------------------------------------------------------------- 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________