From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/76920 Path: news.gmane.org!not-for-mail From: Marco Newsgroups: gmane.comp.tex.context Subject: Re: \externalfigure and factor=max Date: Tue, 12 Jun 2012 23:42:34 +0200 Message-ID: <20120612234234.429bfbde@homerow> References: <20120606204552.4f047659@Zewz> 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: dough.gmane.org 1339537394 11615 80.91.229.3 (12 Jun 2012 21:43:14 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 12 Jun 2012 21:43:14 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Tue Jun 12 23:43:11 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 1SeYrh-0004vK-QS for gctc-ntg-context-518@m.gmane.org; Tue, 12 Jun 2012 23:43:05 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 69D21101E5; Tue, 12 Jun 2012 23:43:05 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with LMTP id n9ZNlRM-FeyA; Tue, 12 Jun 2012 23:43:04 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id DF713101DF; Tue, 12 Jun 2012 23:43:03 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 07081101DF for ; Tue, 12 Jun 2012 23:43:03 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with LMTP id qZEdJeVsjvaR for ; Tue, 12 Jun 2012 23:43:01 +0200 (CEST) Original-Received: from filter2-ams.mf.surf.net (filter2-ams.mf.surf.net [192.87.102.70]) by balder.ntg.nl (Postfix) with ESMTP id 4F7A4101DD for ; Tue, 12 Jun 2012 23:43:00 +0200 (CEST) Original-Received: from plane.gmane.org (plane.gmane.org [80.91.229.3]) by filter2-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id q5CLh0fc012013 for ; Tue, 12 Jun 2012 23:43:00 +0200 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SeYrQ-0004BN-9i for ntg-context@ntg.nl; Tue, 12 Jun 2012 23:42:48 +0200 Original-Received: from 83.68.239.193 ([83.68.239.193]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 12 Jun 2012 23:42:48 +0200 Original-Received: from netuse by 83.68.239.193 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 12 Jun 2012 23:42:48 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 17 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 83.68.239.193 X-Newsreader: Claws Mail 3.8.0 (GTK+ 2.24.10; x86_64-pc-linux-gnu) X-Bayes-Prob: 0.9646 (Score 4.7, tokens from: @@RPTN) X-CanIt-Geo: ip=80.91.229.3; country=NO; latitude=62.0000; longitude=10.0000; http://maps.google.com/maps?q=62.0000,10.0000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0QHlxH0mU - 692f7f8c389f - 20120612 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.70 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.13 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 Xref: news.gmane.org gmane.comp.tex.context:76920 Archived-At: On 2012-06-07 "Rogers, Michael K" wrote: > I played with your example a little and rooted around in grph-trf.mkiv. It seems "max" selects how to scale based on which dimension in the original figure is greater. Oddly, the dimensions of the MP figure are 142.26682pt by 142.2377pt. So I suspect that "max" is selecting the width as the dimension to scale to the specified width=3cm in your case. (Change the height of the MP figure to 5.01cm and you'll see a change.) Whether that's a bug or intended is a question for others. If not, then "max" is for this problem: > > Q. How to scale an image so that the largest dimension is 4cm? > A. \externalfigure [\jobname-img] [factor=max, width=4cm, height=4cm] > > If this is correct, I'd be glad to try to clarify the wiki. (I've not done much wiki-ing.) > > I suppose you could fix your problem with something like > > \ifdim\desiredwidth>\desiredheight > \externalfigure [\jobname-img][width=\desiredwidth] > \else > \externalfigure [\jobname-img][height=\desiredheight] > \fi ___________________________________________________________________________________ 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 ___________________________________________________________________________________