From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/83265 Path: news.gmane.org!not-for-mail From: luigi scarso Newsgroups: gmane.comp.tex.context Subject: Re: how to use \dimexpr and fractional values Date: Fri, 28 Jun 2013 09:34:05 +0200 Message-ID: References: <51CD331E.4010704@uni-bonn.de> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1746677880==" X-Trace: ger.gmane.org 1372404868 3557 80.91.229.3 (28 Jun 2013 07:34:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 28 Jun 2013 07:34:28 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Jun 28 09:34:28 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 1UsTCN-0007I2-AH for gctc-ntg-context-518@m.gmane.org; Fri, 28 Jun 2013 09:34:27 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id F358D10207; Fri, 28 Jun 2013 09:34: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 C1BTNaZ5eqAr; Fri, 28 Jun 2013 09:34:20 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id B9319101E6; Fri, 28 Jun 2013 09:34:20 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id F1263101E6 for ; Fri, 28 Jun 2013 09:34:18 +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 BS1h5Hzto1ox for ; Fri, 28 Jun 2013 09:34:16 +0200 (CEST) Original-Received: from filter4-til.mf.surf.net (filter4-til.mf.surf.net [194.171.167.220]) by balder.ntg.nl (Postfix) with ESMTP id BB012101E5 for ; Fri, 28 Jun 2013 09:34:06 +0200 (CEST) Original-Received: from mail-lb0-x233.google.com (mail-lb0-x233.google.com [IPv6:2a00:1450:4010:c04::233]) by filter4-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r5S7Y5bA024809 for ; Fri, 28 Jun 2013 09:34:05 +0200 Original-Received: by mail-lb0-f179.google.com with SMTP id w20so849346lbh.38 for ; Fri, 28 Jun 2013 00:34:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=cjPiVvrpSWNgYdN0Geo5fyKrhkuB7T3aLSPHEatODp8=; b=tKjS3jj/sNy39U6umzPWam/lFSblmi3LP0Hb1i+/wHTH9338ww9Axhoyqc3qFtONMU VIxIBDzOxIZkr2jhjH7dXG3poPqNXAi72sSTePUrNcljNFAvRyRvMIsvTIoSm5QAfWhO crvXm/ZkCh2kFwH1rH4PDZtErulx9fefF2MMYXuqd+IICb8E0M8YybDMRgrRMCpr0QcR baZXdNB6AWthxs+kma5Ha5IpYOrJcToVZaxrsCSOSaMAkIG4wGBMXhw6pMWMR9rfNRy4 ZkiRILfCl0bgXCN8BOnI/7kDSFjhYfSe8MiB7tw7Oti8aWWDOign9UApISTWKtApAc3D 5Jpw== X-Received: by 10.152.28.34 with SMTP id y2mr5945991lag.0.1372404845190; Fri, 28 Jun 2013 00:34:05 -0700 (PDT) Original-Received: by 10.114.160.83 with HTTP; Fri, 28 Jun 2013 00:34:05 -0700 (PDT) In-Reply-To: <51CD331E.4010704@uni-bonn.de> X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=2a00:1450:4010:c04::233; country=IE X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0VJRHy5WL - b2f6443456e4 - 20130628 (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:83265 Archived-At: --===============1746677880== Content-Type: multipart/alternative; boundary=089e0158c57a49237304e031e733 --089e0158c57a49237304e031e733 Content-Type: text/plain; charset=UTF-8 On Fri, Jun 28, 2013 at 8:54 AM, Thomas A. Schmitz < thomas.schmitz@uni-bonn.de> wrote: > Hi all, > > long story short: I want to calculate a width or height from user input, > which is in the form "0.x" (as in "0.3\textwidth") since I want to use that > number differently in different circumstances. Problem is that \dimexpr > doesn't like decimal values. > long answer short \starttext \def\myfactor{0.3} \def\Myfactor{3} \externalfigure[mill][height=\myfactor\textwidth] \externalfigure[mill][height=\dimexpr \textwidth * \Myfactor / 10\relax] \externalfigure[mill][height=\dimexpr 10cm * \Myfactor / 10\relax] \stoptext http://wiki.contextgarden.net/Expressions -- luigi --089e0158c57a49237304e031e733 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable



On Fri, Jun 28, 2013 at 8:54 AM, Thomas A. Schmitz <thoma= s.schmitz@uni-bonn.de> wrote:
Hi all,

long story short: I want to calculate a width or height from user input, wh= ich is in the form "0.x" (as in "0.3\textwidth") since = I want to use that number differently in different circumstances. Problem i= s that \dimexpr doesn't like decimal values.

long answer short
\starttext
\def\myfactor{0.= 3}
\def\Myfactor{3}
\externalfigure[mill][height=3D\myfactor\textwidt= h]
\externalfigure[mill][height=3D\dimexpr \textwidth * \Myfactor / 10\r= elax]
\externalfigure[mill][height=3D\dimexpr 10cm * \Myfactor / 10\relax]
\st= optext
http://wiki= .contextgarden.net/Expressions
--
luigi
--089e0158c57a49237304e031e733-- --===============1746677880== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --===============1746677880==--