From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/314 Path: main.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: How to get the figure size Date: Tue, 16 Feb 1999 13:53:52 +0100 Sender: owner-ntg-context@let.uu.nl Message-ID: <36C96A60.752A1437@wxs.nl> References: <000401be5989$d4cdc7c0$0c01a8c1@worf.login-bv.com> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1035391175 22980 80.91.224.250 (23 Oct 2002 16:39:35 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 16:39:35 +0000 (UTC) Cc: context Original-To: Gilbert van den Dobbelsteen Xref: main.gmane.org gmane.comp.tex.context:314 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:314 Gilbert van den Dobbelsteen wrote: > This is probably very trivial but I need to do something like this: > > \presetexternalfigure[foo][somefig][height=100pt] > \framed[width={\figurewidth[foo]}]{Some contents} > > Are there any macro's like this? I need to have the height too. > I need it because I have a lot of figures with the same height, but with > different widths. I'm not sure what you need it for, but the most general way of doing this kind of things is using tex's box mechanism. Anyhow, this is one way of doing things: (1) Put this somewhere, e.g. on cont-new.tex (I added it to core-fig, so in th enext release it's there). \unprotect \let\figureheight=\!!zeropoint \let\figurewidth =\!!zeropoint \def\getfiguredimensions% {\dodoubleempty\dogetfiguredimensions} \def\dogetfiguredimensions[#1][#2]% {{\setbox0=\hbox{\externalfigure[#1][#2,\c!object=\v!nee]}}} \protect (2) Now you can ask for the dimensions \getfiguredimensions[koe.pdf] width: \figurewidth, height: \figureheight (3) But, when you just placed the figure, you don't need to ask for it, because the dimensions are already available in \figurewidth/height (so you sort of guessed right about this low level secret macro). > O yeah, and another problem: I use ActivateState perl, and some DJGPP perl > (you know, a port that runs under DOS/WIN/OS/2 *and* win95 and it has long > filename support) > and there are some differences: > > - The DJGPP port is much faster (and I mean a lot faster here) The same for tex -). > - The DJGPP port does globbbing correct, e.g.: > texutil --figures --epspage *.eps > works fine, while the ActiveState port doesn't (texutil says it doesn't > know any figures *.eps). Ha, I just installed active perl and never tested that -) > Perhaps I did something completely wrong (Ok, Wybo, I'll switch to Linux > some day). I have to stick to the ActiveState port because I use perl/Tk and > ODBC database connectivity, which doesn't run under the DJGPP port. That's why I switched also: Tk (currently I run the perl/tk texedit version, with tex and metapost support etc). Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | mail: pragma@wxs.nl ConTeXt and PPCHTeX site: www.ntg.nl/context -----------------------------------------------------------------