From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/80281 Path: news.gmane.org!not-for-mail From: Philipp Gesang Newsgroups: gmane.comp.tex.context Subject: Re: [***Spam/VIR***] Re: Layer vs. overlay Date: Wed, 16 Jan 2013 12:47:21 +0100 Message-ID: <20130116114721.GB553@phlegethon.router_intern> References: <3608C682-5ACB-4006-9CC7-9D848CB5BFC0@gmail.com> <37BA1BD5-D127-4A53-887A-92F5C19FF3A0@gmail.com> <10BF7AFF-32C7-4C8C-A1C6-538C9EB591EA@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0136753684==" X-Trace: ger.gmane.org 1358336853 4780 80.91.229.3 (16 Jan 2013 11:47:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 16 Jan 2013 11:47:33 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Jan 16 12:47:49 2013 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TvRTA-0006oO-0E for gctc-ntg-context-518@m.gmane.org; Wed, 16 Jan 2013 12:47:48 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 34FA7101EF; Wed, 16 Jan 2013 12:47:31 +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 E-PNIhRpdZGJ; Wed, 16 Jan 2013 12:47:29 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 02713101E5; Wed, 16 Jan 2013 12:47:29 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 44263101E5 for ; Wed, 16 Jan 2013 12:47:27 +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 G7HcFeOdhB59 for ; Wed, 16 Jan 2013 12:47:26 +0100 (CET) Original-Received: from filter1-ams.mf.surf.net (filter1-ams.mf.surf.net [192.87.102.69]) by balder.ntg.nl (Postfix) with ESMTP id 1E52A101E2 for ; Wed, 16 Jan 2013 12:47:26 +0100 (CET) Original-Received: from relay.uni-heidelberg.de (relay.uni-heidelberg.de [129.206.100.212]) by filter1-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r0GBlPBT028699 for ; Wed, 16 Jan 2013 12:47:25 +0100 Original-Received: from ix.urz.uni-heidelberg.de (cyrus-portal.urz.uni-heidelberg.de [129.206.100.176]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id r0GBlOgL020429 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 16 Jan 2013 12:47:24 +0100 Original-Received: from extmail.urz.uni-heidelberg.de (extmail.urz.uni-heidelberg.de [129.206.100.140]) by ix.urz.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id r0GBlOtT017783 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 16 Jan 2013 12:47:24 +0100 Original-Received: from localhost (p50846C67.dip.t-dialin.net [80.132.108.103]) (authenticated bits=0) by extmail.urz.uni-heidelberg.de (8.13.4/8.13.1) with ESMTP id r0GBlN2D024256 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Wed, 16 Jan 2013 12:47:23 +0100 Mail-Followup-To: mailing list for ConTeXt users In-Reply-To: X-Operating-System: Linux phlegethon 3.6.8-1-ARCH User-Agent: Mutt/1.5.21 (2010-09-15) X-Bayes-Prob: 0.9876 (Score 4.7, tokens from: @@RPTN) X-CanIt-Geo: ip=129.206.100.212; country=DE; latitude=51.0000; longitude=9.0000; http://maps.google.com/maps?q=51.0000,9.0000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0NIMzLp3D - c7f399f085c2 - 20130116 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.69 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:80281 Archived-At: --===============0136753684== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="aVD9QWMuhilNxW9f" Content-Disposition: inline --aVD9QWMuhilNxW9f Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable =C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7 > Now, I have a code which does much expected, but I'm not able to pass the= desired content to setups/layer: >=20 > ---- > \setupbodyfont[30pt] >=20 > \starttext > A >=20 > \definelayer [beforetext][width=3D\overlaywidth,height=3D\overlayheigh= t] > \defineoverlay[beforetext][{\setups[beforetext]\tightlayer[beforetext]}] >=20 > \startsetups[beforetext] > \setlayer[beforetext][preset=3Drighttop]{\framed[width=3D2in]{\direct= lua{context(userdata.LPr.text)}}} > \stopsetups >=20 > \startluacode > userdata =3D userdata or {} > userdata.LPr =3D userdata.LPr or {} >=20 > for i =3D 1, 2 do > context.startTEXpage{background=3D"foreground,beforetext"} > userdata.LPr.text =3D "BEF" .. i >=20 > context.externalfigure({"cow"},{width=3D"30cm"}) > context.stopTEXpage() > end > \stopluacode >=20 > Z > \stoptext > ---- >=20 > Both images of the cow have "BEF2" in the top right corner, but there sho= uld be "BEF1" on the former and "BEF2" on the latter. >=20 > I'm trying to pass the text string ("BEF" .. i) via userdata, but it does= n't work. Afair entire Lua snippet is evaluated first, so any calls to TEX are delayed until after the loop is executed. Thus the layer is drawn only when LPr.text already has the final value. But I=E2=80=99m not entirely sure that=E2=80=99s the correct explanation. > So how to do it? Lookup the correct string from a table? =C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2= =B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7= =C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2= =B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7= =C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2= =B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7 \setupbodyfont[30pt] \starttext A \definelayer [beforetext][width=3D\overlaywidth,height=3D\overlayheight] \defineoverlay[beforetext][{\setups[beforetext]\tightlayer[beforetext]}] \startsetups[beforetext] \setlayer[beforetext][preset=3Drighttop] {\framed[width=3D2in]{\directlua{userdata.LPr.get_label()}}} \stopsetups \startluacode userdata =3D userdata or { } userdata.LPr =3D userdata.LPr or { } local labels =3D { } local current =3D 0 userdata.LPr.get_label =3D function ( ) current =3D current + 1 context(labels[current]) end for i =3D 1, 2 do context.startTEXpage { background =3D "foreground,beforetext" } labels[i] =3D "BEF" .. i context.externalfigure({"cow"},{width=3D"30cm"}) context.stopTEXpage() end \stopluacode Z \stoptext =C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2= =B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7= =C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2= =B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7= =C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2= =B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7 Regards Philipp --aVD9QWMuhilNxW9f Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iEYEARECAAYFAlD2k0kACgkQ02lYlJYWs9LGOwCfSlk/7J15DBxVahPm+0XY3qMH 9bQAmgLAoRoR0iFGiP+WuP9KuFL61iW5 =gHCQ -----END PGP SIGNATURE----- --aVD9QWMuhilNxW9f-- --===============0136753684== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --===============0136753684==--