From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/72106 Path: news.gmane.org!not-for-mail From: Martin Fechner Newsgroups: gmane.comp.tex.context Subject: Re: lua and brackets Date: Thu, 03 Nov 2011 12:42:31 +0100 Message-ID: <4EB27E27.3090902@bbaw.de> References: <4EB25BC0.70202@bbaw.de> <4EB27486.6070402@wxs.nl> 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 1320320580 16898 80.91.229.12 (3 Nov 2011 11:43:00 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 3 Nov 2011 11:43:00 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Nov 03 12:42:55 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 1RLvh8-0004WJ-MH for gctc-ntg-context-518@m.gmane.org; Thu, 03 Nov 2011 12:42:54 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 38048CB0B3; Thu, 3 Nov 2011 12:42:54 +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 SFJMWyYP4JCa; Thu, 3 Nov 2011 12:42:48 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id B98B1CB097; Thu, 3 Nov 2011 12:42:48 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 0698DCB097 for ; Thu, 3 Nov 2011 12:42:47 +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 zoLrT1H42rdu for ; Thu, 3 Nov 2011 12:42:33 +0100 (CET) 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 29ADFCB05F for ; Thu, 3 Nov 2011 12:42:33 +0100 (CET) Original-Received: from mail.bbaw.de (mail.bbaw.de [194.95.188.6]) by filter3-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id pA3BgWId030854 for ; Thu, 3 Nov 2011 12:42:32 +0100 Original-Received: from mailhub.bbaw.de (unknown [192.168.4.1]) by mail.bbaw.de (Postfix) with ESMTP id 424174A8057 for ; Thu, 3 Nov 2011 12:42:30 +0100 (CET) Original-Received: by mailhub.bbaw.de (Postfix, from userid 10) id D4A0C93D12; Thu, 3 Nov 2011 12:42:30 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by mailhub.bbaw.de (Postfix) with ESMTP id 924D293D14 for ; Thu, 3 Nov 2011 12:42:30 +0100 (CET) Original-Received: from mailhub.bbaw.de (localhost [127.0.0.1]) by localhost (AvMailGate-2.1.4-7) id 32431-9eeBdv; Thu, 3 Nov 2011 12:42:30 +0100 (CET) Original-Received: from [192.168.1.197] (unknown [192.168.1.197]) by mailhub.bbaw.de (Postfix) with ESMTP id 7AD4993D11 for ; Thu, 3 Nov 2011 12:42:30 +0100 (CET) User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2 In-Reply-To: <4EB27486.6070402@wxs.nl> X-AntiVirus: checked by Avira MailGate (version: 2.1.4-7; AVE: 7.9.6.100; VDF: 7.11.16.255; host: mailhub); id=32431-9eeBdv X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=194.95.188.6; country=DE; region=16; city=Berlin; latitude=52.5167; longitude=13.4000; http://maps.google.com/maps?q=52.5167,13.4000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0cFQzGwal - c730df2fedf3 - 20111103 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:72106 Archived-At: Am 03.11.2011 12:01, schrieb Hans Hagen: > On 3-11-2011 10:15, Martin Fechner wrote: >> Hi all, >> >> I try to call a lua-function, but it seems that it doesn't work if the >> parameter contains squared brackets. Here is a short example: >> >> \starttext >> sometext >> \reference[myref]{} >> is >> \ctxlua{tex.print(\atpage[myref])} >> \stoptext >> >> Is there a way to mask the brackets? > > "\atpage[myref]" > My lua function doesn't just print the parameter. I have a function like this: \startluacode function pagesetup(page1,page2) if page1==page2 then tex.print(page1) elseif page1+1==page2 then tex.print(page1..'f.') else tex.print(page1..'-'..page2) end function \stopluacode \starttext \reference[myref1]{} \page \reference[myref2]{} \ctxlua{\at[myref1],\at[myref2]} \stoptext But I find no way that it works with the two references with brackets. Somewhere else I have an similar problem when I work with counters. The lua-function there doesn't accept this \ctxlua{dosomething(\getnumber[mynumber])} ___________________________________________________________________________________ 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 ___________________________________________________________________________________