From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/77972 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: Creating TeX dimensions and counters registers directly in Lua Date: Wed, 22 Aug 2012 09:43:34 +0200 Message-ID: <522AFC92-40B9-438E-9920-F7C662C01B11@gmail.com> References: <503487F9.5040002@gyza.cz> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 6.0 \(1485\)) Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1345621433 30104 80.91.229.3 (22 Aug 2012 07:43:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 22 Aug 2012 07:43:53 +0000 (UTC) To: hajtmar@gyza.cz, mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Aug 22 09:43:50 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 1T45bR-0008K2-4c for gctc-ntg-context-518@m.gmane.org; Wed, 22 Aug 2012 09:43:49 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 6430910201; Wed, 22 Aug 2012 09:43:45 +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 WwIXVx9stes8; Wed, 22 Aug 2012 09:43:39 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id B8CCE101E8; Wed, 22 Aug 2012 09:43:39 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id DEC19101E8 for ; Wed, 22 Aug 2012 09:43:37 +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 vgMt6WqrpxdB for ; Wed, 22 Aug 2012 09:43:34 +0200 (CEST) Original-Received: from filter3-til.mf.surf.net (filter3-til.mf.surf.net [194.171.167.219]) by balder.ntg.nl (Postfix) with ESMTP id 02979101E0 for ; Wed, 22 Aug 2012 09:43:33 +0200 (CEST) Original-Received: from mail-bk0-f41.google.com (mail-bk0-f41.google.com [209.85.214.41]) by filter3-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id q7M7hWRA026941 for ; Wed, 22 Aug 2012 09:43:33 +0200 Original-Received: by bkcjc3 with SMTP id jc3so196613bkc.14 for ; Wed, 22 Aug 2012 00:43:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; bh=PUxASiT7D+i0MKhRjZtWxNDqneI8C4/e0uzJAEgVI7M=; b=HsxWTEGOUiLzeUuI0ljMdREkWkUS7siEJHL6UVHW+tVI08lxCmftg55Bnizr09XRSF XhPeeiwOYgYW3dCzmk2n+5EGTrpAJVLF1rR5AiCTj9bMeiHhu1vO6L2QElECTFRO8857 XGdJjA7uOp2UT79N6r5FkWM2cCoYqFEM0khzo/eg5XQ1A+n/lVFQY5h3pMtQ8/SEBuhZ rvdvXgx8bEeHnfEf2mpDvrQ3rqinlDC07Wi0viMcnf4OimY2291DFIBGI5BfuFrKHNiO I7CwA4B28cYGf1F+C5B16K6HKUznVE9ejIjP3LIh/ecHI8iDUEaQXv8y+Gwo+p477wP8 /ooQ== Original-Received: by 10.204.8.65 with SMTP id g1mr5974300bkg.50.1345621412463; Wed, 22 Aug 2012 00:43:32 -0700 (PDT) Original-Received: from [192.168.2.36] (p54BAF618.dip.t-dialin.net. [84.186.246.24]) by mx.google.com with ESMTPS id y20sm1984277bkv.11.2012.08.22.00.43.31 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 22 Aug 2012 00:43:31 -0700 (PDT) In-Reply-To: <503487F9.5040002@gyza.cz> X-Mailer: Apple Mail (2.1485) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.214.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: 06HNHHwqD - 70f335d2b75b - 20120822 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.219 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:77972 Archived-At: Am 22.08.2012 um 09:19 schrieb Jaroslav Hajtmar : > Hello all, > Is it possible to create a new dimension ConTeXt register directly in Lua= , or I have to first create the ConTeXt dimensional register and then to su= bsequently assign it a value? > = > Here is example: > = > \starttext > \newdimen\mydimension > \directlua{tex.setdimen("mydimension", 123)} > \stoptext > = > works fine, but all like: > = > \starttext > \directlua{tex.print([[\newdimen\myotherdimension]])} > \directlua{tex.setdimen("myotherdimension", 123)} > \directlua{tex.newdimen("myotherdimension")} > = > etc... > = > \stoptext > = > fails. > = > In addition, I am interested in whether directly in Lua to create a new c= ounter as in the previous. > = > \starttext > \newcount\mycount > \directlua{ > tex.setcount("mycount",125) > } > = > again works, but anything like: > = > \starttext > \directlua{tex.print([[\newcount\myothercount]])} > \directlua{tex.newcount("myothercount")} > etc... > = > \stoptext > = > again fails... > = > Is there any source or examples to study anything about it? AFAIK there is no tex.setdimen but what=92s the problem to use Lua tables t= o save the values. \starttext \ctxlua{mydimension =3D number.topoints(10000)} \ctxlua{context(mydimension)} \blank \ctxlua{myotherdimension =3D 123456} \ctxlua{context(number.tocentimeters(myotherdimension))} \stoptext 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 ___________________________________________________________________________= ________