From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/76975 Path: news.gmane.org!not-for-mail From: Philipp Gesang Newsgroups: gmane.comp.tex.context Subject: Re: \box0 to Lua Date: Tue, 19 Jun 2012 07:53:33 +0200 Message-ID: <20120619055332.GA6484@phlegethon> References: <4FDF41B8.1040508@gyza.cz> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0331974817==" X-Trace: dough.gmane.org 1340085130 12590 80.91.229.3 (19 Jun 2012 05:52:10 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 19 Jun 2012 05:52:10 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Jun 19 07:52:09 2012 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 1SgrMD-0007kf-6R for gctc-ntg-context-518@m.gmane.org; Tue, 19 Jun 2012 07:52:05 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id AD775101EE; Tue, 19 Jun 2012 07:52:04 +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 b1p08qpjDkzg; Tue, 19 Jun 2012 07:52:02 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 9C867101E0; Tue, 19 Jun 2012 07:52:02 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id EB45C101E0 for ; Tue, 19 Jun 2012 07:52:01 +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 uJS120HTp9Jn for ; Tue, 19 Jun 2012 07:52:00 +0200 (CEST) Original-Received: from filter5-til.mf.surf.net (filter5-til.mf.surf.net [194.171.167.221]) by balder.ntg.nl (Postfix) with ESMTP id 1D177101DD for ; Tue, 19 Jun 2012 07:52:00 +0200 (CEST) Original-Received: from relay.uni-heidelberg.de (relay.uni-heidelberg.de [129.206.100.212]) by filter5-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id q5J5p7ZA005200 for ; Tue, 19 Jun 2012 07:51:07 +0200 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 q5J5pwsW031922 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 19 Jun 2012 07:51:58 +0200 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 q5J5pvFM010011 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 19 Jun 2012 07:51:57 +0200 Original-Received: from localhost (dslb-188-104-130-197.pools.arcor-ip.net [188.104.130.197]) (authenticated bits=0) by extmail.urz.uni-heidelberg.de (8.13.4/8.13.1) with ESMTP id q5J5puet031421 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Tue, 19 Jun 2012 07:51:57 +0200 Mail-Followup-To: mailing list for ConTeXt users In-Reply-To: X-Operating-System: Linux phlegethon 3.3.7-1-ARCH X-License: "CC-BY-SA 3.0" User-Agent: Mutt/1.5.21 (2010-09-15) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=129.206.100.212; country=DE; region=01; city=Heidelberg; latitude=49.4167; longitude=8.7000; http://maps.google.com/maps?q=49.4167,8.7000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0WHo5P7wi - 02714c07fa3a - 20120619 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.221 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.13 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:76975 Archived-At: --===============0331974817== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="CE+1k2dSO48ffgeK" Content-Disposition: inline --CE+1k2dSO48ffgeK Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Ahoj! =C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7=C2=B7 > On Mon, 18 Jun 2012 16:56:56 +0200, Jaroslav Hajtmar wr= ote: >=20 > >Ahoj... > >To bych ti rekl ... :-) > > tex.box[0].height >=20 > ... To ale z=C3=ADsk=C3=A1=C5=A1 jen v=C3=BD=C5=A1ku boxu, ne? >=20 > Co kdy=C5=BE ten hbox chce=C5=A1 vys=C3=A1zet Luou na n=C4=9Bjakou =C5=A1= =C3=AD=C5=99ku? Na to bude=C5=A1 pot=C5=99ebovat node.hpack() (luatexref-t.pdf, s. 95). =C2=B7=C2=B7=C2=B78<=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 \starttext foo \startluacode local newnode =3D node.new(node.id"glyph") newnode.char =3D unicode.utf8.byte"x" newnode.font =3D font.current() -- won=E2=80=99t work before \starttext newnode.lang =3D tex.language --- second arg to node.hpack is width local hbox =3D node.hpack(newnode, 2*newnode.width) node.write(hbox) \stopluacode bar \stoptext =C2=B7=C2=B7=C2=B78<=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 The first argument is the head of a node list, the second can be the width in sp (or =E2=80=9Cspread=E2=80=9D). See Patrick=E2=80=99s excell= ent tutorial: http://wiki.luatex.org/index.php/TeX_without_TeX to get started with node fun. (The \box registers are accessible as tex.box, see page 112 in the luatex manual.) Philipp >=20 > L. >=20 >=20 > > > >J. > > > > > > > > > > > >Dne 18.6.2012 16:53, Proch=C3=A1zka Luk=C3=A1=C5=A1 Ing. - Pontex s. r. = o. napsal(a): > >>Hello, > >> > >>(my apologies if this message is duplicated - our mail server was > >>out-of-order some time) > >> > >>how to call "\box0" and "\hbox to3cm{abc}" by Lua? > >> > >>---- > >>\startluacode > >> context[[\box0]] % OK but a "nicer" way preferred, so keep on trying= - > >> context.box(0) % Error > >> context.box{0} % Error > >> context.box"0" % Error > >> > >> context.hbox({to =3D "cm"}, "abc") % Error > >>\stopluacode > >>---- > >> > >>TIA. > >> > >>Best regards, > >> > >>Lukas > >> > >> > > > >________________________________________________________________________= ___________ > >If your question is of interest to others as well, please add an entry t= o the Wiki! > > > >maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-c= ontext > >webpage : http://www.pragma-ade.nl / http://tex.aanhet.net > >archive : http://foundry.supelec.fr/projects/contextrev/ > >wiki : http://contextgarden.net > >________________________________________________________________________= ___________ > > >=20 >=20 > --=20 > Ing. Luk=C3=A1=C5=A1 Proch=C3=A1zka [mailto:LPr@pontex.cz] > Pontex s. r. o. [mailto:pontex@pontex.cz] [http://www.pontex.cz] > Bezov=C3=A1 1658 > 147 14 Praha 4 >=20 > Tel: +420 244 062 238 > Fax: +420 244 461 038 >=20 > _________________________________________________________________________= __________ > If your question is of interest to others as well, please add an entry to= the Wiki! >=20 > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-co= ntext > webpage : http://www.pragma-ade.nl / http://tex.aanhet.net > archive : http://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > _________________________________________________________________________= __________ --=20 () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments --CE+1k2dSO48ffgeK Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iEYEARECAAYFAk/gE9wACgkQ02lYlJYWs9KYFwCfYX2cQQZdle1A0kqob2Kp/Bjr 5M8An0RvjBtvxRI9S9kNmE/Yn+F19UIN =YG1J -----END PGP SIGNATURE----- --CE+1k2dSO48ffgeK-- --===============0331974817== 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 ___________________________________________________________________________________ --===============0331974817==--