From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/50935 Path: news.gmane.org!not-for-mail From: Piotr Kopszak Newsgroups: gmane.comp.tex.context Subject: luatex examples - Traversing TeX nodes Date: Mon, 1 Jun 2009 11:48:09 +0200 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: ger.gmane.org 1243849768 10543 80.91.229.12 (1 Jun 2009 09:49:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 1 Jun 2009 09:49:28 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Jun 01 11:49:26 2009 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1MB48v-0002WY-2a for gctc-ntg-context-518@m.gmane.org; Mon, 01 Jun 2009 11:49:21 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 91B5B1FCE5; Mon, 1 Jun 2009 11:49:20 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 31459-06-4; Mon, 1 Jun 2009 11:48:38 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 22B9D1FCDD; Mon, 1 Jun 2009 11:48:38 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 1F3961FC9B for ; Mon, 1 Jun 2009 11:48:37 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 04451-04-2 for ; Mon, 1 Jun 2009 11:48:15 +0200 (CEST) Original-Received: from filter4-til.mf.surf.net (filter4-til.mf.surf.net [194.171.167.220]) by ronja.ntg.nl (Postfix) with ESMTP id 3A6361FCDE for ; Mon, 1 Jun 2009 11:48:15 +0200 (CEST) Original-Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.154]) by filter4-til.mf.surf.net (8.13.8/8.13.8/Debian-3) with ESMTP id n519mAx2027577 for ; Mon, 1 Jun 2009 11:48:12 +0200 Original-Received: by fg-out-1718.google.com with SMTP id l27so478759fgb.8 for ; Mon, 01 Jun 2009 02:48:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=vjdS6hOcqJjUo9WxV5wYotBqkVMdJvTl1CPnNZqFU1s=; b=nkiEUBzrRzzVu4YoBfLzdkpmyCxhl+Z5N1O0pWvc9ZNKsgrkq2dADSJc+CQ1dnadwj 8lJbHFp8HkeiQNhEMw/tRHx6XXtnyLJMttewAY1Zmx7LMWIbuiBNCmhG7e1/YqxH88Tc 52BjXqyNdFB0OSNPiXchAdCBF+CmXc2UZtgNg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=eYRBMcvAQeJaQc/t9hgGuCBE5EF4vqwUZLZzYlaVLPMj0T1OVIPU2Pou9rTU3YlvYE GGk6jHPSfUZetJESCP0V+GMIAtL1PU5VmR6hrnZKbYE/t2kZ+eLZIqYmIUadRx1d68ha wXOWsHtn6Hcw8yAElyMaMpUNbstLmPJgMYoyE= Original-Received: by 10.86.27.6 with SMTP id a6mr6317428fga.6.1243849689566; Mon, 01 Jun 2009 02:48:09 -0700 (PDT) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=72.14.220.154; 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: 235204358 - 3e3c747aae16 - 20090601 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.220 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.11 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 X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:50935 Archived-At: Hello, I am trying to compile luatex examples from http://luatex.bluwiki.com . How could I make it work with ConTeXt? The following fails. ----------------------------------------------------------------------------------------------------------------------------------- \directlua0{ local glyph = node.id('glyph') local hlist = node.id('hlist') local vlist = node.id('vlist') function gothru(h,prof) for t in node.traverse(h) do texio.write_nl(string.rep("...",prof) .. 'NODE type=' .. node.type(t.id) .. ' subtype=' .. t.subtype ) if t.id == hlist or t.id == vlist then texio.write(' w=' .. t.width .. ' h=' .. t.height .. ' d=' .. t.depth .. ' s=' .. t.shift ) gothru(t.list,prof+1) end if t.id == glyph then texio.write(' font=' .. t.font .. ' char=' .. t.char .. ' width=' font.fonts[t.font].characters[t.char]['width']) end end end callback.register('pre_linebreak_filter', function(h) gothru(h,0) return true end ) } \starttext bla bla bla bla \stoptext ------------------------------------------------------------------------------------------------------- best Piotr -- http://okle.pl ___________________________________________________________________________________ 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 ___________________________________________________________________________________