From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/35534 Path: news.gmane.org!not-for-mail From: Giuseppe Bilotta Newsgroups: gmane.comp.tex.context Subject: Re: factor=fit images don't fit Date: Tue, 24 Jul 2007 09:27:16 +0200 Message-ID: <304705957.20070724092716@iol.it> References: <10310609774.20070720012314@iol.it> <1912359178.20070720130501@iol.it> <46A3C247.6050109@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1185262219 17506 80.91.229.12 (24 Jul 2007 07:30:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 24 Jul 2007 07:30:19 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Jul 24 09:30:17 2007 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 1IDEqV-0002gL-2B for gctc-ntg-context-518@m.gmane.org; Tue, 24 Jul 2007 09:30:15 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id C42812009D; Tue, 24 Jul 2007 09:30:14 +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 06316-02-3; Tue, 24 Jul 2007 09:30:07 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 14D6120069; Tue, 24 Jul 2007 09:30:07 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 6152520069 for ; Tue, 24 Jul 2007 09:30:05 +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 06316-02-2 for ; Tue, 24 Jul 2007 09:30:04 +0200 (CEST) Original-Received: from jack.tiscali.it (jack.tiscali.it [213.205.33.53]) by ronja.ntg.nl (Postfix) with ESMTP id 47BBD1FE5E for ; Tue, 24 Jul 2007 09:30:04 +0200 (CEST) Original-Received: from [192.168.0.3] (62.10.76.119) by jack.tiscali.it (7.2.079) id 4681176E003FAB0E for ntg-context@ntg.nl; Tue, 24 Jul 2007 09:30:03 +0200 X-Mailer: The Bat! (v3.5.25) Professional X-Priority: 3 (Normal) In-Reply-To: <46A3C247.6050109@wxs.nl> X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.9 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:35534 Archived-At: Sunday, July 22, 2007 Hans Hagen wrote: > the fit assumes operating on a page not in a box; Ah, didn't know that. I couldn't even tell from the sources, since it uses enclosing box dimensions and not page or paper sizes. I suspect the logic is broken at the page level too though, let me explain why. Currently, if I understand the code correctly, factor=fit expands the figure to have its major direction fit, while factor=max expands the figure to have its minor direction fit. Instead, the behavior I would expect from fit (resp. max) is for the *expansion ratio* to be the minimum (resp. maximum) of the expansion ratios in the two directions (not the sizes in those directions, but the ratio between the sizes of the figure and the container). The difference is noticeable when the container and contained have different aspect ratios. Consider for example a 20x30mm figure in a 50x150mm page (strange numbers, just used to show what I mean): with the current code, using 'fit' would consider the largest dimension (30) and thus calculate a factor of 150/30 = 5, but this gives us an image which is 100x150mm, i.e. an image that doesn't fit! Whereas, if we computed the ratios 50/20 = 2.5 and 150/30 = 5, we would know that the ratio to be picked was 2.5 in 'fit' and 5 in 'max'. Or I misintepreting the meaning of 'fit' and 'max'? > an alternative is: > \framed[width=5cm,height4cm] > > {\externalfigure[mill.png][maxwidth=4cm,maxheight=5cm,width=10cm]} > i.e. setting the maximum values I hadn't thought about using width and maxwidth (and maxheight) at the same time, thanks. Of course, I'd rather have 'fit' and 'max' usable in boxes :) -- Giuseppe "Oblomov" Bilotta ___________________________________________________________________________________ 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 ___________________________________________________________________________________