From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/64968 Path: news.gmane.org!not-for-mail From: Achim Jander Newsgroups: gmane.comp.tex.context Subject: Re: still struggling with footnotes Date: Thu, 06 Jan 2011 16:58:02 +0100 Message-ID: <4D25E68A.6010309@jander.de> References: <4D21F083.8080000@jander.de> <4D24944A.3090600@jander.de> <4D25C84E.1020009@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1294329526 26724 80.91.229.12 (6 Jan 2011 15:58:46 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 6 Jan 2011 15:58:46 +0000 (UTC) Cc: mailing list for ConTeXt users To: Hans Hagen Original-X-From: ntg-context-bounces@ntg.nl Thu Jan 06 16:58:42 2011 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PasEb-0001iy-RB for gctc-ntg-context-518@m.gmane.org; Thu, 06 Jan 2011 16:58:41 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 4C6DFCAA0F; Thu, 6 Jan 2011 16:58:41 +0100 (CET) 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 4krzqoHDBAO1; Thu, 6 Jan 2011 16:58:40 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 519E0CAA07; Thu, 6 Jan 2011 16:58:38 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 8285DCAA07 for ; Thu, 6 Jan 2011 16:58:37 +0100 (CET) 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 JObe-B4KNf-K for ; Thu, 6 Jan 2011 16:58:35 +0100 (CET) Original-Received: from filter3-ams.mf.surf.net (filter3-ams.mf.surf.net [192.87.102.71]) by balder.ntg.nl (Postfix) with ESMTP id 32742CAA03 for ; Thu, 6 Jan 2011 16:58:35 +0100 (CET) Original-Received: from p15188155.pureserver.info (p15188155.pureserver.info [212.227.83.96]) by filter3-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p06FwYHI018159 for ; Thu, 6 Jan 2011 16:58:34 +0100 Original-Received: (qmail 26718 invoked from network); 6 Jan 2011 16:58:34 +0100 Original-Received: from krlh-5f722d3e.pool.mediaways.net (HELO ?192.168.1.43?) (95.114.45.62) by p15188155.pureserver.info with SMTP; 6 Jan 2011 16:58:34 +0100 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 In-Reply-To: <4D25C84E.1020009@wxs.nl> X-Bayes-Prob: 0.5 (Score 0, tokens from: ) X-CanIt-Geo: ip=212.227.83.96; country=DE; region=01; city=Karlsruhe; latitude=49.0047; longitude=8.3858; http://maps.google.com/maps?q=49.0047,8.3858&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0cDQfWyfh - 30300058fec1 - 20110106 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.71 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:64968 Archived-At: Hi Hans, your're a genious, thats so great! Thank you very very much! While testing and adapting the code, there are two questions still: I changed pages[number] = range to local order = v.references.order pages[order] = range and accordingly function document.dosomething() local n = structures.notes.getn("footnote",n) which seems to work, but it would be nice if you could confirm my suggestion that these two values are equal. The other question: As far as I can understand, structures.lists.collected seems to be filled before any typesetting is done yet??? Could you give me some enlightment about that or is it simply the ConTeXt magic? Thank you once again, Greetings Achim Am 06.01.2011 14:49, schrieb Hans Hagen: > something like this > > \enabletrackers[structures.notes] > > \setupnotedefinition[footnote][location=left,distance=1em,hang=4,headalign=flushright] > > > \startluacode > local n, ranges, pages = 0, { }, { } > for k, v in ipairs(structures.lists.collected) do > if v.metadata.kind == "description" and v.metadata.name == > "footnote" then > local realpage = v.references.realpage > local number = v.numberdata.numbers[1] > local range = ranges[realpage] > if not range then > range = { min = 0, max = 0 } > ranges[realpage] = range > end > if number < range.min then > range.min = number > end > if number > range.max then > range.max = number > end > pages[number] = range > end > end > function document.dosomething() > n = n + 1 > local range = pages[n] > if range then > context.setupnotedefinition( > { "footnote" }, > { sample = range.max } > ) > end > end > \stopluacode > > \appendtoks > \ctxlua{document.dosomething()} > \to \everybeforenoteinsert > > \showframe > > \starttext > \dorecurse {200} {test\footnote{test} } > \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 ___________________________________________________________________________________