From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/46561 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: Problem Passing \starttabulate into Lua Date: Mon, 29 Dec 2008 14:28:49 +0100 Message-ID: References: <49560F83.3080706@cyberdude.com>, <68E5AC30CE6FA94DB0C3B4E3294B5D3103754222EA@ES01SNLNT.srn.sandia.gov> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v930.3) Content-Type: text/plain; charset="us-ascii"; Format="flowed"; DelSp="yes" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1230557435 7386 80.91.229.12 (29 Dec 2008 13:30:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 29 Dec 2008 13:30:35 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Dec 29 14:31:43 2008 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 1LHIDe-0004HT-54 for gctc-ntg-context-518@m.gmane.org; Mon, 29 Dec 2008 14:31:42 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id B02101FC6B; Mon, 29 Dec 2008 14:30:26 +0100 (CET) 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 26963-05-4; Mon, 29 Dec 2008 14:29:31 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 683991FC39; Mon, 29 Dec 2008 14:29:31 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id C0E031FC39 for ; Mon, 29 Dec 2008 14:29:29 +0100 (CET) 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 26963-05-3 for ; Mon, 29 Dec 2008 14:28:51 +0100 (CET) Original-Received: from mail-bw0-f20.google.com (mail-bw0-f20.google.com [209.85.218.20]) by ronja.ntg.nl (Postfix) with ESMTP id D8DA91FBC9 for ; Mon, 29 Dec 2008 14:28:51 +0100 (CET) Original-Received: by bwz13 with SMTP id 13so11965375bwz.2 for ; Mon, 29 Dec 2008 05:28:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:to:in-reply-to :content-type:content-transfer-encoding:mime-version:subject:date :references:x-mailer:from; bh=R5BVkjxHEyVnghvICIZla/eMys7BZTC4SrXbbBFWBhk=; b=QdXGO5phOQPsJXPVTVxBLg0JzY1OlvSYhmQTAhHdetzyOuan9bqddoJHP/VfgkZQ69 YHu1FNAy5zjoXcfKejXLzOAQQND2SipJeQvfpTyf2zgRnnJhQx/+PgizZQJEDVxSr+XY WA2AeQabBRiKx0PF4U2cD5X1GcbPJnq0PLKkA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:to:in-reply-to:content-type:content-transfer-encoding :mime-version:subject:date:references:x-mailer:from; b=bzWBznXoKTUrEFLqTweWI0slZenLca5UQkE+lYGL7swclWKX8oJbKbc3tDt4C5oDoY wgf80vctVg+rqIpjXHZyuy62AHqTqIb4gYDp6WuOEmRk05T/OJzwVSwPhtJuj4qxsoTF zbdkvv3f5JzkdIl5RyelvL5+eb1qQWUHAgVrE= Original-Received: by 10.223.105.195 with SMTP id u3mr9883356fao.13.1230557331469; Mon, 29 Dec 2008 05:28:51 -0800 (PST) Original-Received: from ?192.168.2.23? (p5B295891.dip.t-dialin.net [91.41.88.145]) by mx.google.com with ESMTPS id b17sm12777671fka.15.2008.12.29.05.28.50 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 29 Dec 2008 05:28:50 -0800 (PST) In-Reply-To: <68E5AC30CE6FA94DB0C3B4E3294B5D3103754222EA@ES01SNLNT.srn.sandia.gov> X-Mailer: Apple Mail (2.930.3) 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:46561 Archived-At: Am 29.12.2008 um 13:56 schrieb Ashlock, Tad A: > On 2008-12-28 at 15:33, Wolfgang Schuster wrote: >> Am 27.12.2008 um 12:20 schrieb Tad Ashlock: >>> I'm trying to create a ConTeXt macro (mkiv) that will manipulate the >>> macro argument's text with Lua and then feed it back into ConTeXt >>> with tex.print(). My approach worked correctly until I called the >>> macro with \starttabulate ... \stoptabulate in the macro's >>> argument. So I started reducing the problem down to a minimum >>> example which surprisingly turned out to have nothing to do with the >>> manipulations I was performing. > [snip] >> >> \def\testmacro >> {\bgroup >> \catcode`\\=12 >> \dotestmacro} >> >> \def\dotestmacro#1 >> {\ctxlua{d='\luaescapestring{#1}'}% >> \egroup} >> >> \starttext >> >> \testmacro{\starttabulate \NC text \NC text \NC\NR \stoptabulate} >> >> %\ctxlua{tex.sprint(d)} >> >> \stoptext >> >> Wolfgang > > Thank you Wolfgang! That's certainly a step in the right > direction. But what I (and others?) really need is a way of passing > any chunk of ConTeXt code into Lua. Everything you pass to Lua is expanded and this did not work with macros that contain \dosingleempty (or \dodoubleempty etc.). \def\command {\dosingleempty\docommand} \def\docommand[#1]{#1} \def\testmacro#1% {\ctxlua{d='\luaescapestring{#1}'}} \starttext \testmacro{\docommand[text]} % works \testmacro{\command[text]} % fails \stoptext > When I changed '\starttabulate' to '\starttabulate[|l|p|]' in your > solution above, it broke. Try to escape the |, it's a active character in ConTeXt but this could work (untested): \def\testmacro {\bgroup \catcode`\\=12 \catcode`\|=12 \dotestmacro} Wolfgang ___________________________________________________________________________________ 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 ___________________________________________________________________________________