From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/48627 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: Dividing dimensions Date: Sat, 21 Mar 2009 18:49:53 -0400 (EDT) Message-ID: References: <20090321222612.GA19380@phare.normalesup.org> <661C3BE5-9CAE-4C51-96EC-5C7EE1B3B2BD@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1237675891 19068 80.91.229.12 (21 Mar 2009 22:51:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 21 Mar 2009 22:51:31 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Mar 21 23:52:48 2009 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1LlA3c-0000gp-1b for gctc-ntg-context-518@m.gmane.org; Sat, 21 Mar 2009 23:52:48 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 52E8E1FD7D; Sat, 21 Mar 2009 23:51:20 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 13260-01; Sat, 21 Mar 2009 23:50:44 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 476311FD7B; Sat, 21 Mar 2009 23:50:44 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 8BDD51FD7B for ; Sat, 21 Mar 2009 23:50:42 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 09906-05-3 for ; Sat, 21 Mar 2009 23:50:33 +0100 (CET) Original-Received: from filter2-til.mf.surf.net (filter2-til.mf.surf.net [194.171.167.218]) by ronja.ntg.nl (Postfix) with ESMTP id D11951FD72 for ; Sat, 21 Mar 2009 23:50:33 +0100 (CET) Original-Received: from skycaptain.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.93.160]) by filter2-til.mf.surf.net (8.13.8/8.13.8/Debian-3) with ESMTP id n2LMoUgR030158 for ; Sat, 21 Mar 2009 23:50:32 +0100 Original-Received: FROM [192.168.2.8] (c-71-234-195-113.hsd1.ct.comcast.net [71.234.195.113]) BY skycaptain.mr.itd.umich.edu ID 49C56F34.B5090.5973 ; 21 Mar 2009 18:50:28 -0400 In-Reply-To: <661C3BE5-9CAE-4C51-96EC-5C7EE1B3B2BD@gmail.com> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=141.211.93.160; country=US; region=MI; city=Ann Arbor; postalcode=48109; latitude=42.2923; longitude=-83.7145; metrocode=505; areacode=734; http://maps.google.com/maps?q=42.2923,-83.7145&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 197047339 - 4c5afefa6fdc X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.218 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.11 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 X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:48627 Archived-At: On Sat, 21 Mar 2009, Wolfgang Schuster wrote: > > Am 21.03.2009 um 23:26 schrieb Arthur Reutenauer: > >>> Can I divide dimensions to get a number in pdftex? >> >> LaTeX has a package to do exactly that, fp. You could look into its >> code. Or you could use LuaTeX :-) > > > It's easy to do with etex but I would use lua if possible. > > \starttext > \unprotect > > \!!dimena=1cm > \!!dimenb=2cm > \!!dimenc=1cm > \!!dimend=3cm > > \ifdim\dimexpr\!!dimena*100/\!!dimenb\relax>\dimexpr\!!dimenc*100/\!!dimend\relax > this > \else > that > \fi Ah. I was using \dimexpr\!!dimena/\!!dimenb with crazy results. So the trick is to mulitply by a number in between. Thanks Wolfgang. Aditya ___________________________________________________________________________________ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________