From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/64925 Path: news.gmane.org!not-for-mail From: Achim Jander Newsgroups: gmane.comp.tex.context Subject: Re: still struggling with footnotes Date: Wed, 05 Jan 2011 16:54:50 +0100 Message-ID: <4D24944A.3090600@jander.de> References: <4D21F083.8080000@jander.de> 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 1294242943 19494 80.91.229.12 (5 Jan 2011 15:55:43 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 5 Jan 2011 15:55:43 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Jan 05 16:55:39 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 1PaVi6-0004PH-M1 for gctc-ntg-context-518@m.gmane.org; Wed, 05 Jan 2011 16:55:38 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id D4A60CA940; Wed, 5 Jan 2011 16:55: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 C4SKlZdUoym9; Wed, 5 Jan 2011 16:55:35 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 5BE73CA949; Wed, 5 Jan 2011 16:55:35 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 6ADECCA949 for ; Wed, 5 Jan 2011 16:55:34 +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 QUC4B2O2GPm5 for ; Wed, 5 Jan 2011 16:55:23 +0100 (CET) Original-Received: from filter3-til.mf.surf.net (filter3-til.mf.surf.net [194.171.167.219]) by balder.ntg.nl (Postfix) with ESMTP id 4DEB2CA940 for ; Wed, 5 Jan 2011 16:55:23 +0100 (CET) Original-Received: from p15188155.pureserver.info (p15188155.pureserver.info [212.227.83.96]) by filter3-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p05FtMas029680 for ; Wed, 5 Jan 2011 16:55:22 +0100 Original-Received: (qmail 14679 invoked from network); 5 Jan 2011 16:55:21 +0100 Original-Received: from krlh-4d0213e5.pool.mediaways.net (HELO ?192.168.1.43?) (77.2.19.229) by p15188155.pureserver.info with SMTP; 5 Jan 2011 16:55:21 +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: <4D21F083.8080000@jander.de> 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: 0eDPPTmMh - 1c0fc823d40e - 20110105 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.219 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:64925 Archived-At: Am 03.01.2011 16:51, schrieb Achim Jander: > Hi all, > I am still trying to get the footnote numbers aligned in a special > way: flushright, but the width depends on the width of the max > footnote-number on page, > so to get > 1 > 2 > and > ~9 > 10 > > After reading the manuals and the source given in strc-not.lua thats > how far i am at the moment: > > \enabletrackers[structures.notes] > > \setupnote[footnote][numbercommand=, way=bypage] > \setupnotedefinition[footnote][location=left,distance=1em,hang=4,headalign={flushright},width=1em] > > > > \def\getmaxnote[#1]{\ctxlua{ > local n = structures.notes.getn("#1",n) > local current = structures.notes.get("#1",n) > local cr = current.references > local result = cr.realpage > > -- calculate the width of cr.number and store in maxwidth > -- loop through the notes until act.realpage <> cr.realpage > -- and for each note calculate the width, compare with maxwidh and > store the max > -- then set the width to the correct maxwidth > > -- context.setupnotedefinition({"footnote"}, {width=maxwidth}) > > } > } > > \appendtoks > \getmaxnote[footnote] > \to\everybeforenoteinsert > > \showframe > > \starttext > \dorecurse {100} { > test \footnote{test } > } > \stoptext > > Now I can not figure out how to get the "real" footnote-number of the > note (is there any way?) And does this approach make sense at all? > Any hints welcome, i tear my hair for hours now > > Greetings, > Achim Hi again, now i found out how to get the footnote-number: local num = current.numberdata local test = num.numbers local num = tostring(test[1]) but i also found out, that my plan of iterating through the notes was indeed senseless, because at this stage the next footnote is not known. (i should have tested that first). So my new plan is, to calculate the correct width in everybeforenoteinsert, and to compare it with the first one of the page. My question now: is there any possibility to restart the page when i find that i need a greater width? eg to invoke a command \justdoitagainsam?? Sorry that i make so much noise about such a silly footnote-thing, but all my books have many footnotes, and all the notes have to be typesetted like that (not my idea) So without, i could hardly use ConTeXt anyway and that would be sad... Greetings, Achim ___________________________________________________________________________________ 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 ___________________________________________________________________________________