From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/78122 Path: news.gmane.org!not-for-mail From: Marco Patzer Newsgroups: gmane.comp.tex.context Subject: Re: TeX expansion within lua Date: Tue, 4 Sep 2012 20:58:57 +0200 Message-ID: <20120904205857.37097f19@homerow> References: <20120904171243.3f70b4a6@homerow> <20120904194029.20b9abdf@homerow> <505AB3E3-9DBD-4085-A3D4-B03AF447C485@gmail.com> <20120904201154.74c1ed67@homerow> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1346785149 31456 80.91.229.3 (4 Sep 2012 18:59:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 4 Sep 2012 18:59:09 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Tue Sep 04 20:59:10 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 1T8yL7-0003m4-8x for gctc-ntg-context-518@m.gmane.org; Tue, 04 Sep 2012 20:59:09 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 3A96A101EB; Tue, 4 Sep 2012 20:59:06 +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 kHgBsV1g0MFy; Tue, 4 Sep 2012 20:59:04 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id BB581101F2; Tue, 4 Sep 2012 20:59:04 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 06AAD101F2 for ; Tue, 4 Sep 2012 20:59: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 EPZKtNJg93V6 for ; Tue, 4 Sep 2012 20:59:03 +0200 (CEST) Original-Received: from filter1-utr.mf.surf.net (filter1-utr.mf.surf.net [195.169.124.152]) by balder.ntg.nl (Postfix) with ESMTP id 1A97C101EB for ; Tue, 4 Sep 2012 20:59:02 +0200 (CEST) Original-Received: from karen.lavabit.com (karen.lavabit.com [72.249.41.33]) by filter1-utr.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id q84Ix1f5023075 for ; Tue, 4 Sep 2012 20:59:02 +0200 Original-Received: from d.earth.lavabit.com (d.earth.lavabit.com [192.168.111.13]) by karen.lavabit.com (Postfix) with ESMTP id B264211BD31 for ; Tue, 4 Sep 2012 13:59:00 -0500 (CDT) Original-Received: from homerow (83.68.239.193) by lavabit.com with ESMTP id J56XK1D1GD5S for ; Tue, 04 Sep 2012 13:59:00 -0500 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=lavabit; d=lavabit.com; b=6JScLULbbw/TVhiRoXck5ehdKT6jQsNi3gVF+w03TyAQ4EF2ZTy6/7fbXDfR3qgV6JiA677+DtvxfMCF0S/u63RlSdfPRCDL0GKOv9mxiVYa5xcBvqFOF3bzfJ4Bid6mb4m1ZfQ6ekKkauzPwLhN9EbrW+ynDS67YI/FpknIKKw=; h=Date:From:To:Subject:Message-ID:In-Reply-To:References:X-Mailer:Mime-Version:Content-Type:Content-Transfer-Encoding; In-Reply-To: X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.10; x86_64-pc-linux-gnu) X-Bayes-Prob: 0.6342 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=72.249.41.33; country=US; region=TX; city=Dallas; postalcode=75206; latitude=32.8339; longitude=-96.7715; metrocode=623; areacode=214; http://maps.google.com/maps?q=32.8339,-96.7715&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 07HT6X1Td - de1efb6a7049 - 20120904 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) 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:78122 Archived-At: On 2012-09-04 Wolfgang Schuster wrote: > What prevents you from setting the dimen value in Lua? Some background: The code is part of a smarter float placement. It takes the size of the float into account and decides for a location. For example, it positions the float in the margin if it fits or it prints the caption underneath the float if the float spans the margin as well (captions are in the margin by default in this layout). Most of the code is written in TeX and I don't feel it's necessary to rewrite it in Lua. I am more fluent in TeX than in Lua. In this case a TeX helper function computes the size and saves the results in dimen registers. I use Lua for calculations especially when it comes to dimensions. It's a nightmare in TeX and hard to find errors easily creep in. Marco ___________________________________________________________________________________ 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 ___________________________________________________________________________________