From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/73187 Path: news.gmane.org!not-for-mail From: Felix Ingram Newsgroups: gmane.comp.tex.context Subject: \placelist summary alternative solution Date: Wed, 14 Dec 2011 16:50:18 +0000 Message-ID: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1323881442 28244 80.91.229.12 (14 Dec 2011 16:50:42 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 14 Dec 2011 16:50:42 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Dec 14 17:50:38 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 1Ras2P-00023L-U0 for gctc-ntg-context-518@m.gmane.org; Wed, 14 Dec 2011 17:50:37 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id CD874CB171; Wed, 14 Dec 2011 17:50:36 +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 fCGkZTonKbuU; Wed, 14 Dec 2011 17:50:30 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 90B5DCB16A; Wed, 14 Dec 2011 17:50:30 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 5A353CB16A for ; Wed, 14 Dec 2011 17:50:29 +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 CfDYp6rdaU3c for ; Wed, 14 Dec 2011 17:50:27 +0100 (CET) Original-Received: from filter5-til.mf.surf.net (filter5-til.mf.surf.net [194.171.167.221]) by balder.ntg.nl (Postfix) with ESMTP id 6B335CB169 for ; Wed, 14 Dec 2011 17:50:27 +0100 (CET) Original-Received: from mail-vx0-f169.google.com (mail-vx0-f169.google.com [209.85.220.169]) by filter5-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id pBEGoIUB012454 for ; Wed, 14 Dec 2011 17:50:19 +0100 Original-Received: by vcbfk26 with SMTP id fk26so993730vcb.14 for ; Wed, 14 Dec 2011 08:50:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=D3+gh/SJUJBLjdFKbP6y+LdE+MugX7c7i/zbrJOC2oA=; b=lDOEpTNvanjGB7XnzH1fvc928hheUJ6UVwk1+c1Dovj0R604p6o5KM+EddpcmJNqzT NIgko98YHXj4tfdVhOk3773+yiEUsDdUP9EuGikIqdAxGV8T793w64USJCG7x+bmEDGm nbZQOgdns+evmBIq0CA/GTrygSztHplhlHD00= Original-Received: by 10.52.33.99 with SMTP id q3mr5361529vdi.100.1323881418118; Wed, 14 Dec 2011 08:50:18 -0800 (PST) Original-Received: by 10.52.25.7 with HTTP; Wed, 14 Dec 2011 08:50:18 -0800 (PST) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.220.169; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0xG94OjMU - 70a0ea5ae9de - 20111214 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.221 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:73187 Archived-At: I've ended up delving into the dark art that is Lua for this solution: \define[0]\SummaryTable{% \placetable[force, none]{}{% \setupTABLE[frame=off] \bTABLE \bTABLEhead \bTR\bTH Reference\eTH\bTH Title\eTH\bTH Page\eTH\eTR \eTABLEhead \bTABLEbody \startluacode for k, v in ipairs(structures.lists.collected) do if v.metadata.kind == "section" and v.metadata.name == "section" then context.bTR() context.bTD() context("REFREF") context.eTD() context.bTD() context(v.titledata.title) context.eTD() context.bTD() context(v.references.realpage) context.eTD() context.eTR() end end \stopluacode% \eTABLEbody \eTABLE }% }% \starttext \section{Test} \input{knuth} \section{Test} \input{knuth} \section{Test} \input{knuth} \section{Test} \input{knuth} \section{Test} \input{knuth} \section{Test} \input{knuth} \section{Test} \input{knuth} \SummaryTable \stoptext This works to some degree though I have the following questions about it: 1. Is there a way to access a document global variable from Lua? I will use this to replace the REFREF text. 2. v.references.realpage isn't the actual page of the title. How can I access the page number that would have appeared in the ToC? (I've restarted the page numbering in my master doc, the above example works fine) 3. Is there a way to store some metadata along with my title? I'd like something similar to this: \myheader[author=me, date=2011-12-14]{This is my header with meta-data} and then be able to access it from Lua again. Thanks for any help you can give with this. Felix ___________________________________________________________________________________ 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 ___________________________________________________________________________________