From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/69944 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: Optimal way to defining of macros in Luacode in ConTeXt Date: Wed, 13 Jul 2011 16:33:52 +0200 Message-ID: <21109B35-0FFC-44B7-817B-9601A6D5101A@googlemail.com> References: <4E1C6883.30300@gyza.cz> <4E1C6BA0.90008@wxs.nl> <4E1D51D5.50507@gyza.cz> <4E1D6B95.4080200@wxs.nl> <4E1D6DF9.2050700@gyza.cz> <95434AD2-8A25-413A-A4EA-6CBA6DC96776@googlemail.com> <4E1DA72E.6070702@gyza.cz> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1310567663 16449 80.91.229.12 (13 Jul 2011 14:34:23 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 13 Jul 2011 14:34:23 +0000 (UTC) Cc: mailing list for ConTeXt users To: hajtmar@gyza.cz Original-X-From: ntg-context-bounces@ntg.nl Wed Jul 13 16:34:19 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 1Qh0W3-0007MR-0J for gctc-ntg-context-518@m.gmane.org; Wed, 13 Jul 2011 16:34:19 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id CD5C2CAE01; Wed, 13 Jul 2011 16:34:17 +0200 (CEST) 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 QLqr0WaGST2b; Wed, 13 Jul 2011 16:34:12 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 39B7BCAD97; Wed, 13 Jul 2011 16:34:12 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 64CB0CAD97 for ; Wed, 13 Jul 2011 16:34:10 +0200 (CEST) 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 qPi0g9paDn4K for ; Wed, 13 Jul 2011 16:33:57 +0200 (CEST) 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 3873BCAC8D for ; Wed, 13 Jul 2011 16:33:57 +0200 (CEST) Original-Received: from mail-fx0-f42.google.com (mail-fx0-f42.google.com [209.85.161.42]) by filter3-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p6DEXuUt002355 for ; Wed, 13 Jul 2011 16:33:56 +0200 Original-Received: by fxe23 with SMTP id 23so5776438fxe.15 for ; Wed, 13 Jul 2011 07:33:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=rTk/1ML1Kijfh94lgYnrkLbu4pSA4RIBYQKoJU7lS+c=; b=vlz1WIcxH9OPvuIN6Jc79HgYWvYA8K6q5i7Jos0kuuxgbau57w2jzCK5atiQiazW1f INBulpq3goKcG4YSJAkynNrr3LKGGk/3c5yTbFzkpHWCyeJ1prrd2UudRWTIPFQPsDwX jz8ZkqSmaADXh0J2we9bevR1k6SjlqA7WcHd0= Original-Received: by 10.223.67.194 with SMTP id s2mr1798093fai.124.1310567636285; Wed, 13 Jul 2011 07:33:56 -0700 (PDT) Original-Received: from [192.168.2.31] (p5B0EF420.dip.t-dialin.net [91.14.244.32]) by mx.google.com with ESMTPS id l9sm7427927fal.19.2011.07.13.07.33.53 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 13 Jul 2011 07:33:54 -0700 (PDT) In-Reply-To: <4E1DA72E.6070702@gyza.cz> X-Mailer: Apple Mail (2.1084) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.161.42; 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: 0cF7qxUjf - 97cae546cc14 - 20110713 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:69944 Archived-At: Am 13.07.2011 um 16:09 schrieb Jaroslav Hajtmar: > Thanx Wolfgang, > > It looks very interesting... It can be used this method for example for macro definitions? It depends what you want to achieve, while you try to create many commands in the form \MacroXXX where each command contains some content i define only one command which takes the content only when requested. > When I will return to the subject of this mail: > Can also be used for the council said Hans macros with multiple parameters? > > For example macros without parameter is no problem: > context.setvalue('printline',calling.luafunction(),tex.par) > I assume that for a more parameters cannot be used context.setvalue (...) .. > > But how to use multiple parameters when defining the macro as follows: > context([[\\def\\paramcontrol#1#2{%s}]],thirddata.scancsv.paramcontrol('#1', '#2')) Look into cldf-int.lua where you can see a method to create TeX commands without optional arguments from Lua. 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________