From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/65450 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 08:44:38 +0100 Message-ID: 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 1295941548 20774 80.91.229.12 (25 Jan 2011 07:45:48 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 25 Jan 2011 07:45:48 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Jan 25 08:45:44 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 1Phdax-0000OR-J6 for gctc-ntg-context-518@m.gmane.org; Tue, 25 Jan 2011 08:45:43 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id A71BCCAA45; Tue, 25 Jan 2011 08:45:42 +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 PimvYm8AAJF4; Tue, 25 Jan 2011 08:45:30 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id B4515CAA19; Tue, 25 Jan 2011 08:45:30 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 521CCCAA19 for ; Tue, 25 Jan 2011 08:45:29 +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 pQgCALV4c3sa for ; Tue, 25 Jan 2011 08:45:17 +0100 (CET) Original-Received: from filter7-ams.mf.surf.net (filter7-ams.mf.surf.net [192.87.102.75]) by balder.ntg.nl (Postfix) with ESMTP id 7E86ACAA0D for ; Tue, 25 Jan 2011 08:45:17 +0100 (CET) Original-Received: from mail-fx0-f41.google.com (mail-fx0-f41.google.com [209.85.161.41]) by filter7-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p0P7jEkd006183 for ; Tue, 25 Jan 2011 08:45:15 +0100 Original-Received: by fxm12 with SMTP id 12so5320782fxm.14 for ; Mon, 24 Jan 2011 23:45:14 -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=SqulvCA3lKm78WGnpPHaXttTqRtlBCE3FWpZPXpooX4=; b=misHKiEBV9qsaLz51hNp/b+ZhZwm8efJgyDTwY98ftzympkt2e5BfmcvrhxsgBKVn7 QCgzK+CyuGqnRcMVHwg+xC/ViRZGYatlfrdLS5nWOh4RIW14tZ2fLtDoe8wBgyQND9os sEY8DGJP06zEvwVf/l0mTB1XvYO7hY7ccMpmE= 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=Q2M5ndueqe42i1s/x0XqDAK+0y7n47MOTBMbv5foYRGiqJmWDdOtiIUI+NaBNlrzH3 0sxGIQdlAyCoPjvYfbWq8lGb0sGyb8EnVhVLhX7krNbDQSzGMBXWjUuqrRcSeavPoUjQ efbfzc0ulwtEEIbhnjUvV1uBJyjqh1lUfFDPk= Original-Received: by 10.223.103.197 with SMTP id l5mr5452655fao.7.1295941514249; Mon, 24 Jan 2011 23:45:14 -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 f24sm4897897fak.24.2011.01.24.23.45.11 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 24 Jan 2011 23:45:12 -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.161.41; 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: 0DDXHJeLb - 45c83b3f107f - 20110125 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.75 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:65450 Archived-At: Am 25.01.2011 um 08:33 schrieb Proch=E1zka Luk=E1=9A Ing. - Pontex s. r. o.: > Hello, > = > I encountered a bit weird thing when I used Lua in \startsetup: > = > --- > \definelayer[T][x=3D0mm,y=3D0mm,width=3D\paperwidth,height=3D\paperheight] > = > \directlua{n, m =3D 1, 11} % Initialization > = > \startsetups layer > % In my real code (=3D not in this example) > % 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 [1] > = > \startluacode > print("N=3D", n) > = > if n =3D=3D 2 then > else > end > \stopluacode > \stopsetups > = > \setupbackgrounds[page][setups=3Dlayer,background=3D{T}] > = > \starttext > % The code bellow works well [2] > = > \startluacode > print("M=3D", m) > = > if m =3D=3D 2 then > else > end > \stopluacode > = > \dorecurse{4}{\page[empty]} > \stoptext > --- > = > The problem is that Lua code between \startsetups ... \stopsetups [1] see= ms to be "parsed" another way than when in [2]. > = > The [1] gives the following error message: > = > --- > ! LuaTeX error
:1: 'then' expected near 'thenelseend'. > --- > = > So it seems like s and/or <\n>s were "ignored". > = > If you commented [1], the section [2] would work well. > = > So how to use make Lua work well even between \startsetups ... \stopsetup= s? Use \startrawsetups =85 \stoprawsetups. 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 ___________________________________________________________________________= ________