From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/30907 Path: news.gmane.org!not-for-mail From: Henning Hraban Ramm Newsgroups: gmane.comp.tex.context Subject: Re: calculations Date: Wed, 20 Sep 2006 00:04:33 +0200 Message-ID: References: <93F3046C-F059-4C5D-AC7F-73DFD5A4AAD6@fiee.net> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1158703503 30826 80.91.229.2 (19 Sep 2006 22:05:03 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 19 Sep 2006 22:05:03 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Wed Sep 20 00:04:59 2006 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 ciao.gmane.org with esmtp (Exim 4.43) id 1GPnhz-00022K-8h for gctc-ntg-context-518@m.gmane.org; Wed, 20 Sep 2006 00:04:51 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id BAD051FEBA; Wed, 20 Sep 2006 00:04:50 +0200 (CEST) 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 09382-05; Wed, 20 Sep 2006 00:04:45 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 8336A1FEB3; Wed, 20 Sep 2006 00:04:44 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 4006D1FEB3 for ; Wed, 20 Sep 2006 00:04:40 +0200 (CEST) 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 10143-03-5 for ; Wed, 20 Sep 2006 00:04:35 +0200 (CEST) Original-Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.186]) by ronja.ntg.nl (Postfix) with SMTP id E7F211FEAD for ; Wed, 20 Sep 2006 00:04:34 +0200 (CEST) Original-Received: from [83.79.17.167] (helo=[10.128.9.3]) by mrelayeu.kundenserver.de (node=mrelayeu6) with ESMTP (Nemesis), id 0ML29c-1GPnhi1C01-00007y; Wed, 20 Sep 2006 00:04:34 +0200 In-Reply-To: Original-To: mailing list for ConTeXt users X-Mailer: Apple Mail (2.752.2) X-Provags-ID: kundenserver.de abuse@kundenserver.de login:71ece21a21b2fa6ef1812787a4eaee0e X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.7 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:30907 Archived-At: Am 2006-09-19 um 23:34 schrieb nico: >> I need to downscale every score to 63%, and the shown width check >> should use the corrected width. >> How can I do that? (FigWidth should be LPscale * figurewidth) > > I don't know what you really want to do, but an example of computation > could look like this: > > \newdimen\myfigwidth > \newdimen\myfigurewidth > \def\myscale{.63} > > \figurewidth=23pt > \myfigwidth=\dimexpr(\myscale\myfigurewidth) > > \starttext > \the\myfigwidth > \stoptext Thank you, but now I always get: ! Illegal unit of measure (pt inserted). . \figurewidth ->545. 03625pt \dodostartlilypond ...expr (\LPscale \figurewidth ) \ifdim \FigWidth >\localh... from the code: \def\LPscale{.6315789} % downscale the image \ifvmode \getfiguredimensions[\bufferprefix lilypond-\the\lily! figures.pdf][]% \leavevmode% \newdimen\FigWidth \FigWidth=\dimexpr(\LPscale\figurewidth) \ifdim\FigWidth>\localhsize \!!dimena=\localhsize \advance\!!dimena by-\FigWidth \noindent\hskip\!!dimena \fi \fi \externalfigure[\lily!img][scale=\dimexpr(1000\LPscale)]% \egroup% What's wrong with \dimexpr{\SomeDef\SomeDim} ? Some expansion problem? (Sorry, I only try to patch the code, I didn't write it.) Greetlings from Lake Constance! Hraban --- http://www.fiee.net/texnique/ http://contextgarden.net http://www.cacert.org (I'm an assurer)