From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/65454 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: Problem calling Lua during \startsetups Date: Tue, 25 Jan 2011 09:34:43 +0100 Message-ID: <687AABEF-5154-45F8-B703-551F6D934642@gmail.com> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1295944500 1362 80.91.229.12 (25 Jan 2011 08:35:00 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 25 Jan 2011 08:35:00 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Jan 25 09:34:56 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 1PheMZ-0001NP-Rd for gctc-ntg-context-518@m.gmane.org; Tue, 25 Jan 2011 09:34:55 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 7DCADCA92C; Tue, 25 Jan 2011 09:34:55 +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 OnW3wX24jgJL; Tue, 25 Jan 2011 09:34:55 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 729DCCA940; Tue, 25 Jan 2011 09:34:52 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 4B032CA940 for ; Tue, 25 Jan 2011 09:34:50 +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 I9ZikRm0opAx for ; Tue, 25 Jan 2011 09:34:48 +0100 (CET) Original-Received: from filter5-ams.mf.surf.net (filter5-ams.mf.surf.net [192.87.102.73]) by balder.ntg.nl (Postfix) with ESMTP id 4C38CCA92C for ; Tue, 25 Jan 2011 09:34:48 +0100 (CET) Original-Received: from mail-bw0-f42.google.com (mail-bw0-f42.google.com [209.85.214.42]) by filter5-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p0P8YlC9009754 for ; Tue, 25 Jan 2011 09:34:47 +0100 Original-Received: by bwz13 with SMTP id 13so193313bwz.15 for ; Tue, 25 Jan 2011 00:34:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:content-type:mime-version:subject:from :in-reply-to:date:content-transfer-encoding:message-id:references:to :x-mailer; bh=AQdaIJKBwy1PKaELRy/YoH6JwdYOpA4W+s0dcn385UA=; b=lU+oUa+GkZoP6im6IOFtVDF5cPUnXWhqtjlKkGEH6qiSKgIbTy9wX3KS9TUExnLdKS FxkwbuaSQtYcf2Pz2IlCQL+LRgJvX3Kueh1XnSdlnwFNBH9JXzCY8XjhOwaSRwCtDQdm wrTTbXxsvnUq+aweW4tSDnEhSjl3xs1OCwjmU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; b=i+1FOsqMDWdoscmE+fPl0yxGCGvvlgx43rJKHoP33tuhQrJjNLxgUn+JoU7+26ZY6N S8HOZ8Gr5XDXo97ConzDVShvtDEfMBwdaw2zXveu0blaNehkrlsuYzDwBmBJRCVsH2Pm TDXTwM7lIqeiyBvVJe/cTL5bCo7mYs+TnIbOE= Original-Received: by 10.204.68.65 with SMTP id u1mr4729656bki.193.1295944487085; Tue, 25 Jan 2011 00:34:47 -0800 (PST) Original-Received: from [192.168.2.23] (p5B29585F.dip.t-dialin.net [91.41.88.95]) by mx.google.com with ESMTPS id j11sm6645886bka.12.2011.01.25.00.34.45 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 25 Jan 2011 00:34:46 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.1082) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.214.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: 0BDXIyLfK - 11989693b295 - 20110125 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.73 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:65454 Archived-At: Am 25.01.2011 um 09:00 schrieb Proch=E1zka Luk=E1=9A Ing. - Pontex s. r. o.: > Thank you, Wolfgang, this works better. > = > Actually I need to use '%' in the condition and that fails: > = > --- > ... > \startrawsetups layer > % The value of 'n' is used here to set the appropriate background, > % =3D n-th page of a PDF, and also to draw a filled rectangle on > % the left or right side (depending on whether n is even or odd) > = > % The code bellow fails > = > \startluacode > print("N=3D", n) > = > if n % 2 =3D=3D 1 then > = > else > = > end > \stopluacode > \stoprawsetups > ... > --- > = > with: > = > --- > ! LuaTeX error
:1: 'then' expected near 'else'. > --- > = > So like '%' was still treated as TeX comment char. > = > How to enable '%'? You can=92t use % in the luacode environment when you write it inside of another environment because TeX can change the meaning of % but this should works (untested): \startbuffer[lualayer] % =85 \startluacode =85 \stopluacode \stopbuffer \doifmode{foo}{\ctxluabuffer[lualayer]} Wolfgang ___________________________________________________________________________= ________ If your question is of interest to others as well, please add an entry to t= he Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-cont= ext webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________= ________