From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/82016 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: calculating with dimension unit Date: Mon, 22 Apr 2013 12:43:19 +0200 Message-ID: <769A9D3F-2491-455E-A538-897E45917E75@gmail.com> References: <5174728B.70102@gmx.de> <5174F151.8090303@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1366627406 24952 80.91.229.3 (22 Apr 2013 10:43:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 22 Apr 2013 10:43:26 +0000 (UTC) Cc: mailing list for ConTeXt users To: Hans Hagen Original-X-From: ntg-context-bounces@ntg.nl Mon Apr 22 12:43:30 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 1UUEDZ-00036v-QQ for gctc-ntg-context-518@m.gmane.org; Mon, 22 Apr 2013 12:43:29 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 093E4101F1; Mon, 22 Apr 2013 12:43:29 +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 jYn32TkyHDhH; Mon, 22 Apr 2013 12:43:27 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id D0FE3101E8; Mon, 22 Apr 2013 12:43:26 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 1EA28101E8 for ; Mon, 22 Apr 2013 12:43:25 +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 PHiAR5f4YKoI for ; Mon, 22 Apr 2013 12:43:23 +0200 (CEST) Original-Received: from filter2-til.mf.surf.net (filter2-til.mf.surf.net [194.171.167.218]) by balder.ntg.nl (Postfix) with ESMTP id D6868101E3 for ; Mon, 22 Apr 2013 12:43:23 +0200 (CEST) Original-Received: from mail-bk0-x230.google.com (mail-bk0-x230.google.com [IPv6:2a00:1450:4008:c01::230]) by filter2-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r3MAhML3024410 for ; Mon, 22 Apr 2013 12:43:23 +0200 Original-Received: by mail-bk0-f48.google.com with SMTP id jf3so2527439bkc.21 for ; Mon, 22 Apr 2013 03:43:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:content-type:mime-version:subject:from:in-reply-to:date :cc:content-transfer-encoding:message-id:references:to:x-mailer; bh=uy4O0WeukOp0COc5jW6IweZlYK4jNDVRWZ26/gRz3WU=; b=T85/DUqoUCZuqL/sqN1AblFYMWsfO58VK1EE0pfx5KH4go9j5YSCf5Jf09pmhmFiAO 4qnEakWtU1BGaP2K++2UBIOopcQdxpv//G9Pe3jwR3dWkjYeDFZuH33PXGkxati+B1W1 pxhUkLMBKNvKVrWVSvOKEmP2kWR8kHbyGpjERSEMcVSJ1Ha5T+VecU/r+CuV8+bQs30a +BnUl8gOnTbj5JGmJmvHUp/TFmdUJp1eIU04lgCVNEFbYV8hOGRnN1xC6kvRI1LXs5d7 azzRj3cWjDuCY5lkrhPs2Z1oC2rL+4RZ1NWMTg/phnTLp7bRyZirHStKtAt5bQfHBnS0 6syA== X-Received: by 10.205.128.68 with SMTP id hd4mr334070bkc.23.1366627402658; Mon, 22 Apr 2013 03:43:22 -0700 (PDT) Original-Received: from keima.localdomain (nrbg-4d075138.pool.mediaWays.net. [77.7.81.56]) by mx.google.com with ESMTPS id ss14sm5179076bkb.21.2013.04.22.03.43.21 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Apr 2013 03:43:21 -0700 (PDT) In-Reply-To: <5174F151.8090303@wxs.nl> X-Mailer: Apple Mail (2.1503) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=2a00:1450:4008:c01::230; country=IE X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0TJqWHmT5 - 5842ca003684 - 20130422 (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:82016 Archived-At: Am 22.04.2013 um 10:14 schrieb Hans Hagen : > On 4/22/2013 8:48 AM, Wolfgang Schuster wrote: >> >> Am 22.04.2013 um 01:13 schrieb Jan Heinen : >> >>> In a book I produced with ConTeXt last year, I did a lot of calculation to be able to change the layout dynamicaly. >>> >>> With the actual version of ConTeXt I can't compile the book. I have tried a lot of things today ... without success. >>> I hope my minimal-example helps you to understand, what I want to do - and what I am doing wrong: >>> >>> >>> \starttext >>> \setupexternalfigures[location={local,global,default}] >>> >>> \defineexpandable\ColumnA {30mm} >>> \defineexpandable\ColumnB {40mm} >>> \defineexpandable\ColumnABi {\dimexpr(\ColumnA + \ColumnB)} >>> \defineexpandable\ColumnABii {\ctxlua{context(\ColumnA + \ColumnB)}} >>> \newdimen\ColumnABiii \ColumnABiii = \dimexpr(\ColumnA + \ColumnB) >> >> \definemeasure[ColumnA][30mm] >> \definemeasure[ColumnB][40mm] >> \definemeasure[ColumnBi][\the\dimexpr(\measure{ColumnA}+\measure{ColumnB})] > > FYI: \the\dimexpr... will look ahead till there's something nonexpandable, and contrary to what one expects > > \dimexpr(...) > > will not stop at the ) so, although with measures it normally goes okay, personally I always use \relax as terminator; the \relax will be eaten up so there is no interference but it guarantees to stop scanning. AFAIR the etex already mentions it. > (I've been wondering if we should make measured \the\dimexpr..\relax internally which can save dimexpr at the user end.) +1 Wolfgang ___________________________________________________________________________________ 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 ___________________________________________________________________________________